const blobFieldTypes = {
    BLOB: 'Blob',
    ANY_BLOB: 'AnyBlob',
    IMAGE_BLOB: 'ImageBlob',
    TEXT_BLOB: 'TextBlob',
};
const blobFieldTypesValues = Object.values(blobFieldTypes);
const fieldTypes = {
    STRING: 'String',
    INTEGER: 'Integer',
    LONG: 'Long',
    BIG_DECIMAL: 'BigDecimal',
    FLOAT: 'Float',
    DOUBLE: 'Double',
    UUID: 'UUID',
    ENUM: 'Enum',
    BOOLEAN: 'Boolean',
    LOCAL_DATE: 'LocalDate',
    ZONED_DATE_TIME: 'ZonedDateTime',
    INSTANT: 'Instant',
    DURATION: 'Duration',
    TIME: 'LocalTime',
    BYTES: 'byte[]',
    BYTE_BUFFER: 'ByteBuffer',
    ...blobFieldTypes,
};
export default fieldTypes;
export const fieldTypeValues = Object.values(fieldTypes);
export const isBlobType = (fieldType) => blobFieldTypesValues.includes(fieldType);
export const getBlobContentType = (fieldType) => {
    if (fieldType === 'AnyBlob') {
        return 'any';
    }
    else if (fieldType === 'ImageBlob') {
        return 'image';
    }
    else if (fieldType === 'TextBlob') {
        return 'text';
    }
    return undefined;
};
export const isFieldBlobType = (field) => isBlobType(field.fieldType);
export const isFieldBinaryType = (field) => isBlobType(field.fieldType) || field.fieldType === 'byte[]';
export const isFieldEnumType = (field) => Boolean(field.fieldValues);
export const isFieldNotEnumType = (field) => !field.fieldValues;
export const convertFieldBlobType = (field) => {
    if (field.fieldTypeBlobContent === 'image') {
        field.fieldType = 'ImageBlob';
        field.fieldTypeBlobContent = undefined;
    }
    else if (field.fieldTypeBlobContent === 'any') {
        field.fieldType = 'AnyBlob';
        field.fieldTypeBlobContent = undefined;
    }
    else if (field.fieldTypeBlobContent === 'text') {
        field.fieldType = 'TextBlob';
        field.fieldTypeBlobContent = undefined;
    }
    else {
        field.fieldType = 'ByteBuffer';
    }
    return field;
};
