Commit 55bff1ed authored by Volker Krause's avatar Volker Krause
Browse files

Make extractor filter types explicit everywhere

This is a first step towards cleaning up some data type specific
complexity in the filter loading code.
parent 14418675
Pipeline #53605 passed with stages
in 10 minutes and 59 seconds
......@@ -76,6 +76,9 @@ static bool needsFieldName(ExtractorInput::Type type)
bool ExtractorFilter::load(const QJsonObject &obj)
{
d->m_type = ExtractorInput::typeFromName(obj.value(QLatin1String("type")).toString());
if (d->m_type == ExtractorInput::Unknown) {
qCDebug(Log) << "unspecified filter type";
}
auto it = obj.find(QLatin1String("header"));
if (it != obj.end()) {
......
[{
"type": "html",
"filter": [
{ "header": "From", "match": "aerlingus.com" }
{ "header": "From", "match": "aerlingus.com", "type": "Email" }
],
"script": "aerlingus.js"
}]
{
"type": "pdf",
"filter": [
{ "header": "From", "match": "@airbaltic.com" },
{ "property": "reservationFor.airline.iataCode", "match": "BT" }
{ "header": "From", "match": "@airbaltic.com", "type": "Email" },
{ "property": "reservationFor.airline.iataCode", "match": "BT", "type": "JsonLd" }
],
"script": "airbaltic.js"
}
......@@ -2,15 +2,15 @@
{
"type": "text",
"filter": [
{ "header": "From", "match": "@amadeus.com" },
{ "header": "Message-ID", "match": "amadeus.com" }
{ "header": "From", "match": "@amadeus.com", "type": "Email" },
{ "header": "Message-ID", "match": "amadeus.com", "type": "Email" }
],
"script": "amadeus.js"
},
{
"type": "ical",
"filter": [
{ "header": "From", "match": "@amadeus.com" },
{ "header": "From", "match": "@amadeus.com", "type": "Email" },
{ "property": "productId", "match": "//AMADEUS//", "type": "ICal" }
],
"script": "amadeus.js",
......
{
"type": "pdf",
"filter": [
{ "header": "From", "match": "americanairlines@aa.com" },
{ "property": "reservationFor.airline.iataCode", "match": "AA" }
{ "header": "From", "match": "americanairlines@aa.com", "type": "Email" },
{ "property": "reservationFor.airline.iataCode", "match": "AA", "type": "JsonLd" }
],
"script": "americanairlines.js"
}
{
"filter": [
{ "header": "From", "match": "@aohostels.com" }
{ "header": "From", "match": "@aohostels.com", "type": "Email" }
],
"script": "aohostels.js"
}
[
{
"type": "html",
"filter": [ { "header": "From", "match": "@availpro.com" } ],
"filter": [ { "header": "From", "match": "@availpro.com", "type": "Email" } ],
"script": "availpro.js",
"function": "parseHtml"
}
......
[
{
"type": "text",
"filter": [ { "header": "From", "match": "@booking.com" } ],
"filter": [ { "header": "From", "match": "@booking.com", "type": "Email" } ],
"script": "booking.js"
},
{
"type": "html",
"filter": [ { "header": "From", "match": "@booking.com" } ],
"filter": [ { "header": "From", "match": "@booking.com", "type": "Email" } ],
"script": "booking.js",
"function": "parseHtml"
}
......
......@@ -2,15 +2,15 @@
{
"type": "html",
"filter": [
{ "header": "From", "match": "@brusselsairlines.com" }
{ "header": "From", "match": "@brusselsairlines.com", "type": "Email" }
],
"script": "brusselsairlines.js"
},
{
"type": "pdf",
"filter": [
{ "header": "From", "match": "brusselsairlines.com" },
{ "property": "reservationFor.airline.iataCode", "match": "SN" }
{ "header": "From", "match": "brusselsairlines.com", "type": "Email" },
{ "property": "reservationFor.airline.iataCode", "match": "SN", "type": "JsonLd" }
],
"script": "brusselsairlines-receipt.js"
}
......
{
"filter": [
{ "header": "From", "match": "info@cd.cz" },
{ "header": "From", "match": "eshop@cd.cz" }
{ "header": "From", "match": "info@cd.cz", "type": "Email" },
{ "header": "From", "match": "eshop@cd.cz", "type": "Email" }
],
"script": "czechrailways.js"
}
[{
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.blueend.customer.eap.ticket" } ],
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.blueend.customer.eap.ticket", "type": "PkPass" } ],
"script": "easyairportparking-pkpass.js"
}]
[
{
"type": "html",
"filter": [ { "header": "From", "match": "@easyjet.com" } ],
"filter": [ { "header": "From", "match": "@easyjet.com", "type": "Email" } ],
"script": "easyjet.js",
"function": "parseHtmlBooking"
},
{
"type": "pdf",
"filter": [
{ "property": "reservationFor.airline.iataCode", "match": "EJU" },
{ "property": "reservationFor.airline.iataCode", "match": "EZS" },
{ "property": "reservationFor.airline.iataCode", "match": "EZY" }
{ "property": "reservationFor.airline.iataCode", "match": "EJU", "type": "JsonLd" },
{ "property": "reservationFor.airline.iataCode", "match": "EZS", "type": "JsonLd" },
{ "property": "reservationFor.airline.iataCode", "match": "EZY", "type": "JsonLd" }
],
"script": "easyjet.js",
"function": "parsePdfBoardingPass"
......
[{
"type": "text",
"filter": [
{ "header": "From", "match": "@booking.eurowings.com" }
{ "header": "From", "match": "@booking.eurowings.com", "type": "Email" }
],
"script": "eurowings.js"
}, {
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.wings.boardingpass" } ],
"filter": [ { "field": "passTypeIdentifier", "match": "pass.wings.boardingpass", "type": "PkPass" } ],
"script": "eurowings-pkpass.js"
}]
{
"filter": [
{ "header": "From", "match": "@fcmtravel\." },
{ "header": "From", "match": "@travellink\." }
{ "header": "From", "match": "@fcmtravel\.", "type": "Email" },
{ "header": "From", "match": "@travellink\.", "type": "Email" }
],
"script": "fcmtravel.js"
}
{
"filter": [
{ "header": "From", "match": "@hertz.com" }
{ "header": "From", "match": "@hertz.com", "type": "Email" }
],
"script": "hertz.js"
}
{
"filter": [
{ "header": "From", "match": "@iberia.com" }
{ "header": "From", "match": "@iberia.com", "type": "Email" }
],
"script": "iberia.js"
}
......@@ -14,7 +14,8 @@
"filter": [
{
"match": "reservations@customer.goindigo.in",
"header": "From"
"header": "From",
"type": "Email"
}
],
"function": "parseHtml",
......
[{
"type": "text",
"filter": [
{ "header": "From", "match": "noreply@klm.com" }
{ "header": "From", "match": "noreply@klm.com", "type": "Email" }
],
"script": "klm.js"
}]
[{
"type": "html",
"filter": [
{ "header": "From", "match": "korail.com" }
{ "header": "From", "match": "korail.com", "type": "Email" }
],
"script": "korail.js"
}]
[{
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.lufthansa.mbp" } ],
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.lufthansa.mbp", "type": "PkPass" } ],
"script": "lufthansa-pkpass.js"
}]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment