2025-05-14 21:45:16 +02:00

52 lines
1.9 KiB
TypeScript

// import { ObjectType, Field, ID, ArgsType, InputType, registerEnumType, Int } from 'type-graphql';
// import { BaseGraphModel } from '@seed/graphql/BaseGraphModel';
// import { Permission } from '@seed/interfaces/permission';
// import { GetArgs } from '@seed/graphql/Request';
// import { GraphQLJSONObject } from 'graphql-type-json';
// import { AccountTypeEnum } from '@src/accounts/account.components';
// import { EngineModel } from '@seed/engine/EngineModel';
// import { PageDBInterfaceSchema, PageDBSchema, PageSchema } from './schemas/auth-history.schema';
// import { plainToClass } from 'class-transformer';
// import { IEngineSchema } from '@seed/engine/EngineSchema';
// import { uploadToS3 } from '@services/api-uploads/services/S3Service';
// import { updateCaching } from '@services/module-cms/services/PageService';
// import { StreamDBSchema } from '@seed/engine/utils/streams/schemas/stream.schema';
// const permissions: Permission = {
// c: [AccountTypeEnum.admin],
// r: [AccountTypeEnum.public],
// w: [AccountTypeEnum.admin],
// d: [AccountTypeEnum.admin],
// };
// @ObjectType()
// export default class PageModel extends EngineModel<PageDBInterfaceSchema, PageDBSchema, PageSchema> {
// public constructor(input?: PageDBInterfaceSchema & Partial<IEngineSchema>) {
// const dataInit = plainToClass(PageDBSchema, input || {});
// super({
// collectionName: 'pages',
// permissions: permissions,
// dataInit,
// });
// }
// plainToClass(plain: any): PageSchema | PageSchema[] {
// return plainToClass(PageSchema, plain);
// }
// async afterCreate(): Promise<void> {
// await updateCaching(this);
// }
// async afterUpdate(): Promise<void> {
// await updateCaching(this);
// }
// async afterDelete(): Promise<void> {
// await updateCaching(this);
// }
// }