Releases: remult/remult
Releases · remult/remult
v0.26.1
What's Changed
- Doc tweaks by @jycouet in #407
- fixed prevent default in deleting by @noam-honig in #409
- Fixed issue where 404 returns an error - forbidden instead of not found
Full Changelog: v0.26.0...v0.26.1
v0.26.0
Features
- Added support for migrations. See Migrations.
- Added an
error
hook toRemultServerOptions
that is called whenever there is an error in the API lifecycle. See RemultServerOptions. - Added
ForbiddenError
to the API, you can throw it anywhere in the request lifecycle to display a forbidden 401 error. - Added
@Fields.literal
and@Fields.enum
. - Added support for
better-sqlite3
without knex, see Connection a Database. - Added support for
bun:sqlite
#387. - Added a generic implementation for
sqlite
that can be easily extended to any provider. - Added
apiPreprocessFilter
andbackendPreprocessFilter
, see access control. - Added a way to analyze filter and query it -
Filter.getPreciseValues
, which returns aFilterPreciseValues
object containing the precise values for each property. see access control. - Added an exception when calling
updateMany
ordeleteMany
without a filter - to protect against accidental deleting/updating all data. - Added updateMany and deleteMany to OpenAPI (swagger) & graphql
Improvements
- Added validation for
@Fields.number
&Fields.integer
that the value is a valid number. - Added "basic" supports for environments where async hooks doesn't work well - mostly for web based dev machines.
- Improved the API of
rawFilter
so it can now return the SQL where to be added to the command. see Leveraging Custom Filters for Enhanced Data Filtering KnexDataProvider
now supports allexecute
andcreateCommand
and can be used with anySqlDatabase
functionality.- Changed postgres schema builder to use
timestamptz
instead oftimestamp
. - Changed the default storage of
@Fields.object
totext
(varchar max) instead of string 255 inknex
andsqlite
.
Documentation Updates
- Added or rewrote the following articles:
- Migrations
- Access Control
- Custom/SQL Filter
- Direct Database Access
- Extensibility
- Lots of
jsdocs
improvements
Bug Fixes
- Fixed an issue with entity ids that included date.
- Fixed an issue with
repo(Entity,dataProvider)
- where saving wasn't fired because of wrongisProxy
inference. - Fixed an issue with chaining of validators that in some cases caused a validator to be overwritten.
- Fixed
ValueConverters
Number
fromInput
handle 0 as a valid value.
Breaking Changes
- Changed the signature of
updateMany
anddeleteMany
to require awhere
parameter:repo(Task).delete({ where: { completed: true } })
. - Changed the signature of
getDb
to receiveDataProvider
as a parameter instead ofRemult
. - Changed the POST REST API queries to include the filter under the
where
key in the body - previously, it included the filter as the body itself.
New Contributors
Full Changelog: v0.25.8...v0.26.0
v0.25.8
- Fixed issues related to
skipLibCheck: false
- Fixed issues with typing of validators #400
Full Changelog: v0.25.7...v0.25.8
v0.25.7
What's Changed
- Fixed typing issue with validators and typescript 5.4
- Added
deleteMany
andupdateMany
- When
insert
is called in the front-end with an array of items, a single POST call is made to the server - Renamed
addParameterAndReturnSqlToken
toparam
.addParameterAndReturnSqlToken
will be deprecated in future versions - Default number storage in knex, previously was decimal(8,2) now, decimal(18,2)
- Fixed issue where exception throws in
initRequest
orgetUser
caused server to crash, instead of return a bad request error - Changed required to allow 0 as a value - so only null, undefined and empty strings are considered invalid for a required field
- Fixed an issue where
backendPrefilter
was not applied to id basedupdate
,save
ordelete
in the backend - fix typo in the docs of uniqueOnBackend deprecation by @Yedidyar in #369
- Remult Admin Nested Actions quickfix by @ermincelikovic in #342
- docs: bun hono monorepo example by @bensos000 in #375
New Contributors
- @Yedidyar made their first contribution in #369
- @bensos000 made their first contribution in #375
Full Changelog: v0.25.6...v0.25.7
v0.25.6
What's Changed
- Added support for
orderByNullsFirst
inPostgresDataProvider
to change the default postgres behavior where nulls are last - Added support for
tableName
option argument fordbNamesOf
that'll add the table name to each field
Before:Now:const orders = await dbNamesOf(Order) return `(select count(*) from ${orders} where ${orders}.${orders.id}=1)
const orders = await dbNamesOf(Order, { tableNames:true }) return `(select count(*) from ${orders} where ${orders.id}=1)
- improved dbNamesOf of to use by default the wrapIdentifier of the current data provider if no wrap identifier was provided
- Added support for using dbNamesOf in an sql expression for that same entity
- Improved performance of dbNamesOf
- Added support for Hono web framework
- Improved support for Mono repo scenario #355
- Added
withRemult
to next js page router - Fixed custom message to some validators (in etc...)
- Improved support for union string fields
- the fix by @yoni-rapoport in #361
- Bump jose from 4.14.4 to 4.15.5 in /projects/test-servers/next-app-server by @dependabot in #363
- Bump jose from 4.14.4 to 4.15.5 in /examples/nextjs-todo by @dependabot in #362
- Bump jose from 4.14.4 to 4.15.5 in /examples/nextjs-app-router-todo by @dependabot in #364
- Bump jose from 4.15.4 to 4.15.5 in /examples/nuxt-todo by @dependabot in #365
- Doc imp tentative by @jycouet in #356
Full Changelog: v0.25.5...v0.25.6
v0.25.5
What's Changed
- Added
admin
option to servers, enabling the/api/admin
route with a built in entity explorer
- Fixed multiple issues with GraphQL and relations
- Improved support for esm/cjs in same process scenario
- Enabled json storage type for mysql & mysql2 knex adapters
- Fixed issue in case of missing
reflect-metadata
- Added a recommended way to use remult in
sveltekit
usingapi/[...remult]/+server.ts
route instead of a hook - Added ArrayEntityDataProvider to the external api
New Contributors
- @GonerGenesis made their first contribution in #331
- @ermincelikovic made their first contribution in #332
Full Changelog: v0.25.4...v0.25.5
v0.25.3
- Fixed #320, dbReadonly columns are not created in the db
Full Changelog: v0.25.2...v0.25.3
v0.25.2
- Fix the
defaultMessage
of validators - Added Validators.minLength
Full Changelog: v0.25.1...v0.25.2
v0.25.1
What's Changed
- Fixed issue where
defaultGetLimit
caused issues with include queries
Full Changelog: v0.25.0...v0.25.1
v0.25.0
Improvement for validators
- Added
required
as aFieldOption
- Added validation for
maxLength
inStringFieldOptions
- Added the following validators to the
Validators
class:- regex
- url
- in
- notNull
- enum
- relationExists,
- maxLength
- Added support for return value for validations - true || undefined are valid, string will provide the message. For example:
@Fields.string({ validate:(task)=> task.title.length > 5 || "too short" })
- Added the
valueValidator
helper function:@Fields.string({ validate: valueValidator(value => value.length > 5) })
- Added helper functions to create validators,
createValueValidator
,createValueValidatorWithArgs
,createValidator
&createValidatorWithArgs
- Changed signature of
FieldOptions
.validate
the receiveValidateFieldEvent
object as the second parameter instead ofFieldRef
- Updated Signature of
required
andunique
based on api change - Adjusted the
unique
validator to only run on the backend
New Frontend Data Providers
- Added Origin Private File System Storage to store entities in the front end
const db = new JsonDataProvider(new JsonEntityOpfsStorage()) repo(Task, db) .find() .then((tasks) => console.table(tasks))
- Added
SqlJsDataProvider
for use with front end sqlite implementation sql.jsconst db = new SqlDatabase( new SqlJsDataProvider(initSqlJs().then((x) => new x.Database())), ) repo(Task, db) .find() .then((tasks) => console.table(tasks))
Other
- Added
clone
toEntityRef
- Fixed issue where
findOne
didn't work - Fixed issue where exception
XXX is not a known entity, did you forget to set @Entity() or did you forget to add the '@' before the call to Entity?
was thrown in cases where multiple instances of remult were in memory - Issue #314 resolved by @itamardavidyan in #315
New Contributors
- @itamardavidyan made their first contribution in #315
Full Changelog: v0.24.1...v0.25.0