mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add GET /api/v2/templatebuilder/bases endpoint (#26116)
Implement `GET /api/v2/templatebuilder/bases`, which returns the list of base templates available in the template builder. Reads from the bundled catalog by cross-referencing `templatebuilder.BaseTemplateIDs()` with `examples.List()`, enriching each entry with the OS from the `exampleID -> OS` map. The endpoint is gated behind the template builder feature flag (returns 404 when disabled) and requires `policy.ActionRead` on `rbac.ResourceTemplate`. Depends on #26115 > [!NOTE] > This PR was authored by Coder Agents on behalf of @jeremyruppel.
This commit is contained in:
Generated
+21
@@ -8151,6 +8151,27 @@ export type TemplateBuildTimeStats = Record<
|
||||
TransitionStats
|
||||
>;
|
||||
|
||||
// From codersdk/templatebuilder.go
|
||||
/**
|
||||
* TemplateBuilderBase is the API response type for a base template
|
||||
* returned by GET /api/v2/templatebuilder/bases.
|
||||
*/
|
||||
export interface TemplateBuilderBase {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description: string;
|
||||
readonly icon: string;
|
||||
readonly os: string;
|
||||
}
|
||||
|
||||
// From codersdk/templatebuilder.go
|
||||
/**
|
||||
* TemplateBuilderBasesResponse is the response body for listing template builder bases.
|
||||
*/
|
||||
export interface TemplateBuilderBasesResponse {
|
||||
readonly bases: readonly TemplateBuilderBase[];
|
||||
}
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export interface TemplateBuilderConfig {
|
||||
readonly disabled?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user