Releases: eicrud/eicrud
v0.9.7
What's Changed
- feat(core): checkForObjectId now only cast mikro-orm relation fields by @acrosett in #127
- feat(core): add store_bidirectional on CrudContext by @acrosett in #127 -> doc
- feat(core): Utils getEntityId for consistent ID extraction by @acrosett in #127 -> doc
Full Changelog: v0.9.6...v0.9.7
https://www.npmjs.com/org/eicrud
💥Breaking changes:
For mongo users:
In CRUD methods, string representations of ObjectIDs passed in first depth level props and arrays are now casted to ObjectID mongo type (for query and update) ONLY if the field is a mikro-orm relation (annotated with @OneToMany, @OneToOne... etc.
If your database contain previous non-annotated field (currently stored as ObjectId), you need to migrate them to string representation.
v0.9.6
What's Changed
- feat(core): Token authentication (API style) by @acrosett in f6df4cc -> 📗 docs
- feat(core): cacheField to set a different value than id_field to be used in $findOneCached by @acrosett in 57472e2 ->📘 docs
- feat(core): change service import of ms subfolder config (generated by CLI) by @acrosett in e8609f0
- fix(core): generator.ensureIndexes() in main.ts generated CLI projects by @acrosett in 936d1c5
Full Changelog: v0.9.5...v0.9.6
v0.9.5
What's Changed
- build(core): update minor dependencies including [email protected] by @acrosett in 2d0d4dd
- chore(core): set type Extract<keyof T, string>[]; on exclude option by @acrosett in b31f871
- chore(core): better typing in userService by @acrosett in cd5600c
- docs(cli): update @nestjs/cli version in first steps by @acrosett in d8a464c
Full Changelog: v0.9.4...v0.9.5
v0.9.4
What's Changed
- build(core): upgrade to nest v11.1.6 (and other dependencies) by @acrosett in #123
- build(core): upgrade to mikro-orm v6.5.2 by @acrosett in #123
- feat(cli): ensure DB schema on startup in main.ts by @acrosett in #123
- fix(core): checkForId patch many bug by @acrosett in #123
- feat(core): better typing for CrudSecurity by @acrosett in #123
Full Changelog: v0.9.3...v0.9.4
https://www.npmjs.com/org/eicrud
💥Breaking changes:
For mongo users:
In CRUD methods, string representations of ObjectIDs passed in first depth level arrays are now casted to ObjectID mongo type (for query and update). You might need to migrate your Database and cast such string representations to actual ObjectIDs so that your application can continue working.
This applies to you if your application has fields such as
@Property()
@IsString()
mongoIds: string[];
v0.9.3
What's Changed
- build(core): upgrade to nest v11.0.12 by @acrosett in #118
- build(all): upgrade to axios v1.8.4 by @acrosett in #119
Full Changelog: v0.9.2...v0.9.3
https://www.npmjs.com/org/eicrud
💥Breaking changes:
NestJS V11 / Fastify v5
Migration guide: https://docs.nestjs.com/migration-guide
Eicrud
You might need to cast the passing of process.env.JWT_SECRET to a string in your eicrud.config.service.ts.
jwtSecret: process.env.JWT_SECRET as string,v0.9.2
What's Changed
- feat(core): expose orderBy mikroOrm option by @acrosett in #112 -> documentation 📘
Full Changelog: v0.9.1...v0.9.2
v0.9.1
What's Changed
- feat(client): improve client typing by @acrosett in #104
- fix(core): size validation skipped when no @$ decorators by @acrosett in #105
- fix(cli): exports -cc bug by @acrosett in #106
- docs(service): error in operations.md by @danyalutsevich in #95
- docs(setup): update documentation for new env file setup by @shreyas4510 in #99
- perf(test): improve timeout for test cases by @shreyas4510 in #101
New Contributors
- @danyalutsevich made their first contribution in #95
- @shreyas4510 made their first contribution in #99
Full Changelog: v0.9.0...v0.9.1
https://www.npmjs.com/org/eicrud
💥Breaking changes:
1. DTO field default size validation now always happens, as intended
Make sure large fields in your DTO/Entities are annotated with a @$MaxSize of @$MaxArrLength decorators.
Note
By default, every dto field has a max stringified size of 50 (specified in ValidationOptions->defaultMaxSize). This means you need to decorate fields with @$MaxSize(x) to bypass this limit. Using class-validator's @MaxLength won't work. Setting defaultMaxSize to 0 disables that check.
Additionally, @$Type annotated dto fields have a max length of 20 (specified in ValidationOptions->defaultMaxArLength ). This means you need to decorate fields with @$MaxArLength(x) to bypass this limit.
v0.9.0
What's Changed
- feat(core): move
CrudOptionsout of theCrudContextby @acrosett in #93 - feat(core): rename the
returnUpdatedEntitiesoption and limit the behavior to single updates by @acrosett in #92
Full Changelog: v0.8.9...v0.9.0
https://www.npmjs.com/org/eicrud
💥Breaking changes:
1. CrudOptions moved out of the CrudContext
This affects server-side calls of CRUD operations.
Before:
ctx.options = { limit: 10 };
this.$find(query, ctx);Now:
import { OpParams } from "@eicrud/core/crud";
const params: OpParams = {
options: {
limit: 10
}
}
this.$find(query, ctx, params);Note
The CrudContext should be passed to every method call to offer reliable logging. For this reason, it is not suitable for holding the CRUD operations' options; a shared context can cause previous options to be passed by mistake.
2. returnUpdatedEntities renamed to returnUpdatedEntity, behavior removed for nonsingle update/delete
Additionally, the return type of patch/delete DTOs has been modified, the result (updated/deleted) is now a simple object instead of an array.
export interface PatchResponseDto<T = any> {
count: number;
updated?: T;
}
export interface DeleteResponseDto<T = any> {
count: number;
deleted?: T;
}Note
Returning updated entities from the update/delete operations can cause performance issues and OOM errors. Since there isn't a known need for it, the feature has been removed. From the client, you can use findIds > patchIn > findIn or find > deleteIn instead.
v0.8.9
What's Changed
- fix(client): patchIn and deleteIn returning array instead of DTO by @acrosett in #91
- fix(client): incorrect patchOne return type by @acrosett in #91
Full Changelog: v0.8.8...v0.8.9
v0.8.8
What's Changed
- feat(core): add the returnUpdatedEntities CrudOptions by @acrosett in #88 -> documentation 📘
- feat(core): add the alwaysAllowedCrudOptions field in CrudSecurity by @acrosett in #88 -> documentation 📙
Full Changelog: v0.8.7...v0.8.8
https://www.npmjs.com/org/eicrud
💥Breaking changes:
Update and delete operations now return an object (DTO) instead of just a number (affected count).
export interface PatchResponseDto<T = any> {
count: number;
updated?: T[];
}
export interface DeleteResponseDto<T = any> {
count: number;
deleted?: T[];
}Warning
This might trigger typescript errors in your .hook.ts files. To resolve change the return type of afterDeleteHook from Promise<number> to Promise<any>
Note
If you never used the result of patch/delete operations this will not affect you further