import { Context, Event, IndexTypes, RemoteQueryFunction, Subscriber } from "@medusajs/framework/types"; import { MikroOrmBaseRepository as BaseRepository, ContainerRegistrationKeys } from "@medusajs/framework/utils"; import { EntityManager, SqlEntityManager } from "@medusajs/framework/mikro-orm/postgresql"; type InjectedDependencies = { manager: EntityManager; [ContainerRegistrationKeys.QUERY]: RemoteQueryFunction; baseRepository: BaseRepository; }; export declare class PostgresProvider implements IndexTypes.StorageProvider { #private; protected readonly eventActionToMethodMap_: { created: string; updated: string; deleted: string; attached: string; detached: string; }; protected container_: InjectedDependencies; protected readonly schemaObjectRepresentation_: IndexTypes.SchemaObjectRepresentation; protected readonly schemaEntitiesMap_: Record; protected readonly moduleOptions_: IndexTypes.IndexModuleOptions; protected readonly manager_: SqlEntityManager; protected readonly query_: RemoteQueryFunction; protected baseRepository_: BaseRepository; constructor(container: InjectedDependencies, options: { schemaObjectRepresentation: IndexTypes.SchemaObjectRepresentation; entityMap: Record; }, moduleOptions: IndexTypes.IndexModuleOptions); onApplicationStart(): Promise; protected static parseData(data: TData | TData[], schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation): { data: TData[]; entityProperties: string[]; parentsProperties: { [entity: string]: string[]; }; }; protected static parseMessageData(message?: Event): { action: string; data: TData[]; ids: string[]; } | void; consumeEvent(schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation): Subscriber<{ id: string | string[]; }>; query(config: IndexTypes.IndexQueryConfig, sharedContext?: Context): Promise>; /** * Create the index entry and the index relation entry when this event is emitted. * @param entity * @param data * @param schemaEntityObjectRepresentation * @param sharedContext * @protected */ onCreate({ entity, data, schemaEntityObjectRepresentation, }: { entity: string; data: TData | TData[]; schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation; }, sharedContext?: Context): Promise; /** * Update the index entry when this event is emitted. * @param entity * @param data * @param schemaEntityObjectRepresentation * @param sharedContext * @protected */ onUpdate({ entity, data, schemaEntityObjectRepresentation, }: { entity: string; data: TData | TData[]; schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation; }, sharedContext?: Context): Promise; /** * Delete the index entry when this event is emitted. * @param entity * @param data * @param schemaEntityObjectRepresentation * @param sharedContext * @protected */ onDelete({ entity, data, schemaEntityObjectRepresentation, }: { entity: string; data: TData | TData[]; schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation; }, sharedContext?: Context): Promise; /** * event emitted from the link modules to attach a link entity to its parent and child entities from the linked modules. * @param entity * @param data * @param schemaEntityObjectRepresentation * @protected */ onAttach({ entity, data, schemaEntityObjectRepresentation, }: { entity: string; data: TData | TData[]; schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation; }, sharedContext?: Context): Promise; /** * Event emitted from the link modules to detach a link entity from its parent and child entities from the linked modules. * @param entity * @param data * @param schemaEntityObjectRepresentation * @param sharedContext * @protected */ onDetach({ entity, data, schemaEntityObjectRepresentation, }: { entity: string; data: TData | TData[]; schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation; }, sharedContext?: Context): Promise; } export {}; //# sourceMappingURL=postgres-provider.d.ts.map