sync - build workin

This commit is contained in:
2025-09-22 18:45:54 -07:00
parent e04cd5160e
commit b98fed177d
110 changed files with 10189 additions and 8337 deletions

View File

@@ -3,8 +3,8 @@ package client_test
import (
"testing"
"go-garth/internal/api/client"
"go-garth/internal/auth/credentials"
"github.com/sstent/go-garth/api/client"
"github.com/sstent/go-garth/auth/credentials"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View File

@@ -14,11 +14,11 @@ import (
"strings"
"time"
"go-garth/internal/auth/sso"
"go-garth/internal/errors"
types "go-garth/internal/models/types"
shared "go-garth/shared/interfaces"
models "go-garth/shared/models"
"github.com/sstent/go-garth/auth/sso"
"github.com/sstent/go-garth/errors"
types "github.com/sstent/go-garth/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
models "github.com/sstent/go-garth-cli/shared/models"
)
// Client represents the Garmin Connect API client

View File

@@ -7,12 +7,12 @@ import (
"testing"
"time"
"go-garth/internal/testutils"
"github.com/sstent/go-garth/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go-garth/internal/api/client"
"github.com/sstent/go-garth/api/client"
)
func TestClient_GetUserProfile(t *testing.T) {

View File

@@ -9,8 +9,8 @@ import (
"strings"
"time"
"go-garth/internal/models/types"
"go-garth/internal/utils"
"github.com/sstent/go-garth/models/types"
"github.com/sstent/go-garth/utils"
)
// GetOAuth1Token retrieves an OAuth1 token using the provided ticket

View File

@@ -9,8 +9,8 @@ import (
"strings"
"time"
"go-garth/internal/auth/oauth"
types "go-garth/internal/models/types"
"github.com/sstent/go-garth/auth/oauth"
types "github.com/sstent/go-garth/models/types"
)
var (

View File

@@ -5,7 +5,7 @@ import (
"testing"
"time"
"go-garth/internal/api/client"
"github.com/sstent/go-garth/api/client"
"github.com/stretchr/testify/assert"
)

View File

@@ -6,8 +6,8 @@ import (
"sort"
"time"
types "go-garth/internal/models/types"
shared "go-garth/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
)
// BodyBatteryReading represents a single body battery data point

View File

@@ -1,7 +1,7 @@
package data
import (
types "go-garth/internal/models/types"
types "github.com/sstent/go-garth/models/types"
"testing"
"github.com/stretchr/testify/assert"

View File

@@ -6,8 +6,8 @@ import (
"sort"
"time"
types "go-garth/internal/models/types"
shared "go-garth/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
)
// DailyHRVDataWithMethods embeds types.DailyHRVData and adds methods

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"time"
shared "go-garth/shared/interfaces"
types "go-garth/internal/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
)
// DailySleepDTO represents daily sleep data

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"time"
types "go-garth/internal/models/types"
shared "go-garth/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
)
// DetailedSleepDataWithMethods embeds types.DetailedSleepData and adds methods

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"time"
types "go-garth/internal/models/types"
shared "go-garth/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
)
// TrainingStatusWithMethods embeds types.TrainingStatus and adds methods

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"time"
shared "go-garth/shared/interfaces"
types "go-garth/internal/models/types"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
types "github.com/sstent/go-garth/models/types"
)
// VO2MaxData implements the Data interface for VO2 max retrieval

View File

@@ -4,8 +4,9 @@ import (
"testing"
"time"
"go-garth/internal/api/client"
"go-garth/internal/models"
types "github.com/sstent/go-garth/models/types"
"github.com/sstent/go-garth-cli/shared/interfaces"
"github.com/sstent/go-garth-cli/shared/models"
"github.com/stretchr/testify/assert"
)
@@ -14,9 +15,9 @@ func TestVO2MaxData_Get(t *testing.T) {
// Setup
runningVO2 := 45.0
cyclingVO2 := 50.0
settings := &client.UserSettings{
settings := &models.UserSettings{
ID: 12345,
UserData: client.UserData{
UserData: models.UserData{
VO2MaxRunning: &runningVO2,
VO2MaxCycling: &cyclingVO2,
},
@@ -25,14 +26,14 @@ func TestVO2MaxData_Get(t *testing.T) {
vo2Data := NewVO2MaxData()
// Mock the get function
vo2Data.GetFunc = func(day time.Time, c *client.Client) (interface{}, error) {
vo2Profile := &models.VO2MaxProfile{
vo2Data.GetFunc = func(day time.Time, c interfaces.APIClient) (interface{}, error) {
vo2Profile := &types.VO2MaxProfile{
UserProfilePK: settings.ID,
LastUpdated: time.Now(),
}
if settings.UserData.VO2MaxRunning != nil && *settings.UserData.VO2MaxRunning > 0 {
vo2Profile.Running = &models.VO2MaxEntry{
vo2Profile.Running = &types.VO2MaxEntry{
Value: *settings.UserData.VO2MaxRunning,
ActivityType: "running",
Date: day,
@@ -41,7 +42,7 @@ func TestVO2MaxData_Get(t *testing.T) {
}
if settings.UserData.VO2MaxCycling != nil && *settings.UserData.VO2MaxCycling > 0 {
vo2Profile.Cycling = &models.VO2MaxEntry{
vo2Profile.Cycling = &types.VO2MaxEntry{
Value: *settings.UserData.VO2MaxCycling,
ActivityType: "cycling",
Date: day,
@@ -58,7 +59,7 @@ func TestVO2MaxData_Get(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, result)
profile, ok := result.(*models.VO2MaxProfile)
profile, ok := result.(*types.VO2MaxProfile)
assert.True(t, ok)
assert.Equal(t, 12345, profile.UserProfilePK)
assert.NotNil(t, profile.Running)

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"time"
shared "go-garth/shared/interfaces"
shared "github.com/sstent/go-garth-cli/shared/interfaces"
)
// WeightData represents weight data

View File

@@ -6,8 +6,8 @@ import (
"strings"
"time"
"go-garth/internal/api/client"
"go-garth/internal/utils"
"github.com/sstent/go-garth/api/client"
"github.com/sstent/go-garth/utils"
)
type Stats interface {

View File

@@ -5,7 +5,7 @@ import (
"io"
"net/url"
"go-garth/internal/api/client"
"github.com/sstent/go-garth/api/client"
)
// MockClient simulates API client for tests

View File

@@ -3,7 +3,7 @@ package users
import (
"time"
"go-garth/internal/api/client"
"github.com/sstent/go-garth/api/client"
)
type PowerFormat struct {