@@ -4,11 +4,12 @@ package api
44
55// LoginStartResponse represents the response from POST /login/start
66type LoginStartResponse struct {
7- DeviceCode string `json:"device_code"`
8- UserCode string `json:"user_code"`
9- VerificationURI string `json:"verification_uri"`
10- ExpiresIn int `json:"expires_in"`
11- Interval int `json:"interval"`
7+ Error * AppErrorDetail `json:"error,omitempty"`
8+ DeviceCode string `json:"device_code,omitempty"`
9+ UserCode string `json:"user_code,omitempty"`
10+ VerificationURI string `json:"verification_uri,omitempty"`
11+ ExpiresIn int `json:"expires_in,omitempty"`
12+ Interval int `json:"interval,omitempty"`
1213}
1314
1415// LoginPollRequest represents the request body for POST /login/poll
@@ -18,22 +19,19 @@ type LoginPollRequest struct {
1819
1920// LoginPollResponse represents the response from POST /login/poll
2021type LoginPollResponse struct {
21- // Pending state
22- Error string `json:"error,omitempty"`
23- ErrorDescription string `json:"error_description,omitempty"`
24-
25- // Success state
26- AccessToken string `json:"access_token,omitempty"`
27- TokenType string `json:"token_type,omitempty"`
28- ExpiresIn int `json:"expires_in,omitempty"`
22+ Error * AppErrorDetail `json:"error,omitempty"`
23+ AccessToken string `json:"access_token,omitempty"`
24+ TokenType string `json:"token_type,omitempty"`
25+ ExpiresIn int `json:"expires_in,omitempty"`
2926}
3027
3128// VerifyTokenResponse represents the response from GET /verify
3229type VerifyTokenResponse struct {
33- Active bool `json:"active"`
34- UserID string `json:"user_id"`
35- Email string `json:"email"`
36- Exp int64 `json:"exp"`
30+ Error * AppErrorDetail `json:"error,omitempty"`
31+ Active bool `json:"active,omitempty"`
32+ UserID string `json:"user_id,omitempty"`
33+ Email string `json:"email,omitempty"`
34+ Exp int64 `json:"exp,omitempty"`
3735}
3836
3937// --- Organization structs ---
@@ -46,7 +44,8 @@ type Organization struct {
4644
4745// OrganizationsResponse represents the response from GET /organizations
4846type OrganizationsResponse struct {
49- Organizations []Organization `json:"organizations"`
47+ Error * AppErrorDetail `json:"error,omitempty"`
48+ Organizations []Organization `json:"organizations,omitempty"`
5049}
5150
5251// --- Application structs ---
@@ -60,10 +59,11 @@ type CreateApplicationRequest struct {
6059
6160// CreateApplicationResponse represents the response from POST /applications
6261type CreateApplicationResponse struct {
63- ApplicationID string `json:"applicationId"`
64- RepositoryName string `json:"repositoryName"`
65- CloneURLSSH string `json:"cloneUrlSsh"`
66- CloneURLHTTPS string `json:"cloneUrlHttps"`
62+ Error * AppErrorDetail `json:"error,omitempty"`
63+ ApplicationID string `json:"applicationId,omitempty"`
64+ RepositoryName string `json:"repositoryName,omitempty"`
65+ CloneURLSSH string `json:"cloneUrlSsh,omitempty"`
66+ CloneURLHTTPS string `json:"cloneUrlHttps,omitempty"`
6767}
6868
6969// GetApplicationByRepoRequest represents the request body for GET /application/from-repo
@@ -74,7 +74,8 @@ type GetApplicationByRepoRequest struct {
7474
7575// GetApplicationByRepoResponse represents the response from GET /application/from-repo
7676type GetApplicationByRepoResponse struct {
77- ApplicationID string `json:"applicationId"`
77+ Error * AppErrorDetail `json:"error,omitempty"`
78+ ApplicationID string `json:"applicationId,omitempty"`
7879}
7980
8081// GetApplicationEnvRequest represents the request body for POST /application/env
@@ -85,7 +86,8 @@ type GetApplicationEnvRequest struct {
8586
8687// GetApplicationEnvResponse represents the response from POST /application/env
8788type GetApplicationEnvResponse struct {
88- EnvVars map [string ]string `json:"envVars"`
89+ Error * AppErrorDetail `json:"error,omitempty"`
90+ EnvVars map [string ]string `json:"envVars,omitempty"`
8991}
9092
9193// ResourceItem represents a single resource
@@ -97,7 +99,8 @@ type ResourceItem struct {
9799
98100// GetApplicationResourcesResponse represents the response from GET /applications/:applicationId/resources
99101type GetApplicationResourcesResponse struct {
100- Resources []ResourceItem `json:"resources"`
102+ Error * AppErrorDetail `json:"error,omitempty"`
103+ Resources []ResourceItem `json:"resources,omitempty"`
101104}
102105
103106// CreateApplicationVersionRequest represents the request body for POST /applications/versions
@@ -107,7 +110,8 @@ type CreateApplicationVersionRequest struct {
107110
108111// CreateApplicationVersionResponse represents the response from POST /applications/versions
109112type CreateApplicationVersionResponse struct {
110- VersionID string `json:"versionId"`
113+ Error * AppErrorDetail `json:"error,omitempty"`
114+ VersionID string `json:"versionId,omitempty"`
111115}
112116
113117// ApplicationItem represents a single application in the list
@@ -126,7 +130,8 @@ type GetOrganizationApplicationsRequest struct {
126130
127131// GetOrganizationApplicationsResponse represents the response from POST /organizations/applications
128132type GetOrganizationApplicationsResponse struct {
129- Applications []ApplicationItem `json:"applications"`
133+ Error * AppErrorDetail `json:"error,omitempty"`
134+ Applications []ApplicationItem `json:"applications,omitempty"`
130135}
131136
132137// AddGithubCollaboratorsRequest represents the request body for POST /applications/add-gh-collaborators
@@ -137,6 +142,21 @@ type AddGithubCollaboratorsRequest struct {
137142
138143// AddGithubCollaboratorsResponse represents the response from POST /applications/add-gh-collaborators
139144type AddGithubCollaboratorsResponse struct {
140- Success bool `json:"success"`
141- Message string `json:"message,omitempty"`
145+ Error * AppErrorDetail `json:"error,omitempty"`
146+ Success bool `json:"success,omitempty"`
147+ Message string `json:"message,omitempty"`
148+ }
149+
150+ // --- Version Check structs ---
151+
152+ // CheckVersionResponse represents the response from GET /version/check
153+ type CheckVersionResponse struct {
154+ Error * AppErrorDetail `json:"error,omitempty"`
155+ ForceUpgrade bool `json:"forceUpgrade,omitempty"`
156+ CanUpgrade bool `json:"canUpgrade,omitempty"`
157+ LatestVersion * string `json:"latestVersion,omitempty"`
158+ }
159+
160+ type VersionCheckRequest struct {
161+ Version string `json:"version"`
142162}
0 commit comments