From 26c858adc180ac9007f228f6ac37acb9bf18fdc4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jul 2023 07:17:23 +0000 Subject: [PATCH] chore(main): Release 15.0.0 --- docs/CHANGELOG.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 99 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e5fe887f6..137ba507a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,104 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [15.0.0](https://github.com/Hustle/papr/compare/v14.0.0...v15.0.0) (2023-07-29) + + +### ⚠ BREAKING CHANGES + +* Node.js v14 is not supported. +* The return type of `bulkWrite` now includes also `void` +* Nested properties after 6 levels of nesting are no longer type checked. +* Papr is using new internal stricter types for query filters and update +* `Filter` and `UpdateFilter` types are now using the strict counterpart types from mongodb v5. +* Schemas no longer have a default `__v` property defined. Users who have migrated from Mongoose or are otherwise taking advantage of this property will have to manually add it to their schema definitions. +* This changes the produced JSON schema for required `oneOf` types to correctly include it in the resulting `required` properties array. +* Changes the return type for `schema` and the generic arguments for `model` and various utils +* The hook parameters have been merged into a single object parameter. +* Arrays will no longer default to type (T | undefined)[] +* Removed undocumented support for a custom model generic type in the `model()` function. +* `bulkWrite` operations types updated to handle defaults for attributes. +* `schema()` generic types have changed. +* TypeScript types have changed - now using the embedded types from mongodb package. + +### Features + +* `decimal` type ([#326](https://github.com/Hustle/papr/issues/326)) ([13443bc](https://github.com/Hustle/papr/commit/13443bc196c369720d5605f26fb513e9b8e27e2e)) +* `null` type ([#337](https://github.com/Hustle/papr/issues/337)) ([e78f1ca](https://github.com/Hustle/papr/commit/e78f1ca9e4aeaa61a176201ef38ba50bf98a1dc4)) +* `oneOf` type ([#275](https://github.com/Hustle/papr/issues/275)) ([2d55250](https://github.com/Hustle/papr/commit/2d55250a99f0629f051fe7d768080046d30d5866)) +* `tuple` type ([#284](https://github.com/Hustle/papr/issues/284)) ([0531447](https://github.com/Hustle/papr/commit/0531447af494e60ff0ecfeeffc29c169a359c7b6)) +* `unknown` type ([#276](https://github.com/Hustle/papr/issues/276)) ([716712a](https://github.com/Hustle/papr/commit/716712a0241761a8b3008ef52f090aa9532e9b9f)) +* Add `findCursor` model method ([#454](https://github.com/Hustle/papr/issues/454)) ([3b65525](https://github.com/Hustle/papr/commit/3b6552593403d4fd4f2c382f53021e4b5666406e)) +* Add `Model.exists(filter)` query helper ([47ee728](https://github.com/Hustle/papr/commit/47ee728c0d8ce36943aa211e98d81f00aa2fe62c)) +* Add mongodb v5 support with strict filter types ([#422](https://github.com/Hustle/papr/issues/422)) ([547a794](https://github.com/Hustle/papr/commit/547a794dc4256e5a97f3bf13a08b4de659fd411d)) +* Add timestamp option to set property names ([115c805](https://github.com/Hustle/papr/commit/115c805d902176aec11c4b3cb8af2d09fe27b913)) +* Adopt filter types from mongodb and enhance strictness ([#430](https://github.com/Hustle/papr/issues/430)) ([b54ef0b](https://github.com/Hustle/papr/commit/b54ef0b76ee899d1a6d7e0fae9b90e3063775eaf)) +* Allow const enums ([#497](https://github.com/Hustle/papr/issues/497)) ([194e505](https://github.com/Hustle/papr/commit/194e505ae0837fc53cc746330ca003f7a106e8a0)) +* Allow user definition of `_id` property type ([#311](https://github.com/Hustle/papr/issues/311)) ([056928e](https://github.com/Hustle/papr/commit/056928e955a34aa466d547dd99d1cb75f59ece9d)) +* Better `bulkWrite` types for insert operations ([#211](https://github.com/Hustle/papr/issues/211)) ([8ae6182](https://github.com/Hustle/papr/commit/8ae6182d871fc6daec346884b3ed5bb2333d4964)) +* Initial public commit ([740b1ef](https://github.com/Hustle/papr/commit/740b1efb5fd63db9e7d5bd50366fc78f4d458f3d)) +* Make array members non-optional by default ([#231](https://github.com/Hustle/papr/issues/231)) ([2c52719](https://github.com/Hustle/papr/commit/2c52719f0025c85760c3d5a82660cdb5cf2c8c5b)) +* Model.findOneAndDelete ([#75](https://github.com/Hustle/papr/issues/75)) ([c555246](https://github.com/Hustle/papr/commit/c55524668343e196fec65241cb778a1a4694c06a)) +* Send result to the after hook parameters ([#242](https://github.com/Hustle/papr/issues/242)) ([cef1536](https://github.com/Hustle/papr/commit/cef1536ba7eff4c2e6b52a2106eb88b9bff2149f)) +* Support `constant` type ([#312](https://github.com/Hustle/papr/issues/312)) ([e676703](https://github.com/Hustle/papr/commit/e67670399dad5dfbbe7b30ea688f5c7912ba7a8b)) +* Support excluding fields in ProjectionType ([#360](https://github.com/Hustle/papr/issues/360)) ([086d8f1](https://github.com/Hustle/papr/commit/086d8f160d7ec6fdd78e439f3d5b8d6d94f5ace2)) +* Support for mongodb v4.8.1 ([#262](https://github.com/Hustle/papr/issues/262)) ([0b86f01](https://github.com/Hustle/papr/commit/0b86f01954cd6a9370ae7fd3924b6e862cf94473)) +* Support IDs with strings or numbers ([#74](https://github.com/Hustle/papr/issues/74)) ([3e793cb](https://github.com/Hustle/papr/commit/3e793cbd40ad3539fda39b5436a1df7665e84f41)) +* Support nested fields in projection ([#155](https://github.com/Hustle/papr/issues/155)) ([6ed7ba1](https://github.com/Hustle/papr/commit/6ed7ba12cc0216d1156d155f7a6eb0985b34bc0b)) +* Support TypeScript moduleResolution nodenext option ([#460](https://github.com/Hustle/papr/issues/460)) ([14791f6](https://github.com/Hustle/papr/commit/14791f671e652db1814c618afc67face19271c08)) +* Type check nested objects in generic objects ([#439](https://github.com/Hustle/papr/issues/439)) ([3a142f3](https://github.com/Hustle/papr/commit/3a142f333d95c7a4145db2e4deff022655862e6e)) +* Use mongodb v4.* ([#36](https://github.com/Hustle/papr/issues/36)) ([74a5586](https://github.com/Hustle/papr/commit/74a55863b9229edfc2118b3a2b27fda13f4f43c5)) +* Use mongodb v4.2.1 ([#141](https://github.com/Hustle/papr/issues/141)) ([a17e53f](https://github.com/Hustle/papr/commit/a17e53fcab7d0c307c11bce99728da625a484e68)) + + +### Bug Fixes + +* Allow explicit optional types on schemas ([#207](https://github.com/Hustle/papr/issues/207)) ([716dbb4](https://github.com/Hustle/papr/commit/716dbb404092162aa438eeb05dfa2afa393b735f)) +* Apply defaults in bulkWrite updateOne operations ([#41](https://github.com/Hustle/papr/issues/41)) ([ee84388](https://github.com/Hustle/papr/commit/ee8438888cc3e57a90efe7fb00cfe82d441edd0e)) +* bump minimist from 1.2.5 to 1.2.6 ([#180](https://github.com/Hustle/papr/issues/180)) ([b9d5cea](https://github.com/Hustle/papr/commit/b9d5cea0713b286352790703e27365528fe02dd2)) +* bump node-fetch from 2.6.1 to 2.6.7 ([cb25d05](https://github.com/Hustle/papr/commit/cb25d05bdceb0d51ebee42ef87da868c67f40c26)) +* bump normalize-url from 4.5.0 to 4.5.1 ([ebd58c2](https://github.com/Hustle/papr/commit/ebd58c20eda7c38bcf510ecbbb1d22fa7763e4db)) +* bump path-parse from 1.0.6 to 1.0.7 ([e85b312](https://github.com/Hustle/papr/commit/e85b312f377e4736d39252378d2aeb60c2e08c1a)) +* bump prismjs from 1.23.0 to 1.25.0 ([682db15](https://github.com/Hustle/papr/commit/682db15b9c254cf2306597c9c1bcca3a84449846)) +* bump prismjs from 1.25.0 to 1.27.0 ([7c0d1d2](https://github.com/Hustle/papr/commit/7c0d1d212e3a63979ece1ced78f4d4999f7c95ca)) +* bump shelljs from 0.8.4 to 0.8.5 ([#149](https://github.com/Hustle/papr/issues/149)) ([2ee4a30](https://github.com/Hustle/papr/commit/2ee4a30e6d99cad06339a1b290d29d25e8114a13)) +* bump tmpl from 1.0.4 to 1.0.5 ([5907415](https://github.com/Hustle/papr/commit/5907415468d11d78a3a9e671a52a46fe8c7fb102)) +* bump trim-off-newlines from 1.0.1 to 1.0.3 ([#152](https://github.com/Hustle/papr/issues/152)) ([6ed3ccd](https://github.com/Hustle/papr/commit/6ed3ccd1923d06a53e7210441f0e4f68e9e77782)) +* bump ws from 7.4.5 to 7.5.5 ([4962e37](https://github.com/Hustle/papr/commit/4962e3732e10e703d3b85f8c615b3ebcfc8e614c)) +* Correct `oneOf` required option ([a24054f](https://github.com/Hustle/papr/commit/a24054fbfaeb0f1ad58470080db6cc77bae23533)) +* Correct TimestampSchema ternary in DocumentForInsert ([#277](https://github.com/Hustle/papr/issues/277)) ([7e8d750](https://github.com/Hustle/papr/commit/7e8d7504aeee51e6ad0c27a9df7a8597fdb63f74)) +* Customisable Hook context type ([#258](https://github.com/Hustle/papr/issues/258)) ([26d4628](https://github.com/Hustle/papr/commit/26d4628ef1fef0ca9266d4a4c6d21c3fc53313e7)) +* Customize benchmark db name via CLI arg ([#32](https://github.com/Hustle/papr/issues/32)) ([a159933](https://github.com/Hustle/papr/commit/a1599337a2909ba985b586816db4805d8768c7bc)) +* Customize mongo URL in benchmark tool ([#19](https://github.com/Hustle/papr/issues/19)) ([2cfac08](https://github.com/Hustle/papr/commit/2cfac08a0e304eaf9b3ed027b70281e11086710a)) +* ESM build with file extensions ([#122](https://github.com/Hustle/papr/issues/122)) ([b81a6de](https://github.com/Hustle/papr/commit/b81a6de3c67a779fef4ffa77ff26efc69d8e4c4d)) +* Filter defaults in bulkWrite to avoid conflicts ([#42](https://github.com/Hustle/papr/issues/42)) ([28d3fb4](https://github.com/Hustle/papr/commit/28d3fb489f65ecd97ffb63189421d67635cbec0e)) +* Fix insert and projection types ([#72](https://github.com/Hustle/papr/issues/72)) ([344abab](https://github.com/Hustle/papr/commit/344abab587b4850351c535b8282184871a6afb9c)) +* Improve defaults type at schema declaration ([#178](https://github.com/Hustle/papr/issues/178)) ([efa5d92](https://github.com/Hustle/papr/commit/efa5d92b1ed47a4145b5bac7e27c1793ca029954)) +* Require mongodb >=v4.1.1 ([125d928](https://github.com/Hustle/papr/commit/125d928a2bf9175134a6ba672bdd98fb74854fea)) +* Support custom dates in insert operations ([afe201a](https://github.com/Hustle/papr/commit/afe201ac9705f0acc46077dbeb73191b151766a6)) +* Support enum type with array of const values ([#133](https://github.com/Hustle/papr/issues/133)) ([f39003f](https://github.com/Hustle/papr/commit/f39003f29538826821554405ec656740dd2ab621)) +* Update sed command for macOS ([#234](https://github.com/Hustle/papr/issues/234)) ([0b6c476](https://github.com/Hustle/papr/commit/0b6c47620e670ac00ae42681b7f9f74c478e8112)) +* Upgrade mongodb to v4.11.0 ([#343](https://github.com/Hustle/papr/issues/343)) ([f7db8b7](https://github.com/Hustle/papr/commit/f7db8b70b1fcf294890319d374151dbb67e2af44)) +* Upgrade mongodb to v4.9.0 ([#292](https://github.com/Hustle/papr/issues/292)) ([64de742](https://github.com/Hustle/papr/commit/64de742dfbc07e16611de4e3f05128fd92c6ff31)) +* Upgrade mongodb to v4.9.1 ([#304](https://github.com/Hustle/papr/issues/304)) ([cc2e975](https://github.com/Hustle/papr/commit/cc2e97562bb9bd502b1851debdc58727f7a1d398)) +* Upgrade typescript to v4.8.2 ([#300](https://github.com/Hustle/papr/issues/300)) ([fd3ee59](https://github.com/Hustle/papr/commit/fd3ee591b281adcabc8d5207244283063592b19f)) +* Use Record for objectGeneric type ([#274](https://github.com/Hustle/papr/issues/274)) ([59f3664](https://github.com/Hustle/papr/commit/59f3664389a4ead84cae185ab4526a3f04f580da)) +* Use returnDocument instead of returnOriginal ([#7](https://github.com/Hustle/papr/issues/7)) ([bbbb651](https://github.com/Hustle/papr/commit/bbbb6519b98b64ff20b066955e4c613b24d37792)) +* Util getIds accepts readonly structures ([#381](https://github.com/Hustle/papr/issues/381)) ([940d519](https://github.com/Hustle/papr/commit/940d519c9b05af42efa1b3a8c7373753abc3bc47)) + + +### Performance Improvements + +* Improve update filter types check times ([#440](https://github.com/Hustle/papr/issues/440)) ([15d1ba9](https://github.com/Hustle/papr/commit/15d1ba903d3d7ecba3522d5b8908014ad2b5355d)) + + +### Code Refactoring + +* Perform no-op on `bulkWrite` when no operations provided ([#455](https://github.com/Hustle/papr/issues/455)) ([d56a0f6](https://github.com/Hustle/papr/commit/d56a0f67e00de30e13b1be814a5f33bb455f0004)) +* Remove custom model type support ([#219](https://github.com/Hustle/papr/issues/219)) ([8675ffa](https://github.com/Hustle/papr/commit/8675ffa0cfcf247c85f41ed2254b497ae3cd1ff1)) +* Remove default schema `__v` version property ([86bca4f](https://github.com/Hustle/papr/commit/86bca4f4b45fa06cc3be9536bd0f0b51e27228e0)) +* Remove node.js v14 support ([#464](https://github.com/Hustle/papr/issues/464)) ([935b331](https://github.com/Hustle/papr/commit/935b33162aa41356779131182767630f8776b1c4)) + ## [14.0.0](https://github.com/plexinc/papr/compare/v13.1.0...v14.0.0) (2023-07-11) diff --git a/package.json b/package.json index ff62cb584..b66a92c06 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "papr", "description": "MongoDB TypeScript-aware Models", "author": "Plex Inc.", - "version": "14.0.0", + "version": "15.0.0", "keywords": [ "mongodb", "database",