Git Product home page Git Product logo

sequelize's People

Contributors

christianbratschke avatar d6u avatar devonsabbatical avatar eseliger avatar felixfbecker avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jd-robbs avatar louy avatar lumaxis avatar modulitos avatar morpheusxaut avatar munsellj avatar ppetzold avatar prokopsimek avatar rokoroku avatar simonschick avatar superd22 avatar swadicalrag avatar thylossus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sequelize's Issues

An in-range update of typescript is breaking the build 🚨

Version 2.4.1 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.4.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As typescript is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes TypeScript 2.4

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.4.

For breaking changes, check out the Breaking changes in TypeScript 2.4 page.

For the complete list of fixed issues, check out the fixed issues query for Typescript 2.4.

Download:

Commits

The new version differs by 141 commits.

  • 8b2fe13 Update LKG.
  • 14d95ed Test:Block-scoped definition of Promise works
  • a8846bf Skip block scope check with no error location
  • 44f2336 Merge pull request #16633 from Microsoft/release-2.4_fixIncrementalParsing
  • 4875a27 Add tests
  • 15ef20d Set the structureReused to be safemoudles when dynamic import change
  • 6d33083 Add tests
  • 11b9f6e Wip-fix incremental parsing
  • 2721fd4 In TypeScript code, never bind JSDoc normally, just set parent pointers (#16555) (#16561)
  • 0968ed9 Revert string enum changes (#16569)
  • 096f8cc Update LKG
  • 9241175 Allow running in strict mode (#16557)
  • f49b007 Update LKG
  • f1b0f59 Update version to 2.4.1
  • ed9cde9 Update LKG

There are 141 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error casting SequelizeStaticAndInstance.Model to Model

Reported by @Thylossus in #14.

Changed type of return value of Model<TInstance, TAttributes>.scope from this to Model<TInstance, TAttributes>. The following example in https://github.com/Thylossus/sequelize-pull-request-justification-demo/tree/master tries to mimic the example from https://github.com/louy/typed-sequelize/blob/master/README.md.

However, I cannot compile this example due to a type error:

index.ts(16,16): error TS2322: Type 'sequelize.Model<Thing, ThingInstance>' is not assignable to type 'sequelize.SequelizeStaticAndInstance.Model<Thing, ThingInstance>'.
  Types of property 'scope' are incompatible.
    Type '(options?: string | string[] | ScopeOptions | WhereOptions) => Model<Thing, ThingInstance>' is not assignable to type '(options?: string | string[] | ScopeOptions | WhereOptions) => this'.
      Type 'Model<Thing, ThingInstance>' is not assignable to type 'this'.

This is probably related to microsoft/TypeScript#5863. Changing the return type of scope solves the error for me.
Of course, this is not a sufficient criterion for changing your code, but I believe that isn't working for anyone. Feedback about the correctness of this assumption is very welcome.

Can't get scope abstract constructors to typecheck

Trying to get scopes working with these typing and running into a confusing type error. Here's a minimal example that seems to fail with the following versions:

import { Model, DataTypes } from "sequelize";
import sequelize from "../database";

class Message extends Model {}

Message.init(
  {
    private: DataTypes.BOOLEAN
  },
  {
    sequelize,
    scopes: {
      private: {
        where: {
          private: true
        }
      }
    }
  }
);

let PrivateMessages = Message.scope("private");

PrivateMessages.findAll({
  where: {}
});
// The 'this' context of type 'typeof Model' is not assignable to method's 'this' of type '(new () => Model) & typeof Model'.
//   Type 'typeof Model' is not assignable to type 'new () => Model'.
//     Cannot assign an abstract constructor type to a non-abstract constructor type.

Similarly to #112, I would expect typeof Model to be new () => Model, so I'm not sure why this intersection type fails.

Canonical examples of instance methods?

Not sure whether I'm missing something really obvious here, but my models don't type check if I refer to the model classes within their methods.

import { Model, DataTypes } from "sequelize";
import sequelize from "./lib/sequelize";

class Message extends Model {
  id: number;
  text: string;
  
  createFromEvent(event: string) {
    return Message.create({ text: event });
  }
}

Message.init({ text: DataTypes.STRING }, { sequelize });

The call to Message.create fails with the following error.

The 'this' context of type 'typeof Message' is not assignable to method's 'this' of type '(new () => Message) & typeof Model'

I'm suffering from the fact that I'm not well versed in TypeScript and this error message is not transparent to me.

  • (new () => Message) seems to be the type signature that would describe a constructor/class that returns Message type objects. In which case, that should be satisfied by the fact that this is the Message class.
  • typeof Model which would presumably be equivalent to (new () => Model). I would have imagined that this was also satisfied because the Message class inherits from the model class.

I'm in the process of converting existing Sequelize code to TypeScript and so I expect that one of the abstractions already in place is tripping me up. Either way, it would be great to have a reference example of a typed model definition that includes these kind of methods.

About npm @types

With Typescript2, it's able to install type definitions by just adding @types/sequelize to the devDependency, without typings.

So I tried to migrate to devDependency with @types from typings, But it seems like it already taken by others: https://www.npmjs.com/package/@types/sequelize

The repository says it's for sequelize 4, but almost everything was broken.. is that right definitions?

Includable in FindOptions missing {all: true}

It appears the current typings (tested at 09b3a90) are missing the include: [{all: true}] option on the Includable type in FindOptions for eager-loading all included associations (as described here).

I guess this could easily be fixed by e.g. adding all?: boolean; to the IncludeOptions interface. If that doesn't work for you due to problems with interface reuse, a new IncludeAllOptions interface would be minimal as well.

Happy to provide a PR if you want one for what could be a one-line change 😄

Installation error

Hi, when I run npm install --save-dev types/sequelize I get the following errors, would someone be able to assist?

npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:198:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:891:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:342:1
1)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:497:12)
npm WARN addRemoteGit  types/sequelize resetting remote C:\Users\AshfordP\AppDat
a\Roaming\npm-cache\_git-remotes\git-github-com-types-sequelize-git-16fbe1d4 bec
ause of error: { Error: Command failed: git -c core.longpaths=true config --get
remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:198:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:891:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:342:1
1)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:497:12)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/sequelize.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-sequelize-git-16fb
e1d4: Cloning into bare repository 'C:\Users\AshfordP\AppData\Roaming\npm-cache\
_git-remotes\git-github-com-types-sequelize-git-16fbe1d4'...
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/sequelize.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-sequelize-git-16fb
e1d4: fatal: unable to connect to github.com:
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/sequelize.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-sequelize-git-16fb
e1d4: github.com[0: 192.30.253.112]: errno=No error
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/sequelize.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-sequelize-git-16fb
e1d4: github.com[1: 192.30.253.113]: errno=No error
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:198:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:891:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child
_process.js:226:5)
npm WARN addRemoteGit  types/validator#83990944fcc53bcb4b05b347c3cdfcb7aa05b3c7
resetting remote C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-remotes\git-gi
thub-com-types-validator-git-83990944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5 b
ecause of error: { Error: Command failed: git -c core.longpaths=true config --ge
t remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:198:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:891:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child
_process.js:226:5)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/validator.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-validator-git-8399
0944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5: Cloning into bare repository 'C:\
Users\AshfordP\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-valid
ator-git-83990944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5'...
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/validator.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-validator-git-8399
0944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5: fatal: unable to connect to githu
b.com:
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/validator.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-validator-git-8399
0944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5: github.com[0: 192.30.253.112]: er
rno=No error
npm ERR! git clone --template=C:\Users\AshfordP\AppData\Roaming\npm-cache\_git-r
emotes\_templates --mirror git://github.com/types/validator.git C:\Users\Ashford
P\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-validator-git-8399
0944fcc53bcb4b05b347c3cdfcb7aa05b3c7-df0aafd5: github.com[1: 192.30.253.113]: er
rno=No error
[email protected] C:\Users\AshfordP\Documents\Private\briard-api
`-- @types/[email protected]  (git+https://github.com/types/sequelize.git#505b409d
c42199abf5f0df5a9d9e86010850909f)
  `-- @types/[email protected]  (git+https://github.com/types/validator.git#839909
44fcc53bcb4b05b347c3cdfcb7aa05b3c7)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

