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"
}]
{
"type": "html",
"filter": [
{ "header": "From", "match": "@nh-hotels.com" }
{ "header": "From", "match": "@nh-hotels.com", "type": "Email" }
],
"script": "nh-hotels.js",
"function": "parseHtml"
......
......@@ -2,8 +2,8 @@
{
"type": "text",
"filter": [
{ "header": "From", "match": "express@studentagency.cz" },
{ "header": "From", "match": "info@regiojet.cz" }
{ "header": "From", "match": "express@studentagency.cz", "type": "Email" },
{ "header": "From", "match": "info@regiojet.cz", "type": "Email" }
],
"script": "regiojet.js",
"function": "main"
......
......@@ -2,14 +2,14 @@
{
"type": "pdf",
"filter": [
{ "header": "From", "match": "no-reply@flysas.com" },
{ "property": "reservationFor.airline.iataCode", "match": "SK" }
{ "header": "From", "match": "no-reply@flysas.com", "type": "Email" },
{ "property": "reservationFor.airline.iataCode", "match": "SK", "type": "JsonLd" }
],
"script": "sas-boardingpass.js"
},
{
"type": "pdf",
"filter": [ { "header": "From", "match": "no-reply@flysas.com" } ],
"filter": [ { "header": "From", "match": "no-reply@flysas.com", "type": "Email" } ],
"script": "sas-receipt.js"
}
]
[
{
"type": "html",
"filter": [ { "header": "From", "match": "@simplebooking.it" } ],
"filter": [ { "header": "From", "match": "@simplebooking.it", "type": "Email" } ],
"script": "simplebooking.js",
"function": "parseHtml"
}
......
[
{
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.stanstedexpress.ticket" } ],
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.stanstedexpress.ticket", "type": "PkPass" } ],
"script": "stansted-express.js",
"function": "parsePkPass"
}
......
[
{
"type": "text",
"filter": [ { "header": "From", "match": "noreply@swiss.com" } ],
"filter": [ { "header": "From", "match": "noreply@swiss.com", "type": "Email" } ],
"script": "swiss.js"
}
]
......@@ -2,7 +2,7 @@
{
"type": "text",
"filter": [
{ "header": "From", "match": "@via.com" }
{ "header": "From", "match": "@via.com", "type": "Email" }
],
"script": "travelport-galileo.js",
"function": "parsePNR"
......
......@@ -2,7 +2,7 @@
{
"type": "pdf",
"filter": [
{ "property": "reservationFor.provider.identifier", "match": "3415" }
{ "property": "reservationFor.provider.identifier", "match": "3415", "type": "JsonLd" }
],
"script": "vgn.js",
"function": "parsePdf"
......
[
{
"type": "html",
"filter": [ { "header": "From", "match": "@vueling.com" } ],
"filter": [ { "header": "From", "match": "@vueling.com", "type": "Email" } ],
"script": "vueling.js",
"function": "parseHtmlBooking"
}
......
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