From 29471ec33aa54215f8fcc1058d8845455f5147b5 Mon Sep 17 00:00:00 2001 From: Ben Fradet Date: Fri, 6 Apr 2018 10:13:35 +0100 Subject: [PATCH] Add com.mandrill/message_opened/jsonschema/1-0-1 (closes #750) --- jsonpaths/com.mandrill/message_opened_1.json | 1 + .../message_opened/jsonschema/1-0-1 | 236 ++++++++++++++++++ sql/com.mandrill/message_opened_1.sql | 1 + 3 files changed, 238 insertions(+) create mode 100644 schemas/com.mandrill/message_opened/jsonschema/1-0-1 diff --git a/jsonpaths/com.mandrill/message_opened_1.json b/jsonpaths/com.mandrill/message_opened_1.json index 3c35fc007..f81d977a0 100644 --- a/jsonpaths/com.mandrill/message_opened_1.json +++ b/jsonpaths/com.mandrill/message_opened_1.json @@ -37,6 +37,7 @@ "$.data.msg.resends", "$.data.msg.smtp_events", "$.data.msg.template", + "$.data.msg.subaccount", "$.data.user_agent_parsed.mobile", "$.data.user_agent_parsed.os_company_url", "$.data.user_agent_parsed.os_company", diff --git a/schemas/com.mandrill/message_opened/jsonschema/1-0-1 b/schemas/com.mandrill/message_opened/jsonschema/1-0-1 new file mode 100644 index 000000000..8c03ff3c2 --- /dev/null +++ b/schemas/com.mandrill/message_opened/jsonschema/1-0-1 @@ -0,0 +1,236 @@ +{ + "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", + "description": "Schema for a Mandrill message opened event", + "self": { + "vendor": "com.mandrill", + "name": "message_opened", + "format": "jsonschema", + "version": "1-0-1" + }, + + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "ip": { + "type": "string" + }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "country_short": { + "type": "string" + }, + "country": { + "type": "string" + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "postal_code": { + "type": "string" + }, + "region": { + "type": "string" + }, + "timezone": { + "type": "string" + } + }, + "additionalProperties": false + }, + "msg": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_version": { + "type": "string" + }, + "clicks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ts": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string" + }, + "ip": { + "type": "string" + }, + "location": { + "type": "string" + }, + "ua": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "email": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "user_id": { + "type": "number" + } + }, + "additionalProperties": true + }, + "opens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ts": { + "type": "string", + "format": "date-time" + }, + "ip": { + "type": "string" + }, + "location": { + "type": ["string", "null"] + }, + "ua": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "sender": { + "type": "string" + }, + "state": { + "type": "string" + }, + "subaccount": { + "type": ["string", "null"] + }, + "subject": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "ts": { + "type": "string", + "format": "date-time" + }, + "resends": { + "type": "array" + }, + "smtp_events": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ts": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "diag": { + "type": "string" + }, + "source_ip": { + "type": "string" + }, + "destination_ip": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": true + } + }, + "template": { + "type": ["string", "null"] + } + }, + "additionalProperties": false + }, + "ts": { + "type": "string", + "format": "date-time" + }, + "user_agent_parsed": { + "type": "object", + "properties": { + "mobile": { + "type": "boolean" + }, + "os_company_url": { + "type": ["string", "null"] + }, + "os_company": { + "type": ["string", "null"] + }, + "os_family": { + "type": ["string", "null"] + }, + "os_icon": { + "type": ["string", "null"] + }, + "os_name": { + "type": ["string", "null"] + }, + "os_url": { + "type": ["string", "null"] + }, + "type": { + "type": ["string", "null"] + }, + "ua_company_url": { + "type": ["string", "null"] + }, + "ua_company": { + "type": ["string", "null"] + }, + "ua_family": { + "type": ["string", "null"] + }, + "ua_icon": { + "type": ["string", "null"] + }, + "ua_name": { + "type": ["string", "null"] + }, + "ua_url": { + "type": ["string", "null"] + }, + "ua_version": { + "type": ["string", "null"] + } + }, + "additionalProperties": false + }, + "user_agent": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/sql/com.mandrill/message_opened_1.sql b/sql/com.mandrill/message_opened_1.sql index 6f14d8e24..5275a3d9d 100644 --- a/sql/com.mandrill/message_opened_1.sql +++ b/sql/com.mandrill/message_opened_1.sql @@ -53,6 +53,7 @@ CREATE TABLE atomic.com_mandrill_message_opened_1 ( "msg.resends" varchar(5000) encode runlength, -- Holds a JSON array "msg.smtp_events" varchar(5000) encode runlength, -- Holds a JSON array "msg.template" varchar(255) encode raw, + "msg.subaccount" varchar(255) encode raw, "user_agent_parsed.mobile" varchar(255) encode raw, "user_agent_parsed.os_company_url" varchar(255) encode raw, "user_agent_parsed.os_company" varchar(255) encode raw,