import type { CreateNotificationParams, LogPublicationParams, WriteObjectParams } from './types' import type { ObjectType } from '../objectCache' export async function writeObjectDirect(params: WriteObjectParams): Promise { const { objectCache } = await import('../objectCache') await objectCache.set({ objectType: params.objectType, hash: params.hash, event: params.event, parsed: params.parsed, version: params.version, hidden: params.hidden, ...(params.index !== undefined ? { index: params.index } : {}), ...(params.published !== undefined ? { published: params.published } : {}), }) } export async function updatePublishedDirect(params: { objectType: ObjectType; id: string; published: false | string[] }): Promise { const { objectCache } = await import('../objectCache') await objectCache.updatePublished(params.objectType, params.id, params.published) } export async function createNotificationDirect(params: CreateNotificationParams): Promise { const { notificationService } = await import('../notificationService') const notificationParams: Parameters[0] = { type: params.type as Parameters[0]['type'], objectType: params.objectType, objectId: params.objectId, eventId: params.eventId, } if (params.data !== undefined) { notificationParams.data = params.data } await notificationService.createNotification(notificationParams) } export async function logPublicationDirect(params: LogPublicationParams): Promise { const { publishLog } = await import('../publishLog') await publishLog.logPublicationDirect(params) }