Internal Bluebird promise is not compatible with es6 Promise interace

#When I tried to make a method that wraps model methods and return with default es6 Promise interface (declared from lib.es6.d.ts), it returns incompatible type error:

[ts] Bluebird<Model> is not compatible with Promise<Model>

So I changed promise.d.ts file like this

import * as Bluebird from 'bluebird';

export const Promise: typeof Bluebird;
// export type Promise<T> = Bluebird<T>;
export default Promise;

then the error has gone.

Consider this issue :)

Trouble with Init()

I wrote code that looks like this:

import {DataTypes, Model, Sequelize} from 'sequelize';

class SavedQuery extends Model {
  id: number;
  name: string;
  description: string;
  author: string;
  mtime: Date;
}

const sequelize = new Sequelize(config.database, config.user, config.password, sqlConfig);

  SavedQuery.init({
    name: DataTypes.STRING,
    description: DataTypes.STRING,
    author: DataTypes.STRING,
    mtime: DataTypes.DATE,
  }, {sequelize});

This type checks fine using [email protected] and [email protected]. But when I run it I get this error:

  SavedQuery.init({
             ^
TypeError: SavedQuery.init is not a function

Is there something I'm missing here? I'm going straight off the test cases.

findOrCreate wrong return types?

findOrCreate should return (instance, created) instead of a Model or I'm missing something?

The successful result of the promise will be (instance, created) - Make sure to use .spread()

static findOrCreate(options: FindOrInitializeOptions): Promise<Model>;

So this makes it not possible to use arrays destructuring like let [user, isCreated] = await Models.User.findOrCreate(..)

Edit: Used wrong version of the definition file, needed 3.

WhereOptions are broken

  • Sequelize.where() objects cannot be passed to the where option
Argument of type '{ offset: number; limit: number; order: string | fn | col | literal | (string | fn | col | litera...' is not assignable to parameter of type 'FindOptions'.
Types of property 'include' are incompatible.
  Type '{ association: BelongsTo; include: { association: BelongsToMany; attributes: string[]; where: { [...' is not assignable to type '(Model<any, any> | Association | IncludeOptions)[]'.
    Type '{ association: BelongsTo; include: { association: BelongsToMany; attributes: string[]; where: { [...' is not assignable to type 'Model<any, any> | Association | IncludeOptions'.
      Type '{ association: BelongsTo; include: { association: BelongsToMany; attributes: string[]; where: { [...' is not assignable to type 'IncludeOptions'.
        Types of property 'where' are incompatible.
          Type 'where' is not assignable to type 'WhereOptions'.
            Index signature is missing in type 'where'.
  • WhereNested is only supports passing $and and $or?!
  • WhereOptions has Object at the end, which means we can basically put anything in it
  • WhereLogic is basically useless
  • There is no type alias that combines all the possible types you can pass to where

I would like to refactor all the where options to use a single type alias that includes all possible options.

[v4] Is it possible to use sequelize.define method?

Hi,

I was trying to use Sequelize define method instead of Model.init(), but I cannot find a proper way to use it. I was trying to do it this way:

import { DataTypes, Model, ModelAttributes, ModelAttributeColumnOptions } from 'sequelize';
import sequelize from '../sequelize';//connection

class MyModel extends Model {
  id: string;

  foo() {}
}

const type = sequelize.define<MyModel>('MyModel', <ModelAttributes>{
  id: <ModelAttributeColumnOptions>{
    type: DataTypes.UUIDV4,
    primaryKey: true,
  },
});

type.findById('id'); // this causes transpilation error

According to typings define method returns an instance of type TModel not the TModel type itself, so it's impossible this way to use any of the static methods defined in Model class. Is it possible to use this method at all, or it's currently required to use only Model.init() method?

Changing the typing to define<TModel>(...): typeof Model would allow access to Model static methods but at the same moment it would make impossible to access any of the MyModel attributes. Probably the easiest way would be making this function to return typeof TModel but it didn't seem to be possible with TypeScript. Is any workaround for this?

Best

"export assignment" error when compiling Typescript

When using the latest type definitions with Sequelize 4.17.0, I get the following error when compiling with tsc:

node_modules/@types/sequelize/lib/query-types.d.ts(3,16): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.

Perhaps I'm missing something in my local setup, but this appears to be an issue with the Sequelize type definitions.

I am running typescript 2.6.0-rc on Linux, 4.13.8-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux, if that matters.

Generics for the model attributes?

Why don't we have generic for the model attributes?
e.g.

interface TypedModelAttributes {
  id: number;
  optionalData?: object;
}

class TypedModel extends Model<TypedModelAttributes> {
  ...
}

// usage
TypedModel.build({ ... }) // will be type-checked by "TypedModelAttributes"
TypedModel.findOne({ where: { ... }) // will be type-checked by "keyof TypedModelAttributes"
...

It is more accurate and will bring a lot of conveniences than current <K extends keyof this> way.

Passing Custom Data via `SaveOptions`

Across some of my apps, I pass request-level data into the save and update methods which I then re-use within various hooks (see here).

That said, I can't see a way of passing data via SaveOptions. In vanilla JavaScript it works fine, also in TypeScript - but still, the compiler sometimes complains about things like the following, plus constantly highlights it as an error:

// via `save()` after setting some properties on the entity
await user.save({ctx: ctx}) as User;

// via `update()`
await user.update({firstName: 'John'}, {
        ctx: ctx,
        fields: ['firstName', 'lastName']
    }) as User;

In this example, I am trying to pass the ctx argument.

Is there any way of allowing this in npm-sequelize? I tried it via Declaration Merging and creating a new SaveOptions interface - but to no avail.

I thought, perhaps in a newer version of TypeScript, there's a way of allowing additional, undefined properties to be set on an object (without losing typing).

Model.count return type can be an Array

Currently, Model.count has this signature:

count(options?: CountOptions): Promise<number>;

However, if you pass group options to the count call, the return is an array. For example, assuming a naive blog posts table with an author_id column:

const count = await Post.count(); 
// returns number

const count = await Post.count({group: ['author_id'], attributes: ['author_id']});
// returns [{count: 1, author_id: 1}, {count: 10, author_id: 2}];

The workaround is to add as any after the call to suppress warnings. Not sure what the proper fix is in the type definition itself, but happy to PR with guidance :)

V4 vs V3

I tried to update last night to the v4 typings and noticed I had to change my entire setup. Is there a reason that there is such a big difference between the v3 and v4 typings?

Would be better to make them more inline with each other, for upgrading purposes?
Is v4 is a better setup in the long run?

4.0

I began working on the typings for Sequelize 4.0 in a branch: https://github.com/felixfbecker/typed-sequelize/tree/v4
and wanted to get some feedback / discussion. Basically whats changing in Sequelize 4.0 is that there is no Instance class, but only an abstract Model class. find() etc. are static methods, and instances are actual instances of Model. Sequelize.define() now returns a subclass of Model, and it is actually possible to subclass Model on your own - this will allow us to define models as classes and use decorators to attach metadata.

I removed the generic type arguments to Model and Instance, because static methods cannot reference them anyway. So the attributes passed to update() etc. will now be Object.
Another problem is that TypeScript currently does not allow static methods to return a polymorphic this - that means find() can only return Model, and it will be necassary to cast the return:

const user = await User.find() as User;

Also all the files use exports.default in addition to module.exports, so we can get rid of the exports =. That makes all the files a lot cleaner and allows us to work more with classes instead of interfaces. I also started to move code out of the huge index.d.ts to exactly mirror the sequelize project structure.

Documentation for BelongsToSetAssociationMixin outdated?

I tried using this syntax earlier today from here and it wasn't working:


interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes {
   // getRole...
   setRole: Sequelize.BelongsToSetAssociationMixin<RoleInstance, RoleId>;
   // createRole...
}

TypeScript (2.0.3 btw) complains that Generic type 'Instance<TAttributes>' requires 1 type argument(s). Replacing it with Sequelize.Instance<UserAttributes> seems to work.

Further, RoleId isn't described in the documentation; what is that value from? I supplied the type keyword for what that field is in my RoleAttributes interface and it seems to have worked.

Apologies if this is all working as it should and I'm just missing something obvious!

Remove required status checks

@louy It is very cumbersome having to create a branch, commit, push, open a PR, wait for Travis, merge, delete branch just for a single commit if I already run the tests locally. Could you remove the status checks requirement? We can still wait until the checks are green for PRs, it's just not required anymore.

Error with Order

Using a simple order option like [['createdAt', 'DESC']] does not work:

await User.find({
    order: [['createdAt', 'DESC']]
});

results in

[ts] Argument of type '{ where: { [x: string]: any; [x: number]: undefined; userId: any; }; order: [string[]]; attribute...' is not assignable to parameter of type 'FindOptions'.
 Types of property 'order' are incompatible.
   Type '[string[]]' is not assignable to type 'string | fn | col | literal | [string | col | fn | literal, string] | [Model<any, any> | { model:...'.
     Type '[string[]]' is not assignable to type '(string | fn | col | literal | [string | col | fn | literal, string] | [Model<any, any> | { model...'.
       Types of property '[Symbol.iterator]' are incompatible.
         Type '() => IterableIterator<string[]>' is not assignable to type '() => IterableIterator<string | fn | col | literal | [string | col | fn | literal, string] | [Mod...'.
           Type 'IterableIterator<string[]>' is not assignable to type 'IterableIterator<string | fn | col | literal | [string | col | fn | literal, string] | [Model<any...'.
             Type 'string[]' is not assignable to type 'string | fn | col | literal | [string | col | fn | literal, string] | [Model<any, any> | { model:...'.
               Type 'string[]' is not assignable to type '[Model<any, any>, Model<any, any>, string, string]'.
                 Property '0' is missing in type 'string[]'.

Order is defined as

  export type OrderItem =
    string | fn | col | literal |
    [string | col | fn | literal, string] |
    [Model<any, any> | { model: Model<any, any>, as: string }, string, string] |
    [Model<any, any>, Model<any, any>, string, string];
  export type Order = OrderItem | OrderItem[];

I'm not sure why it doesn't work, any idea?

Project doesn't support noImplicitAny

Hi, your definition file seems completely broken. When I include it in my project without even using it I get all these errors:

typings/main/definitions/sequelize/index.d.ts(825,15): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(832,13): error TS7006: Parameter 'value' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(832,20): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(833,12): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1037,19): error TS7006: Parameter 'date' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1038,15): error TS7006: Parameter 'date' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1088,11): error TS7006: Parameter 'hext' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1209,15): error TS7006: Parameter 'type' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1209,21): error TS7006: Parameter 'srid' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1229,3): error TS7010: 'construcor', which lacks return-type annotation, implicitly has an 'any' return type.
typings/main/definitions/sequelize/index.d.ts(1229,14): error TS7006: Parameter 'type' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1229,20): error TS7006: Parameter 'srid' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1230,3): error TS7010: 'construcor', which lacks return-type annotation, implicitly has an 'any' return type.
typings/main/definitions/sequelize/index.d.ts(1343,34): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1343,43): error TS7006: Parameter 'Model' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1346,37): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1346,46): error TS7006: Parameter 'Model' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1348,36): error TS7006: Parameter 'attributes' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1348,48): error TS7006: Parameter 'Model' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1350,36): error TS7006: Parameter 'dataValues' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1350,48): error TS7006: Parameter 'fields' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1350,56): error TS7006: Parameter 'Model' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1353,36): error TS7006: Parameter 'args' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1353,42): error TS7006: Parameter 'primaryKeys' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1373,39): error TS7006: Parameter 'hash' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1373,45): error TS7006: Parameter 'omitNull' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1373,55): error TS7006: Parameter 'options' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1374,25): error TS7006: Parameter 'SubClass' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1374,35): error TS7006: Parameter 'SuperClass' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1376,27): error TS7006: Parameter 'args' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1376,33): error TS7006: Parameter 'begin' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1391,15): error TS7006: Parameter 'fn' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1391,19): error TS7006: Parameter 'args' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1397,15): error TS7006: Parameter 'col' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1401,15): error TS7006: Parameter 'val' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1405,15): error TS7006: Parameter 'val' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1409,15): error TS7006: Parameter 'conditionsOrPath' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1409,33): error TS7006: Parameter 'value' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1413,15): error TS7006: Parameter 'attribute' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1413,26): error TS7006: Parameter 'comparator' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1413,38): error TS7006: Parameter 'logic' implicitly has an 'any' type.
typings/main/definitions/sequelize/index.d.ts(1418,34): error TS7006: Parameter 'obj' implicitly has an 'any' type.

