콘텐츠로 이동

SCOPES — @gj-kit/expo-workouts

@gj-kit/expo-workouts/core에서 공개하는 constant입니다. package version 0.1.1의 release declaration을 그대로 표시합니다.

import { SCOPES } from '@gj-kit/expo-workouts/core';
SCOPES: readonly [
"workouts",
"distance",
"activeEnergy",
"elevation",
"routes",
"heartRate",
"steps"
]

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/expo-workouts
  • 버전: 0.1.1
  • 공개 entry: ./core
  • 소스: GitHub

One authorization vocabulary for both platforms. Read calls have NO include flags — capability is chosen once, at authorization time. CLOSED for 1.x.

Owner decision ② (2026-08-22) split this union from four members to seven so the consuming developer chooses the granularity. Use WORKOUT_TOTALS_SCOPES for the coarse form; name the members individually for the fine form.

'workouts' no longer implies totals. read: ['workouts'] is valid code before and after this change and means something materially different after: ONE Android permission row instead of four, and distanceM / activeEnergyKcal / elevationGainM undefined on EVERY workout.

  • workouts — the exercise SESSION and its intrinsic fields only.
  • distance — gates Workout.distanceM + distanceProvenance. iOS requests BOTH .distanceWalkingRunning AND .distanceCycling, always both.
  • activeEnergy — gates Workout.activeEnergyKcal + activeEnergyProvenance. Named activeEnergy and NOT energy: TotalCaloriesBurnedRecord is forbidden as a fallback because it silently mixes in BMR.
  • elevation — gates Workout.elevationGainM. ⚠ On iOS this maps to the EMPTY HealthKit set and therefore ALIASES workouts.
  • routes — read maps to READ_EXERCISE_ROUTES, which is manifest-declared and NEVER requestable at runtime; write maps to WRITE_EXERCISE_ROUTE (singular).
  • heartRate / steps — the READ_/WRITE_ pair for that type; each also gates its own top-level read function.