Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/muesli/reflow v0.3.0
github.com/oapi-codegen/oapi-codegen/v2 v2.7.1
github.com/oapi-codegen/runtime v1.1.2
github.com/oapi-codegen/runtime v1.4.2
github.com/pelletier/go-toml/v2 v2.4.3
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/pkg/errors v0.9.1
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
github.com/oapi-codegen/oapi-codegen/v2 v2.7.1 h1:a7Ab7YlpqkVG5HKrTaeFstm32Z5QOnyjnbsCO0jiMYM=
github.com/oapi-codegen/oapi-codegen/v2 v2.7.1/go.mod h1:qzFy6iuobJw/hD1aRILee4G87/ShmhR0xYCwcUtZMCw=
github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI=
github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/oapi-codegen/runtime v1.4.2 h1:GMxFVYLzoYLua+/KvzgSphkyK1lLTReQI9Vf4hvATKE=
github.com/oapi-codegen/runtime v1.4.2/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY=
github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU=
github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw=
Expand Down
2 changes: 2 additions & 0 deletions internal/dev_server/api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ paths:
- $ref: "#/components/parameters/projectKey"
- $ref: "#/components/parameters/projectExpand"
requestBody:
required: true
content:
application/json:
schema:
Expand Down Expand Up @@ -94,6 +95,7 @@ paths:
- $ref: "#/components/parameters/projectKey"
- $ref: "#/components/parameters/projectExpand"
requestBody:
required: true
content:
application/json:
schema:
Expand Down
8 changes: 4 additions & 4 deletions internal/dev_server/api/data_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ func availableVariationsToResponseFormat(availableVariations map[string][]model.
respVariationsForFlag := make([]Variation, 0, len(variationsForFlag))
for _, variation := range variationsForFlag {
respVariationsForFlag = append(respVariationsForFlag, Variation{
Id: variation.Id,
Description: variation.Description,
Name: variation.Name,
Value: variation.Value,
UnderscoreId: variation.Id,
Description: variation.Description,
Name: variation.Name,
Value: variation.Value,
})
}
respAvailableVariations[flagKey] = respVariationsForFlag
Expand Down
8 changes: 4 additions & 4 deletions internal/dev_server/api/get_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ func (s server) GetProject(ctx context.Context, request GetProjectRequestObject)
}

response := ProjectJSONResponse{
LastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
UnderscoreLastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
}

if request.Params.Expand != nil {
Expand Down
8 changes: 4 additions & 4 deletions internal/dev_server/api/patch_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func (s server) PatchProject(ctx context.Context, request PatchProjectRequestObj
}

response := ProjectJSONResponse{
LastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
UnderscoreLastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
}

if request.Params.Expand != nil {
Expand Down
8 changes: 4 additions & 4 deletions internal/dev_server/api/post_add_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func (s server) PostAddProject(ctx context.Context, request PostAddProjectReques
}

response := ProjectJSONResponse{
LastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
UnderscoreLastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
}

if request.Params.Expand != nil {
Expand Down
10 changes: 5 additions & 5 deletions internal/dev_server/api/post_import_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s server) PostImportProject(ctx context.Context, request PostImportProject
for flagKey, vars := range *request.Body.AvailableVariations {
for _, v := range vars {
variations[flagKey] = append(variations[flagKey], model.ImportVariation{
Id: v.Id,
Id: v.UnderscoreId,
Name: v.Name,
Description: v.Description,
Value: v.Value,
Expand Down Expand Up @@ -72,10 +72,10 @@ func (s server) PostImportProject(ctx context.Context, request PostImportProject
}

response := ProjectJSONResponse{
LastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
UnderscoreLastSyncedFromSource: project.LastSyncTime.Unix(),
Context: project.Context,
SourceEnvironmentKey: project.SourceEnvironmentKey,
FlagsState: &project.AllFlagsState,
}

return PostImportProject201JSONResponse{response}, nil
Expand Down
Loading
Loading