Commit f7d6efa3 authored by Volker Krause's avatar Volker Krause
Browse files

Use MIME types in the extractor script definitions

This isn't entirely complete yet, the remaining cases have a slightly
changed semantics with the upcoming new system.
parent 7e1f7543
Pipeline #54948 passed with stages
in 11 minutes and 25 seconds
......@@ -46,9 +46,6 @@ bool Extractor::load(const QJsonObject &obj, const QString &fileName, int index)
d->m_index = index;
d->m_mimeType = obj.value(QLatin1String("mimeType")).toString();
if (d->m_mimeType.isEmpty()) { // ### legacy support
setType(ExtractorInput::typeFromName(obj.value(QLatin1String("type")).toString()));
}
if (d->m_mimeType.isEmpty()) {
qCDebug(Log) << "extractor MIME type not specified" << fileName;;
}
......
......@@ -3,11 +3,11 @@
{
"field": "From",
"match": "@reservation.accor-mail.com",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "parseConfirmation",
"script": "accor.js",
"type": "Html"
"mimeType": "text/html"
}
......@@ -3,11 +3,11 @@
{
"field": "From",
"match": "@acprail.com",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "main",
"script": "acprail.js",
"type": "Html"
"mimeType": "text/html"
}
[{
"type": "html",
"mimeType": "text/html",
"filter": [
{ "field": "From", "match": "aerlingus.com", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "aerlingus.com", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "aerlingus.js"
}]
......@@ -3,11 +3,11 @@
{
"field": "From",
"match": "@agoda.com",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "main",
"script": "agoda.js",
"type": "Html"
"mimeType": "text/html"
}
{
"type": "pdf",
"mimeType": "application/pdf",
"filter": [
{ "field": "From", "match": "@airbaltic.com", "type": "Email", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "BT", "type": "JsonLd" }
{ "field": "From", "match": "@airbaltic.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "BT", "mimeType": "application/ld+json" }
],
"script": "airbaltic.js"
}
......@@ -3,11 +3,11 @@
{
"field": "From",
"match": "@aircoach.ie",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "main",
"script": "aircoach-ie.js",
"type": "Text"
"mimeType": "text/plain"
}
[
{
"type": "text",
"mimeType": "text/plain",
"filter": [
{ "field": "From", "match": "@amadeus.com", "type": "Email", "scope": "Ancestors" },
{ "field": "Message-ID", "match": "amadeus.com", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "@amadeus.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "Message-ID", "match": "amadeus.com", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "amadeus.js"
},
{
"type": "ical",
"mimeType": "text/calendar",
"filter": [
{ "field": "From", "match": "@amadeus.com", "type": "Email", "scope": "Ancestors" },
{ "field": "productId", "match": "//AMADEUS//", "type": "ICal", "scope": "Parent" }
{ "field": "From", "match": "@amadeus.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "productId", "match": "//AMADEUS//", "mimeType": "text/calendar", "scope": "Parent" }
],
"script": "amadeus.js",
"function": "parseEvent"
......
{
"type": "pdf",
"mimeType": "application/pdf",
"filter": [
{ "field": "From", "match": "americanairlines@aa.com", "type": "Email", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "AA", "type": "JsonLd" }
{ "field": "From", "match": "americanairlines@aa.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "AA", "mimeType": "application/ld+json" }
],
"script": "americanairlines.js"
}
{
"filter": [
{ "field": "From", "match": "@aohostels.com", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "@aohostels.com", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "aohostels.js",
"type": "Text"
"mimeType": "text/plain"
}
[
{
"type": "html",
"filter": [ { "field": "From", "match": "@availpro.com", "type": "Email", "scope": "Ancestors" } ],
"mimeType": "text/html",
"filter": [ { "field": "From", "match": "@availpro.com", "mimeType": "message/rfc822", "scope": "Ancestors" } ],
"script": "availpro.js",
"function": "parseHtml"
}
......
[
{
"type": "text",
"filter": [ { "field": "From", "match": "@booking.com", "type": "Email", "scope": "Ancestors" } ],
"mimeType": "text/plain",
"filter": [ { "field": "From", "match": "@booking.com", "mimeType": "message/rfc822", "scope": "Ancestors" } ],
"script": "booking.js"
},
{
"type": "html",
"filter": [ { "field": "From", "match": "@booking.com", "type": "Email", "scope": "Ancestors" } ],
"mimeType": "text/html",
"filter": [ { "field": "From", "match": "@booking.com", "mimeType": "message/rfc822", "scope": "Ancestors" } ],
"script": "booking.js",
"function": "parseHtml"
}
......
[
{
"type": "html",
"mimeType": "text/html",
"filter": [
{ "field": "From", "match": "@brusselsairlines.com", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "@brusselsairlines.com", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "brusselsairlines.js"
},
{
"type": "pdf",
"mimeType": "application/pdf",
"filter": [
{ "field": "From", "match": "brusselsairlines.com", "type": "Email", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "SN", "type": "JsonLd" }
{ "field": "From", "match": "brusselsairlines.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "reservationFor.airline.iataCode", "match": "SN", "mimeType": "application/ld+json" }
],
"script": "brusselsairlines-receipt.js"
}
......
......@@ -3,10 +3,10 @@
{
"match": "uic:9997",
"field": "reservationFor.provider.identifier",
"type": "JsonLd"
"mimeType": "application/ld+json"
}
],
"function": "parsePdf",
"script": "chaos-communication-congress.js",
"type": "Pdf"
"mimeType": "application/pdf"
}
{
"filter": [
{ "field": "From", "match": "info@cd.cz", "type": "Email", "scope": "Ancestors" },
{ "field": "From", "match": "eshop@cd.cz", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "info@cd.cz", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "From", "match": "eshop@cd.cz", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "czechrailways.js",
"type": "Text"
"mimeType": "text/plain"
}
......@@ -4,48 +4,48 @@
{
"field": "From",
"match": "buchungsbestaetigung@bahn.de",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
},
{
"match": "uic:0080",
"field": "reservationFor.provider.identifier",
"type": "JsonLd"
"mimeType": "application/ld+json"
},
{
"match": "vdv:6260",
"field": "reservationFor.provider.identifier",
"type": "JsonLd"
"mimeType": "application/ld+json"
}
],
"function": "parsePdf",
"script": "deutschebahn.js",
"type": "Pdf"
"mimeType": "application/pdf"
},
{
"filter": [
{
"field": "From",
"match": "UNITTEST-buchungsbestaetigung@bahn.de",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "parseText",
"script": "deutschebahn.js",
"type": "Text"
"mimeType": "text/plain"
},
{
"filter": [
{
"field": "From",
"match": "buchungsbestaetigung@bahn.de",
"type": "Email",
"mimeType": "message/rfc822",
"scope": "Ancestors"
}
],
"function": "parseCancellation",
"script": "deutschebahn.js",
"type": "Html"
"mimeType": "text/html"
}
]
[
{
"type": "ical",
"filter": [ { "field": "productId", "match": "//DinnerBooking//", "type": "ICal", "scope": "Parent" } ],
"mimeType": "text/calendar",
"filter": [ { "field": "productId", "match": "//DinnerBooking//", "mimeType": "text/calendar", "scope": "Parent" } ],
"script": "dinnerbooking.js",
"function": "parseEvent"
}
......
[{
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.blueend.customer.eap.ticket", "type": "PkPass", "scope": "Current" } ],
"mimeType": "application/vnd.apple.pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.com.blueend.customer.eap.ticket", "mimeType": "application/vnd.apple.pkpass", "scope": "Current" } ],
"script": "easyairportparking-pkpass.js"
}]
[
{
"type": "html",
"filter": [ { "field": "From", "match": "@easyjet.com", "type": "Email", "scope": "Ancestors" } ],
"mimeType": "text/html",
"filter": [ { "field": "From", "match": "@easyjet.com", "mimeType": "message/rfc822", "scope": "Ancestors" } ],
"script": "easyjet.js",
"function": "parseHtmlBooking"
},
{
"type": "pdf",
"mimeType": "application/pdf",
"filter": [
{ "field": "reservationFor.airline.iataCode", "match": "EJU", "type": "JsonLd" },
{ "field": "reservationFor.airline.iataCode", "match": "EZS", "type": "JsonLd" },
{ "field": "reservationFor.airline.iataCode", "match": "EZY", "type": "JsonLd" }
{ "field": "reservationFor.airline.iataCode", "match": "EJU", "mimeType": "application/ld+json" },
{ "field": "reservationFor.airline.iataCode", "match": "EZS", "mimeType": "application/ld+json" },
{ "field": "reservationFor.airline.iataCode", "match": "EZY", "mimeType": "application/ld+json" }
],
"script": "easyjet.js",
"function": "parsePdfBoardingPass"
......
[{
"type": "text",
"mimeType": "text/plain",
"filter": [
{ "field": "From", "match": "@booking.eurowings.com", "type": "Email", "scope": "Ancestors" }
{ "field": "From", "match": "@booking.eurowings.com", "mimeType": "message/rfc822", "scope": "Ancestors" }
],
"script": "eurowings.js"
}, {
"type": "pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.wings.boardingpass", "type": "PkPass", "scope": "Current" } ],
"mimeType": "application/vnd.apple.pkpass",
"filter": [ { "field": "passTypeIdentifier", "match": "pass.wings.boardingpass", "mimeType": "application/vnd.apple.pkpass", "scope": "Current" } ],
"script": "eurowings-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