refactor(server): use cascades for keys and tokens (#2544)

This commit is contained in:
Jason Rasmussen
2023-05-23 16:40:04 -04:00
committed by GitHub
parent e2bd7e1e08
commit 50a792a81a
19 changed files with 100 additions and 126 deletions
@@ -0,0 +1,22 @@
import { APIKeyEntity } from '@app/infra/entities';
export class APIKeyCreateResponseDto {
secret!: string;
apiKey!: APIKeyResponseDto;
}
export class APIKeyResponseDto {
id!: string;
name!: string;
createdAt!: string;
updatedAt!: string;
}
export function mapKey(entity: APIKeyEntity): APIKeyResponseDto {
return {
id: entity.id,
name: entity.name,
createdAt: entity.createdAt,
updatedAt: entity.updatedAt,
};
}