Skip to content

Commit cc95b82

Browse files
closes #118, closes #124, closes #146 and closes #149
1 parent b8809b3 commit cc95b82

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

Diff for: lib/interfaces/IFindOptions.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {WhereOptions, LoggingOptions, SearchPathOptions, col, and, or, FindOptionsAttributesArray,
2-
literal} from 'sequelize';
2+
literal, fn} from 'sequelize';
33
import {Model} from "../models/Model";
44
import {IIncludeOptions} from "./IIncludeOptions";
55

@@ -41,8 +41,8 @@ export interface IFindOptions extends LoggingOptions, SearchPathOptions {
4141
* first element is the column / function to order by, the second is the direction. For example:
4242
* `order: [['name', 'DESC']]`. In this way the column will be escaped, but the direction will not.
4343
*/
44-
order?: string | col | literal | Array<string | number | typeof Model | { model: typeof Model, as?: string }> |
45-
Array<string | col | literal | Array<string | number | typeof Model | { model: typeof Model, as?: string }>>;
44+
order?: string | col | fn | literal | Array<string | number | typeof Model | { model: typeof Model, as?: string }> |
45+
Array<string | col | fn | literal | Array<string | number | typeof Model | { model: typeof Model, as?: string }>>;
4646

4747
/**
4848
* Limit the results

Diff for: lib/models/Model.d.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ import {ICountOptions} from '../interfaces/ICountOptions';
2222
/* tslint:disable:max-line-length */
2323
/* tslint:disable:max-classes-per-file */
2424

25-
/**
26-
* Creates override for sequelize model to make the food
27-
*/
28-
export declare class Model<T> extends Hooks {
25+
export declare abstract class Model<T> extends Hooks {
2926

3027
constructor(values?: any, options?: IBuildOptions);
3128

@@ -411,6 +408,11 @@ export declare class Model<T> extends Hooks {
411408
*/
412409
static unscoped(): typeof Model;
413410

411+
/**
412+
* A reference to the sequelize instance
413+
*/
414+
static sequelize: Sequelize;
415+
414416
/**
415417
* Adds relation between specified instances and source instance
416418
*/

Diff for: lib/models/Sequelize.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {ISequelizeValidationOnlyConfig} from "../interfaces/ISequelizeValidation
77
export declare class Sequelize extends SequelizeOrigin {
88

99
_: {[modelName: string]: (typeof Model)};
10+
connectionManager: any;
1011

1112
constructor(config: SequelizeConfig | ISequelizeValidationOnlyConfig);
1213
constructor(uri: string);

Diff for: lib/models/v3/Sequelize.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class Sequelize extends SequelizeOrigin implements BaseSequelize {
1818
init: (config: SequelizeConfig) => void;
1919
addModels: (models: Array<typeof Model> | string[]) => void;
2020
associateModels: (models: Array<typeof Model>) => void;
21+
connectionManager: any;
2122

2223
constructor(config: SequelizeConfig | string) {
2324
if (typeof config === "string") {

Diff for: lib/models/v4/Sequelize.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class Sequelize extends OriginSequelize implements BaseSequelize {
1414
init: (config: SequelizeConfig) => void;
1515
addModels: (models: Array<typeof Model> | string[]) => void;
1616
associateModels: (models: Array<typeof Model>) => void;
17+
connectionManager: any;
1718

1819
constructor(config: SequelizeConfig | string) {
1920
if (typeof config === "string") {

0 commit comments

Comments
 (0)