8000 chore: switch to generated types by code-asher · Pull Request #1394 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: switch to generated types #1394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 12, 2022
Prev Previous commit
Next Next commit
Delete handwritten types
Except for UserAgent which seems to be purely frontend and
ReconnectingPTYRequest which is not in codersdk so I am just leaving it
for now.
  • Loading branch information
code-asher committed May 11, 2022
commit 609e6a286967ecce336b84dfa517c693357256b4
111 changes: 0 additions & 111 deletions site/src/api/types.ts
534F
Original file line number Diff line number Diff line change
@@ -1,121 +1,10 @@
/**
* `BuildInfoResponse` must be kept in sync with the go struct in buildinfo.go.
*/
export interface BuildInfoResponse {
external_url: string
version: string
}

export interface LoginResponse {
session_token: string
}

export interface CreateUserRequest {
username: string
email: string
password: string
organization_id: string
}

export interface UserResponse {
readonly id: string
readonly username: string
readonly email: string
readonly created_at: string
readonly status: "active" | "suspended"
readonly organization_ids: string[]
readonly roles: { name: string; display_name: string }[]
}

/**
* `Organization` must be kept in sync with the go struct in organizations.go
*/
export interface Organization {
id: string
name: string
created_at: string
updated_at: string
}

export interface Provisioner {
id: string
name: string
}

// This must be kept in sync with the `Template` struct in the back-end
export interface Template {
id: string
created_at: string
updated_at: string
organization_id: string
name: string
provisioner: string
active_version_id: string
}

export interface CreateTemplateRequest {
name: string
organizationId: string
provisioner: string
}

export interface CreateWorkspaceRequest {
name: string
template_id: string
organization_id: string
}

export interface WorkspaceBuild {
id: string
}

export interface Workspace {
id: string
created_at: string
updated_at: string
owner_id: string
template_id: string
name: string
autostart_schedule: string
autostop_schedule: string
latest_build: WorkspaceBuild
}

export interface WorkspaceResource {
id: string
agents?: WorkspaceAgent[]
}

export interface WorkspaceAgent {
id: string
name: string
operating_system: string
}

export interface APIKeyResponse {
key: string
}

export interface UserAgent {
readonly browser: string
readonly device: string
readonly ip_address: string
readonly os: string
}

export interface WorkspaceAutostartRequest {
schedule: string
}

export interface WorkspaceAutostopRequest {
schedule: string
}

export interface UpdateProfileRequest {
readonly username: string
readonly email: string
}

export interface ReconnectingPTYRequest {
readonly data?: string
readonly height?: number
Expand Down
0