import { invert } from 'lodash';
import { CustomerTypeName, InventoryLevelTypeName, LocationTypeName, OrderTypeName, ProductTypeName, ProductVariantTypeName } from '../../../models';
import { LineItemTypeName } from '../../../models/shopify/LineItem';
export const OrderKeysToDefaultFieldNames = {};
export const OrderDefaultFieldNameToKey = invert(OrderKeysToDefaultFieldNames);
export const ProductKeysToDefaultFieldNames = {};
export const ProductDefaultFieldNameToKey = invert(ProductKeysToDefaultFieldNames);
export const ProductVariantKeysToDefaultFieldNames = {};
export const ProductVariantDefaultFieldNameToKey = invert(ProductVariantKeysToDefaultFieldNames);
export const LocationKeysToDefaultFieldNames = {};
export const LocationDefaultFieldNameToKey = invert(LocationKeysToDefaultFieldNames);
export const InventoryLevelKeysToDefaultFieldNames = {};
export const InventoryLevelDefaultFieldNameToKey = invert(InventoryLevelKeysToDefaultFieldNames);
export const LineItemKeysToDefaultFieldNames = {};
export const LineItemDefaultFieldNameToKey = invert(LineItemKeysToDefaultFieldNames);
export const CustomerKeysToDefaultFieldNames = {};
export const CustomerDefaultFieldNameToKey = invert(CustomerKeysToDefaultFieldNames);
export const DefaultModelFieldNames = {
    [OrderTypeName]: {
        modelKeyToFieldName: OrderKeysToDefaultFieldNames,
        fieldNameToModelKey: OrderDefaultFieldNameToKey,
    },
    [ProductTypeName]: {
        modelKeyToFieldName: ProductKeysToDefaultFieldNames,
        fieldNameToModelKey: ProductDefaultFieldNameToKey
    },
    [ProductVariantTypeName]: {
        modelKeyToFieldName: ProductVariantKeysToDefaultFieldNames,
        fieldNameToModelKey: ProductVariantDefaultFieldNameToKey
    },
    [LocationTypeName]: {
        modelKeyToFieldName: LocationKeysToDefaultFieldNames,
        fieldNameToModelKey: LocationDefaultFieldNameToKey,
    },
    [InventoryLevelTypeName]: {
        modelKeyToFieldName: InventoryLevelKeysToDefaultFieldNames,
        fieldNameToModelKey: InventoryLevelDefaultFieldNameToKey,
    },
    [LineItemTypeName]: {
        modelKeyToFieldName: LineItemKeysToDefaultFieldNames,
        fieldNameToModelKey: LineItemDefaultFieldNameToKey,
    },
    [CustomerTypeName]: {
        modelKeyToFieldName: CustomerKeysToDefaultFieldNames,
        fieldNameToModelKey: CustomerDefaultFieldNameToKey,
    }
};
export function getDefaultFieldName(type, modelFieldName) {
    const defaultModelFieldNames = DefaultModelFieldNames[type].modelKeyToFieldName;
    return (modelFieldName in defaultModelFieldNames) ?
        defaultModelFieldNames[modelFieldName] :
        modelFieldName;
}
export function getModelKeyFromDefaultFieldName(type, defaultFieldName) {
    return (DefaultModelFieldNames[type].fieldNameToModelKey[defaultFieldName] ?? defaultFieldName);
}
//# sourceMappingURL=index.js.map