Skip to content

Commit

Permalink
fix: schema updates (#73)
Browse files Browse the repository at this point in the history
Resolves #72 and addresses some other missing fields along the way. See
a list of the errors of missing fields I collected from the logs after
fixing the schema issue with `events`.

Curiously, some of the missing fields do not appear in the 2023-10-15
API revision docs, nor do I see them in the latest revision docs. Those
which did not appear I removed. This included
`profiles.attributes.anonymous_id`,`metrics.attributes.integration.object',`
and `'metrics.attributes.integration.key` and a few others.

I am most interested in fixing the events schema and while I eyeballed
the results for the others, please feel free to further validate. I am
also unclear on styling conventions. Feel free to edit as needed.


```
Properties ('type', 'attributes.audiences', 'attributes.send_options', 'attributes.tracking_options', 'attributes.send_strategy', 'relationships', 'links', 'filter') were present in the 'campaigns' stream but not found in catalog schema. Ignoring. 
Properties ('relationships', 'links') were present in the 'flows' stream but not found in catalog schema. Ignoring. 
Properties ('type', 'attributes.opt_in_process', 'relationships', 'links') were present in the 'lists' stream but not found in catalog schema. Ignoring.
Properties ('type', 'attributes.integration.object', 'attributes.integration.key', 'links') were present in the 'metrics' stream but not found in catalog schema. Ignoring.
Properties ('attributes.anonymous_id', 'attributes.location.ip', 'relationships', 'links') were present in the 'profiles' stream but not found in catalog schema. Ignoring.
Properties ('links',) were present in the 'templates' stream but not found in catalog schema. Ignoring.
```

---------

Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
  • Loading branch information
nickolasclarke and edgarrmondragon authored Apr 29, 2024
1 parent 2591211 commit fabc5fd
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 21 deletions.
37 changes: 37 additions & 0 deletions tap_klaviyo/schemas/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
"null"
]
},
"relationships": {
"description": "",
"type": [
"object",
"null"
]
},
"links": {
"description": "",
"type": [
"object"
]
},
"attributes": {
"properties": {
"name": {
Expand All @@ -31,6 +44,30 @@
"null"
]
},
"audiences": {
"description": "The audiences to be included and/or excluded from the campaign",
"type": [
"object"
]
},
"send_options": {
"description": "Options to use when sending a campaign",
"type": [
"object"
]
},
"tracking_options": {
"description": "The tracking options associated with the campaign",
"type": [
"object"
]
},
"send_strategy": {
"description": "The send strategy the campaign will send with",
"type": [
"object"
]
},
"status": {
"description": "The current status of the campaign",
"type": [
Expand Down
40 changes: 20 additions & 20 deletions tap_klaviyo/schemas/event.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"properties": {
"name": {
"type": [
"string",
"null"
]
},
"id": {
"description": "The event ID",
"type": [
Expand All @@ -28,22 +22,21 @@
"null"
]
},
"relationships": {
"description": "Event relationships",
"type": [
"null",
"object"
]
},
"links": {
"description": "links",
"type": [
"object"
]
},
"attributes": {
"properties": {
"metric_id": {
"description": "The metric ID",
"type": [
"string",
"null"
]
},
"profile_id": {
"description": "Profile ID of the associated profile, if available",
"type": [
"string",
"null"
]
},
"timestamp": {
"description": "Event timestamp in seconds",
"type": [
Expand Down Expand Up @@ -74,6 +67,13 @@
]
}
},
"included": {
"description": "",
"type": [
"null",
"array"
]
},
"type": [
"object",
"null"
Expand Down
13 changes: 13 additions & 0 deletions tap_klaviyo/schemas/flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
"string"
]
},
"relationships": {
"description": "",
"type": [
"null",
"object"
]
},
"links": {
"description": "",
"type": [
"object"
]
},
"attributes": {
"properties": {
"name": {
Expand Down
22 changes: 21 additions & 1 deletion tap_klaviyo/schemas/lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
"null"
]
},
"relationships": {
"description": "Relationships to other resources that are related to this list",
"type": [
"object",
"null"
]
},
"links": {
"description": "Relationships to other resources that are related to this list",
"type": [
"object",
"null"
]
},
"attributes": {
"properties": {
"name": {
Expand All @@ -24,7 +38,13 @@
"null"
]
},

"opt_in_process": {
"description": "The opt-in process for this list. Could be either 'single_opt_in' or 'double_opt_in'.",
"type": [
"string",
"null"
]
},
"created": {
"description": "Date and time when the list was created, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)",
"format": "date-time",
Expand Down
20 changes: 20 additions & 0 deletions tap_klaviyo/schemas/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
"null"
]
},
"relationships": {
"description": "Event relationships",
"type": [
"null",
"object"
]
},
"links": {
"description": "links",
"type": [
"object"
]
},
"attributes": {
"properties": {
"name": {
Expand All @@ -40,6 +53,13 @@
"null"
]
},
"links": {
"description": "Links related to the metric",
"type": [
"object",
"null"
]
},
"integration": {
"properties": {
"id": {
Expand Down
20 changes: 20 additions & 0 deletions tap_klaviyo/schemas/profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
"null"
]
},
"relationships": {
"description": "",
"type": [
"null",
"object"
]
},
"links": {
"description": "",
"type": [
"object"
]
},
"attributes": {
"properties": {
"email": {
Expand Down Expand Up @@ -167,6 +180,13 @@
"string",
"null"
]
},
"ip": {
"description": "IP address",
"type": [
"null",
"string"
]
}
},
"type": [
Expand Down
6 changes: 6 additions & 0 deletions tap_klaviyo/schemas/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"null"
]
},
"links": {
"description": "Links",
"type": [
"object"
]
},
"attributes": {
"properties": {
"company_id": {
Expand Down

0 comments on commit fabc5fd

Please sign in to comment.