typegoose

Typegoose - Define Mongoose models using TypeScript classes.

MIT License

Downloads
403.8K
Stars
2.1K
Committers
105

Bot releases are hidden (Show)

typegoose - Release 6.2.1

Published by hasezoey almost 5 years ago

  • Fix functions isString and isNumber to check against their mongoose.Schema.Types.*.name equivalent (fixes #149 )

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

typegoose - Release 6.2.0

Published by hasezoey almost 5 years ago

This Update may break some code (mongoose upgrade, inline _id change, enum changes)

  • Update Dependencies
    • Upgrade mongoose from 5.7.7 to 5.8.3
    • Upgrade @types/mongoose from 5.5.30 to 5.5.35
    • [IC] Upgrade Typescript from 3.7.2 to 3.7.4
    • [IC] Upgrade NYC from 14.1.1 to 15.0.0
  • The option useNewEnum (and TG_USE_NEW_ENUM) got removed, because it would interfer with the number-enums
  • Added the ability to use number-enums on number-type props
  • Changed behaviour of string-enums to only work on string-type props
  • Fix PropOptions type for autopopulate
  • [IC] When the type is a Schema, it is now handled by mapOptions & mapArrayOptions
  • [IC] fix tests not exiting after completion
  • [IC] add tslint-plugin tslint-consistent-codestyle

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

typegoose - Release 6.1.8

Published by hasezoey almost 5 years ago

  • backport for:
    • fixes typegoose/typegoose#160
    • [IC] mapArrayOptions now uses mapOptions
    • [IC] adding function mapOptions

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

typegoose - Release 6.1.7

Published by hasezoey almost 5 years ago

  • add support for environment variables here the new documentation
  • [IC] warnMixed now uses the right target
  • [IC] add function utils.getRightTarget

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

typegoose - Release 6.1.6

Published by hasezoey almost 5 years ago

  • handle _id: false/true better
  • add function getClass
  • [IC] fix using "name"-getter in getName

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

typegoose - Release 6.1.5

Published by hasezoey almost 5 years ago

  • Option merging is now properly done
  • [IC] fix giving wrong key to customMerger
  • [IC] remove the need to use "cloneDeepWith"

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

typegoose - Release 6.1.4

Published by hasezoey almost 5 years ago

  • Apply Global Options without needing @modelOptions
  • [IC] add function "utils.assignGlobalModelOptions"

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

typegoose - Release 6.1.3

Published by hasezoey almost 5 years ago

  • fix bug when "buildSchema" didnt get called when overwriting the type in @prop
  • [IC] add tests for Generic Discriminators

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

typegoose - Release 6.1.2

Published by hasezoey almost 5 years ago

  • Allow setting _id: false (and apply it) for @mapProp
  • [IC] De-duplicate code for _id if subDocument

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

typegoose - Release 6.1.1

Published by hasezoey almost 5 years ago

  • deleteModel now deletes the model from the connection it is on typegoose/typegoose#119
  • [IC] de-duplicate test code for connecting

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

typegoose - Release 6.1.0

Published by hasezoey almost 5 years ago

  • Update Dependencies
    • Upgrade mongoose from 5.7.1 to 5.7.7
    • [IC] Upgrade Typescript from 3.6.x to 3.7.2
  • Completly remove @staticMethod & @instanceMethod, because they were completly obsolete
  • README now has no documentation anymore
  • @prop({ validate }) now accepts { validator, message } as an array
  • Add function deleteModel & deleteModelWithClass
  • allow Prop Option "type" to overwrite the inferred type look here for an example
  • integrate "Array Validators & Transform" tests typegoose/typegoose#29
  • adding global options, with setGlobalOptions
  • add modelOption runSyncIndexes
  • add modelOption allowMixed
  • add text to PropOptions
  • deprecate ArrayPropOptions's itemsRef, itemsRefPath & itemsRefType
  • DocumentType will now overwrite the type of _id if the class is extending Base (in typescript there is currently no other way)
  • add tslib as dependencie to minimize generated code
  • fixing typo in (deprecated) setModelForClass
  • Remake how Enums are handeled, use setGlobalOptions({ globalOptions: { useNewEnum: true } }) (to not break existing databases made with the old handling)
  • add function getModelWithString
  • [IC] tsconfig: add option "strictBindCallApply"
  • [IC] tsconfig: add option "strictFunctionTypes"
  • [IC] combine initAsObject and initAsArray into initProperty
  • [IC] Use internal "isNullOrUndefined", needed because all "util.is*" functions got deprecated in node 4.0.0
  • [IC] Replace all "isArray" with "Array.isArray", needed because all "util.is*" functions got deprecated in node 4.0.0
  • [IC] adding many sanity isNullOrUndefined checks
  • [IC] Re-done how the handling of Mixed is done
  • [IC] Re-done how IModelOptions are merged (thanks to lodash cloneDeepWith & mergeWith)
  • [IC] de-duplicate "ref" & "refPath" code
  • [IC] added test for "Custom Types"
  • [IC] typegoose now makes use of "importHelpers"(tsconfig) to save some space
  • [IC] Refactor how "isPrimitive" works, some types like Buffer & Decimal now work
  • [IC] Added more debug logs to prop.ts
  • [IC] Move Decorator Cache to the class itself
  • [IC] "baseProp" now uses one single arguments, whith all the options
  • [IC] "createUniqueID" now returns a boolean instead of the "initname"

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

typegoose - Release 6.0.4

Published by hasezoey about 5 years ago

This Release didnt change anything on the code, it was mostly tests & github-page

  • Update Dependencies
    • Upgrade mongoose from 5.7.1 to 5.7.4
  • Added soft warning when using "ref" in an "arrayProp"
  • Added soft warning when using "refPath" in an "arrayProp"
  • Add missing ")" to a deprecation message
  • [IC] Fixed some Test's types
  • [IC] internal variable renames to better reflect what they are for

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

typegoose - Release 6.0.3

Published by hasezoey about 5 years ago

  • when using @plugin, options are now checked if they are an object, when not: make them an object
  • Added many debug logs for _buildSchema
  • Added Prop Option autopopulate, only has an effect if mongoose-autopopulate is used
  • Added default class FindOrCreate which has the types for mongoose-findorcreate

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

typegoose - Release 6.0.2

Published by hasezoey about 5 years ago

  • actually allow overwriting "_id" of "Base"
  • [IC] add npm version script

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

typegoose - Release 6.0.1

Published by hasezoey about 5 years ago

  • Add TSDoc for refType on PropOptions
  • refPath now uses the right type (new uses refType instead of itemsType)
  • Fix decorator options (rawOptions) mutating thanks to typegoose#60
  • Pre hook's function's next is now not marked as "optional" anymore, which caused next() to be EmptyVoidFn | undefined

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

typegoose - Release 6.0.0

Published by hasezoey about 5 years ago

For the changelog please look at https://typegoose.github.io/typegoose/changelog#600

typegoose - Release 5.9.2

Published by hasezoey about 5 years ago

  • Change README examples & badges to the new repo

  • use new travis.yml (from version 6.0.0)

  • use new style of package.json (from version 6.0.0)

  • Tags got deleted and added, please remove all local tags and re-download them

This Release did not change anything in the code, it is just there to update the NPM front

typegoose - Release 5.9.1

Published by hasezoey about 5 years ago

  • fix accidentally added typeguards
  • add a note that typegoose uses mongoose's strict by default
  • add note that typegoose dosnt work with classes with the same name (at least in 5.x, working on it in 6.x)
  • implemented a hack for ObjectId / ObjectID (mongoose some version fixed this)
typegoose - Release 5.9.0

Published by hasezoey about 5 years ago

  • This should not be a breaking release
  • Hooks now support Regular Expression for names, like mongoose
  • Tests are splitted into their own files
  • Fixing itemsRefPath & adding tests
  • itemsRef now supports to be used with a string as model
  • @prop({ alias }) is now supported
  • Index weights are now supported
  • isDocument & isDocumentArray typeguards are now implemented
  • Updated Dependencies
    Note worthy are:
    • mongoose 5.6 is now required instead of 5.5
    • this project should be used with typescript 3.5+
  • @mapProp() is now implemented
  • Fix for @prop({ select })
  • A public version of buildSchema is now available
  • Added more Documentation to README
  • Added TSDOC to many functions and properties
  • build target is now ES6 instead of ES5