Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
393 changes: 379 additions & 14 deletions src/commands/environment.rs

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions src/gql/mutations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,42 @@ pub struct EnvironmentDelete;
)]
pub struct FunctionUpdate;

#[derive(GraphQLQuery)]
#[graphql(
schema_path = "src/gql/schema.json",
query_path = "src/gql/mutations/strings/ServiceInstanceUpdate.graphql",
response_derives = "Debug, Serialize, Clone",
skip_serializing_none
)]
pub struct ServiceInstanceUpdate;

#[derive(GraphQLQuery)]
#[graphql(
schema_path = "src/gql/schema.json",
query_path = "src/gql/mutations/strings/DeploymentTriggerUpdate.graphql",
response_derives = "Debug, Serialize, Clone",
skip_serializing_none
)]
pub struct DeploymentTriggerUpdate;

#[derive(GraphQLQuery)]
#[graphql(
schema_path = "src/gql/schema.json",
query_path = "src/gql/mutations/strings/DeploymentTriggerDelete.graphql",
response_derives = "Debug, Serialize, Clone",
skip_serializing_none
)]
pub struct DeploymentTriggerDelete;

#[derive(GraphQLQuery)]
#[graphql(
schema_path = "src/gql/schema.json",
query_path = "src/gql/mutations/strings/DeploymentTriggerCreate.graphql",
response_derives = "Debug, Serialize, Clone",
skip_serializing_none
)]
pub struct DeploymentTriggerCreate;

impl std::fmt::Display for custom_domain_create::DNSRecordType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Expand Down
7 changes: 7 additions & 0 deletions src/gql/mutations/strings/DeploymentTriggerCreate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation DeploymentTriggerCreate($serviceId: String!, $environmentId: String!, $projectId: String!, $repository: String!, $branch: String!, $provider: String!) {
deploymentTriggerCreate(
input: {serviceId: $serviceId, projectId: $projectId, environmentId: $environmentId, repository: $repository, branch: $branch, provider: $provider}
) {
id
}
}
3 changes: 3 additions & 0 deletions src/gql/mutations/strings/DeploymentTriggerDelete.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mutation DeploymentTriggerDelete($id: String!) {
deploymentTriggerDelete(id: $id)
}
8 changes: 8 additions & 0 deletions src/gql/mutations/strings/DeploymentTriggerUpdate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mutation DeploymentTriggerUpdate($id: String!, $repository: String!, $branch: String!) {
deploymentTriggerUpdate(
id: $id
input: {repository: $repository, branch: $branch}
) {
id
}
}
7 changes: 7 additions & 0 deletions src/gql/mutations/strings/ServiceInstanceUpdate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation ServiceInstanceUpdate($serviceId: String!, $environmentId: String!, $source: ServiceSourceInput!) {
serviceInstanceUpdate(
environmentId: $environmentId
serviceId: $serviceId
input: {source: $source}
)
}
12 changes: 11 additions & 1 deletion src/gql/queries/strings/Project.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ query Project($id: String!) {
name
canAccess
deletedAt
deploymentTriggers {
edges {
node {
branch
id
repository
serviceId
}
}
}
serviceInstances {
edges {
node {
Expand Down Expand Up @@ -77,4 +87,4 @@ query Project($id: String!) {
}
}
}
}
}
12 changes: 12 additions & 0 deletions src/util/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{
use crate::{
commands::{Configs, queries::project::ProjectProjectServicesEdgesNode},
controllers::variables::Variable,
queries::project::ProjectProjectEnvironmentsEdgesNodeServiceInstancesEdgesNode,
};
use anyhow::{Context, Result};

Expand Down Expand Up @@ -177,6 +178,17 @@ impl Display for PromptService<'_> {
}
}

#[derive(Debug, Clone, PartialEq)]
pub struct PromptServiceInstance<'a>(
pub &'a ProjectProjectEnvironmentsEdgesNodeServiceInstancesEdgesNode,
);

impl Display for PromptServiceInstance<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0.service_name)
}
}

/// Bash style completion of paths
#[derive(Clone)]
pub struct PathAutocompleter;
Expand Down