From fb6b05293a4ea82ea4bf54b3538694260189a304 Mon Sep 17 00:00:00 2001 From: Plural Bot Date: Fri, 2 Dec 2022 10:19:59 +0000 Subject: [PATCH] fix(gqlclient): Update GraphQL Schema Signed-off-by: Plural Bot --- client.go | 388 +++++++++++++++++++++++++------------------------- models_gen.go | 53 ++++++- 2 files changed, 243 insertions(+), 198 deletions(-) diff --git a/client.go b/client.go index e05bbe6..dcc18fe 100644 --- a/client.go +++ b/client.go @@ -1456,19 +1456,6 @@ const GetInstallationByIDDocument = `query GetInstallationById ($id: ID) { ... InstallationFragment } } -fragment InstallationFragment on Installation { - id - context - licenseKey - acmeKeyId - acmeSecret - repository { - ... RepositoryFragment - } - oidcProvider { - ... OIDCProvider - } -} fragment RepositoryFragment on Repository { id name @@ -1506,6 +1493,19 @@ fragment OIDCProvider on OidcProvider { userinfoEndpoint } } +fragment InstallationFragment on Installation { + id + context + licenseKey + acmeKeyId + acmeSecret + repository { + ... RepositoryFragment + } + oidcProvider { + ... OIDCProvider + } +} ` func (c *Client) GetInstallationByID(ctx context.Context, id *string, httpRequestOptions ...client.HTTPRequestOption) (*GetInstallationByID, error) { @@ -1658,60 +1658,6 @@ const GetRecipeDocument = `query GetRecipe ($repo: String, $name: String) { } } } -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - optional - version - } - breaking - instructions { - instructions - script - } - wait - application - providers - secrets - wirings { - terraform - helm - } - providerWirings - outputs - providerVsn -} -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value - } - validation { - type - regex - message - } -} fragment RecipeFragment on Recipe { id name @@ -1787,6 +1733,60 @@ fragment ChartFragment on Chart { description latestVersion } +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} +fragment DependenciesFragment on Dependencies { + dependencies { + type + name + repo + optional + version + } + breaking + instructions { + instructions + script + } + wait + application + providers + secrets + wirings { + terraform + helm + } + providerWirings + outputs + providerVsn +} +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value + } + validation { + type + regex + message + } +} ` func (c *Client) GetRecipe(ctx context.Context, repo *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipe, error) { @@ -1966,6 +1966,24 @@ const ListAllRecipesDocument = `query ListAllRecipes ($repo: String) { } } } +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment + } + terraform { + ... TerraformFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment ChartFragment on Chart { + id + name + description + latestVersion +} fragment TerraformFragment on Terraform { id name @@ -2077,24 +2095,6 @@ fragment RepositoryFragment on Repository { name } } -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment - } - terraform { - ... TerraformFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment ChartFragment on Chart { - id - name - description - latestVersion -} ` func (c *Client) ListAllRecipes(ctx context.Context, repo *string, httpRequestOptions ...client.HTTPRequestOption) (*ListAllRecipes, error) { @@ -2176,11 +2176,45 @@ const GetStackDocument = `query GetStack ($name: String!, $provider: Provider!) ... StackFragment } } -fragment ChartFragment on Chart { +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value + } + validation { + type + regex + message + } +} +fragment StackFragment on Stack { id name + featured description - latestVersion + bundles { + ... RecipeFragment + } +} +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment + } + terraform { + ... TerraformFragment + } + configuration { + ... RecipeConfigurationFragment + } } fragment TerraformFragment on Terraform { id @@ -2217,46 +2251,6 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value - } - validation { - type - regex - message - } -} -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment - } - terraform { - ... TerraformFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment StackFragment on Stack { - id - name - featured - description - bundles { - ... RecipeFragment - } -} fragment RecipeFragment on Recipe { id name @@ -2314,6 +2308,12 @@ fragment RepositoryFragment on Repository { name } } +fragment ChartFragment on Chart { + id + name + description + latestVersion +} ` func (c *Client) GetStack(ctx context.Context, name string, provider Provider, httpRequestOptions ...client.HTTPRequestOption) (*GetStack, error) { @@ -2370,18 +2370,16 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment } - recipes { - name + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment } } fragment TerraformFragment on Terraform { @@ -2394,24 +2392,30 @@ fragment TerraformFragment on Terraform { } valuesTemplate } -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value - } - validation { +fragment DependenciesFragment on Dependencies { + dependencies { type - regex - message + name + repo + optional + version } + breaking + instructions { + instructions + script + } + wait + application + providers + secrets + wirings { + terraform + helm + } + providerWirings + outputs + providerVsn } fragment StackFragment on Stack { id @@ -2422,16 +2426,18 @@ fragment StackFragment on Stack { ... RecipeFragment } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment - } - recipeItems { - ... RecipeItemFragment +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name } - configuration { - ... RecipeConfigurationFragment + recipes { + name } } fragment RecipeItemFragment on RecipeItem { @@ -2452,30 +2458,24 @@ fragment ChartFragment on Chart { description latestVersion } -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - optional - version - } - breaking - instructions { - instructions - script +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value } - wait - application - providers - secrets - wirings { - terraform - helm + validation { + type + regex + message } - providerWirings - outputs - providerVsn } ` @@ -2914,6 +2914,15 @@ const GetTerraformInstallationsDocument = `query GetTerraformInstallations ($id: } } } +fragment TerraformInstallationFragment on TerraformInstallation { + id + terraform { + ... TerraformFragment + } + version { + ... VersionFragment + } +} fragment TerraformFragment on Terraform { id name @@ -2967,15 +2976,6 @@ fragment CrdFragment on Crd { name blob } -fragment TerraformInstallationFragment on TerraformInstallation { - id - terraform { - ... TerraformFragment - } - version { - ... VersionFragment - } -} ` func (c *Client) GetTerraformInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetTerraformInstallations, error) { diff --git a/models_gen.go b/models_gen.go index 25ed6f9..65c993f 100644 --- a/models_gen.go +++ b/models_gen.go @@ -2225,6 +2225,7 @@ type UserEventAttributes struct { Status *UserEventStatus `json:"status,omitempty"` } +// The version of a package. type Version struct { Chart *Chart `json:"chart"` Crds []*Crd `json:"crds"` @@ -2237,10 +2238,12 @@ type Version struct { Readme *string `json:"readme"` Scan *PackageScan `json:"scan"` Tags []*VersionTag `json:"tags"` - Terraform *Terraform `json:"terraform"` - UpdatedAt *string `json:"updatedAt"` - ValuesTemplate *string `json:"valuesTemplate"` - Version string `json:"version"` + // The template engine used to render the valuesTemplate. + TemplateType *TemplateType `json:"templateType"` + Terraform *Terraform `json:"terraform"` + UpdatedAt *string `json:"updatedAt"` + ValuesTemplate *string `json:"valuesTemplate"` + Version string `json:"version"` } type VersionAttributes struct { @@ -3974,6 +3977,48 @@ func (e TagGroup) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +// Template engines that can be used at build time. +type TemplateType string + +const ( + TemplateTypeGotemplate TemplateType = "GOTEMPLATE" + TemplateTypeLua TemplateType = "LUA" +) + +var AllTemplateType = []TemplateType{ + TemplateTypeGotemplate, + TemplateTypeLua, +} + +func (e TemplateType) IsValid() bool { + switch e { + case TemplateTypeGotemplate, TemplateTypeLua: + return true + } + return false +} + +func (e TemplateType) String() string { + return string(e) +} + +func (e *TemplateType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = TemplateType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid TemplateType", str) + } + return nil +} + +func (e TemplateType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type TestStatus string const (