import { getSystemUser } from './auth/index.js';
import { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';
export class ProviderInfo {
    provider;
    type;
}
export class DataSourceInfo {
    dataSource;
    host;
    port;
    instance;
    database;
    userName;
    type;
    constructor(init) {
        this.dataSource = init.dataSource;
        this.host = init.host;
        this.port = init.port;
        this.database = init.database;
        this.userName = init.userName;
        this.type = init.type;
    }
}
;
export class MJServerEvent {
    type;
    dataSources;
    userPayload;
    systemUser;
}
export const MJ_SERVER_EVENT_CODE = 'MJ_SERVER_EVENT';
export async function raiseEvent(type, dataSources, userPayload, component) {
    const event = new MJServerEvent();
    event.type = type;
    event.dataSources = dataSources;
    event.userPayload = userPayload;
    event.systemUser = await getSystemUser();
    const mje = new MJEvent();
    mje.args = event;
    mje.component = component;
    mje.event = MJEventType.ComponentEvent;
    mje.eventCode = MJ_SERVER_EVENT_CODE;
    MJGlobal.Instance.RaiseEvent(mje);
}
//# sourceMappingURL=types.js.map