import { AppContext, UserPayload } from '../types.js';
import { BaseEntity, CompositeKey, Metadata, UserInfo } from '@memberjunction/core';
import { CompositeKeyInputType, CompositeKeyOutputType } from '../generic/KeyInputOutputTypes.js';
/**
 * This type defines the possible list of actions that can be taken in syncing data: Create, Update, CreateOrUpdate, Delete, or DeleteWithFilter
 * DeleteWithFilter is where you specify a valid SQL expression that can be used in a where clause to get a list of records in a given entity to delete
 * this can be used to ensure cleaning out data from a subset of a given table.
 */
export declare enum SyncDataActionType {
    Create = "Create",
    Update = "Update",
    CreateOrUpdate = "CreateOrUpdate",
    Delete = "Delete",
    DeleteWithFilter = "DeleteWithFilter"
}
export declare class ActionItemInputType {
    EntityName: string;
    PrimaryKey?: CompositeKeyInputType;
    AlternateKey?: CompositeKeyInputType;
    Type: SyncDataActionType;
    /**
     * This field is a JSON representation of the field values of the entity to be created or updated. It is used for all ActionTypes except for
     */
    RecordJSON?: string;
    /**
     * This field is only provided when the Action Type is DeleteWithFilter. It is a valid SQL expression that can be used in a where clause to get a list of records in a given entity to delete
     */
    DeleteFilter?: string;
}
export declare class ActionItemOutputType {
    Success: boolean;
    ErrorMessage: string;
    EntityName: string;
    PrimaryKey?: CompositeKeyOutputType;
    AlternateKey?: CompositeKeyOutputType;
    Type: SyncDataActionType;
    /**
     * This field is a JSON representation of the field values of the entity to be created or updated. It is used for all ActionTypes except for
     */
    RecordJSON?: string;
    /**
     * This field is only provided when the Action Type is DeleteWithFilter. It is a valid SQL expression that can be used in a where clause to get a list of records in a given entity to delete
     */
    DeleteFilter?: string;
}
export declare class SyncDataResultType {
    Success: boolean;
    Results: ActionItemOutputType[];
}
export declare class SyncDataResolver {
    /**
     * This mutation will sync the specified items with the existing system. Items will be processed in order and the results of each operation will be returned in the Results array within the return value.
     * @param items - an array of ActionItemInputType objects that specify the action to be taken on the specified entity with the specified primary key and the JSON representation of the field values.
     */
    SyncData(items: ActionItemInputType[], context: AppContext): Promise<{
        Success: boolean;
        Results: ActionItemOutputType[];
    }>;
    protected GetLowercaseMetadataEntitiesList(user: UserInfo, forceRefresh?: boolean): Promise<string[]>;
    protected DoSyncItemsAffectMetadata(user: UserInfo, items: ActionItemInputType[]): Promise<boolean>;
    protected SyncSingleItem(item: ActionItemInputType, context: AppContext, md: Metadata, userPayload: UserPayload): Promise<ActionItemOutputType>;
    protected SyncSingleItemDeleteWithFilter(entityName: string, filter: string, result: ActionItemOutputType, user: UserInfo, userPayload: UserPayload): Promise<void>;
    protected LoadFromAlternateKey(entityName: string, alternateKey: CompositeKey, user: UserInfo): Promise<BaseEntity>;
    protected SyncSingleItemCreateOrUpdate(entityObject: BaseEntity, pk: CompositeKey, ak: CompositeKey, fieldValues: any, result: ActionItemOutputType, userPayload: UserPayload): Promise<void>;
    protected SyncSingleItemDelete(entityObject: BaseEntity, pk: CompositeKey, ak: CompositeKey, result: ActionItemOutputType, userPayload: UserPayload): Promise<void>;
    protected SyncSingleItemCreate(entityObject: BaseEntity, fieldValues: any, result: ActionItemOutputType, userPayload: UserPayload): Promise<void>;
    protected SyncSingleItemUpdate(entityObject: BaseEntity, pk: CompositeKey, ak: CompositeKey, fieldValues: any, result: ActionItemOutputType, userPayload: UserPayload): Promise<void>;
    protected InnerSyncSingleItemUpdate(entityObject: BaseEntity, fieldValues: any, result: ActionItemOutputType, userPayload: UserPayload): Promise<void>;
}
//# sourceMappingURL=SyncDataResolver.d.ts.map