@@ -4,17 +4,17 @@ package api
44import (
55 "time"
66
7- "github.com/n1rna/ee-cli/internal/schema "
7+ "github.com/n1rna/ee-cli/internal/entities "
88)
99
10- // ConvertSchemaFromAPI converts API Schema to local schema .Schema
11- func ConvertSchemaFromAPI (apiSchema * Schema ) * schema .Schema {
10+ // ConvertSchemaFromAPI converts API Schema to local entities .Schema
11+ func ConvertSchemaFromAPI (apiSchema * Schema ) * entities .Schema {
1212 if apiSchema == nil {
1313 return nil
1414 }
1515
16- localSchema := & schema .Schema {
17- Entity : schema .Entity {
16+ localSchema := & entities .Schema {
17+ Entity : entities .Entity {
1818 ID : apiSchema .GUID , // Use GUID as ID for local storage
1919 Name : apiSchema .Name ,
2020 Description : apiSchema .Description ,
@@ -23,13 +23,13 @@ func ConvertSchemaFromAPI(apiSchema *Schema) *schema.Schema {
2323 CreatedAt : apiSchema .CreatedAt .Time (),
2424 UpdatedAt : apiSchema .UpdatedAt .Time (),
2525 },
26- Variables : make ([]schema .Variable , len (apiSchema .Variables )),
26+ Variables : make ([]entities .Variable , len (apiSchema .Variables )),
2727 Extends : apiSchema .Extends ,
2828 }
2929
3030 // Convert variables
3131 for i , apiVar := range apiSchema .Variables {
32- localSchema .Variables [i ] = schema .Variable {
32+ localSchema .Variables [i ] = entities .Variable {
3333 Name : apiVar .Name ,
3434 Type : apiVar .Type ,
3535 Regex : apiVar .Regex ,
@@ -41,8 +41,8 @@ func ConvertSchemaFromAPI(apiSchema *Schema) *schema.Schema {
4141 return localSchema
4242}
4343
44- // ConvertSchemaToAPI converts local schema .Schema to API Schema
45- func ConvertSchemaToAPI (localSchema * schema .Schema ) * Schema {
44+ // ConvertSchemaToAPI converts local entities .Schema to API Schema
45+ func ConvertSchemaToAPI (localSchema * entities .Schema ) * Schema {
4646 if localSchema == nil {
4747 return nil
4848 }
@@ -70,14 +70,14 @@ func ConvertSchemaToAPI(localSchema *schema.Schema) *Schema {
7070 return apiSchema
7171}
7272
73- // ConvertProjectFromAPI converts API Project to local schema .Project
74- func ConvertProjectFromAPI (apiProject * Project ) * schema .Project {
73+ // ConvertProjectFromAPI converts API Project to local entities .Project
74+ func ConvertProjectFromAPI (apiProject * Project ) * entities .Project {
7575 if apiProject == nil {
7676 return nil
7777 }
7878
79- localProject := & schema .Project {
80- Entity : schema .Entity {
79+ localProject := & entities .Project {
80+ Entity : entities .Entity {
8181 ID : apiProject .GUID , // Use GUID as ID for local storage
8282 Name : apiProject .Name ,
8383 Description : apiProject .Description ,
@@ -86,7 +86,7 @@ func ConvertProjectFromAPI(apiProject *Project) *schema.Project {
8686 CreatedAt : apiProject .CreatedAt .Time (),
8787 UpdatedAt : apiProject .UpdatedAt .Time (),
8888 },
89- Environments : make (map [string ]schema .Environment ), // Will be populated separately
89+ Environments : make (map [string ]entities .Environment ), // Will be populated separately
9090 }
9191
9292 // Schema will be resolved separately if needed
@@ -98,8 +98,8 @@ func ConvertProjectFromAPI(apiProject *Project) *schema.Project {
9898 return localProject
9999}
100100
101- // ConvertProjectToAPI converts local schema .Project to API Project
102- func ConvertProjectToAPI (localProject * schema .Project ) * Project {
101+ // ConvertProjectToAPI converts local entities .Project to API Project
102+ func ConvertProjectToAPI (localProject * entities .Project ) * Project {
103103 if localProject == nil {
104104 return nil
105105 }
@@ -118,14 +118,14 @@ func ConvertProjectToAPI(localProject *schema.Project) *Project {
118118 return apiProject
119119}
120120
121- // ConvertConfigSheetFromAPI converts API ConfigSheet to local schema .ConfigSheet
122- func ConvertConfigSheetFromAPI (apiConfigSheet * ConfigSheet ) * schema .ConfigSheet {
121+ // ConvertConfigSheetFromAPI converts API ConfigSheet to local entities .ConfigSheet
122+ func ConvertConfigSheetFromAPI (apiConfigSheet * ConfigSheet ) * entities .ConfigSheet {
123123 if apiConfigSheet == nil {
124124 return nil
125125 }
126126
127- localConfigSheet := & schema .ConfigSheet {
128- Entity : schema .Entity {
127+ localConfigSheet := & entities .ConfigSheet {
128+ Entity : entities .Entity {
129129 ID : apiConfigSheet .GUID , // Use GUID as ID for local storage
130130 Name : apiConfigSheet .Name ,
131131 Description : apiConfigSheet .Description ,
@@ -137,15 +137,15 @@ func ConvertConfigSheetFromAPI(apiConfigSheet *ConfigSheet) *schema.ConfigSheet
137137 Values : apiConfigSheet .Variables , // API uses 'variables', local uses 'values'
138138 Extends : apiConfigSheet .Extends ,
139139 // Schema will need to be set by caller based on schema reference
140- Schema : schema .SchemaReference {}, // Empty for now
140+ Schema : entities .SchemaReference {}, // Empty for now
141141 }
142142
143143 return localConfigSheet
144144}
145145
146- // ConvertConfigSheetToAPI converts local schema .ConfigSheet to API ConfigSheet
146+ // ConvertConfigSheetToAPI converts local entities .ConfigSheet to API ConfigSheet
147147func ConvertConfigSheetToAPI (
148- localConfigSheet * schema .ConfigSheet ,
148+ localConfigSheet * entities .ConfigSheet ,
149149 projectGUID , schemaGUID string ,
150150) * ConfigSheet {
151151 if localConfigSheet == nil {
0 commit comments