Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions plugins/GoogleHealth/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": { "name": "userProfile" },
"required": true,
"error": "Could not authenticate with Google Health. Check the OAuth client ID and secret, that the Google Health API is enabled in your Google Cloud project, and that you completed Google sign-in granting the requested health permissions.",
"success": "Connected to Google Health successfully."
}
]
}
16 changes: 16 additions & 0 deletions plugins/GoogleHealth/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "Google Health User",
"sourceType": "Google Health User",
"icon": "heart-pulse",
"singular": "User",
"plural": "Users"
},
{
"name": "Google Health Device",
"sourceType": "Google Health Device",
"icon": "watch-fitness",
"singular": "Device",
"plural": "Devices"
}
]
110 changes: 110 additions & 0 deletions plugins/GoogleHealth/v1/dataStreams/bodyMetric.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"name": "bodyMetric",
"displayName": "Body Measurement",
"description": "Body measurements over time for a chosen metric such as weight or body fat, from individual logged readings",
"tags": [
"Body",
"Health"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "users/me/dataTypes/{{metric}}/dataPoints",
"getArgs": [
{
"key": "filter",
"value": "{{metric.replace(/-/g,'_')}}.sample_time.civil_time >= \"{{new Date(new Date(timeframe.end).getTime()-new Date(timeframe.start).getTime()<=90000000 ? new Date(timeframe.end).getTime()-1 : timeframe.start).toISOString().slice(0,10)}}\" AND {{metric.replace(/-/g,'_')}}.sample_time.civil_time < \"{{new Date(new Date(timeframe.end).getTime()+86399999).toISOString().slice(0,10)}}\""
}
],
"paging": {
"mode": "token",
"pageSize": {
"realm": "queryArg",
"path": "pageSize",
"value": "500"
},
"in": {
"realm": "payload",
"path": "nextPageToken"
},
"out": {
"realm": "queryArg",
"path": "pageToken"
}
},
"postRequestScript": "bodyMetric.js"
},
"matches": "none",
"ui": [
{
"type": "autocomplete",
"name": "metric",
"label": "Metric",
"allowCustomValues": false,
"isMulti": false,
"defaultValue": "weight",
"data": {
"source": "fixed",
"values": [
{
"value": "weight",
"label": "Weight (kg)"
},
{
"value": "body-fat",
"label": "Body Fat (%)"
}
]
},
"validation": {
"required": true
}
}
],
"metadata": [
{
"name": "date",
"displayName": "Date",
"shape": [
"date",
{
"format": "dd/MM"
}
],
"role": "timestamp"
},
{
"name": "value",
"displayName": "Value",
"shape": [
"number",
{
"decimalPlaces": 1
}
],
"role": "value"
},
{
"name": "metric",
"displayName": "Metric",
"shape": "string"
},
{
"name": "unit",
"displayName": "Unit",
"shape": "string",
"role": "unitLabel"
}
],
"timeframes": true,
"defaultShaping": {
"sort": {
"by": [
[
"date",
"asc"
]
]
}
}
}
118 changes: 118 additions & 0 deletions plugins/GoogleHealth/v1/dataStreams/dailyHealthMetric.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"name": "dailyHealthMetric",
"displayName": "Daily Health Metric",
"description": "Daily health summary values for a chosen metric such as resting heart rate, heart rate variability, respiratory rate or oxygen saturation",
"tags": [
"Heart Rate",
"Health"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "users/me/dataTypes/{{metric}}/dataPoints",
"getArgs": [
{
"key": "filter",
"value": "{{metric.replace(/-/g,'_')}}.date >= \"{{new Date(new Date(timeframe.end).getTime()-new Date(timeframe.start).getTime()<=90000000 ? new Date(timeframe.end).getTime()-1 : timeframe.start).toISOString().slice(0,10)}}\" AND {{metric.replace(/-/g,'_')}}.date < \"{{new Date(new Date(timeframe.end).getTime()+86399999).toISOString().slice(0,10)}}\""
}
],
"paging": {
"mode": "token",
"pageSize": {
"realm": "queryArg",
"path": "pageSize",
"value": "370"
},
"in": {
"realm": "payload",
"path": "nextPageToken"
},
"out": {
"realm": "queryArg",
"path": "pageToken"
}
},
"postRequestScript": "dailyHealthMetric.js"
},
"matches": "none",
"ui": [
{
"type": "autocomplete",
"name": "metric",
"label": "Metric",
"allowCustomValues": false,
"isMulti": false,
"defaultValue": "daily-resting-heart-rate",
"data": {
"source": "fixed",
"values": [
{
"value": "daily-resting-heart-rate",
"label": "Resting Heart Rate"
},
{
"value": "daily-heart-rate-variability",
"label": "Heart Rate Variability"
},
{
"value": "daily-respiratory-rate",
"label": "Respiratory Rate"
},
{
"value": "daily-oxygen-saturation",
"label": "Oxygen Saturation (SpO2)"
}
]
},
"validation": {
"required": true
}
}
],
"metadata": [
{
"name": "date",
"displayName": "Date",
"shape": [
"date",
{
"format": "dd/MM"
}
],
"role": "timestamp"
},
{
"name": "value",
"displayName": "Value",
"shape": [
"number",
{
"decimalPlaces": 1
}
],
"role": "value"
},
{
"name": "metric",
"displayName": "Metric",
"shape": "string"
},
{
"name": "unit",
"displayName": "Unit",
"shape": "string",
"role": "unitLabel"
}
],
"timeframes": true,
"defaultShaping": {
"sort": {
"by": [
[
"date",
"asc"
]
]
}
}
}
Loading
Loading