diff --git a/package.json b/package.json index e1d63d52..eda97365 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,5 @@ "@napi-rs/triples": "^1.1.0", "node-fetch": "^3.1.0", "tar": "^6.1.11" - }, - "module": "index.ts", - "devDependencies": { - "@types/bun": "latest" - }, - "peerDependencies": { - "typescript": "^5.0.0" } -} \ No newline at end of file +} diff --git a/src/client.rs b/src/client.rs index 851ac1de..572aa8c6 100644 --- a/src/client.rs +++ b/src/client.rs @@ -61,8 +61,6 @@ pub async fn post_graphql( variables: Q::Variables, ) -> Result { let body = Q::build_query(variables); - let b = &body; - dbg!(serde_json::to_string(&b).unwrap()); let res: GraphQLResponse = client.post(url).json(&body).send().await?.json().await?; diff --git a/src/commands/add.rs b/src/commands/add.rs index 1cdd9d40..b1708960 100644 --- a/src/commands/add.rs +++ b/src/commands/add.rs @@ -49,12 +49,6 @@ pub async fn command(args: Args, _json: bool) -> Result<()> { let type_of_create = if !args.database.is_empty() { fake_select("What do you need?", "Database"); CreateKind::Database(args.database) - } else if args.service.is_some() { - fake_select("What do you need?", "Empty Service"); - CreateKind::EmptyService { - name: prompt_name(args.service)?, - variables: prompt_variables(args.variables)?, - } } else if args.repo.is_some() { fake_select("What do you need?", "GitHub Repo"); CreateKind::GithubRepo { @@ -69,6 +63,12 @@ pub async fn command(args: Args, _json: bool) -> Result<()> { variables: prompt_variables(args.variables)?, name: prompt_name(args.service)?, } + } else if args.service.is_some() { + fake_select("What do you need?", "Empty Service"); + CreateKind::EmptyService { + name: prompt_name(args.service)?, + variables: prompt_variables(args.variables)?, + } } else { let need = prompt_options("What do you need?", CreateKind::iter().collect())?; match need { @@ -171,7 +171,7 @@ fn prompt_repo(repo: Option) -> Result { fake_select("Enter a repo", &repo); return Ok(repo); } - + prompt_text_with_placeholder_disappear("Enter a repo", "/") } diff --git a/src/gql/queries/mod.rs b/src/gql/queries/mod.rs index 45476c91..dd7eb744 100644 --- a/src/gql/queries/mod.rs +++ b/src/gql/queries/mod.rs @@ -152,7 +152,7 @@ pub struct TemplateDetail; #[derive(GraphQLQuery)] #[graphql( schema_path = "src/gql/schema.json", - query_path = "src/gql/queries/strings/GithubRepos.graphql", + query_path = "src/gql/queries/strings/GitHubRepos.graphql", response_derives = "Debug, Serialize, Clone" )] pub struct GitHubRepos; diff --git a/src/gql/queries/strings/GitHubRepos.graphql b/src/gql/queries/strings/GitHubRepos.graphql index f3b0e925..7ae3a03d 100644 --- a/src/gql/queries/strings/GitHubRepos.graphql +++ b/src/gql/queries/strings/GitHubRepos.graphql @@ -1,6 +1,6 @@ query GitHubRepos { githubRepos { - fullName, + fullName defaultBranch } } \ No newline at end of file diff --git a/src/gql/schema.json b/src/gql/schema.json index 7c235a08..560dae20 100644 --- a/src/gql/schema.json +++ b/src/gql/schema.json @@ -157,12 +157,6 @@ { "description": null, "enumValues": [ - { - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "BACKUPS" - }, { "deprecationReason": null, "description": null, @@ -22590,7 +22584,18 @@ } }, { - "args": [], + "args": [ + { + "defaultValue": null, + "description": null, + "name": "projectId", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + ], "deprecationReason": null, "description": "List available regions", "isDeprecated": false, @@ -26252,6 +26257,18 @@ "name": "String", "ofType": null } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "teamId", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } } ], "inputFields": null,