Skip to content

Releases: remult/remult

v0.26.1

18 Apr 10:54
Compare
Choose a tag to compare

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

08 Apr 15:26
Compare
Choose a tag to compare

Features

  • Added support for migrations. See Migrations.
  • Added an error hook to RemultServerOptions 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 and backendPreprocessFilter, see access control.
  • Added a way to analyze filter and query it - Filter.getPreciseValues, which returns a FilterPreciseValues object containing the precise values for each property. see access control.
  • Added an exception when calling updateMany or deleteMany 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 all execute and createCommand and can be used with any SqlDatabase functionality.
  • Changed postgres schema builder to use timestamptz instead of timestamp.
  • Changed the default storage of @Fields.object to text (varchar max) instead of string 255 in knex and sqlite.

Documentation Updates

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 wrong isProxy 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 and deleteMany to require a where parameter: repo(Task).delete({ where: { completed: true } }).
  • Changed the signature of getDb to receive DataProvider as a parameter instead of Remult.
  • 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

05 Apr 08:57
Compare
Choose a tag to compare
  • Fixed issues related to skipLibCheck: false
  • Fixed issues with typing of validators #400

Full Changelog: v0.25.7...v0.25.8

v0.25.7

21 Mar 09:16
Compare
Choose a tag to compare

What's Changed

  • Fixed typing issue with validators and typescript 5.4
  • Added deleteMany and updateMany
  • When insert is called in the front-end with an array of items, a single POST call is made to the server
  • Renamed addParameterAndReturnSqlToken to param. 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 or getUser 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 based update, save or delete 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

Full Changelog: v0.25.6...v0.25.7

v0.25.6

17 Mar 10:53
Compare
Choose a tag to compare

What's Changed

  • Added support for orderByNullsFirst in PostgresDataProvider to change the default postgres behavior where nulls are last
  • Added support for tableName option argument for dbNamesOf that'll add the table name to each field
    Before:
    const orders = await dbNamesOf(Order)
    return `(select count(*) from ${orders} where ${orders}.${orders.id}=1)
    Now:
    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

Full Changelog: v0.25.5...v0.25.6

v0.25.5

11 Feb 08:22
Compare
Choose a tag to compare

What's Changed

  • Added admin option to servers, enabling the /api/admin route with a built in entity explorer
    Admin
  • 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 using api/[...remult]/+server.ts route instead of a hook
  • Added ArrayEntityDataProvider to the external api

New Contributors

Full Changelog: v0.25.4...v0.25.5

v0.25.3

15 Jan 13:57
Compare
Choose a tag to compare
  • Fixed #320, dbReadonly columns are not created in the db

Full Changelog: v0.25.2...v0.25.3

v0.25.2

12 Jan 16:59
Compare
Choose a tag to compare
  • Fix the defaultMessage of validators
  • Added Validators.minLength

Full Changelog: v0.25.1...v0.25.2

v0.25.1

11 Jan 17:36
Compare
Choose a tag to compare

What's Changed

  • Fixed issue where defaultGetLimit caused issues with include queries

Full Changelog: v0.25.0...v0.25.1

v0.25.0

10 Jan 05:49
Compare
Choose a tag to compare

Improvement for validators

  • Added required as a FieldOption
  • Added validation for maxLength in StringFieldOptions
  • Added the following validators to the Validators class:
    • regex
    • email
    • 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 receive ValidateFieldEvent object as the second parameter instead of FieldRef
  • Updated Signature of required and unique 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.js
    const db = new SqlDatabase(
      new SqlJsDataProvider(initSqlJs().then((x) => new x.Database())),
    )
    repo(Task, db)
      .find()
      .then((tasks) => console.table(tasks))

Other

  • Added clone to EntityRef
  • 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

Full Changelog: v0.24.1...v0.25.0