typegoose

Typegoose - Define Mongoose models using TypeScript classes.

MIT License

Downloads
403.8K
Stars
2.1K
Committers
105

Bot releases are hidden (Show)

typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • If an SchemaType dosnt extend SchemaTypeOptions, the options are now defaulted to the outer-layer
  • innerOptions and outerOptions can now be used for Maps too
  • Custom Validators now support message being an function
  • [IC] mapOptions now always errors if the given type dosnt extend mongoose.SchemaTypeOptions
typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Update Dependencies
    • mongoose to 5.9.19
    • @types/mongoose to 5.7.27
    • @types/lodash to 4.14.155
    • typescript to 3.9.5
  • TimeStamps's (Default Class) properties are not marked as Readonly anymore
  • All Typeguards now accept undefined as the first parameter too (if an type was OR with undefined, the function would give an type-error)
  • Add option discriminators for embedded Discriminators [#248]
  • Set correct Decorator Return type (ClassDecorator & PropertyDecorator)
  • Change warning message for warnMixed
  • [IC] Moved function _buildPropMetadata to its own file (processProp) and renamed it to processProp [#286]
  • [IC] Moved pre-processing in function prop into processProp [#286]
  • [IC] Removed error NoMetadataError
  • [IC] Removed check that Type needs to be defined in prop / processProp
typegoose - Release 7.2.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • mongoose to 5.9.17
    • @types/mongoose to 5.7.21
    • typescript to 3.9.3
  • Remove type RefSchemaType
  • Add mongoose.Schema.Types.* that are suitable for ref to RefType
  • Runtime-Deprecate @mapProp(TDEP0002) & @arrayProp(TDEP0001)
  • Runtime-Deprecate type-alias options, items & of & refType(TDEP0003)
  • Handle mongoose.Types.Array<Ref<>> for Typeguards (isDocumentArray & isRefTypeArray) [#278]

https://typegoose.github.io/typegoose/docs/changelog#720

typegoose - Release 7.1.3

Published by hasezoey over 4 years ago

  • Added an Error if option ref is set but is undefined/null
  • Add mongoose.Types.DocumentArray and mongoose.Schema.Types.DocumentArray to @prop array-detection
  • Change if (!kind) to if (isNullOrUndefined(kind))

https://typegoose.github.io/typegoose/docs/changelog#713

typegoose - Release 7.1.2

Published by hasezoey over 4 years ago

  • @prop options types now work again
  • BasePropOptions.type is now unkown instead of any
  • All aliases of BasePropOptions.type now inherit the types from there
  • Fix bug where autopopulate (or any other plugin) wouldnt pick up on virtuals [#274]
  • [IC] refType is now moved to prop

https://typegoose.github.io/typegoose/docs/changelog#712

typegoose - Release 7.1.1

Published by hasezoey over 4 years ago

  • Remove empty interface PropOptions
  • Remove type PropOptionsWithValidate
  • Rename type PropOptionsWithNumberValidate to PropOptionsForNumber
  • Rename type PropOptionsWithStringValidate to PropOptionsForString
  • Add options options & match for VirtualOptions
  • Add option enum for ValidateNumberOptions
  • arrayProp & mapProp are now just an alias for prop
  • Set TSDoc option @deprecated for arrayProp and mapProp
  • Detect mongoose.Types.Array & mongoose.Schema.Types.Array as Array in @prop
  • Detect mongoose.Types.Map & mongoose.Schema.Types.Map as Map in @prop
  • Add Overloads to @prop
  • PascalCased decorators now have the TSDoc of the original function
  • Default class Base's __v & __t are now optional (with ?)
  • Fix mentioned bug from #181, to allow mongoose.Schema.Types.String & mongoose.Schema.Types.Number as valid enum types
  • Options of & items are now mapped to type and get called when buildSchema is called
  • [IC] DeDuplicate code in prop.ts

https://typegoose.github.io/typegoose/docs/changelog#711

typegoose - Release 7.1.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • mongoose to 5.9.14
    • @types/mongoose to 5.7.19
    • tslib to 2.0.0
    • typescript to 3.9.2
  • Fix duplicate hooks / virtuals / queryMethods / plugins / indices via inheritance [#218 ]
  • improve TSDoc of some functions
  • Fix queryMethod reflection
  • Set proper function type for queryMethod
  • Added the ability to define option ref with an arrow-function (ref: () => type)
  • All Decorators are now exported PascalCased & camelCased
  • Actually export the @queryMethod decorator
  • The @queryMethod decorator now has correct types [#247]
  • The functions addModelToTypegoose, getModelForClass, buildSchema, deleteModelWithClass, getDiscriminatorModelForClass now have the T generic removed (it was unnecessary)
  • The functions addModelToTypegoose, getModelForClass, getDiscriminatorModelForClass now have an new optional generic QueryHelpers
  • The Type ReturnModelType now has the T generic removed (it was unnecessary)
  • The Type ReturnModelType now has an second optional generic QueryHelpers
  • Fix bug where ref: Class didnt execute getName when Virtual-Populate was used
  • Allow use of @prop for arrays & maps (In preparation for 8.0), it is now auto-detected based on design:type
  • The Decorator @plugin now automatically infers the options if the plugin & function have typings and use options
  • [IC] add some tslint rules & apply them
  • [IC] enable "strictNullChecks" & fix accordingly

https://typegoose.github.io/typegoose/docs/changelog#710

typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Added the ability to define option ref with an arrow-function (ref: () => type)
  • All Decorators are now exported PascalCased & camelCased
  • Actually export the @queryMethod decorator
  • The @queryMethod decorator now has correct types [#247]
  • The functions addModelToTypegoose, getModelForClass, buildSchema, deleteModelWithClass, getDiscriminatorModelForClass now have the T generic removed (it was unnecessary)
  • The functions addModelToTypegoose, getModelForClass, getDiscriminatorModelForClass now have an new optional generic QueryHelpers
  • The Type ReturnModelType now has the T generic removed (it was unnecessary)
  • The Type ReturnModelType now has an second optional generic QueryHelpers
typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Update Dependencies
    • mongoose to 5.9.13
    • @types/mongoose to 5.7.16
    • tslib to 1.11.2
  • Fix duplicate hooks / virtuals / queryMethods / plugins / indices via inheritance [#218]
  • improve TSDoc of some functions
  • Fix queryMethod reflection
  • Set proper function type for queryMethod
  • [IC] add some tslint rules & apply them
  • [IC] enable "strictNullChecks" & fix accordingly
typegoose - Release 7.0.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • mongoose to 5.9.10
    • @types/mongoose to 5.7.12
  • Minimal NodeJS version is now 10.15
  • Minimal Typescript version is now 3.8.3
  • Typegoose class got completly removed
  • All Deprecated arrayProp options got remove
    • itemsRef replaced with plain ref
    • itemsRefPath replaced with plain refPath
    • itemsRefType replaced with plain refType
  • All enums got moved from src/types to src/internal/constants
  • All things from src/types now get exported as type
  • All Errors now get exported as errors
  • All non-essentail types get exported as types
  • utils's getName function now gets exported
  • Add PropOption addNullToEnum
  • Remove Deprecated value overwrite for VirtualOptions
  • Remove instance properties from Model type (remove & T from ModelType)
  • Add class decorator queryMethod
  • [IC] rename file optionsProp to modelOptions
  • [IC] Replace mocha & chai with jest
  • [IC] Completly remove TG_USE_NEW_ENUM from documentation & code
  • [IC] Replace almost all if-throw with the internal assertion function
  • [IC] Move VirtualPopulate cache to Reflection
  • [IC] Move Plugins cache to Reflection
  • [IC] Move Hooks cache to Reflection
  • [IC] All remaining test's models now get exported with an name (not being exported as model anymore)

https://typegoose.github.io/typegoose/changelog#700

typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Update Dependencies
    • mongoose to 5.9.10
    • @types/mongoose to 5.7.12
    • semver to 7.3.2
  • Add class decorator queryMethod
  • Add option language_override to IndexOptions
  • Fix spelling errors in documentation
  • Add PropOption addNullToEnum
  • [IC] rename file optionsProp to modelOptions
  • [IC] Replace mocha & chai with jest
typegoose - Release 6.5.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • semver to 7.3.2
    • tslib to 1.11.1
    • loglevel to 1.6.8
  • Remove useNewEnum type from types
  • Add warning when value is an primitive and will result in an Mixed (fixes #152)
  • Add option language_override to IndexOptions
  • Fix spelling errors in documentation
  • [IC] Replace deprecated arrayProp options with proper ones in all tests & test-models

https://typegoose.github.io/typegoose/changelog#650

typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Remove instance properties from Model type (remove & T from ModelType)
  • [IC] Completly remove TG_USE_NEW_ENUM from documentation & code
  • [IC] Replace almost all if-throw with the internal assertion function
  • [IC] Replace mocha & chai with jest
typegoose -

Published by hasezoey over 4 years ago

Includes since last pre-release:

  • Minimal NodeJS version is now 10.15
  • Minimal Typescript version is now 3.8.3
  • Typegoose class got completly removed
  • All Deprecated arrayProp options got remove
    • itemsRef replaced with plain ref
    • itemsRefPath replaced with plain refPath
    • itemsRefType replaced with plain refType
  • All enums got moved from src/types to src/internal/constants
  • All things from src/types now get exported as type
  • All Errors now get exported as errors
  • All non-essentail types get exported as types
  • utils's getName function now gets exported
  • Remove Deprecated value overwrite for VirtualOptions
  • [IC] Move VirtualPopulate cache to Reflection
  • [IC] Move Plugins cache to Reflection
  • [IC] Move Hooks cache to Reflection
  • [IC] All remaining test's models now get exported with an name (not being exported as model anymore)
  • Update Dependencies
    • mongoose to 5.9.9
    • @types/mongoose to 5.7.10
    • tslib to 1.11.1
    • loglevel to 1.6.8
    • semver to 7.3.0
typegoose -

Published by hasezoey over 4 years ago

typegoose - Release 6.4.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • mongoose to 5.9.2
    • @types/mongoose to 5.7.1
    • semver to 7.1.3
    • loglevel to 1.6.7
    • tslib to 1.11.0
  • Completly remove __uniqueID, because it was not used internally anymore

https://typegoose.github.io/typegoose/changelog#640

typegoose - Release 6.3.2

Published by hasezoey over 4 years ago

  • Indexes: clone array instead of re-using it (fixes #194)

https://typegoose.github.io/typegoose/changelog#632

typegoose - Release 6.3.1

Published by hasezoey over 4 years ago

  • Hopefully fix the Strictmode error of the new Ref-Type

https://typegoose.github.io/typegoose/changelog#631

typegoose - Release 6.3.0

Published by hasezoey over 4 years ago

  • Update Dependencies
    • mongoose to 5.8.11
    • @types/mongoose to 5.7.0
    • semver to 7.1.2
  • Add @types/mongoose to peerDependencies
  • Add generic type to @plugin to set the type for the options
  • Use a modified Ref-Type to automaticly get the type (if the Ref'd type has string as _id, it automaticly sets the RefType to string)

https://typegoose.github.io/typegoose/changelog#630

typegoose - Release 6.2.2

Published by hasezoey over 4 years ago

  • Fix use of "rawOptions.type" after deletion (fixes typegoose/typegoose#178)

https://typegoose.github.io/typegoose/changelog#622