From b1687f37ecdfd1e9a74e478d99e6ffae1aa3974e Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Tue, 18 Oct 2022 11:00:51 +0200 Subject: [PATCH 1/8] [GA] fix snapshot build --- .github/workflows/publish_snapshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_snapshots.yml b/.github/workflows/publish_snapshots.yml index e2b1ba67..eaf3d802 100644 --- a/.github/workflows/publish_snapshots.yml +++ b/.github/workflows/publish_snapshots.yml @@ -23,7 +23,7 @@ jobs: - name: Has SNAPSHOT version id: is-snapshot - run: grep "version = '.*-SNAPSHOT'" build.gradle + run: grep 'version = ".*-SNAPSHOT"' build.gradle.kts - uses: actions/setup-java@v3 with: From d58139808f5bf70bf563fb381f5e3585a7567a66 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 20 Oct 2022 17:02:47 +0200 Subject: [PATCH 2/8] Bump dev version --- java-sdk/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-sdk/build.gradle.kts b/java-sdk/build.gradle.kts index 61814ec5..44e16f4c 100644 --- a/java-sdk/build.gradle.kts +++ b/java-sdk/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } allprojects { - version = "0.8.0" + version = "0.8.1-SNAPSHOT" group = "org.radarbase" } From 3ae8d47c3c3856f02bcc57cb0d2f01f5e6320ed4 Mon Sep 17 00:00:00 2001 From: Junjie Zhou <1192031540@qq.com> Date: Mon, 31 Oct 2022 23:31:27 +0800 Subject: [PATCH 3/8] add nutrition schema (get food log) --- commons/connector/fitbit/fitbit_food_log.avsc | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 commons/connector/fitbit/fitbit_food_log.avsc diff --git a/commons/connector/fitbit/fitbit_food_log.avsc b/commons/connector/fitbit/fitbit_food_log.avsc new file mode 100644 index 00000000..f8db28e5 --- /dev/null +++ b/commons/connector/fitbit/fitbit_food_log.avsc @@ -0,0 +1,103 @@ +{ + "namespace": "org.radarcns.connector.fitbit", + "type": "record", + "name": "FitbitFoodLog", + "doc": "A summary of the user's food log entry for a given day.", + "fields": [ + { + "name": "isFavorite", + "type": "boolean", + "doc": "Whether the food is the favorite one." + }, + { + "name": "time", + "type": "string", + "doc": "Date of the food being logged." + }, + { + "name": "logId", + "type": "long", + "doc": "The id of the logged food." + }, + { + "name": "accessLevel", + "type": "string", + "doc": "The access level of the food." + }, + { + "name": "amount", + "type": "int", + "doc": "The amount of the food." + }, + { + "name": "brand", + "type": "string", + "doc": "The brand of the food." + }, + { + "name": "foodId", + "type": "long", + "doc": "The id of the food." + }, + { + "name": "locale", + "type": "string", + "doc": "The locale of the food." + }, + { + "name": "mealTypeId", + "type": "long", + "doc": "The meal type id of the food." + }, + { + "name": "name", + "type": "string", + "doc": "The name of the food." + }, + { + "name": "unitId", + "type": "long", + "doc": "The unit id of the food." + }, + { + "name": "unitName", + "type": "string", + "doc": "The unit name of the food." + }, + { + "name": "plural", + "type": "string", + "doc": "The plural of the food." + }, + { + "name": "calories", + "type": "float", + "doc": "The calories of the food." + }, + { + "name": "carbs", + "type": "float", + "doc": "The carbs of the food." + }, + { + "name": "fat", + "type": "float", + "doc": "The fat of the food." + }, + { + "name": "fiber", + "type": "float", + "doc": "The fiber of the food." + }, + { + "name": "protein", + "type": "float", + "doc": "The protein of the food." + }, + { + "name": "sodium", + "type": "float", + "doc": "The sodium of the food." + } + ] +} \ No newline at end of file From 0c1da5e844c2eb6a502df3b58cc8da7ed2eaf16a Mon Sep 17 00:00:00 2001 From: Junjie Zhou <1192031540@qq.com> Date: Mon, 31 Oct 2022 23:35:51 +0800 Subject: [PATCH 4/8] update the type of "time" and add "timeReceived" --- commons/connector/fitbit/fitbit_food_log.avsc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/commons/connector/fitbit/fitbit_food_log.avsc b/commons/connector/fitbit/fitbit_food_log.avsc index f8db28e5..5c887603 100644 --- a/commons/connector/fitbit/fitbit_food_log.avsc +++ b/commons/connector/fitbit/fitbit_food_log.avsc @@ -4,16 +4,21 @@ "name": "FitbitFoodLog", "doc": "A summary of the user's food log entry for a given day.", "fields": [ + { + "name": "time", + "type": "double", + "doc": "Device timestamp in UTC (s)." + }, + { + "name": "timeReceived", + "type": "double", + "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." + }, { "name": "isFavorite", "type": "boolean", "doc": "Whether the food is the favorite one." }, - { - "name": "time", - "type": "string", - "doc": "Date of the food being logged." - }, { "name": "logId", "type": "long", From b8a5bb799aee627b2846a2590b5c09611575dec7 Mon Sep 17 00:00:00 2001 From: Yatharth Ranjan Date: Wed, 2 Nov 2022 10:08:21 +0000 Subject: [PATCH 5/8] add food log to fitbit specification --- specifications/connector/radar-fitbit-connector.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specifications/connector/radar-fitbit-connector.yml b/specifications/connector/radar-fitbit-connector.yml index 66cb5f36..eef2218f 100644 --- a/specifications/connector/radar-fitbit-connector.yml +++ b/specifications/connector/radar-fitbit-connector.yml @@ -1,7 +1,7 @@ name: RADAR-FITBIT-CONNECTOR vendor: RADAR-base model: radar-connect-fitbit-source -version: 0.2.0 +version: 0.2.1 doc: Spec for Radar fitbit connector. Schemas should be registered in the connector. data: - doc: The intraday time series for heart rate. @@ -25,3 +25,6 @@ data: - doc: The intraday time series for Calories. Also includes Activity Level and METS. topic: connect_fitbit_intraday_calories value_schema: .connector.fitbit.FitbitIntradayCalories + - doc: The Food Log for the day. + topic: connect_fitbit_food_log + value_schema: .connector.fitbit.FitbitFoodLog From 008025f7575afbd4b742ffd587c57c2349dc12ef Mon Sep 17 00:00:00 2001 From: Yatharth Ranjan Date: Wed, 2 Nov 2022 12:43:59 +0000 Subject: [PATCH 6/8] release version --- java-sdk/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-sdk/build.gradle.kts b/java-sdk/build.gradle.kts index 44e16f4c..a330cd26 100644 --- a/java-sdk/build.gradle.kts +++ b/java-sdk/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } allprojects { - version = "0.8.1-SNAPSHOT" + version = "0.8.1" group = "org.radarbase" } From 50b12edc4ff7a0393869fae5d3eb6f352b5329a8 Mon Sep 17 00:00:00 2001 From: Yatharth Ranjan Date: Wed, 2 Nov 2022 15:30:38 +0000 Subject: [PATCH 7/8] Changes according to PR review --- commons/connector/fitbit/fitbit_food_log.avsc | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/commons/connector/fitbit/fitbit_food_log.avsc b/commons/connector/fitbit/fitbit_food_log.avsc index 5c887603..cef91a7d 100644 --- a/commons/connector/fitbit/fitbit_food_log.avsc +++ b/commons/connector/fitbit/fitbit_food_log.avsc @@ -27,12 +27,12 @@ { "name": "accessLevel", "type": "string", - "doc": "The access level of the food." + "doc": "The access level of the food. There are three access level types for food log entries that an authorized user can view via API requests. Each food is annotated with an accessLevel field with one of the following values: PUBLIC - Foods that are in Fitbit's public food database and are visible to any Fitbit users. Only Fitbit populates this database to avoid spam and duplicate entries. PRIVATE - Foods created by a user either on the website or via the Create Food endpoint. SHARED - A food created by a user whose foods privacy is set to Friends or Anyone. These can be logged either on the website or via the Create Food endpoint. These foods can be discovered using the Search Foods endpoint." }, { "name": "amount", "type": "int", - "doc": "The amount of the food." + "doc": "The amount of the food. Unit can be accessed from From the unitName of the food." }, { "name": "brand", @@ -42,17 +42,17 @@ { "name": "foodId", "type": "long", - "doc": "The id of the food." + "doc": "The id of the food. This can be from the Fitbit food database or a private food the authorized user has entered - https://dev.fitbit.com/build/reference/web-api/nutrition/get-food/." }, { "name": "locale", "type": "string", - "doc": "The locale of the food." + "doc": "The locale of the food. Example format - en_US" }, { "name": "mealTypeId", "type": "long", - "doc": "The meal type id of the food." + "doc": "The meal type id of the food. The mealTypeId field is always 7 (Anytime). Meals are not associated with particular times." }, { "name": "name", @@ -62,7 +62,7 @@ { "name": "unitId", "type": "long", - "doc": "The unit id of the food." + "doc": "The unit id of the food. Typically, an application retrieves the complete list of units once at startup. From then on, the application will receive a food-specific list of unit ids along with the [Favorite](https://dev.fitbit.com/build/reference/web-api/nutrition/get-favorite-foods/), [Recent](https://dev.fitbit.com/build/reference/web-api/nutrition/get-recent-foods/), or [Frequent](https://dev.fitbit.com/build/reference/web-api/nutrition/get-frequent-foods/) food or by making a query to [Search Foods](https://dev.fitbit.com/build/reference/web-api/nutrition/search-foods/) endpoint. These are the IDs of units that apply to the favorite food. The application will refer to the complete list of units retrieved previously to get and display to the user the unit name or plural name for each unit ID on food-specific list." }, { "name": "unitName", @@ -70,39 +70,39 @@ "doc": "The unit name of the food." }, { - "name": "plural", + "name": "unitPlural", "type": "string", - "doc": "The plural of the food." + "doc": "The plural unit name of the food." }, { "name": "calories", "type": "float", - "doc": "The calories of the food." + "doc": "The calories of the food in kilocalories." }, { "name": "carbs", "type": "float", - "doc": "The carbs of the food." + "doc": "The carbs of the food in grams." }, { "name": "fat", "type": "float", - "doc": "The fat of the food." + "doc": "The fat of the food in grams." }, { "name": "fiber", "type": "float", - "doc": "The fiber of the food." + "doc": "The fiber of the food in grams." }, { "name": "protein", "type": "float", - "doc": "The protein of the food." + "doc": "The protein of the food in grams." }, { "name": "sodium", "type": "float", - "doc": "The sodium of the food." + "doc": "The sodium of the food in milligrams." } ] -} \ No newline at end of file +} From 19d6013b7283d67ea470e3218bcd6f92f410fe30 Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Wed, 2 Nov 2022 16:11:56 +0000 Subject: [PATCH 8/8] fix tests --- commons/connector/fitbit/fitbit_food_log.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/connector/fitbit/fitbit_food_log.avsc b/commons/connector/fitbit/fitbit_food_log.avsc index cef91a7d..3ec2b426 100644 --- a/commons/connector/fitbit/fitbit_food_log.avsc +++ b/commons/connector/fitbit/fitbit_food_log.avsc @@ -47,7 +47,7 @@ { "name": "locale", "type": "string", - "doc": "The locale of the food. Example format - en_US" + "doc": "The locale of the food. Example format - en_US." }, { "name": "mealTypeId",