diff --git a/CHANGELOG.md b/CHANGELOG.md index b33c3b3..c28e7e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The format of this file is based on [Keep a Changelog](https://keepachangelog.co ## [2.22.0] - TBD -TBD +### Changed + +- Update to latest fiberplane-client and schema. For more information see + fiberplane/fiberplane/174 (#278) ## [2.21.0] - 2024-02-26 diff --git a/Cargo.lock b/Cargo.lock index 41a6f93..34ac543 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64uuid" version = "1.1.0" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#362db2ac82fa9c1c65315fe2d8124959fb87c60b" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "base64 0.13.1", "serde", @@ -935,8 +935,8 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fiberplane" -version = "1.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "1.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "base64uuid", "fiberplane-api-client", @@ -948,8 +948,8 @@ dependencies = [ [[package]] name = "fiberplane-api-client" -version = "1.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "1.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "anyhow", "base64uuid", @@ -963,8 +963,8 @@ dependencies = [ [[package]] name = "fiberplane-markdown" -version = "1.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "1.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "fiberplane-models", "pulldown-cmark", @@ -975,8 +975,8 @@ dependencies = [ [[package]] name = "fiberplane-models" -version = "1.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "1.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "base64 0.13.1", "base64uuid", @@ -999,8 +999,8 @@ dependencies = [ [[package]] name = "fiberplane-provider-runtime" -version = "2.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "2.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "bytes", "fiberplane-models", @@ -1019,8 +1019,8 @@ dependencies = [ [[package]] name = "fiberplane-templates" -version = "1.0.0-beta.11" -source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#fe1aa4b382e7fe3ba8c6c0ad33f942f29d43f431" +version = "1.0.0-beta.12" +source = "git+ssh://git@github.com/fiberplane/fiberplane.git?branch=main#1158fc6051aa55b091c1fe0c77ae0d0e559fa276" dependencies = [ "base64uuid", "fiberplane-models", diff --git a/src/front_matter.rs b/src/front_matter.rs index c88eb07..4bcb0cc 100644 --- a/src/front_matter.rs +++ b/src/front_matter.rs @@ -1,17 +1,13 @@ -use std::{io::stdin, path::PathBuf}; - use anyhow::{Context, Result}; use clap::{Parser, ValueHint}; -use fiberplane::{ - api_client::{ - workspace_front_matter_schemas_create, workspace_front_matter_schemas_get_by_name, - }, - base64uuid::Base64Uuid, - models::{ - front_matter_schemas::FrontMatterSchema, names::Name, - workspaces::NewWorkspaceFrontMatterSchema, - }, +use fiberplane::api_client::{ + workspace_front_matter_schema_create, workspace_front_matter_schema_get_by_name, }; +use fiberplane::base64uuid::Base64Uuid; +use fiberplane::models::front_matter_schemas::FrontMatterSchema; +use fiberplane::models::names::Name; +use fiberplane::models::workspaces::NewWorkspaceFrontMatterSchema; +use std::{io::stdin, path::PathBuf}; use url::Url; use crate::{ @@ -159,7 +155,7 @@ pub async fn handle_set_command(args: SetArgs) -> Result<()> { serde_json::from_str(&content).with_context(|| "cannot parse content as schema")? }; - workspace_front_matter_schemas_create( + workspace_front_matter_schema_create( &client, workspace_id, NewWorkspaceFrontMatterSchema::builder() @@ -189,7 +185,7 @@ pub async fn handle_create_command(args: CreateArgs) -> Result<()> { serde_json::from_str(&content).with_context(|| "cannot parse content as schema")? }; - workspace_front_matter_schemas_create( + workspace_front_matter_schema_create( &client, workspace_id, NewWorkspaceFrontMatterSchema::builder() @@ -208,7 +204,7 @@ pub async fn handle_get_command(args: GetArgs) -> Result<()> { let (workspace_id, fmc_name) = front_matter_collection_picker(&client, args.workspace_id, args.name).await?; - let fmc = workspace_front_matter_schemas_get_by_name(&client, workspace_id, &fmc_name).await?; + let fmc = workspace_front_matter_schema_get_by_name(&client, workspace_id, &fmc_name).await?; println!( "{}", @@ -225,9 +221,9 @@ pub async fn handle_delete_command(args: DeleteArgs) -> Result<()> { front_matter_collection_picker(&client, args.workspace_id, args.name).await?; unimplemented!( - "The workspace_front_matter_schemas_delete endpoint is missing from the API for now." + "The workspace_front_matter_schema_delete endpoint is missing from the API for now." ); - // workspace_front_matter_schemas_delete(&client, workspace_id, &fmc_name).await?; + // workspace_front_matter_schema_delete(&client, workspace_id, &fmc_name).await?; // Ok(()) } diff --git a/src/interactive.rs b/src/interactive.rs index d056a04..02b1e7d 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -3,8 +3,8 @@ use dialoguer::{theme, Confirm, FuzzySelect, Input, MultiSelect, Select}; use fiberplane::api_client::clients::ApiClient; use fiberplane::api_client::{ data_source_get, data_source_list, notebook_search, proxy_list, snippet_list, template_list, - trigger_list, views_get, webhook_delivery_list, webhooks_list, - workspace_front_matter_schemas_get, workspace_list, workspace_users_list, + trigger_list, view_list, webhook_delivery_list, webhook_list, + workspace_front_matter_schema_get, workspace_list, workspace_user_list, }; use fiberplane::base64uuid::Base64Uuid; use fiberplane::models::data_sources::DataSource; @@ -578,7 +578,7 @@ pub async fn view_picker( pb.set_message("Fetching views"); pb.enable_steady_tick(Duration::from_millis(100)); - let results = views_get(client, workspace_id, None, None, None, None).await?; + let results = view_list(client, workspace_id, None, None, None, None).await?; pb.finish_and_clear(); @@ -690,7 +690,7 @@ pub async fn workspace_user_picker( pb.set_message("Fetching workspace users"); pb.enable_steady_tick(Duration::from_millis(100)); - let results = workspace_users_list(client, *workspace, Some("name"), Some("ascending")).await?; + let results = workspace_user_list(client, *workspace, Some("name"), Some("ascending")).await?; pb.finish_and_clear(); @@ -740,7 +740,7 @@ pub async fn webhook_picker( pb.enable_steady_tick(Duration::from_millis(100)); let max = Pagination::max(); - let results = webhooks_list( + let results = webhook_list( client, workspace, Some(max.page as i32), @@ -891,7 +891,7 @@ pub async fn front_matter_collection_picker( pb.set_message("Fetching front matter collections"); pb.enable_steady_tick(Duration::from_millis(100)); - let results = workspace_front_matter_schemas_get(config, workspace_id).await?; + let results = workspace_front_matter_schema_get(config, workspace_id).await?; pb.finish_and_clear(); diff --git a/src/notebooks.rs b/src/notebooks.rs index 1065f44..4b48ee9 100644 --- a/src/notebooks.rs +++ b/src/notebooks.rs @@ -13,7 +13,7 @@ use fiberplane::api_client::{ front_matter_add_keys, front_matter_delete, front_matter_delete_key, front_matter_update, front_matter_update_key, notebook_cells_append, notebook_create, notebook_delete, notebook_duplicate, notebook_get, notebook_list, notebook_search, notebook_snippet_insert, - workspace_front_matter_schemas_get_by_name, + workspace_front_matter_schema_get_by_name, }; use fiberplane::base64uuid::Base64Uuid; use fiberplane::markdown::{markdown_to_notebook, notebook_to_markdown}; @@ -1112,7 +1112,7 @@ async fn handle_front_matter_add_collection_command( front_matter_collection_picker(&client, args.workspace_id, args.name).await?; let notebook_id = notebook_picker(&client, args.notebook_id, Some(workspace_id)).await?; - let fmc = workspace_front_matter_schemas_get_by_name(&client, workspace_id, &fmc_name).await?; + let fmc = workspace_front_matter_schema_get_by_name(&client, workspace_id, &fmc_name).await?; let insertions: Vec = fmc .iter() diff --git a/src/views.rs b/src/views.rs index e2e3731..cbbd258 100644 --- a/src/views.rs +++ b/src/views.rs @@ -6,7 +6,7 @@ use crate::KeyValueArgument; use anyhow::Result; use clap::{Parser, ValueEnum}; use cli_table::Table; -use fiberplane::api_client::{view_delete, view_update, views_create, views_get}; +use fiberplane::api_client::{view_create, view_delete, view_list, view_update}; use fiberplane::base64uuid::Base64Uuid; use fiberplane::models::labels::Label; use fiberplane::models::names::Name; @@ -133,7 +133,7 @@ async fn handle_create(args: CreateArguments) -> Result<()> { view.sort_by = args.sort_by; view.sort_direction = args.sort_direction; - let view = views_create(&client, workspace_id, view).await?; + let view = view_create(&client, workspace_id, view).await?; info!("Successfully created new view"); @@ -184,7 +184,7 @@ async fn handle_list(args: ListArguments) -> Result<()> { let workspace_id = workspace_picker(&client, args.workspace_id).await?; - let views = views_get( + let views = view_list( &client, workspace_id, args.sort_by.map(Into::<&str>::into), diff --git a/src/webhooks.rs b/src/webhooks.rs index 3acc5e1..93e3417 100644 --- a/src/webhooks.rs +++ b/src/webhooks.rs @@ -10,7 +10,7 @@ use clap::ValueEnum; use cli_table::Table; use fiberplane::api_client::{ webhook_create, webhook_delete, webhook_delivery_get, webhook_delivery_list, - webhook_delivery_resend, webhook_update, webhooks_list, + webhook_delivery_resend, webhook_list, webhook_update, }; use fiberplane::base64uuid::Base64Uuid; use fiberplane::models::webhooks::{ @@ -170,7 +170,7 @@ async fn handle_webhook_list(args: ListArgs) -> Result<()> { let client = api_client_configuration(args.token, args.config, args.base_url).await?; let workspace_id = workspace_picker(&client, args.workspace_id).await?; - let webhooks = webhooks_list(&client, workspace_id, args.page, args.limit).await?; + let webhooks = webhook_list(&client, workspace_id, args.page, args.limit).await?; match args.output { WebhookOutput::Table => { diff --git a/src/workspaces.rs b/src/workspaces.rs index 9f1331a..3a390ac 100644 --- a/src/workspaces.rs +++ b/src/workspaces.rs @@ -9,9 +9,9 @@ use clap::{Parser, ValueEnum}; use cli_table::Table; use dialoguer::FuzzySelect; use fiberplane::api_client::{ - workspace_create, workspace_delete, workspace_get, workspace_invite, workspace_invite_delete, - workspace_invite_get, workspace_leave, workspace_list, workspace_update, workspace_user_remove, - workspace_user_update, workspace_users_list, + workspace_create, workspace_delete, workspace_get, workspace_invite_create, + workspace_invite_delete, workspace_invite_get, workspace_leave, workspace_list, + workspace_update, workspace_user_list, workspace_user_remove, workspace_user_update, }; use fiberplane::base64uuid::Base64Uuid; use fiberplane::models::data_sources::{ProviderType, SelectedDataSource}; @@ -21,8 +21,8 @@ use fiberplane::models::sorting::{ WorkspaceMembershipSortFields, }; use fiberplane::models::workspaces::{ - AuthRole, Membership, NewWorkspace, NewWorkspaceInvite, UpdateWorkspace, Workspace, - WorkspaceInvite, WorkspaceInviteResponse, WorkspaceUserUpdate, + AuthRole, Membership, NewWorkspace, NewWorkspaceInvite, UpdateWorkspace, UpdateWorkspaceUser, + Workspace, WorkspaceInvite, WorkspaceInviteResponse, }; use std::collections::BTreeMap; use std::{fmt::Display, path::PathBuf}; @@ -311,7 +311,7 @@ async fn handle_invite_create(args: InviteCreateArgs) -> Result<()> { let workspace_id = workspace_picker(&client, args.workspace_id).await?; let email = text_req("Email", args.email, None)?; - let invite = workspace_invite( + let invite = workspace_invite_create( &client, workspace_id, NewWorkspaceInvite::new(email, args.role), @@ -456,7 +456,7 @@ async fn handle_user_list(args: UserListArgs) -> Result<()> { let client = api_client_configuration(args.token, args.config, args.base_url).await?; let workspace_id = workspace_picker(&client, args.workspace_id).await?; - let users = workspace_users_list( + let users = workspace_user_list( &client, workspace_id, args.sort_by.map(Into::<&str>::into), @@ -504,8 +504,8 @@ async fn handle_user_update(args: UserUpdateArgs) -> Result<()> { let user = workspace_user_picker(&client, &workspace_id, args.user_id).await?; let payload = match args.role { - Some(role) => WorkspaceUserUpdate::builder().role(role).build(), - None => WorkspaceUserUpdate::builder().build(), + Some(role) => UpdateWorkspaceUser::builder().role(role).build(), + None => UpdateWorkspaceUser::builder().build(), }; workspace_user_update(&client, workspace_id, user, payload).await?;