An in-range update of typescript is breaking the build 🚨

Version 2.6.1 of typescript was just published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.5.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

typescript is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes TypeScript 2.6

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.6.

For breaking changes, check out the Breaking changes in TypeScript 2.6 page.

For API breaking changes, check out the API Breaking changes in TypeScript 2.6 page.

For the complete list of fixed issues, check out the issues fixed in TypeScript 2.6 RC and after TypeScript 2.6 RC.

Download:

Special thanks to all contributors to this release:

  • Adrian Leonhard
  • Alex Chugaev
  • Alex Eagle
  • Anders Hejlsberg
  • Andrew Casey
  • Andy Hanson
  • Armando Aguirre
  • Arthur Ozga
  • Basarat Ali Syed
  • Benjamin Lichtman
  • Charles Pierce
  • Daniel Rosenwasser
  • @falsandtru
  • Filipe Silva
  • Francois Wouts
  • Henry Mercer
  • Herrington Darkholme
  • Ivan Enderlin
  • Joe Calzaretta
  • Klaus Meinhardt
  • Magnus Kulke
  • Matt Bierner
  • Matt Mitchell
  • Mohamed Hegazy
  • Nathan Shively-Sanders
  • Paul van Brenk
  • Ron Buckton
  • Ryan Cavanaugh
  • Sheetal Nandi
  • Stas Vilchik
  • Taras Mankovski
  • Thomas den Hollander
  • Vakhurin Sergey
  • Wesley Wigham
  • Zeeshan Ahmed
  • Zev Spitz
