- Notifications
You must be signed in to change notification settings - Fork1k
chore: remove coder/preview dependency from codersdk#17939
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
`go list -deps github.com/coder/coder/v2/codersdk | grep preview`
const ( | ||
ParameterFormTypeDefaultParameterFormType="" | ||
ParameterFormTypeRadioParameterFormType="radio" | ||
ParameterFormTypeSliderParameterFormType="slider" | ||
ParameterFormTypeInputParameterFormType="input" | ||
ParameterFormTypeDropdownParameterFormType="dropdown" | ||
ParameterFormTypeCheckboxParameterFormType="checkbox" | ||
ParameterFormTypeSwitchParameterFormType="switch" | ||
ParameterFormTypeMultiSelectParameterFormType="multi-select" | ||
ParameterFormTypeTagSelectParameterFormType="tag-select" | ||
ParameterFormTypeTextAreaParameterFormType="textarea" | ||
ParameterFormTypeErrorParameterFormType="error" | ||
) | ||
typeOptionType=string | ||
const ( | ||
OptionTypeStringOptionType="string" | ||
OptionTypeNumberOptionType="number" | ||
OptionTypeBooleanOptionType="bool" | ||
OptionTypeListStringOptionType="list(string)" | ||
) | ||
typeDiagnosticSeverityStringstring | ||
const ( | ||
DiagnosticSeverityErrorDiagnosticSeverityString="error" | ||
DiagnosticSeverityWarningDiagnosticSeverityString="warning" | ||
) | ||
// FriendlyDiagnostic == previewtypes.FriendlyDiagnostic | ||
// Copied to avoid import deps | ||
typeFriendlyDiagnosticstruct { | ||
SeverityDiagnosticSeverityString`json:"severity"` | ||
Summarystring`json:"summary"` | ||
Detailstring`json:"detail"` | ||
ExtraDiagnosticExtra`json:"extra"` | ||
} | ||
typeDiagnosticExtrastruct { | ||
Codestring`json:"code"` | ||
} | ||
// NullHCLString == `previewtypes.NullHCLString`. | ||
typeNullHCLStringstruct { | ||
Valuestring`json:"value"` | ||
Validbool`json:"valid"` | ||
} | ||
typeParameterstruct { | ||
ParameterData | ||
ValueNullHCLString`json:"value"` | ||
Diagnostics []FriendlyDiagnostic`json:"diagnostics"` | ||
} | ||
typeParameterDatastruct { | ||
Namestring`json:"name"` | ||
DisplayNamestring`json:"display_name"` | ||
Descriptionstring`json:"description"` | ||
TypeOptionType`json:"type"` | ||
FormTypeParameterFormType`json:"form_type"` | ||
StylingParameterStyling`json:"styling"` | ||
Mutablebool`json:"mutable"` | ||
DefaultValueNullHCLString`json:"default_value"` | ||
Iconstring`json:"icon"` | ||
Options []ParameterOption`json:"options"` | ||
Validations []ParameterValidation`json:"validations"` | ||
Requiredbool`json:"required"` | ||
// legacy_variable_name was removed (= 14) | ||
Orderint64`json:"order"` | ||
Ephemeralbool`json:"ephemeral"` | ||
} | ||
typeParameterStylingstruct { | ||
Placeholder*string`json:"placeholder,omitempty"` | ||
Disabled*bool`json:"disabled,omitempty"` | ||
Label*string`json:"label,omitempty"` | ||
} | ||
typeParameterOptionstruct { | ||
Namestring`json:"name"` | ||
Descriptionstring`json:"description"` | ||
ValueNullHCLString`json:"value"` | ||
Iconstring`json:"icon"` | ||
} | ||
typeParameterValidationstruct { | ||
Errorstring`json:"validation_error"` | ||
// All validation attributes are optional. | ||
Regex*string`json:"validation_regex"` | ||
Min*int64`json:"validation_min"` | ||
Max*int64`json:"validation_max"` | ||
Monotonic*string`json:"validation_monotonic"` | ||
} | ||
typeDynamicParametersRequeststruct { | ||
// ID identifies the request. The response contains the same | ||
// ID so that the client can match it to the request. | ||
IDint`json:"id"` | ||
Inputsmap[string]string`json:"inputs"` | ||
} | ||
typeDynamicParametersResponsestruct { | ||
IDint`json:"id"` | ||
Diagnostics []FriendlyDiagnostic`json:"diagnostics"` | ||
Parameters []Parameter`json:"parameters"` | ||
// TODO: Workspace tags | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We should have aguts
like equivalent tool to "copy" types from other packages.
This is always unfortunate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks!
a3acf54
to1a6eeae
Comparea123900
intomainUh oh!
There was an error while loading.Please reload this page.
No description provided.