import { BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core"; import { MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationRunEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity } from "@memberjunction/core-entities"; import { MJCommunicationProviderEntityExtended, ProcessedMessage } from "./BaseProvider.js"; /** * Base class for communications. This class can be sub-classed if desired if you would like to modify the logic across ALL actions. To do so, sub-class this class and use the * @RegisterClass decorator from the @memberjunction/global package to register your sub-class with the ClassFactory. This will cause your sub-class to be used instead of this base class when the Metadata object insantiates the ActionEngine. */ export declare class CommunicationEngineBase extends BaseEngine { /** * Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application. Do not directly create new instances of it, always use this method to get the instance. */ static get Instance(): CommunicationEngineBase; private _baseMessageTypes; private _providers; private _providerMessageTypes; private _entityCommunicationMessageTypes; private _entityCommunicationFields; /** * This method is called to configure the engine. It loads the metadata and caches it in the GlobalObjectStore. You must call this method before doing anything else with the engine. * If this method was previously run on the instance of the engine, it will return immediately without re-loading the metadata. If you want to force a reload of the metadata, you can pass true for the forceReload parameter. * @param forceRefresh If true, the metadata will be loaded from the database even if it was previously loaded. * @param contextUser If you are running on the server side you must pass this in, but it is not required in an environment where a user is authenticated directly, e.g. a browser or other client. */ Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise; protected AdditionalLoading(contextUser?: UserInfo): Promise; get BaseMessageTypes(): MJCommunicationBaseMessageTypeEntity[]; get Providers(): MJCommunicationProviderEntityExtended[]; get ProviderMessageTypes(): MJCommunicationProviderMessageTypeEntity[]; /** * Returns the communication metadata as a structured object. * Maintained for backward compatibility with consumers that access Metadata.EntityCommunicationFields etc. */ get Metadata(): { BaseMessageTypes: MJCommunicationBaseMessageTypeEntity[]; Providers: MJCommunicationProviderEntityExtended[]; ProviderMessageTypes: MJCommunicationProviderMessageTypeEntity[]; EntityCommunicationMessageTypes: MJEntityCommunicationMessageTypeEntity[]; EntityCommunicationFields: MJEntityCommunicationFieldEntity[]; }; /** * Starts a communication run */ StartRun(): Promise; /** * Ends a communication run * @param run * @returns */ EndRun(run: MJCommunicationRunEntity): Promise; /** * This method creates a new Communication Log record and saves it to the database with a status of pending. It returns the new Communication Log record. * @param processedMessage * @param run */ StartLog(processedMessage: ProcessedMessage, run?: MJCommunicationRunEntity): Promise; } //# sourceMappingURL=BaseEngine.d.ts.map