1895 extensibility v1 application tokens (#16365)

First PR to implement application tokens
- add new application role in twenty-server
- move duplicated constants and types to twenty-shared
- will  add role configuration utils into twenty-sdk in another PR
This commit is contained in:
martmull
2025-12-08 10:42:46 +01:00
committed by GitHub
parent 1f9a6b067a
commit 7f1e69740a
188 changed files with 977 additions and 457 deletions
@@ -0,0 +1,17 @@
import { isDefined } from 'twenty-shared/utils';
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
import { type FlatEntity } from 'src/engine/metadata-modules/flat-entity/types/flat-entity.type';
export const getFlatEntityByUniversalIdentifier = <T extends FlatEntity>(
maps: FlatEntityMaps<T>,
universalIdentifier: string,
): T | undefined => {
const flatEntityId = maps.idByUniversalIdentifier[universalIdentifier];
if (!isDefined(flatEntityId)) {
return;
}
return maps.byId[flatEntityId];
};