Commit Graph

66 Commits

Author SHA1 Message Date
Melvin Groenhoff
e1a2d5cfc4 Allow to assign result of Sequelize.where() to where clause in find options. (#19962) 2017-09-26 15:51:05 -07:00
axetroy
17698b27a6 [sequelize] describe the transaction's options as clearly as possible 2017-09-15 11:45:16 +08:00
Nathan Shively-Sanders
cbea696607 Merge pull request #19432 from stackbuilders/add_subquery
Include subQuery for sequelize version 3 as well
2017-09-05 16:07:21 -07:00
Konrad Koch
a42b6e7553 camelizeIf and underscoredIf wrong in SequelizeLoDash
The type definition defines that `underscoredIf` and `camelizeIf` is accessable via `Utils._.underscoredIf`
The correct path would be `Utils.underscoredIf` for a sequelize version '>=3.0.0'
2017-09-03 16:16:16 +02:00
Danlock
5bb93e3433 Deferrable option mistakenly refers to the interface and not it's contents (#18677) 2017-08-30 17:24:43 -07:00
Juan Carlos Paucar
f43d588a4a Include subQuery for sequelize version 3 as well 2017-08-29 13:19:31 -05:00
Bowden Kelly
e014c942a6 Merge pull request #19204 from samcal/patch-1
sequelize: Update types for PoolOptions
2017-08-24 17:18:55 -07:00
BRAMILLE Sébastien
c74411e4c8 Merge branch 'master' into fix/sequelize-addIndex-typings 2017-08-22 22:48:47 +01:00
Sam Calvert
a10f859034 Update types for PoolOptions 2017-08-21 10:58:47 -07:00
Sebastien Bramille
d0315e8d62 [Sequelize] Fix addIndex typing 2017-08-21 14:02:07 +01:00
Meykel Gruel
e64381c9e8 merged changes for Nick Mueller <https://github.com/morpheusxaut> from v3 to v4
Tickets:

* https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19014
2017-08-16 11:16:32 +02:00
kukoo1
bf2e0faa52 add missing constructor options (database, username, password, retry, typeValidation [only v4]), add RetryOptions interface for reuse and DRY purpose (#18896) 2017-08-14 11:22:49 -07:00
Izik Lisbon
f668da13f4 Sequelize is using Validator to validate that a string is a UUID. Validator supports 4 versions of UUID:
b59133b172/lib/isUUID.js (L14-L19)

Update Sequelize's typescript to include `all` and change `number` type to a more specific type (3|4|5).
Update Validator's typescript to be more specific. instead of `string | number` set the enum values (3|4|5|all)
2017-08-09 00:01:33 -07:00
Jerod King
6b00563c2d Fixing findCreateFind to return [Model, created] (#18305)
http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-findCreateFind
2017-07-24 10:40:48 -07:00
Wesley Wigham
6f77e8e733 Merge pull request #18090 from izikl/master
Sequelize: Add  version property to the Table's options to support Optimistic Locking
2017-07-19 15:23:36 -07:00
Izik Lisbon
7225bdcae6 Sequelize: Add to the Table's options to support Optimistic Locking. 2017-07-14 20:21:08 -07:00
Jan Klimke
0961f7aec7 removed merge markers 2017-07-14 18:29:25 +02:00
Jan Klimke
35ed47ed7c added literal as allowed type for attributes 2017-07-14 15:13:25 +02:00
Jan Klimke
61b4704342 Merge branch 'master' of github.com:DefinitelyTyped/DefinitelyTyped 2017-07-14 15:03:42 +02:00
Ryan Cavanaugh
16f4cecbc2 Merge pull request #17602 from gloorx/master
[Sequelize] Add rejectOnEmpty mode types
2017-07-10 10:19:16 -07:00
Jan Klimke
0d31771b6c Merge branch 'master' of github.com:DefinitelyTyped/DefinitelyTyped 2017-07-10 14:37:38 +02:00
Jan Klimke
e431ed9c19 Merge branch 'master' of github.com:DefinitelyTyped/DefinitelyTyped
# Conflicts:
#	types/sequelize/v3/index.d.ts
2017-07-06 16:55:12 +02:00
Ron Buckton
a55f2c071f Merge pull request #17680 from mmkal/sequelize-generic-find
sequelize: use type indexing to make find* functions more helpful.
2017-07-05 16:24:21 -07:00
Ron Buckton
7213eb1049 Merge pull request #17719 from natesilva/sequelize-add-timestamps
sequelize: support `timestamps` option on `AssociationOptionsBelongsToMany`
2017-07-03 13:48:33 -07:00
Nate Silva
e5f1296ee4
support timestamps option on AssociationOptionsBelongsToMany
as documented at http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-belongsToMany
2017-07-03 13:15:50 -07:00
mmkal
b40190a341 revert some more bluebird changes 2017-07-02 22:07:06 -04:00
mmkal
79317ed00f go back to bluebird promises 2017-07-02 22:02:46 -04:00
mmkal
3d3e779a32 feat: use typescript type indexing to make find* functions more helpful.
This turns WhereOptions and FindOptions into generic types, which can then check that you are using the correct column names, in the find* functions (findOne, findAll etc.). In other places where there is no attributes type available, fall back to the old behaviour of allowing any field names (now with types named AnyWhereOptions and AnyFindOptions).

This allows typescript to catch more errors, e.g.

User.findOne({ where: { firstName: 'Bob' } });
vs.
User.findOne({ where: { first_name: 'Bob' } });
2017-07-01 14:15:26 -04:00
pueue
e5860485cc Add EmptyResultError 2017-06-29 16:52:13 +09:00
James D. Callahan III
71e7fffe99 Add missing boolean to union type. 2017-06-23 09:07:54 -05:00
James D. Callahan III
74a003f706 Add missing null to the type union for WhereOptions index signature, and change Object to object. 2017-06-23 08:39:54 -05:00
James D. Callahan III
b7959ad3c2 Split credits out to one name per line for easier readability. 2017-06-23 08:36:16 -05:00
James D. Callahan III
f931bd815c Update version declaration. 2017-06-23 08:35:26 -05:00
James D. Callahan III
9de97afa10 Change required TypeScript version to 2.3 due to bluebird. 2017-06-21 11:29:22 -05:00
James D. Callahan III
b3da69a4a0 Remove redundant lodash references. 2017-06-21 11:04:00 -05:00
James D. Callahan III
ad5714f75b Import bluebird as Promise to fix breakage - bluebird.spread and other methods were unrecognized. 2017-06-21 10:45:21 -05:00
Nathan Shively-Sanders
31739ef0c6 Merge pull request #17303 from DefinitelyTyped/weak-types-round-3
More fixes for 2.4. Not all for weak types.
2017-06-20 09:20:23 -07:00
Nathan Shively-Sanders
1119ad2d81 More fixes for 2.4. Not all for weak types:
2.4 also has been inference for generics, which finds more errors as
well.
2017-06-19 13:00:47 -07:00
Andy Hanson
c15e214e5a bluebird: Make Thenable an alias to the builtin PromiseLike. 2017-06-16 09:02:18 -07:00
Nick Schultz
c0abcfd863 undo spacing change 2017-06-13 14:24:28 -04:00
Nick Schultz
031e22146e make options optional 2017-06-13 14:22:40 -04:00
Nick Schultz
81a8b26f06 add addConstraint and removeConstraint definitions 2017-06-13 14:11:41 -04:00
Nick Schultz
f91d29adad sequelize: update BelongsToMany<Set|Create|Add>AssociationMixin to accept join table attributes (#17071)
* update BelongsToMany<Set|Create|Add>AssociationMixin to accept join table attributes correctly

* dont make a bunch of automatic editor changes
2017-06-08 15:27:57 -07:00
snewell92
b860983357 Sequelize Add documented props to SyncOptions (#16976)
* Added alter, hooks, and searchPath to syncOptions interface with compiler test and documentation comments (straight from sequelize v4 docs)

* Fix implicit any return type error
2017-06-05 16:33:06 -07:00
Nathan Shively-Sanders
163f4438df Fix weak type errors (#16845)
* Fix first round of weak type errors

Done through griddle-react

* 95% done with weak type fixes

* Fix last couple of weak type errors

* Remove some lint from mithril tests

* mithril's Lifecycle is not a weak type any more

Restore the Lifecycle constraints in the rest of the definitions.

* Fix react-redux tests after #16652 broke them

* Remove package-lock.json
2017-06-04 22:03:03 -07:00
Nick Müller
55b533a6c4 [sequelize] Added missing type to sequelize.DefineIndexesOptions.fields (#16908)
* Added missing type to sequelize.DefineIndexesOptions.fields

* Added test for added sequelize.DefineIndexesOptions type
2017-06-04 14:14:18 -07:00
John Pinkster
ad99b8e217 Sequelize - FIX/SubQuery and Raw (#16657)
* Sequelize - FIX/SubQuery and Raw 

In the `FindOptions` there is an optional property missing from the definition file that allows you to turn on and off sub queries with nested associations

Documentation of functionality:
https://github.com/sequelize/sequelize/issues/1756

Please fill in this template.

- [ ] Use a meaningful title for the pull request. Include the name of the package modified.
- [ ] Test the change in your own code. (Compile and run.)
- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).

Select one of these and delete the others:

If adding a new definition:
- [ ] The package does not provide its own types, and you can not add them.
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`.

If changing an existing definition:
- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<url here>>
- [ ] Increase the version number in the header if appropriate.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "../tslint.json" }`.

If removing a declaration:
- [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
- [ ] Delete the package's directory.
- [ ] Add it to `notNeededPackages.json`.

* Adding test
2017-06-02 07:21:01 -07:00
Nathan Shively-Sanders
d3ed133f41 Merge pull request #16534 from jklimke/add_options_to_unmanaged_transaction_call_for_sequelize
Add options to unmanaged transaction call for sequelize
2017-06-01 15:31:41 -07:00
John Pinkster
82307e4d26 Adding a test for include.paranoid 2017-05-18 07:11:38 -04:00
John Pinkster
869397339e Sequelize - FIX/Paranoid in IncludeOptions
In the `IncludeOptions` there is an optional property missing from the definition file that allows you to turn on and off the paranoid functionality from the search. 

Documentation of functionality: 
http://docs.sequelizejs.com/manual/tutorial/models-usage.html#including-soft-deleted-records

Please fill in this template.

- [ ] Use a meaningful title for the pull request. Include the name of the package modified.
- [ ] Test the change in your own code. (Compile and run.)
- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).

Select one of these and delete the others:

If adding a new definition:
- [ ] The package does not provide its own types, and you can not add them.
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`.

If changing an existing definition:
- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<url here>>
- [ ] Increase the version number in the header if appropriate.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "../tslint.json" }`.

If removing a declaration:
- [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
- [ ] Delete the package's directory.
- [ ] Add it to `notNeededPackages.json`.
2017-05-17 21:11:35 -04:00