Commits

The new version differs by 1177 commits ahead by 1177, behind by 85.

  • 477bdc7 Update LKG
  • 6bc04a9 Use lowercased names for generated locale directories (#19581)
  • 0f32f55 Make getCompletionEntryDetails and getCompletionEntrySymbol parameters non-optional (#19507) (#19592)
  • 1359a93 Update LKG
  • a7e172b Support multiple completions with the same name but different source module (#19455) (#19496)
  • c35e90e Merge pull request #19484 from Microsoft/reloadScriptsWithoutProject
  • 96c66a6 Add test case to verify reload works without open project
  • b16e6d4 Reload contents of file from disk irrespective of project presence and file already containing its own text
  • 6489a75 Update LKG
  • 1a1c672 Merge pull request #19445 from Microsoft/foundWhileSearchingNodeModules
  • 4e56347 Set the files found during node_modules search correctly when reusing existing program structure
  • aaaa280 Add the test case that fails and reports error for files not in root directory in watch mode
  • 3134111 Merge pull request #19434 from Microsoft/port-master-10-23
  • a362bbf Fix lint error
  • 02cc07c For @types installing quickfix, only activate for implicit-any module (#19394) (#19429)

There are 250 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

`dataValues` not defined

this.dataValues causes squiggly lines in instance methods since there's no definition for it ("TS2339: Property 'dataValues' does not exist on type 'User'.") - perhaps it's missing?

For example:

import * as _ from 'lodash';

class User extends Model {
    public id: string;
    [...]

    public toJSON() {
        return _.omit(this.dataValues, ['passwordHash']);
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.