chore(twenty-server): upgrade typeorm to 0.3.29 (#21957)
## Summary Upgrades **typeorm `0.3.26` → `0.3.29`** and adapts the twenty-orm `update`/`upsert` overrides to typeorm's newly-added `options.returning`. Upgrading to resolve [this](https://github.com/twentyhq/twenty/security/dependabot/1573) alert. ## Why `0.3.29` is the latest release compatible with `@ptc-org/nestjs-query-typeorm` (peers `typeorm@^0.3.15`; the `1.x` line has no compatible release, so it's blocked until that dependency moves). ## Changes **`chore` — bump** - `typeorm` patch descriptor `0.3.26 → 0.3.29` + `yarn.lock`. - Local patch carried over **unchanged** (pure rename) — both hunks (`PickKeysByType` nullable-awareness, `DeleteResult.generatedMaps`) are still absent upstream in `0.3.29`, so it remains load-bearing. **`refactor` — adapt overrides** - `0.3.29` adds `options?: UpdateOptions` (carrying `returning`) to `EntityManager`/`Repository` `update()`. The override must accept it at the base-mandated position, so it's added as its **own dedicated parameter** (not hidden inside `permissionOptions`), honoring `options.returning` with a fallback to Twenty's permission-aware `selectedColumns` (`'*'` default). - The same merge is applied to `upsert()`, which already received `UpsertOptions` but was dropping its `returning` field — so both write methods now treat the option identically. - Internal call sites + specs updated for the new parameter slot. ## Verification - `nx typecheck twenty-server` — **0 errors** - twenty-orm unit tests — **191 / 191 pass** - `oxlint` / `oxfmt` — clean
This commit is contained in:
+1
@@ -405,6 +405,7 @@ describe('WorkspaceRepository', () => {
|
||||
'test-entity',
|
||||
{ id: 'test-id' },
|
||||
{ name: 'test' },
|
||||
undefined,
|
||||
{
|
||||
shouldBypassPermissionChecks: false,
|
||||
objectRecordsPermissions: mockObjectRecordsPermissions,
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
} from 'typeorm';
|
||||
import { type PickKeysByType } from 'typeorm/common/PickKeysByType';
|
||||
import { type QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
|
||||
import { type UpdateOptions } from 'typeorm/repository/UpdateOptions';
|
||||
import { type UpsertOptions } from 'typeorm/repository/UpsertOptions';
|
||||
|
||||
import { type FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
|
||||
@@ -592,6 +593,7 @@ export class WorkspaceRepository<
|
||||
| ObjectId[]
|
||||
| FindOptionsWhere<T>,
|
||||
partialEntity: QueryDeepPartialEntity<T>,
|
||||
options?: UpdateOptions,
|
||||
entityManager?: WorkspaceEntityManager,
|
||||
selectedColumns?: string[],
|
||||
): Promise<UpdateResult> {
|
||||
@@ -610,6 +612,7 @@ export class WorkspaceRepository<
|
||||
this.target,
|
||||
criteria,
|
||||
partialEntity,
|
||||
options,
|
||||
permissionOptions,
|
||||
selectedColumns,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user