Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: eicrud/eicrud

v0.9.7

22 Sep 12:35
55c17d7

Choose a tag to compare

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

17 Sep 13:00

Choose a tag to compare

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

https://www.npmjs.com/org/eicrud

v0.9.5

13 Sep 20:12

Choose a tag to compare

What's Changed

Full Changelog: v0.9.4...v0.9.5

https://www.npmjs.com/org/eicrud

v0.9.4

03 Sep 12:23

Choose a tag to compare

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

25 Mar 12:40

Choose a tag to compare

What's Changed

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

⚠️ Node v16 and v18 are no longer supported (>= v20 is required).

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

01 Dec 15:00
9e8eff9

Choose a tag to compare

What's Changed

Full Changelog: v0.9.1...v0.9.2

https://www.npmjs.com/org/eicrud

v0.9.1

22 Nov 22:03
6b1c6de

Choose a tag to compare

What's Changed

New Contributors

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

01 Nov 16:19

Choose a tag to compare

What's Changed

  • feat(core): move CrudOptions out of the CrudContext by @acrosett in #93
  • feat(core): rename the returnUpdatedEntities option 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

30 Oct 15:09
2b2c497

Choose a tag to compare

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

https://www.npmjs.com/org/eicrud

v0.8.8

27 Oct 18:14

Choose a tag to compare

What's Changed

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