chore: generate countries.tsx from Go code (#15274)

Closes https://github.com/coder/coder/issues/15074

We have a hard-coded list of countries at
https://github.com/coder/coder/blob/main/site/src/pages/SetupPage/countries.tsx.
This means Go code in coder/coder doesn't have an easy way of utilizing
it.

## Solution
Generate countries.tsx from Go code. Generated by `scripts/apitypings`
This commit is contained in:
Joobi S B
2024-11-15 23:35:21 +05:30
committed by GitHub
parent aea6208515
commit 4cb807670d
15 changed files with 1348 additions and 1051 deletions
+30
View File
@@ -0,0 +1,30 @@
// Code generated by typegen/main.go. DO NOT EDIT.
package codersdk
type RBACResource string
const (
{{- range $element := . }}
Resource{{ pascalCaseName $element.FunctionName }} RBACResource = "{{ $element.Type }}"
{{- end }}
)
type RBACAction string
const (
{{- range $element := actionsList }}
{{ $element.Enum }} RBACAction = "{{ $element.Value }}"
{{- end }}
)
// RBACResourceActions is the mapping of resources to which actions are valid for
// said resource type.
var RBACResourceActions = map[RBACResource][]RBACAction{
{{- range $element := . }}
Resource{{ pascalCaseName $element.FunctionName }}: {
{{- range $actionValue, $_ := $element.Actions }}
{{- actionEnum $actionValue -}},
{{- end -}}
},
{{- end }}
}