diff --git a/.gitignore b/.gitignore index 3f82f1b..9561a58 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ yarn-debug.log* yarn-error.log* .eslintcache -# vscode +# IDEs +.vscode __debug_bin .idea diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1f9e72f..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "eslint.workingDirectories": ["ui"] -} diff --git a/api/gqlgen.yml b/api/gqlgen.yml index 4f1052d..8d8d6f7 100644 --- a/api/gqlgen.yml +++ b/api/gqlgen.yml @@ -38,6 +38,8 @@ models: resolver: true type: resolver: true + album: + resolver: true MediaURL: model: github.com/photoview/photoview/api/graphql/models.MediaURL MediaEXIF: diff --git a/api/graphql/generated.go b/api/graphql/generated.go index b8220c9..910e648 100644 --- a/api/graphql/generated.go +++ b/api/graphql/generated.go @@ -98,6 +98,7 @@ type ComplexityRoot struct { Media struct { Album func(childComplexity int) int + Date func(childComplexity int) int Downloads func(childComplexity int) int Exif func(childComplexity int) int Faces func(childComplexity int) int @@ -188,7 +189,7 @@ type ComplexityRoot struct { MyFaceGroups func(childComplexity int, paginate *models.Pagination) int MyMedia func(childComplexity int, order *models.Ordering, paginate *models.Pagination) int MyMediaGeoJSON func(childComplexity int) int - MyTimeline func(childComplexity int, paginate *models.Pagination, onlyFavorites *bool) int + MyTimeline func(childComplexity int, paginate *models.Pagination, onlyFavorites *bool, fromDate *time.Time) int MyUser func(childComplexity int) int MyUserPreferences func(childComplexity int) int Search func(childComplexity int, query string, limitMedia *int, limitAlbums *int) int @@ -287,11 +288,12 @@ type MediaResolver interface { Thumbnail(ctx context.Context, obj *models.Media) (*models.MediaURL, error) HighRes(ctx context.Context, obj *models.Media) (*models.MediaURL, error) VideoWeb(ctx context.Context, obj *models.Media) (*models.MediaURL, error) - + Album(ctx context.Context, obj *models.Media) (*models.Album, error) Exif(ctx context.Context, obj *models.Media) (*models.MediaEXIF, error) Favorite(ctx context.Context, obj *models.Media) (bool, error) Type(ctx context.Context, obj *models.Media) (models.MediaType, error) + Shares(ctx context.Context, obj *models.Media) ([]*models.ShareToken, error) Downloads(ctx context.Context, obj *models.Media) ([]*models.MediaDownload, error) Faces(ctx context.Context, obj *models.Media) ([]*models.ImageFace, error) @@ -332,7 +334,7 @@ type QueryResolver interface { MyMedia(ctx context.Context, order *models.Ordering, paginate *models.Pagination) ([]*models.Media, error) Media(ctx context.Context, id int, tokenCredentials *models.ShareTokenCredentials) (*models.Media, error) MediaList(ctx context.Context, ids []int) ([]*models.Media, error) - MyTimeline(ctx context.Context, paginate *models.Pagination, onlyFavorites *bool) ([]*models.TimelineGroup, error) + MyTimeline(ctx context.Context, paginate *models.Pagination, onlyFavorites *bool, fromDate *time.Time) ([]*models.Media, error) MyMediaGeoJSON(ctx context.Context) (interface{}, error) MapboxToken(ctx context.Context) (*string, error) ShareToken(ctx context.Context, credentials models.ShareTokenCredentials) (*models.ShareToken, error) @@ -567,6 +569,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Media.Album(childComplexity), true + case "Media.date": + if e.complexity.Media.Date == nil { + break + } + + return e.complexity.Media.Date(childComplexity), true + case "Media.downloads": if e.complexity.Media.Downloads == nil { break @@ -1226,7 +1235,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.MyTimeline(childComplexity, args["paginate"].(*models.Pagination), args["onlyFavorites"].(*bool)), true + return e.complexity.Query.MyTimeline(childComplexity, args["paginate"].(*models.Pagination), args["onlyFavorites"].(*bool), args["fromDate"].(*time.Time)), true case "Query.myUser": if e.complexity.Query.MyUser == nil { @@ -1723,7 +1732,15 @@ type Query { "Get a list of media by their ids, user must own the media or be admin" mediaList(ids: [ID!]!): [Media!]! - myTimeline(paginate: Pagination, onlyFavorites: Boolean): [TimelineGroup!]! @isAuthorized + """ + Get a list of media, ordered first by day, then by album if multiple media was found for the same day. + """ + myTimeline( + paginate: Pagination, + onlyFavorites: Boolean, + "Only fetch media that is older than this date" + fromDate: Time + ): [Media!]! @isAuthorized "Get media owned by the logged in user, returned in GeoJson format" myMediaGeoJson: Any! @isAuthorized @@ -1980,6 +1997,8 @@ type Media { videoMetadata: VideoMetadata favorite: Boolean! type: MediaType! + "The date the image was shot or the date it was imported as a fallback" + date: Time! shares: [ShareToken!]! downloads: [MediaDownload!]! @@ -2843,6 +2862,15 @@ func (ec *executionContext) field_Query_myTimeline_args(ctx context.Context, raw } } args["onlyFavorites"] = arg1 + var arg2 *time.Time + if tmp, ok := rawArgs["fromDate"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fromDate")) + arg2, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) + if err != nil { + return nil, err + } + } + args["fromDate"] = arg2 return args, nil } @@ -4067,14 +4095,14 @@ func (ec *executionContext) _Media_album(ctx context.Context, field graphql.Coll Object: "Media", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Album, nil + return ec.resolvers.Media().Album(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -4086,9 +4114,9 @@ func (ec *executionContext) _Media_album(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(models.Album) + res := resTmp.(*models.Album) fc.Result = res - return ec.marshalNAlbum2githubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐAlbum(ctx, field.Selections, res) + return ec.marshalNAlbum2ᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐAlbum(ctx, field.Selections, res) } func (ec *executionContext) _Media_exif(ctx context.Context, field graphql.CollectedField, obj *models.Media) (ret graphql.Marshaler) { @@ -4225,6 +4253,41 @@ func (ec *executionContext) _Media_type(ctx context.Context, field graphql.Colle return ec.marshalNMediaType2githubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐMediaType(ctx, field.Selections, res) } +func (ec *executionContext) _Media_date(ctx context.Context, field graphql.CollectedField, obj *models.Media) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Media", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Date(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + func (ec *executionContext) _Media_shares(ctx context.Context, field graphql.CollectedField, obj *models.Media) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -7112,7 +7175,7 @@ func (ec *executionContext) _Query_myTimeline(ctx context.Context, field graphql resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().MyTimeline(rctx, args["paginate"].(*models.Pagination), args["onlyFavorites"].(*bool)) + return ec.resolvers.Query().MyTimeline(rctx, args["paginate"].(*models.Pagination), args["onlyFavorites"].(*bool), args["fromDate"].(*time.Time)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsAuthorized == nil { @@ -7128,10 +7191,10 @@ func (ec *executionContext) _Query_myTimeline(ctx context.Context, field graphql if tmp == nil { return nil, nil } - if data, ok := tmp.([]*models.TimelineGroup); ok { + if data, ok := tmp.([]*models.Media); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/photoview/photoview/api/graphql/models.TimelineGroup`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/photoview/photoview/api/graphql/models.Media`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -7143,9 +7206,9 @@ func (ec *executionContext) _Query_myTimeline(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]*models.TimelineGroup) + res := resTmp.([]*models.Media) fc.Result = res - return ec.marshalNTimelineGroup2ᚕᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐTimelineGroupᚄ(ctx, field.Selections, res) + return ec.marshalNMedia2ᚕᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐMediaᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_myMediaGeoJson(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -10576,10 +10639,19 @@ func (ec *executionContext) _Media(ctx context.Context, sel ast.SelectionSet, ob return res }) case "album": - out.Values[i] = ec._Media_album(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Media_album(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) case "exif": field := field out.Concurrently(i, func() (res graphql.Marshaler) { @@ -10621,6 +10693,11 @@ func (ec *executionContext) _Media(ctx context.Context, sel ast.SelectionSet, ob } return res }) + case "date": + out.Values[i] = ec._Media_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "shares": field := field out.Concurrently(i, func() (res graphql.Marshaler) { @@ -12466,53 +12543,6 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as return res } -func (ec *executionContext) marshalNTimelineGroup2ᚕᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐTimelineGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.TimelineGroup) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTimelineGroup2ᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐTimelineGroup(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalNTimelineGroup2ᚖgithubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐTimelineGroup(ctx context.Context, sel ast.SelectionSet, v *models.TimelineGroup) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._TimelineGroup(ctx, sel, v) -} - func (ec *executionContext) marshalNUser2githubᚗcomᚋphotoviewᚋphotoviewᚋapiᚋgraphqlᚋmodelsᚐUser(ctx context.Context, sel ast.SelectionSet, v models.User) graphql.Marshaler { return ec._User(ctx, sel, &v) } diff --git a/api/graphql/models/actions/media_actions.go b/api/graphql/models/actions/media_actions.go new file mode 100644 index 0000000..1593c21 --- /dev/null +++ b/api/graphql/models/actions/media_actions.go @@ -0,0 +1,22 @@ +package actions + +import ( + "github.com/photoview/photoview/api/graphql/models" + "gorm.io/gorm" +) + +func MyMedia(db *gorm.DB, user *models.User, order *models.Ordering, paginate *models.Pagination) ([]*models.Media, error) { + if err := user.FillAlbums(db); err != nil { + return nil, err + } + + query := db.Where("media.album_id IN (SELECT user_albums.album_id FROM user_albums WHERE user_albums.user_id = ?)", user.ID) + query = models.FormatSQL(query, order, paginate) + + var media []*models.Media + if err := query.Find(&media).Error; err != nil { + return nil, err + } + + return media, nil +} diff --git a/api/graphql/models/actions/media_actions_test.go b/api/graphql/models/actions/media_actions_test.go new file mode 100644 index 0000000..7a1eab6 --- /dev/null +++ b/api/graphql/models/actions/media_actions_test.go @@ -0,0 +1,88 @@ +package actions_test + +import ( + "testing" + + "github.com/photoview/photoview/api/graphql/models" + "github.com/photoview/photoview/api/graphql/models/actions" + "github.com/photoview/photoview/api/test_utils" + "github.com/stretchr/testify/assert" +) + +func TestMyMedia(t *testing.T) { + db := test_utils.DatabaseTest(t) + + password := "1234" + user, err := models.RegisterUser(db, "user", &password, false) + assert.NoError(t, err) + + rootAlbum := models.Album{ + Title: "root", + Path: "/photos", + } + + assert.NoError(t, db.Save(&rootAlbum).Error) + + childAlbum := models.Album{ + Title: "subalbum", + Path: "/photos/subalbum", + ParentAlbumID: &rootAlbum.ID, + } + + assert.NoError(t, db.Save(&childAlbum).Error) + + assert.NoError(t, db.Model(&user).Association("Albums").Append(&rootAlbum)) + assert.NoError(t, db.Model(&user).Association("Albums").Append(&childAlbum)) + + media := []models.Media{ + { + Title: "pic1", + Path: "/photos/pic1", + AlbumID: rootAlbum.ID, + }, + { + Title: "pic2", + Path: "/photos/pic2", + AlbumID: rootAlbum.ID, + }, + { + Title: "pic3", + Path: "/photos/subalbum/pic3", + AlbumID: childAlbum.ID, + }, + { + Title: "pic4", + Path: "/photos/subalbum/pic4", + AlbumID: childAlbum.ID, + }, + } + + assert.NoError(t, db.Save(&media).Error) + + anotherUser, err := models.RegisterUser(db, "user2", &password, false) + assert.NoError(t, err) + + anotherAlbum := models.Album{ + Title: "AnotherAlbum", + Path: "/another", + } + + assert.NoError(t, db.Save(&anotherAlbum).Error) + + anotherMedia := models.Media{ + Title: "anotherPic", + Path: "/another/anotherPic", + AlbumID: anotherAlbum.ID, + } + + assert.NoError(t, db.Save(&anotherMedia).Error) + + assert.NoError(t, db.Model(&anotherUser).Association("Albums").Append(&anotherAlbum)) + + t.Run("Simple query", func(t *testing.T) { + myMedia, err := actions.MyMedia(db, user, nil, nil) + + assert.NoError(t, err) + assert.Len(t, myMedia, 4) + }) +} diff --git a/api/graphql/models/media.go b/api/graphql/models/media.go index 0a1490d..44e06f9 100644 --- a/api/graphql/models/media.go +++ b/api/graphql/models/media.go @@ -45,6 +45,10 @@ func (m *Media) BeforeSave(tx *gorm.DB) error { return nil } +func (m *Media) Date() time.Time { + return m.DateShot +} + type MediaType string const ( diff --git a/api/graphql/resolvers/media.go b/api/graphql/resolvers/media.go index da62d30..a660175 100644 --- a/api/graphql/resolvers/media.go +++ b/api/graphql/resolvers/media.go @@ -8,6 +8,7 @@ import ( api "github.com/photoview/photoview/api/graphql" "github.com/photoview/photoview/api/graphql/auth" "github.com/photoview/photoview/api/graphql/models" + "github.com/photoview/photoview/api/graphql/models/actions" "github.com/photoview/photoview/api/scanner/face_detection" "github.com/pkg/errors" "gorm.io/gorm/clause" @@ -19,29 +20,7 @@ func (r *queryResolver) MyMedia(ctx context.Context, order *models.Ordering, pag return nil, errors.New("unauthorized") } - if err := user.FillAlbums(r.Database); err != nil { - return nil, err - } - - userAlbumIDs := make([]int, len(user.Albums)) - for i, album := range user.Albums { - userAlbumIDs[i] = album.ID - } - - var media []*models.Media - - query := r.Database. - Joins("Album"). - Where("albums.id IN (?)", userAlbumIDs). - Where("media.id IN (?)", r.Database.Model(&models.MediaURL{}).Select("id").Where("media_url.media_id = media.id")) - - query = models.FormatSQL(query, order, paginate) - - if err := query.Find(&media).Error; err != nil { - return nil, err - } - - return media, nil + return actions.MyMedia(r.Database, user, order, paginate) } func (r *queryResolver) Media(ctx context.Context, id int, tokenCredentials *models.ShareTokenCredentials) (*models.Media, error) { @@ -115,6 +94,15 @@ func (r *mediaResolver) Type(ctx context.Context, media *models.Media) (models.M return formattedType, nil } +func (r *mediaResolver) Album(ctx context.Context, obj *models.Media) (*models.Album, error) { + var album models.Album + err := r.Database.Find(&album, obj.AlbumID).Error + if err != nil { + return nil, err + } + return &album, nil +} + func (r *mediaResolver) Shares(ctx context.Context, media *models.Media) ([]*models.ShareToken, error) { var shareTokens []*models.ShareToken if err := r.Database.Where("media_id = ?", media.ID).Find(&shareTokens).Error; err != nil { diff --git a/api/graphql/resolvers/timeline.go b/api/graphql/resolvers/timeline.go index d4adaa5..8674616 100644 --- a/api/graphql/resolvers/timeline.go +++ b/api/graphql/resolvers/timeline.go @@ -2,135 +2,40 @@ package resolvers import ( "context" - "fmt" "time" - "github.com/photoview/photoview/api/database" "github.com/photoview/photoview/api/graphql/auth" "github.com/photoview/photoview/api/graphql/models" - "gorm.io/gorm" ) -func (r *queryResolver) MyTimeline(ctx context.Context, paginate *models.Pagination, onlyFavorites *bool) ([]*models.TimelineGroup, error) { +func (r *queryResolver) MyTimeline(ctx context.Context, paginate *models.Pagination, onlyFavorites *bool, fromDate *time.Time) ([]*models.Media, error) { user := auth.UserFromContext(ctx) if user == nil { return nil, auth.ErrUnauthorized } - var timelineGroups []*models.TimelineGroup + query := r.Database. + Joins("JOIN albums ON media.album_id = albums.id"). + Where("albums.id IN (?)", r.Database.Table("user_albums").Select("user_albums.album_id").Where("user_id = ?", user.ID)). + Order("YEAR(media.date_shot) DESC"). + Order("MONTH(media.date_shot) DESC"). + Order("DAY(media.date_shot) DESC"). + Order("albums.title ASC") - transactionError := r.Database.Transaction(func(tx *gorm.DB) error { - // album_id, year, month, day - daysQuery := tx.Select( - "albums.id AS album_id", - fmt.Sprintf("%s AS year", database.DateExtract(tx, database.DateCompYear, "media.date_shot")), - fmt.Sprintf("%s AS month", database.DateExtract(tx, database.DateCompMonth, "media.date_shot")), - fmt.Sprintf("%s AS day", database.DateExtract(tx, database.DateCompDay, "media.date_shot")), - ). - Table("media"). - Joins("JOIN albums ON media.album_id = albums.id"). - Where("albums.id IN (?)", tx.Table("user_albums").Select("user_albums.album_id").Where("user_id = ?", user.ID)) - - if onlyFavorites != nil && *onlyFavorites == true { - daysQuery.Where("media.id IN (?)", tx.Table("user_media_data").Select("user_media_data.media_id").Where("user_media_data.user_id = ?", user.ID).Where("user_media_data.favorite = 1")) - } - - if paginate != nil { - if paginate.Limit != nil { - daysQuery.Limit(*paginate.Limit) - } - - if paginate.Offset != nil { - daysQuery.Offset(*paginate.Offset) - } - } - - rows, err := daysQuery.Group("albums.id").Group( - fmt.Sprintf("%s, %s, %s", - database.DateExtract(tx, database.DateCompYear, "media.date_shot"), - database.DateExtract(tx, database.DateCompMonth, "media.date_shot"), - database.DateExtract(tx, database.DateCompDay, "media.date_shot")), - ). - Order( - fmt.Sprintf("%s DESC, %s DESC, %s DESC", - database.DateExtract(tx, database.DateCompYear, "media.date_shot"), - database.DateExtract(tx, database.DateCompMonth, "media.date_shot"), - database.DateExtract(tx, database.DateCompDay, "media.date_shot")), - ).Rows() - - defer rows.Close() - - if err != nil { - return err - } - - type group struct { - albumID int - year int - month int - day int - } - - dbGroups := make([]group, 0) - - for rows.Next() { - var g group - rows.Scan(&g.albumID, &g.year, &g.month, &g.day) - dbGroups = append(dbGroups, g) - } - - timelineGroups = make([]*models.TimelineGroup, len(dbGroups)) - - for i, group := range dbGroups { - - // Fill album - var groupAlbum models.Album - if err := tx.First(&groupAlbum, group.albumID).Error; err != nil { - return err - } - - // Fill media - var groupMedia []*models.Media - mediaQuery := tx.Model(&models.Media{}). - Where("album_id = ?", group.albumID). - Where(fmt.Sprintf("%s = ?", database.DateExtract(tx, database.DateCompYear, "media.date_shot")), group.year). - Where(fmt.Sprintf("%s = ?", database.DateExtract(tx, database.DateCompMonth, "media.date_shot")), group.month). - Where(fmt.Sprintf("%s = ?", database.DateExtract(tx, database.DateCompDay, "media.date_shot")), group.day). - Order("date_shot DESC") - - if onlyFavorites != nil && *onlyFavorites == true { - mediaQuery.Where("media.id IN (?)", tx.Table("user_media_data").Select("user_media_data.media_id").Where("user_media_data.user_id = ?", user.ID).Where("user_media_data.favorite = 1")) - } - - if err := mediaQuery.Limit(5).Find(&groupMedia).Error; err != nil { - return err - } - - // Get total media count - var totalMedia int64 - if err := mediaQuery.Count(&totalMedia).Error; err != nil { - return err - } - - var date time.Time = groupMedia[0].DateShot - date = time.Date(date.Year(), date.Month(), date.Day(), 0, 0, 0, 0, date.Location()) - - timelineGroup := models.TimelineGroup{ - Album: &groupAlbum, - Media: groupMedia, - MediaTotal: int(totalMedia), - Date: date, - } - - timelineGroups[i] = &timelineGroup - } - - return nil - }) - - if transactionError != nil { - return nil, transactionError + if fromDate != nil { + query = query.Where("media.date_shot < ?", fromDate) } - return timelineGroups, nil + if onlyFavorites != nil && *onlyFavorites == true { + query = query.Where("media.id IN (?)", r.Database.Table("user_media_data").Select("user_media_data.media_id").Where("user_media_data.user_id = ?", user.ID).Where("user_media_data.favorite = 1")) + } + + query = models.FormatSQL(query, nil, paginate) + + var media []*models.Media + if err := query.Find(&media).Error; err != nil { + return nil, err + } + + return media, nil } diff --git a/api/graphql/schema.graphql b/api/graphql/schema.graphql index e534491..166b435 100644 --- a/api/graphql/schema.graphql +++ b/api/graphql/schema.graphql @@ -63,7 +63,15 @@ type Query { "Get a list of media by their ids, user must own the media or be admin" mediaList(ids: [ID!]!): [Media!]! - myTimeline(paginate: Pagination, onlyFavorites: Boolean): [TimelineGroup!]! @isAuthorized + """ + Get a list of media, ordered first by day, then by album if multiple media was found for the same day. + """ + myTimeline( + paginate: Pagination, + onlyFavorites: Boolean, + "Only fetch media that is older than this date" + fromDate: Time + ): [Media!]! @isAuthorized "Get media owned by the logged in user, returned in GeoJson format" myMediaGeoJson: Any! @isAuthorized @@ -318,6 +326,8 @@ type Media { videoMetadata: VideoMetadata favorite: Boolean! type: MediaType! + "The date the image was shot or the date it was imported as a fallback" + date: Time! shares: [ShareToken!]! downloads: [MediaDownload!]! diff --git a/ui/package-lock.json b/ui/package-lock.json index 874aa03..dd55fed 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -57,7 +57,8 @@ "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^13.1.9", - "apollo": "^2.33.4", + "apollo": "2.33.4", + "apollo-language-server": "1.26.3", "husky": "^6.0.0", "i18next-parser": "^4.2.0", "lint-staged": "^11.0.1", @@ -106,12 +107,12 @@ } }, "node_modules/@apollo/federation": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.27.0.tgz", - "integrity": "sha512-hMeRN9IPsIn+5J5SmWof0ODbvRjRj8mBNqbsm9Zjkqjbw6RTlcx90taMk7cYhcd/E+uTyLQt5cOSRVBx53cxbQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.25.0.tgz", + "integrity": "sha512-HspsFSatOhBwDSbYq7WyrtalhX98ShOrzT1Knwj/VHLGfFbLsbREpx191S8D2Wr6ew8LhqCcUkfNrrTBB1l3XA==", "dev": true, "dependencies": { - "apollo-graphql": "^0.9.3", + "apollo-graphql": "^0.9.2", "lodash.xorby": "^4.7.0" }, "engines": { @@ -839,6 +840,9 @@ "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-bigint": { @@ -944,6 +948,9 @@ "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-jsx": { @@ -966,6 +973,9 @@ "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { @@ -974,6 +984,9 @@ "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-numeric-separator": { @@ -982,6 +995,9 @@ "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-object-rest-spread": { @@ -990,6 +1006,9 @@ "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-optional-catch-binding": { @@ -998,6 +1017,9 @@ "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-optional-chaining": { @@ -1006,6 +1028,9 @@ "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-private-property-in-object": { @@ -1749,6 +1774,9 @@ "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/types": "^7.4.4", "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/preset-react": { @@ -1926,6 +1954,29 @@ "node": ">=10" } }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "optional": true, + "peer": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", + "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "optional": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@csstools/convert-colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz", @@ -2006,7 +2057,10 @@ "node_modules/@graphql-typed-document-node/core": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.0.tgz", - "integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==" + "integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==", + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" + } }, "node_modules/@hapi/address": { "version": "2.1.4", @@ -2132,6 +2186,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/types/node_modules/chalk": { @@ -2144,6 +2201,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/types/node_modules/color-convert": { @@ -3850,6 +3910,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@testing-library/dom/node_modules/chalk": { @@ -3862,6 +3925,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@testing-library/dom/node_modules/color-convert": { @@ -3931,6 +3997,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@testing-library/jest-dom/node_modules/chalk": { @@ -4173,6 +4242,34 @@ "node": ">= 6" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "optional": true, + "peer": true + }, "node_modules/@types/aria-query": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.0.tgz", @@ -5079,6 +5176,10 @@ "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ajv-errors": { @@ -5119,6 +5220,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-escapes/node_modules/type-fest": { @@ -5127,6 +5231,9 @@ "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-html": { @@ -5258,6 +5365,159 @@ "npm": ">=6" } }, + "node_modules/apollo-codegen-core/node_modules/@apollo/federation": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.27.0.tgz", + "integrity": "sha512-hMeRN9IPsIn+5J5SmWof0ODbvRjRj8mBNqbsm9Zjkqjbw6RTlcx90taMk7cYhcd/E+uTyLQt5cOSRVBx53cxbQ==", + "dev": true, + "dependencies": { + "apollo-graphql": "^0.9.3", + "lodash.xorby": "^4.7.0" + }, + "engines": { + "node": ">=12.13.0 <17.0" + }, + "peerDependencies": { + "graphql": "^14.5.0 || ^15.0.0" + } + }, + "node_modules/apollo-codegen-core/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@endemolshinegroup/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.2.tgz", + "integrity": "sha512-ZHkXKq2XFFmAUdmSZrmqUSIrRM4O9gtkdpxMmV+LQl7kScUnbo6pMnXu6+FTDgZ12aW6SDoZoOJfS56WD+Eu6A==", + "dev": true, + "dependencies": { + "lodash.get": "^4", + "make-error": "^1", + "ts-node": "^8", + "tslib": "^1" + }, + "engines": { + "node": ">=8.0.0", + "yarn": ">=1.3.0" + }, + "peerDependencies": { + "cosmiconfig": ">=5 < 6" + } + }, + "node_modules/apollo-codegen-core/node_modules/apollo-language-server": { + "version": "1.26.4", + "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.4.tgz", + "integrity": "sha512-WQtJxQcHcTTHB3ckA56vyN3W2Lb+ha3YWsojwyirBWHvT0mLoZeblEISv2y5iADgRE9kR80CXs/WV82VaKbxPQ==", + "dev": true, + "dependencies": { + "@apollo/federation": "0.27.0", + "@apollographql/apollo-tools": "^0.5.1", + "@apollographql/graphql-language-service-interface": "^2.0.2", + "@endemolshinegroup/cosmiconfig-typescript-loader": "^1.0.0", + "apollo-datasource": "^0.9.0", + "apollo-env": "^0.10.0", + "apollo-graphql": "^0.9.3", + "apollo-link": "^1.2.3", + "apollo-link-context": "^1.0.9", + "apollo-link-error": "^1.1.1", + "apollo-link-http": "^1.5.5", + "apollo-server-errors": "^2.0.2", + "await-to-js": "^2.0.1", + "core-js": "^3.0.1", + "cosmiconfig": "^5.0.6", + "dotenv": "^8.0.0", + "glob": "^7.1.3", + "graphql": "14.0.2 - 14.2.0 || ^14.3.1 || ^15.0.0", + "graphql-tag": "^2.10.1", + "lodash.debounce": "^4.0.8", + "lodash.merge": "^4.6.1", + "minimatch": "^3.0.4", + "moment": "2.29.1", + "vscode-languageserver": "^5.1.0", + "vscode-uri": "1.0.6" + }, + "engines": { + "node": ">=8", + "npm": ">=6" + } + }, + "node_modules/apollo-codegen-core/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/apollo-codegen-core/node_modules/cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "dependencies": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/apollo-codegen-core/node_modules/import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "dependencies": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/apollo-codegen-core/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/apollo-codegen-core/node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/apollo-codegen-core/node_modules/ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "dependencies": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" + } + }, "node_modules/apollo-codegen-flow": { "version": "0.38.4", "resolved": "https://registry.npmjs.org/apollo-codegen-flow/-/apollo-codegen-flow-0.38.4.tgz", @@ -5372,12 +5632,12 @@ } }, "node_modules/apollo-language-server": { - "version": "1.26.4", - "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.4.tgz", - "integrity": "sha512-WQtJxQcHcTTHB3ckA56vyN3W2Lb+ha3YWsojwyirBWHvT0mLoZeblEISv2y5iADgRE9kR80CXs/WV82VaKbxPQ==", + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.3.tgz", + "integrity": "sha512-gVe3wN+cVxrEeLgYJVAf7s1V4YszXjDxZKS0oHUzCrSfH9JDroPwXfiZa6JK540wtx1l18Cpl71gJ++/aYaoNQ==", "dev": true, "dependencies": { - "@apollo/federation": "0.27.0", + "@apollo/federation": "0.25.0", "@apollographql/apollo-tools": "^0.5.1", "@apollographql/graphql-language-service-interface": "^2.0.2", "@endemolshinegroup/cosmiconfig-typescript-loader": "^1.0.0", @@ -5427,6 +5687,12 @@ "cosmiconfig": ">=5 < 6" } }, + "node_modules/apollo-language-server/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "node_modules/apollo-language-server/node_modules/cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -5477,6 +5743,31 @@ "node": ">=4" } }, + "node_modules/apollo-language-server/node_modules/ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "dependencies": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" + } + }, "node_modules/apollo-link": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", @@ -6009,6 +6300,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", "dependencies": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.0", @@ -6019,6 +6311,9 @@ }, "engines": { "node": ">=6" + }, + "peerDependencies": { + "eslint": ">= 4.12.1" } }, "node_modules/babel-extract-comments": { @@ -7497,9 +7792,9 @@ } }, "node_modules/cli-progress": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.1.tgz", - "integrity": "sha512-AXxiCe2a0Lm0VN+9L0jzmfQSkcZm5EYspfqXKaSIQKqIk+0hnkZ3/v1E9B39mkD6vYhKih3c/RPsJBSwq9O99Q==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.0.tgz", + "integrity": "sha512-g7rLWfhAo/7pF+a/STFH/xPyosaL1zgADhI0OM83hl3c7S43iGvJWEAV2QuDOnQ8i6EMBj/u4+NTd0d5L+4JfA==", "dev": true, "dependencies": { "colors": "^1.1.2", @@ -8181,6 +8476,13 @@ "sha.js": "^2.4.8" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "optional": true, + "peer": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -10147,6 +10449,9 @@ "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==", "engines": { "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "node_modules/eslint-plugin-react/node_modules/doctrine": { @@ -10298,6 +10603,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/eslint-visitor-keys": { @@ -10390,6 +10698,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/eslint/node_modules/chalk": { @@ -10402,6 +10713,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/eslint/node_modules/color-convert": { @@ -11274,7 +11588,8 @@ "node_modules/flatten": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", - "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==" + "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==", + "deprecated": "flatten is deprecated in favor of utility frameworks such as lodash." }, "node_modules/flush-write-stream": { "version": "1.1.1", @@ -11626,6 +11941,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -11803,6 +12119,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { @@ -12746,7 +13065,6 @@ "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", "dev": true, - "license": "MIT", "bin": { "husky": "lib/bin.js" }, @@ -13762,6 +14080,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-diff/node_modules/chalk": { @@ -13774,6 +14095,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-diff/node_modules/color-convert": { @@ -15803,6 +16127,10 @@ "dependencies": { "@babel/runtime": "^7.5.5", "tiny-warning": "^1.0.3" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.0" } }, "node_modules/mini-css-extract-plugin": { @@ -16785,6 +17113,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -18786,6 +19117,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/pretty-format/node_modules/color-convert": { @@ -19367,6 +19701,9 @@ "prop-types": "^15.7.2", "react-fast-compare": "^3.1.1", "react-side-effect": "^2.1.0" + }, + "peerDependencies": { + "react": ">=16.3.0" } }, "node_modules/react-hook-form": { @@ -19414,6 +19751,9 @@ "react-is": "^16.6.0", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" } }, "node_modules/react-router-dom": { @@ -19428,6 +19768,9 @@ "react-router": "5.2.0", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" } }, "node_modules/react-router-dom/node_modules/history": { @@ -20924,12 +21267,18 @@ "dependencies": { "object-assign": "^4.1.1", "react-is": "^16.12.0 || ^17.0.0" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0" } }, "node_modules/react-side-effect": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.0.tgz", - "integrity": "sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==" + "integrity": "sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==", + "peerDependencies": { + "react": "^16.3.0" + } }, "node_modules/react-spring": { "version": "8.0.27", @@ -21249,6 +21598,9 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/regexpu-core": { @@ -24319,35 +24671,79 @@ "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "devOptional": true, + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz", + "integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==", + "optional": true, + "peer": true, "dependencies": { + "@cspotcode/source-map-support": "0.6.1", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, "engines": { - "node": ">=6.0.0" + "node": ">=12.0.0" }, "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "optional": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.0" } }, "node_modules/ts-node/node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/ts-pnp": { "version": "1.2.0", @@ -26863,6 +27259,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/color-convert": { @@ -27027,12 +27426,12 @@ } }, "@apollo/federation": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.27.0.tgz", - "integrity": "sha512-hMeRN9IPsIn+5J5SmWof0ODbvRjRj8mBNqbsm9Zjkqjbw6RTlcx90taMk7cYhcd/E+uTyLQt5cOSRVBx53cxbQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.25.0.tgz", + "integrity": "sha512-HspsFSatOhBwDSbYq7WyrtalhX98ShOrzT1Knwj/VHLGfFbLsbREpx191S8D2Wr6ew8LhqCcUkfNrrTBB1l3XA==", "dev": true, "requires": { - "apollo-graphql": "^0.9.3", + "apollo-graphql": "^0.9.2", "lodash.xorby": "^4.7.0" } }, @@ -28272,6 +28671,23 @@ } } }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "optional": true, + "peer": true + }, + "@cspotcode/source-map-support": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", + "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "optional": true, + "peer": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, "@csstools/convert-colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz", @@ -28342,7 +28758,8 @@ "@graphql-typed-document-node/core": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.0.tgz", - "integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==" + "integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==", + "requires": {} }, "@hapi/address": { "version": "2.1.4", @@ -28681,6 +29098,7 @@ "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", "dev": true, "requires": { + "@oclif/config": "^1.15.1", "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.3", "@oclif/plugin-help": "^3", @@ -29951,6 +30369,34 @@ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "optional": true, + "peer": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "optional": true, + "peer": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "optional": true, + "peer": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "optional": true, + "peer": true + }, "@types/aria-query": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.0.tgz", @@ -30906,6 +31352,120 @@ "ast-types": "^0.14.0", "common-tags": "^1.5.1", "recast": "^0.20.0" + }, + "dependencies": { + "@apollo/federation": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@apollo/federation/-/federation-0.27.0.tgz", + "integrity": "sha512-hMeRN9IPsIn+5J5SmWof0ODbvRjRj8mBNqbsm9Zjkqjbw6RTlcx90taMk7cYhcd/E+uTyLQt5cOSRVBx53cxbQ==", + "dev": true, + "requires": { + "apollo-graphql": "^0.9.3", + "lodash.xorby": "^4.7.0" + } + }, + "@endemolshinegroup/cosmiconfig-typescript-loader": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@endemolshinegroup/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.2.tgz", + "integrity": "sha512-ZHkXKq2XFFmAUdmSZrmqUSIrRM4O9gtkdpxMmV+LQl7kScUnbo6pMnXu6+FTDgZ12aW6SDoZoOJfS56WD+Eu6A==", + "dev": true, + "requires": { + "lodash.get": "^4", + "make-error": "^1", + "ts-node": "^8", + "tslib": "^1" + } + }, + "apollo-language-server": { + "version": "1.26.4", + "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.4.tgz", + "integrity": "sha512-WQtJxQcHcTTHB3ckA56vyN3W2Lb+ha3YWsojwyirBWHvT0mLoZeblEISv2y5iADgRE9kR80CXs/WV82VaKbxPQ==", + "dev": true, + "requires": { + "@apollo/federation": "0.27.0", + "@apollographql/apollo-tools": "^0.5.1", + "@apollographql/graphql-language-service-interface": "^2.0.2", + "@endemolshinegroup/cosmiconfig-typescript-loader": "^1.0.0", + "apollo-datasource": "^0.9.0", + "apollo-env": "^0.10.0", + "apollo-graphql": "^0.9.3", + "apollo-link": "^1.2.3", + "apollo-link-context": "^1.0.9", + "apollo-link-error": "^1.1.1", + "apollo-link-http": "^1.5.5", + "apollo-server-errors": "^2.0.2", + "await-to-js": "^2.0.1", + "core-js": "^3.0.1", + "cosmiconfig": "^5.0.6", + "dotenv": "^8.0.0", + "glob": "^7.1.3", + "graphql": "14.0.2 - 14.2.0 || ^14.3.1 || ^15.0.0", + "graphql-tag": "^2.10.1", + "lodash.debounce": "^4.0.8", + "lodash.merge": "^4.6.1", + "minimatch": "^3.0.4", + "moment": "2.29.1", + "vscode-languageserver": "^5.1.0", + "vscode-uri": "1.0.6" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + } } }, "apollo-codegen-flow": { @@ -30994,12 +31554,12 @@ } }, "apollo-language-server": { - "version": "1.26.4", - "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.4.tgz", - "integrity": "sha512-WQtJxQcHcTTHB3ckA56vyN3W2Lb+ha3YWsojwyirBWHvT0mLoZeblEISv2y5iADgRE9kR80CXs/WV82VaKbxPQ==", + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/apollo-language-server/-/apollo-language-server-1.26.3.tgz", + "integrity": "sha512-gVe3wN+cVxrEeLgYJVAf7s1V4YszXjDxZKS0oHUzCrSfH9JDroPwXfiZa6JK540wtx1l18Cpl71gJ++/aYaoNQ==", "dev": true, "requires": { - "@apollo/federation": "0.27.0", + "@apollo/federation": "0.25.0", "@apollographql/apollo-tools": "^0.5.1", "@apollographql/graphql-language-service-interface": "^2.0.2", "@endemolshinegroup/cosmiconfig-typescript-loader": "^1.0.0", @@ -31038,6 +31598,12 @@ "tslib": "^1" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -31075,6 +31641,19 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true + }, + "ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } } } }, @@ -32706,9 +33285,9 @@ } }, "cli-progress": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.1.tgz", - "integrity": "sha512-AXxiCe2a0Lm0VN+9L0jzmfQSkcZm5EYspfqXKaSIQKqIk+0hnkZ3/v1E9B39mkD6vYhKih3c/RPsJBSwq9O99Q==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.0.tgz", + "integrity": "sha512-g7rLWfhAo/7pF+a/STFH/xPyosaL1zgADhI0OM83hl3c7S43iGvJWEAV2QuDOnQ8i6EMBj/u4+NTd0d5L+4JfA==", "dev": true, "requires": { "colors": "^1.1.2", @@ -33261,6 +33840,13 @@ "sha.js": "^2.4.8" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "optional": true, + "peer": true + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -34903,7 +35489,8 @@ "eslint-plugin-react-hooks": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz", - "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==" + "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==", + "requires": {} }, "eslint-plugin-testing-library": { "version": "3.10.2", @@ -43223,7 +43810,8 @@ "react-side-effect": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.0.tgz", - "integrity": "sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==" + "integrity": "sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==", + "requires": {} }, "react-spring": { "version": "8.0.27", @@ -45931,23 +46519,46 @@ } }, "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "devOptional": true, + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz", + "integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==", + "optional": true, + "peer": true, "requires": { + "@cspotcode/source-map-support": "0.6.1", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" }, "dependencies": { + "acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "optional": true, + "peer": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "optional": true, + "peer": true + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "devOptional": true + "optional": true, + "peer": true } } }, diff --git a/ui/package.json b/ui/package.json index 7c2c1c0..d4dca0c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -63,7 +63,7 @@ "lint:types": "tsc --noemit", "jest": "craco test --setupFilesAfterEnv ./testing/setupTests.ts", "jest:ci": "CI=true craco test --setupFilesAfterEnv ./testing/setupTests.ts --verbose --ci --coverage", - "genSchemaTypes": "npx apollo client:codegen --target=typescript --globalTypesFile=src/__generated__/globalTypes.ts", + "genSchemaTypes": "apollo client:codegen --target=typescript --globalTypesFile=src/__generated__/globalTypes.ts", "extractTranslations": "i18next -c i18next-parser.config.js", "prepare": "(cd .. && npx husky install)" }, @@ -75,7 +75,9 @@ "husky": "^6.0.0", "i18next-parser": "^4.2.0", "lint-staged": "^11.0.1", - "tsc-files": "^1.1.2" + "tsc-files": "^1.1.2", + "apollo": "2.33.4", + "apollo-language-server": "1.26.3" }, "prettier": { "trailingComma": "es5", diff --git a/ui/src/Pages/AlbumPage/__generated__/albumQuery.ts b/ui/src/Pages/AlbumPage/__generated__/albumQuery.ts index 2414a76..f7138d2 100644 --- a/ui/src/Pages/AlbumPage/__generated__/albumQuery.ts +++ b/ui/src/Pages/AlbumPage/__generated__/albumQuery.ts @@ -3,102 +3,102 @@ // @generated // This file was automatically generated and should not be edited. -import { OrderDirection, MediaType } from './../../../__generated__/globalTypes' +import { OrderDirection, MediaType } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: albumQuery // ==================================================== export interface albumQuery_album_subAlbums_thumbnail_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface albumQuery_album_subAlbums_thumbnail { - __typename: 'Media' - id: string + __typename: "Media"; + id: string; /** * URL to display the media in a smaller resolution */ - thumbnail: albumQuery_album_subAlbums_thumbnail_thumbnail | null + thumbnail: albumQuery_album_subAlbums_thumbnail_thumbnail | null; } export interface albumQuery_album_subAlbums { - __typename: 'Album' - id: string - title: string + __typename: "Album"; + id: string; + title: string; /** * An image in this album used for previewing this album */ - thumbnail: albumQuery_album_subAlbums_thumbnail | null + thumbnail: albumQuery_album_subAlbums_thumbnail | null; } export interface albumQuery_album_media_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface albumQuery_album_media_highRes { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface albumQuery_album_media_videoWeb { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface albumQuery_album_media { - __typename: 'Media' - id: string - type: MediaType + __typename: "Media"; + id: string; + type: MediaType; /** * URL to display the media in a smaller resolution */ - thumbnail: albumQuery_album_media_thumbnail | null + thumbnail: albumQuery_album_media_thumbnail | null; /** * URL to display the photo in full resolution, will be null for videos */ - highRes: albumQuery_album_media_highRes | null + highRes: albumQuery_album_media_highRes | null; /** * URL to get the video in a web format that can be played in the browser, will be null for photos */ - videoWeb: albumQuery_album_media_videoWeb | null - favorite: boolean + videoWeb: albumQuery_album_media_videoWeb | null; + favorite: boolean; } export interface albumQuery_album { - __typename: 'Album' - id: string - title: string + __typename: "Album"; + id: string; + title: string; /** * The albums contained in this album */ - subAlbums: albumQuery_album_subAlbums[] + subAlbums: albumQuery_album_subAlbums[]; /** * The media inside this album */ - media: albumQuery_album_media[] + media: albumQuery_album_media[]; } export interface albumQuery { @@ -106,14 +106,14 @@ export interface albumQuery { * Get album by id, user must own the album or be admin * If valid tokenCredentials are provided, the album may be retrived without further authentication */ - album: albumQuery_album + album: albumQuery_album; } export interface albumQueryVariables { - id: string - onlyFavorites?: boolean | null - mediaOrderBy?: string | null - mediaOrderDirection?: OrderDirection | null - limit?: number | null - offset?: number | null + id: string; + onlyFavorites?: boolean | null; + mediaOrderBy?: string | null; + mediaOrderDirection?: OrderDirection | null; + limit?: number | null; + offset?: number | null; } diff --git a/ui/src/Pages/AllAlbumsPage/__generated__/getMyAlbums.ts b/ui/src/Pages/AllAlbumsPage/__generated__/getMyAlbums.ts index 51041d3..600309f 100644 --- a/ui/src/Pages/AllAlbumsPage/__generated__/getMyAlbums.ts +++ b/ui/src/Pages/AllAlbumsPage/__generated__/getMyAlbums.ts @@ -8,35 +8,35 @@ // ==================================================== export interface getMyAlbums_myAlbums_thumbnail_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface getMyAlbums_myAlbums_thumbnail { - __typename: 'Media' - id: string + __typename: "Media"; + id: string; /** * URL to display the media in a smaller resolution */ - thumbnail: getMyAlbums_myAlbums_thumbnail_thumbnail | null + thumbnail: getMyAlbums_myAlbums_thumbnail_thumbnail | null; } export interface getMyAlbums_myAlbums { - __typename: 'Album' - id: string - title: string + __typename: "Album"; + id: string; + title: string; /** * An image in this album used for previewing this album */ - thumbnail: getMyAlbums_myAlbums_thumbnail | null + thumbnail: getMyAlbums_myAlbums_thumbnail | null; } export interface getMyAlbums { /** * List of albums owned by the logged in user. */ - myAlbums: getMyAlbums_myAlbums[] + myAlbums: getMyAlbums_myAlbums[]; } diff --git a/ui/src/Pages/LoginPage/__generated__/CheckInitialSetup.ts b/ui/src/Pages/LoginPage/__generated__/CheckInitialSetup.ts index 8e91c1b..94fe677 100644 --- a/ui/src/Pages/LoginPage/__generated__/CheckInitialSetup.ts +++ b/ui/src/Pages/LoginPage/__generated__/CheckInitialSetup.ts @@ -8,13 +8,13 @@ // ==================================================== export interface CheckInitialSetup_siteInfo { - __typename: 'SiteInfo' + __typename: "SiteInfo"; /** * Whether or not the initial setup wizard should be shown */ - initialSetup: boolean + initialSetup: boolean; } export interface CheckInitialSetup { - siteInfo: CheckInitialSetup_siteInfo + siteInfo: CheckInitialSetup_siteInfo; } diff --git a/ui/src/Pages/PeoplePage/SingleFaceGroup/__generated__/singleFaceGroup.ts b/ui/src/Pages/PeoplePage/SingleFaceGroup/__generated__/singleFaceGroup.ts index cfcaca7..b5d773c 100644 --- a/ui/src/Pages/PeoplePage/SingleFaceGroup/__generated__/singleFaceGroup.ts +++ b/ui/src/Pages/PeoplePage/SingleFaceGroup/__generated__/singleFaceGroup.ts @@ -3,80 +3,80 @@ // @generated // This file was automatically generated and should not be edited. -import { MediaType } from './../../../../__generated__/globalTypes' +import { MediaType } from "./../../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: singleFaceGroup // ==================================================== export interface singleFaceGroup_faceGroup_imageFaces_rectangle { - __typename: 'FaceRectangle' - minX: number - maxX: number - minY: number - maxY: number + __typename: "FaceRectangle"; + minX: number; + maxX: number; + minY: number; + maxY: number; } export interface singleFaceGroup_faceGroup_imageFaces_media_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface singleFaceGroup_faceGroup_imageFaces_media_highRes { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface singleFaceGroup_faceGroup_imageFaces_media { - __typename: 'Media' - id: string - type: MediaType - title: string + __typename: "Media"; + id: string; + type: MediaType; + title: string; /** * URL to display the media in a smaller resolution */ - thumbnail: singleFaceGroup_faceGroup_imageFaces_media_thumbnail | null + thumbnail: singleFaceGroup_faceGroup_imageFaces_media_thumbnail | null; /** * URL to display the photo in full resolution, will be null for videos */ - highRes: singleFaceGroup_faceGroup_imageFaces_media_highRes | null - favorite: boolean + highRes: singleFaceGroup_faceGroup_imageFaces_media_highRes | null; + favorite: boolean; } export interface singleFaceGroup_faceGroup_imageFaces { - __typename: 'ImageFace' - id: string - rectangle: singleFaceGroup_faceGroup_imageFaces_rectangle - media: singleFaceGroup_faceGroup_imageFaces_media + __typename: "ImageFace"; + id: string; + rectangle: singleFaceGroup_faceGroup_imageFaces_rectangle; + media: singleFaceGroup_faceGroup_imageFaces_media; } export interface singleFaceGroup_faceGroup { - __typename: 'FaceGroup' - id: string - label: string | null - imageFaces: singleFaceGroup_faceGroup_imageFaces[] + __typename: "FaceGroup"; + id: string; + label: string | null; + imageFaces: singleFaceGroup_faceGroup_imageFaces[]; } export interface singleFaceGroup { - faceGroup: singleFaceGroup_faceGroup + faceGroup: singleFaceGroup_faceGroup; } export interface singleFaceGroupVariables { - id: string - limit: number - offset: number + id: string; + limit: number; + offset: number; } diff --git a/ui/src/Pages/PeoplePage/__generated__/myFaces.ts b/ui/src/Pages/PeoplePage/__generated__/myFaces.ts index b947e43..53db027 100644 --- a/ui/src/Pages/PeoplePage/__generated__/myFaces.ts +++ b/ui/src/Pages/PeoplePage/__generated__/myFaces.ts @@ -8,59 +8,59 @@ // ==================================================== export interface myFaces_myFaceGroups_imageFaces_rectangle { - __typename: 'FaceRectangle' - minX: number - maxX: number - minY: number - maxY: number + __typename: "FaceRectangle"; + minX: number; + maxX: number; + minY: number; + maxY: number; } export interface myFaces_myFaceGroups_imageFaces_media_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface myFaces_myFaceGroups_imageFaces_media { - __typename: 'Media' - id: string - title: string + __typename: "Media"; + id: string; + title: string; /** * URL to display the media in a smaller resolution */ - thumbnail: myFaces_myFaceGroups_imageFaces_media_thumbnail | null + thumbnail: myFaces_myFaceGroups_imageFaces_media_thumbnail | null; } export interface myFaces_myFaceGroups_imageFaces { - __typename: 'ImageFace' - id: string - rectangle: myFaces_myFaceGroups_imageFaces_rectangle - media: myFaces_myFaceGroups_imageFaces_media + __typename: "ImageFace"; + id: string; + rectangle: myFaces_myFaceGroups_imageFaces_rectangle; + media: myFaces_myFaceGroups_imageFaces_media; } export interface myFaces_myFaceGroups { - __typename: 'FaceGroup' - id: string - label: string | null - imageFaceCount: number - imageFaces: myFaces_myFaceGroups_imageFaces[] + __typename: "FaceGroup"; + id: string; + label: string | null; + imageFaceCount: number; + imageFaces: myFaces_myFaceGroups_imageFaces[]; } export interface myFaces { - myFaceGroups: myFaces_myFaceGroups[] + myFaceGroups: myFaces_myFaceGroups[]; } export interface myFacesVariables { - limit?: number | null - offset?: number | null + limit?: number | null; + offset?: number | null; } diff --git a/ui/src/Pages/PlacesPage/__generated__/placePageQueryMedia.ts b/ui/src/Pages/PlacesPage/__generated__/placePageQueryMedia.ts index c1879d3..056bd39 100644 --- a/ui/src/Pages/PlacesPage/__generated__/placePageQueryMedia.ts +++ b/ui/src/Pages/PlacesPage/__generated__/placePageQueryMedia.ts @@ -3,86 +3,86 @@ // @generated // This file was automatically generated and should not be edited. -import { MediaType } from './../../../__generated__/globalTypes' +import { MediaType } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: placePageQueryMedia // ==================================================== export interface placePageQueryMedia_mediaList_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface placePageQueryMedia_mediaList_highRes { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface placePageQueryMedia_mediaList_videoWeb { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface placePageQueryMedia_mediaList { - __typename: 'Media' - id: string - title: string + __typename: "Media"; + id: string; + title: string; /** * URL to display the media in a smaller resolution */ - thumbnail: placePageQueryMedia_mediaList_thumbnail | null + thumbnail: placePageQueryMedia_mediaList_thumbnail | null; /** * URL to display the photo in full resolution, will be null for videos */ - highRes: placePageQueryMedia_mediaList_highRes | null + highRes: placePageQueryMedia_mediaList_highRes | null; /** * URL to get the video in a web format that can be played in the browser, will be null for photos */ - videoWeb: placePageQueryMedia_mediaList_videoWeb | null - type: MediaType + videoWeb: placePageQueryMedia_mediaList_videoWeb | null; + type: MediaType; } export interface placePageQueryMedia { /** * Get a list of media by their ids, user must own the media or be admin */ - mediaList: placePageQueryMedia_mediaList[] + mediaList: placePageQueryMedia_mediaList[]; } export interface placePageQueryMediaVariables { - mediaIDs: string[] + mediaIDs: string[]; } diff --git a/ui/src/Pages/SettingsPage/Users/__generated__/changeUserPassword.ts b/ui/src/Pages/SettingsPage/Users/__generated__/changeUserPassword.ts index 05c3c74..0435e49 100644 --- a/ui/src/Pages/SettingsPage/Users/__generated__/changeUserPassword.ts +++ b/ui/src/Pages/SettingsPage/Users/__generated__/changeUserPassword.ts @@ -8,15 +8,15 @@ // ==================================================== export interface changeUserPassword_updateUser { - __typename: 'User' - id: string + __typename: "User"; + id: string; } export interface changeUserPassword { - updateUser: changeUserPassword_updateUser + updateUser: changeUserPassword_updateUser; } export interface changeUserPasswordVariables { - userId: string - password: string + userId: string; + password: string; } diff --git a/ui/src/Pages/SettingsPage/Users/__generated__/createUser.ts b/ui/src/Pages/SettingsPage/Users/__generated__/createUser.ts index cb25833..16111f8 100644 --- a/ui/src/Pages/SettingsPage/Users/__generated__/createUser.ts +++ b/ui/src/Pages/SettingsPage/Users/__generated__/createUser.ts @@ -8,17 +8,17 @@ // ==================================================== export interface createUser_createUser { - __typename: 'User' - id: string - username: string - admin: boolean + __typename: "User"; + id: string; + username: string; + admin: boolean; } export interface createUser { - createUser: createUser_createUser + createUser: createUser_createUser; } export interface createUserVariables { - username: string - admin: boolean + username: string; + admin: boolean; } diff --git a/ui/src/Pages/SettingsPage/Users/__generated__/deleteUser.ts b/ui/src/Pages/SettingsPage/Users/__generated__/deleteUser.ts index 4bd1512..7a42e6a 100644 --- a/ui/src/Pages/SettingsPage/Users/__generated__/deleteUser.ts +++ b/ui/src/Pages/SettingsPage/Users/__generated__/deleteUser.ts @@ -8,15 +8,15 @@ // ==================================================== export interface deleteUser_deleteUser { - __typename: 'User' - id: string - username: string + __typename: "User"; + id: string; + username: string; } export interface deleteUser { - deleteUser: deleteUser_deleteUser + deleteUser: deleteUser_deleteUser; } export interface deleteUserVariables { - id: string + id: string; } diff --git a/ui/src/Pages/SettingsPage/Users/__generated__/updateUser.ts b/ui/src/Pages/SettingsPage/Users/__generated__/updateUser.ts index e39f1fb..28752c4 100644 --- a/ui/src/Pages/SettingsPage/Users/__generated__/updateUser.ts +++ b/ui/src/Pages/SettingsPage/Users/__generated__/updateUser.ts @@ -8,18 +8,18 @@ // ==================================================== export interface updateUser_updateUser { - __typename: 'User' - id: string - username: string - admin: boolean + __typename: "User"; + id: string; + username: string; + admin: boolean; } export interface updateUser { - updateUser: updateUser_updateUser + updateUser: updateUser_updateUser; } export interface updateUserVariables { - id: string - username?: string | null - admin?: boolean | null + id: string; + username?: string | null; + admin?: boolean | null; } diff --git a/ui/src/Pages/SettingsPage/__generated__/changeUserPreferences.ts b/ui/src/Pages/SettingsPage/__generated__/changeUserPreferences.ts index bd0cd51..ef23398 100644 --- a/ui/src/Pages/SettingsPage/__generated__/changeUserPreferences.ts +++ b/ui/src/Pages/SettingsPage/__generated__/changeUserPreferences.ts @@ -3,22 +3,22 @@ // @generated // This file was automatically generated and should not be edited. -import { LanguageTranslation } from './../../../__generated__/globalTypes' +import { LanguageTranslation } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL mutation operation: changeUserPreferences // ==================================================== export interface changeUserPreferences_changeUserPreferences { - __typename: 'UserPreferences' - id: string - language: LanguageTranslation | null + __typename: "UserPreferences"; + id: string; + language: LanguageTranslation | null; } export interface changeUserPreferences { - changeUserPreferences: changeUserPreferences_changeUserPreferences + changeUserPreferences: changeUserPreferences_changeUserPreferences; } export interface changeUserPreferencesVariables { - language?: string | null + language?: string | null; } diff --git a/ui/src/Pages/SettingsPage/__generated__/myUserPreferences.ts b/ui/src/Pages/SettingsPage/__generated__/myUserPreferences.ts index 8617434..861e000 100644 --- a/ui/src/Pages/SettingsPage/__generated__/myUserPreferences.ts +++ b/ui/src/Pages/SettingsPage/__generated__/myUserPreferences.ts @@ -3,18 +3,18 @@ // @generated // This file was automatically generated and should not be edited. -import { LanguageTranslation } from './../../../__generated__/globalTypes' +import { LanguageTranslation } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: myUserPreferences // ==================================================== export interface myUserPreferences_myUserPreferences { - __typename: 'UserPreferences' - id: string - language: LanguageTranslation | null + __typename: "UserPreferences"; + id: string; + language: LanguageTranslation | null; } export interface myUserPreferences { - myUserPreferences: myUserPreferences_myUserPreferences + myUserPreferences: myUserPreferences_myUserPreferences; } diff --git a/ui/src/Pages/SharePage/__generated__/SharePageToken.ts b/ui/src/Pages/SharePage/__generated__/SharePageToken.ts index 3d31b1e..0891fc7 100644 --- a/ui/src/Pages/SharePage/__generated__/SharePageToken.ts +++ b/ui/src/Pages/SharePage/__generated__/SharePageToken.ts @@ -3,172 +3,172 @@ // @generated // This file was automatically generated and should not be edited. -import { MediaType } from './../../../__generated__/globalTypes' +import { MediaType } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: SharePageToken // ==================================================== export interface SharePageToken_shareToken_album { - __typename: 'Album' - id: string + __typename: "Album"; + id: string; } export interface SharePageToken_shareToken_media_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface SharePageToken_shareToken_media_downloads_mediaUrl { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; /** * The file size of the resource in bytes */ - fileSize: number + fileSize: number; } export interface SharePageToken_shareToken_media_downloads { - __typename: 'MediaDownload' - title: string - mediaUrl: SharePageToken_shareToken_media_downloads_mediaUrl + __typename: "MediaDownload"; + title: string; + mediaUrl: SharePageToken_shareToken_media_downloads_mediaUrl; } export interface SharePageToken_shareToken_media_highRes { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface SharePageToken_shareToken_media_videoWeb { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface SharePageToken_shareToken_media_exif { - __typename: 'MediaEXIF' - id: string + __typename: "MediaEXIF"; + id: string; /** * The model name of the camera */ - camera: string | null + camera: string | null; /** * The maker of the camera */ - maker: string | null + maker: string | null; /** * The name of the lens */ - lens: string | null - dateShot: any | null + lens: string | null; + dateShot: any | null; /** * The exposure time of the image */ - exposure: number | null + exposure: number | null; /** * The aperature stops of the image */ - aperture: number | null + aperture: number | null; /** * The ISO setting of the image */ - iso: number | null + iso: number | null; /** * The focal length of the lens, when the image was taken */ - focalLength: number | null + focalLength: number | null; /** * A formatted description of the flash settings, when the image was taken */ - flash: number | null + flash: number | null; /** * An index describing the mode for adjusting the exposure of the image */ - exposureProgram: number | null + exposureProgram: number | null; } export interface SharePageToken_shareToken_media { - __typename: 'Media' - id: string - title: string - type: MediaType + __typename: "Media"; + id: string; + title: string; + type: MediaType; /** * URL to display the media in a smaller resolution */ - thumbnail: SharePageToken_shareToken_media_thumbnail | null - downloads: SharePageToken_shareToken_media_downloads[] + thumbnail: SharePageToken_shareToken_media_thumbnail | null; + downloads: SharePageToken_shareToken_media_downloads[]; /** * URL to display the photo in full resolution, will be null for videos */ - highRes: SharePageToken_shareToken_media_highRes | null + highRes: SharePageToken_shareToken_media_highRes | null; /** * URL to get the video in a web format that can be played in the browser, will be null for photos */ - videoWeb: SharePageToken_shareToken_media_videoWeb | null - exif: SharePageToken_shareToken_media_exif | null + videoWeb: SharePageToken_shareToken_media_videoWeb | null; + exif: SharePageToken_shareToken_media_exif | null; } export interface SharePageToken_shareToken { - __typename: 'ShareToken' - token: string + __typename: "ShareToken"; + token: string; /** * The album this token shares */ - album: SharePageToken_shareToken_album | null + album: SharePageToken_shareToken_album | null; /** * The media this token shares */ - media: SharePageToken_shareToken_media | null + media: SharePageToken_shareToken_media | null; } export interface SharePageToken { - shareToken: SharePageToken_shareToken + shareToken: SharePageToken_shareToken; } export interface SharePageTokenVariables { - token: string - password?: string | null + token: string; + password?: string | null; } diff --git a/ui/src/Pages/SharePage/__generated__/shareAlbumQuery.ts b/ui/src/Pages/SharePage/__generated__/shareAlbumQuery.ts index fa6cb19..f65bdaa 100644 --- a/ui/src/Pages/SharePage/__generated__/shareAlbumQuery.ts +++ b/ui/src/Pages/SharePage/__generated__/shareAlbumQuery.ts @@ -3,179 +3,179 @@ // @generated // This file was automatically generated and should not be edited. -import { OrderDirection, MediaType } from './../../../__generated__/globalTypes' +import { OrderDirection, MediaType } from "./../../../__generated__/globalTypes"; // ==================================================== // GraphQL query operation: shareAlbumQuery // ==================================================== export interface shareAlbumQuery_album_subAlbums_thumbnail_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface shareAlbumQuery_album_subAlbums_thumbnail { - __typename: 'Media' - id: string + __typename: "Media"; + id: string; /** * URL to display the media in a smaller resolution */ - thumbnail: shareAlbumQuery_album_subAlbums_thumbnail_thumbnail | null + thumbnail: shareAlbumQuery_album_subAlbums_thumbnail_thumbnail | null; } export interface shareAlbumQuery_album_subAlbums { - __typename: 'Album' - id: string - title: string + __typename: "Album"; + id: string; + title: string; /** * An image in this album used for previewing this album */ - thumbnail: shareAlbumQuery_album_subAlbums_thumbnail | null + thumbnail: shareAlbumQuery_album_subAlbums_thumbnail | null; } export interface shareAlbumQuery_album_media_thumbnail { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface shareAlbumQuery_album_media_downloads_mediaUrl { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; /** * The file size of the resource in bytes */ - fileSize: number + fileSize: number; } export interface shareAlbumQuery_album_media_downloads { - __typename: 'MediaDownload' - title: string - mediaUrl: shareAlbumQuery_album_media_downloads_mediaUrl + __typename: "MediaDownload"; + title: string; + mediaUrl: shareAlbumQuery_album_media_downloads_mediaUrl; } export interface shareAlbumQuery_album_media_highRes { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; /** * Width of the image in pixels */ - width: number + width: number; /** * Height of the image in pixels */ - height: number + height: number; } export interface shareAlbumQuery_album_media_videoWeb { - __typename: 'MediaURL' + __typename: "MediaURL"; /** * URL for previewing the image */ - url: string + url: string; } export interface shareAlbumQuery_album_media_exif { - __typename: 'MediaEXIF' + __typename: "MediaEXIF"; /** * The model name of the camera */ - camera: string | null + camera: string | null; /** * The maker of the camera */ - maker: string | null + maker: string | null; /** * The name of the lens */ - lens: string | null - dateShot: any | null + lens: string | null; + dateShot: any | null; /** * The exposure time of the image */ - exposure: number | null + exposure: number | null; /** * The aperature stops of the image */ - aperture: number | null + aperture: number | null; /** * The ISO setting of the image */ - iso: number | null + iso: number | null; /** * The focal length of the lens, when the image was taken */ - focalLength: number | null + focalLength: number | null; /** * A formatted description of the flash settings, when the image was taken */ - flash: number | null + flash: number | null; /** * An index describing the mode for adjusting the exposure of the image */ - exposureProgram: number | null + exposureProgram: number | null; } export interface shareAlbumQuery_album_media { - __typename: 'Media' - id: string - title: string - type: MediaType + __typename: "Media"; + id: string; + title: string; + type: MediaType; /** * URL to display the media in a smaller resolution */ - thumbnail: shareAlbumQuery_album_media_thumbnail | null - downloads: shareAlbumQuery_album_media_downloads[] + thumbnail: shareAlbumQuery_album_media_thumbnail | null; + downloads: shareAlbumQuery_album_media_downloads[]; /** * URL to display the photo in full resolution, will be null for videos */ - highRes: shareAlbumQuery_album_media_highRes | null + highRes: shareAlbumQuery_album_media_highRes | null; /** * URL to get the video in a web format that can be played in the browser, will be null for photos */ - videoWeb: shareAlbumQuery_album_media_videoWeb | null - exif: shareAlbumQuery_album_media_exif | null + videoWeb: shareAlbumQuery_album_media_videoWeb | null; + exif: shareAlbumQuery_album_media_exif | null; } export interface shareAlbumQuery_album { - __typename: 'Album' - id: string - title: string + __typename: "Album"; + id: string; + title: string; /** * The albums contained in this album */ - subAlbums: shareAlbumQuery_album_subAlbums[] + subAlbums: shareAlbumQuery_album_subAlbums[]; /** * The media inside this album */ - media: shareAlbumQuery_album_media[] + media: shareAlbumQuery_album_media[]; } export interface shareAlbumQuery { @@ -183,15 +183,15 @@ export interface shareAlbumQuery { * Get album by id, user must own the album or be admin * If valid tokenCredentials are provided, the album may be retrived without further authentication */ - album: shareAlbumQuery_album + album: shareAlbumQuery_album; } export interface shareAlbumQueryVariables { - id: string - token: string - password?: string | null - mediaOrderBy?: string | null - mediaOrderDirection?: OrderDirection | null - limit?: number | null - offset?: number | null + id: string; + token: string; + password?: string | null; + mediaOrderBy?: string | null; + mediaOrderDirection?: OrderDirection | null; + limit?: number | null; + offset?: number | null; } diff --git a/ui/src/Pages/PhotosPage/PhotosPage.tsx b/ui/src/Pages/TimelinePage/TimelinePage.tsx similarity index 73% rename from ui/src/Pages/PhotosPage/PhotosPage.tsx rename to ui/src/Pages/TimelinePage/TimelinePage.tsx index 82e5e82..47f666c 100644 --- a/ui/src/Pages/PhotosPage/PhotosPage.tsx +++ b/ui/src/Pages/TimelinePage/TimelinePage.tsx @@ -1,18 +1,18 @@ import React from 'react' import Layout from '../../components/layout/Layout' -import TimelineGallery from '../../components/timelineGallery/TimelineGallery' import { useTranslation } from 'react-i18next' +import TimelineGallery from '../../components/timelineGallery/TimelineGallery' -const PhotosPage = () => { +const TimelinePage = () => { const { t } = useTranslation() return ( <> - + ) } -export default PhotosPage +export default TimelinePage diff --git a/ui/src/__generated__/globalTypes.ts b/ui/src/__generated__/globalTypes.ts index 7475227..ddf40c3 100644 --- a/ui/src/__generated__/globalTypes.ts +++ b/ui/src/__generated__/globalTypes.ts @@ -8,34 +8,34 @@ //============================================================== export enum LanguageTranslation { - Danish = 'Danish', - English = 'English', - French = 'French', - German = 'German', - Italian = 'Italian', - Polish = 'Polish', - Portuguese = 'Portuguese', - Russian = 'Russian', - SimplifiedChinese = 'SimplifiedChinese', - Spanish = 'Spanish', - Swedish = 'Swedish', - TraditionalChinese = 'TraditionalChinese', + Danish = "Danish", + English = "English", + French = "French", + German = "German", + Italian = "Italian", + Polish = "Polish", + Portuguese = "Portuguese", + Russian = "Russian", + SimplifiedChinese = "SimplifiedChinese", + Spanish = "Spanish", + Swedish = "Swedish", + TraditionalChinese = "TraditionalChinese", } export enum MediaType { - Photo = 'Photo', - Video = 'Video', + Photo = "Photo", + Video = "Video", } export enum NotificationType { - Close = 'Close', - Message = 'Message', - Progress = 'Progress', + Close = "Close", + Message = "Message", + Progress = "Progress", } export enum OrderDirection { - ASC = 'ASC', - DESC = 'DESC', + ASC = "ASC", + DESC = "DESC", } //============================================================== diff --git a/ui/src/__generated__/siteTranslation.ts b/ui/src/__generated__/siteTranslation.ts index f2175ab..66345d9 100644 --- a/ui/src/__generated__/siteTranslation.ts +++ b/ui/src/__generated__/siteTranslation.ts @@ -3,18 +3,18 @@ // @generated // This file was automatically generated and should not be edited. -import { LanguageTranslation } from './globalTypes' +import { LanguageTranslation } from "./globalTypes"; // ==================================================== // GraphQL query operation: siteTranslation // ==================================================== export interface siteTranslation_myUserPreferences { - __typename: 'UserPreferences' - id: string - language: LanguageTranslation | null + __typename: "UserPreferences"; + id: string; + language: LanguageTranslation | null; } export interface siteTranslation { - myUserPreferences: siteTranslation_myUserPreferences + myUserPreferences: siteTranslation_myUserPreferences; } diff --git a/ui/src/components/album/AlbumFilter.tsx b/ui/src/components/album/AlbumFilter.tsx index d76dedc..c010931 100644 --- a/ui/src/components/album/AlbumFilter.tsx +++ b/ui/src/components/album/AlbumFilter.tsx @@ -10,7 +10,7 @@ import { ReactComponent as DirectionIcon } from './icons/direction-arrow.svg' import Dropdown from '../../primitives/form/Dropdown' -type FavoriteCheckboxProps = { +export type FavoriteCheckboxProps = { onlyFavorites: boolean setOnlyFavorites(favorites: boolean): void } @@ -79,7 +79,7 @@ const SortingOptions = ({ setOrdering, ordering }: SortingOptionsProps) => {