import { SHOPIFY_OBJECT_FAMILY, ShopifyObjectFamilyToTypes, ShopifyObjectTypeToFamily } from '../shopify/shopifyObjectFamilies';
import { SerializedModelProperties, } from './AirtableModel';
/**
 * Default max records allowed in a base for the Pro plan.
 */
export const DEFAULT_RECORD_MAX = 50000;
export function getAirtableBaseUrl(airtableBaseId) {
    return `https://airtable.com/${airtableBaseId}`;
}
export const DefaultDesyncOrder = [
    SHOPIFY_OBJECT_FAMILY.ORDERS,
    SHOPIFY_OBJECT_FAMILY.PRODUCTS_AND_INVENTORY,
    SHOPIFY_OBJECT_FAMILY.MISC,
];
const SerializedBaseProperties = [...SerializedModelProperties, 'name'];
export function serializeBase(airtableTable) {
    return SerializedBaseProperties.reduce((accum, propertyName) => {
        accum[propertyName] = airtableTable[propertyName];
        return accum;
    }, {});
}
export function getParentMostSyncedType(shopifyObjectType, syncConfig) {
    const { shopify_object_types } = syncConfig;
    if (!shopify_object_types.includes(shopifyObjectType)) {
        return null;
    }
    const shopifyObjectFamily = ShopifyObjectTypeToFamily[shopifyObjectType];
    const objectTypesInFamily = ShopifyObjectFamilyToTypes[shopifyObjectFamily];
    return objectTypesInFamily.find(objectTypeInFamily => shopify_object_types.find(syncedType => syncedType === objectTypeInFamily));
}
//# sourceMappingURL=AirtableBase.js.map