diff --git a/client.go b/client.go index 5735abf..6cea6ee 100644 --- a/client.go +++ b/client.go @@ -1105,44 +1105,6 @@ const GetPackageInstallationsDocument = `query GetPackageInstallations ($id: ID! } } } -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 VersionFragment on Version { - id - readme - version - valuesTemplate - package - crds { - ... CrdFragment - } - dependencies { - ... DependenciesFragment - } -} fragment CrdFragment on Crd { id name @@ -1185,6 +1147,44 @@ fragment ChartFragment on Chart { description latestVersion } +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 VersionFragment on Version { + id + readme + version + valuesTemplate + package + crds { + ... CrdFragment + } + dependencies { + ... DependenciesFragment + } +} ` func (c *Client) GetPackageInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetPackageInstallations, error) { @@ -1518,6 +1518,20 @@ const GetInstallationsDocument = `query GetInstallations { } } } +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name + } +} fragment OIDCProvider on OidcProvider { id clientId @@ -1554,20 +1568,6 @@ fragment InstallationFragment on Installation { ... OIDCProvider } } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} ` func (c *Client) GetInstallations(ctx context.Context, httpRequestOptions ...client.HTTPRequestOption) (*GetInstallations, error) { @@ -1646,6 +1646,22 @@ const GetRecipeDocument = `query GetRecipe ($repo: String, $name: String) { } } } +fragment ChartFragment on Chart { + id + name + description + latestVersion +} +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} fragment DependenciesFragment on Dependencies { dependencies { type @@ -1759,22 +1775,6 @@ fragment RecipeItemFragment on RecipeItem { ... RecipeConfigurationFragment } } -fragment ChartFragment on Chart { - id - name - description - latestVersion -} -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} ` func (c *Client) GetRecipe(ctx context.Context, repo *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipe, error) { @@ -1800,6 +1800,56 @@ const ListRecipesDocument = `query ListRecipes ($repo: String, $provider: Provid } } } +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 + description + restricted + provider + tests { + type + name + message + args { + name + repo + key + } + } + repository { + id + name + } + oidcSettings { + uriFormat + uriFormats + authMethod + domainKey + subdomain + } + recipeSections { + ... RecipeSectionFragment + } +} fragment RecipeSectionFragment on RecipeSection { index repository { @@ -1879,23 +1929,29 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value +` + +func (c *Client) ListRecipes(ctx context.Context, repo *string, provider *Provider, httpRequestOptions ...client.HTTPRequestOption) (*ListRecipes, error) { + vars := map[string]interface{}{ + "repo": repo, + "provider": provider, } - validation { - type - regex - message + + var res ListRecipes + if err := c.Client.Post(ctx, "ListRecipes", ListRecipesDocument, &res, vars, httpRequestOptions...); err != nil { + return nil, err + } + + return &res, nil +} + +const ListAllRecipesDocument = `query ListAllRecipes ($repo: String) { + recipes(repositoryName: $repo, first: 500) { + edges { + node { + ... RecipeFragment + } + } } } fragment RecipeFragment on Recipe { @@ -1929,29 +1985,30 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } -` - -func (c *Client) ListRecipes(ctx context.Context, repo *string, provider *Provider, httpRequestOptions ...client.HTTPRequestOption) (*ListRecipes, error) { - vars := map[string]interface{}{ - "repo": repo, - "provider": provider, +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment } - - var res ListRecipes - if err := c.Client.Post(ctx, "ListRecipes", ListRecipesDocument, &res, vars, httpRequestOptions...); err != nil { - return nil, err + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment } - - return &res, nil } - -const ListAllRecipesDocument = `query ListAllRecipes ($repo: String) { - recipes(repositoryName: $repo, first: 500) { - edges { - node { - ... RecipeFragment - } - } +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name } } fragment RecipeItemFragment on RecipeItem { @@ -2026,63 +2083,6 @@ fragment RecipeConfigurationFragment on RecipeConfiguration { message } } -fragment RecipeFragment on Recipe { - id - name - description - restricted - provider - tests { - type - name - message - args { - name - repo - key - } - } - repository { - id - name - } - oidcSettings { - uriFormat - uriFormats - authMethod - domainKey - subdomain - } - recipeSections { - ... RecipeSectionFragment - } -} -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment - } - recipeItems { - ... RecipeItemFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} ` func (c *Client) ListAllRecipes(ctx context.Context, repo *string, httpRequestOptions ...client.HTTPRequestOption) (*ListAllRecipes, error) { @@ -2143,61 +2143,26 @@ const CreateStackDocument = `mutation CreateStack ($attributes: StackAttributes! createStack(attributes: $attributes) { id } -} -` - -func (c *Client) CreateStack(ctx context.Context, attributes StackAttributes, httpRequestOptions ...client.HTTPRequestOption) (*CreateStack, error) { - vars := map[string]interface{}{ - "attributes": attributes, - } - - var res CreateStack - if err := c.Client.Post(ctx, "CreateStack", CreateStackDocument, &res, vars, httpRequestOptions...); err != nil { - return nil, err - } - - return &res, nil -} - -const GetStackDocument = `query GetStack ($name: String!, $provider: Provider!) { - stack(name: $name, provider: $provider) { - ... StackFragment - } -} -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - optional - version +} +` + +func (c *Client) CreateStack(ctx context.Context, attributes StackAttributes, httpRequestOptions ...client.HTTPRequestOption) (*CreateStack, error) { + vars := map[string]interface{}{ + "attributes": attributes, } - breaking - instructions { - instructions - script + + var res CreateStack + if err := c.Client.Post(ctx, "CreateStack", CreateStackDocument, &res, vars, httpRequestOptions...); err != nil { + return nil, err } - wait - application - providers - secrets - wirings { - terraform - helm + + return &res, nil +} + +const GetStackDocument = `query GetStack ($name: String!, $provider: Provider!) { + stack(name: $name, provider: $provider) { + ... StackFragment } - providerWirings - outputs - providerVsn } fragment RecipeConfigurationFragment on RecipeConfiguration { name @@ -2256,11 +2221,15 @@ fragment RecipeItemFragment on RecipeItem { ... RecipeConfigurationFragment } } -fragment ChartFragment on Chart { +fragment TerraformFragment on Terraform { id name + package description - latestVersion + dependencies { + ... DependenciesFragment + } + valuesTemplate } fragment StackFragment on Stack { id @@ -2302,6 +2271,37 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } +fragment ChartFragment on Chart { + id + name + description + latestVersion +} +fragment DependenciesFragment on Dependencies { + dependencies { + type + name + repo + optional + version + } + breaking + instructions { + instructions + script + } + wait + application + providers + secrets + wirings { + terraform + helm + } + providerWirings + outputs + providerVsn +} ` func (c *Client) GetStack(ctx context.Context, name string, provider Provider, httpRequestOptions ...client.HTTPRequestOption) (*GetStack, error) { @@ -2327,62 +2327,23 @@ const ListStacksDocument = `query ListStacks ($featured: Boolean, $cursor: Strin } } } -fragment RecipeFragment on Recipe { +fragment RecipeItemFragment on RecipeItem { id - name - description - restricted - provider - tests { - type - name - message - args { - name - repo - key - } - } - repository { - id - name - } - oidcSettings { - uriFormat - uriFormats - authMethod - domainKey - subdomain - } - recipeSections { - ... RecipeSectionFragment - } -} -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment + chart { + ... ChartFragment } - recipeItems { - ... RecipeItemFragment + terraform { + ... TerraformFragment } configuration { ... RecipeConfigurationFragment } } -fragment RepositoryFragment on Repository { +fragment ChartFragment on Chart { id name - notes - icon - darkIcon description - publisher { - name - } - recipes { - name - } + latestVersion } fragment TerraformFragment on Terraform { id @@ -2413,32 +2374,62 @@ fragment RecipeConfigurationFragment on RecipeConfiguration { message } } -fragment StackFragment on Stack { +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment + } + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment RecipeFragment on Recipe { id name - featured description - bundles { - ... RecipeFragment + restricted + provider + tests { + type + name + message + args { + name + repo + key + } } -} -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment + repository { + id + name } - terraform { - ... TerraformFragment + oidcSettings { + uriFormat + uriFormats + authMethod + domainKey + subdomain } - configuration { - ... RecipeConfigurationFragment + recipeSections { + ... RecipeSectionFragment } } -fragment ChartFragment on Chart { +fragment RepositoryFragment on Repository { id name + notes + icon + darkIcon description - latestVersion + publisher { + name + } + recipes { + name + } } fragment DependenciesFragment on Dependencies { dependencies { @@ -2465,6 +2456,15 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } +fragment StackFragment on Stack { + id + name + featured + description + bundles { + ... RecipeFragment + } +} ` func (c *Client) ListStacks(ctx context.Context, featured *bool, cursor *string, httpRequestOptions ...client.HTTPRequestOption) (*ListStacks, error) { @@ -2902,6 +2902,33 @@ const GetTerraformInstallationsDocument = `query GetTerraformInstallations ($id: } } } +fragment VersionFragment on Version { + id + readme + version + valuesTemplate + package + crds { + ... CrdFragment + } + dependencies { + ... DependenciesFragment + } +} +fragment CrdFragment on Crd { + id + name + blob +} +fragment TerraformInstallationFragment on TerraformInstallation { + id + terraform { + ... TerraformFragment + } + version { + ... VersionFragment + } +} fragment TerraformFragment on Terraform { id name @@ -2937,33 +2964,6 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment VersionFragment on Version { - id - readme - version - valuesTemplate - package - crds { - ... CrdFragment - } - dependencies { - ... DependenciesFragment - } -} -fragment CrdFragment on Crd { - id - 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) { @@ -3235,11 +3235,6 @@ const ListKeysDocument = `query ListKeys ($emails: [String]) { } } } -fragment UserFragment on User { - id - name - email -} fragment PublicKeyFragment on PublicKey { id content @@ -3247,6 +3242,11 @@ fragment PublicKeyFragment on PublicKey { ... UserFragment } } +fragment UserFragment on User { + id + name + email +} ` func (c *Client) ListKeys(ctx context.Context, emails []*string, httpRequestOptions ...client.HTTPRequestOption) (*ListKeys, error) {