diff --git a/README.md b/README.md index 6b4de39..099bd29 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ ghealth setup --instructions | `sedentary-period` | sedentary intervals | list, daily-rollup, reconcile | | `swim-lengths-data` | `swimStrokeType`, `strokeCount` *(use daily-rollup for `strokeCountSum`)* | list, rollup, daily-rollup, reconcile | | `hydration-log` | `milliliters` consumed | list, get, daily-rollup, reconcile | -| `nutrition-log` | nutrients, `energy`, mealType, food | list, get, rollup, daily-rollup, reconcile | +| `nutrition-log` | nutrients, `energy`, mealType, food | list, get, create, rollup, daily-rollup, reconcile | | `food` | nutrient profiles, servings *(catalog — no time filter)* | list, get | | `food-measurement-unit` | `displayName` *(catalog — no time filter)* | list, get | | `blood-glucose` | mg/dL, mealType, measurementTiming | list, get, rollup, daily-rollup, reconcile | diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index eb399cd..5bde21f 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -49,17 +49,17 @@ const ScopePrefix = "https://www.googleapis.com/auth/googlehealth." // AllScopes lists all available Health API OAuth scope suffixes. var AllScopes = []ScopeInfo{ {Suffix: "activity_and_fitness.readonly", Label: "Activity & Fitness (read)", Category: "activity_and_fitness"}, - {Suffix: "activity_and_fitness", Label: "Activity & Fitness (read/write)", Category: "activity_and_fitness"}, + {Suffix: "activity_and_fitness.writeonly", Label: "Activity & Fitness (write)", Category: "activity_and_fitness"}, {Suffix: "health_metrics_and_measurements.readonly", Label: "Health Metrics (read)", Category: "health_metrics_and_measurements"}, - {Suffix: "health_metrics_and_measurements", Label: "Health Metrics (read/write)", Category: "health_metrics_and_measurements"}, + {Suffix: "health_metrics_and_measurements.writeonly", Label: "Health Metrics (write)", Category: "health_metrics_and_measurements"}, {Suffix: "sleep.readonly", Label: "Sleep (read)", Category: "sleep"}, - {Suffix: "sleep", Label: "Sleep (read/write)", Category: "sleep"}, + {Suffix: "sleep.writeonly", Label: "Sleep (write)", Category: "sleep"}, {Suffix: "nutrition.readonly", Label: "Nutrition (read)", Category: "nutrition"}, - {Suffix: "nutrition", Label: "Nutrition (read/write)", Category: "nutrition"}, + {Suffix: "nutrition.writeonly", Label: "Nutrition (write)", Category: "nutrition"}, {Suffix: "profile.readonly", Label: "Profile (read)", Category: "profile"}, - {Suffix: "profile", Label: "Profile (read/write)", Category: "profile"}, + {Suffix: "profile.writeonly", Label: "Profile (write)", Category: "profile"}, {Suffix: "settings.readonly", Label: "Settings (read)", Category: "settings"}, - {Suffix: "settings", Label: "Settings (read/write)", Category: "settings"}, + {Suffix: "settings.writeonly", Label: "Settings (write)", Category: "settings"}, {Suffix: "location.readonly", Label: "Location (read)", Category: "location"}, {Suffix: "ecg.readonly", Label: "Electrocardiogram (read)", Category: "ecg"}, {Suffix: "irn.readonly", Label: "Irregular Rhythm Notifications (read)", Category: "irn"}, diff --git a/pkg/types/registry.go b/pkg/types/registry.go index 189b5ca..86b53c5 100644 --- a/pkg/types/registry.go +++ b/pkg/types/registry.go @@ -509,7 +509,8 @@ func init() { ID: "nutrition-log", FilterName: "nutrition_log", TimeField: interval, Category: "nutrition", Description: "Logged food/nutrition entries with nutrient and energy breakdown", - Operations: []string{"list", "get", "rollup", "daily-rollup", "reconcile"}, + Operations: []string{"list", "get", "create", "rollup", "daily-rollup", "reconcile"}, + Writable: true, }) register(&DataType{ ID: "food", FilterName: "food", TimeField: TimeFieldNone,