diff --git a/src/cli.rs b/src/cli.rs index ec841ceb..825929cd 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,5 +1,5 @@ use crate::{ - config::{ProfileId, RequestCollection, RequestRecipeId}, + collection::{ProfileId, RequestCollection, RequestRecipeId}, http::{HttpEngine, Repository, RequestBuilder}, template::{Prompt, Prompter, TemplateContext}, util::{find_by, ResultExt}, diff --git a/src/config.rs b/src/collection.rs similarity index 98% rename from src/config.rs rename to src/collection.rs index 77362555..3343bd64 100644 --- a/src/config.rs +++ b/src/collection.rs @@ -1,3 +1,6 @@ +//! A request collection defines recipes, profiles, etc. that make requests +//! possible + mod insomnia; use crate::template::TemplateString; diff --git a/src/config/insomnia.rs b/src/collection/insomnia.rs similarity index 98% rename from src/config/insomnia.rs rename to src/collection/insomnia.rs index 0a8a8440..6411de4c 100644 --- a/src/config/insomnia.rs +++ b/src/collection/insomnia.rs @@ -2,7 +2,7 @@ //! format use crate::{ - config::{Profile, RequestCollection, RequestRecipe}, + collection::{Profile, RequestCollection, RequestRecipe}, template::TemplateString, }; use anyhow::Context; diff --git a/src/factory.rs b/src/factory.rs index 87816076..5fbd6ab2 100644 --- a/src/factory.rs +++ b/src/factory.rs @@ -1,5 +1,5 @@ use crate::{ - config::{Chain, ChainSource, RequestRecipeId}, + collection::{Chain, ChainSource, RequestRecipeId}, http::{Body, Repository, Request, RequestId, RequestRecord, Response}, template::{Prompt, Prompter, TemplateContext, TemplateString}, }; diff --git a/src/http.rs b/src/http.rs index 7b483291..2ccf995a 100644 --- a/src/http.rs +++ b/src/http.rs @@ -42,7 +42,7 @@ pub use record::*; pub use repository::*; use crate::{ - config::RequestRecipe, template::TemplateContext, util::ResultExt, + collection::RequestRecipe, template::TemplateContext, util::ResultExt, }; use anyhow::Context; use chrono::Utc; diff --git a/src/http/record.rs b/src/http/record.rs index 8cbe86bb..25e00af6 100644 --- a/src/http/record.rs +++ b/src/http/record.rs @@ -1,7 +1,7 @@ //! HTTP-related data types use crate::{ - config::RequestRecipeId, + collection::RequestRecipeId, http::{parse, ContentType}, util::ResultExt, }; diff --git a/src/http/repository.rs b/src/http/repository.rs index 41f72f1a..d563cb87 100644 --- a/src/http/repository.rs +++ b/src/http/repository.rs @@ -3,7 +3,7 @@ //! caching and other ephemeral data (e.g. prettified content). use crate::{ - config::{CollectionId, RequestRecipeId}, + collection::{CollectionId, RequestRecipeId}, http::{Request, RequestId, RequestRecord, Response}, util::{data_directory, ResultExt}, }; diff --git a/src/main.rs b/src/main.rs index a259a1f8..ee4d812e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ #![feature(try_blocks)] mod cli; -mod config; +mod collection; #[cfg(test)] mod factory; mod http; @@ -15,7 +15,8 @@ mod tui; mod util; use crate::{ - cli::Subcommand, config::RequestCollection, tui::Tui, util::data_directory, + cli::Subcommand, collection::RequestCollection, tui::Tui, + util::data_directory, }; use anyhow::Context; use clap::Parser; diff --git a/src/template.rs b/src/template.rs index e1f1f808..7eeff212 100644 --- a/src/template.rs +++ b/src/template.rs @@ -5,7 +5,7 @@ pub use error::{ChainError, TemplateError, TemplateResult}; pub use prompt::{Prompt, Prompter}; use crate::{ - config::{Chain, ChainSource, RequestRecipeId}, + collection::{Chain, ChainSource, RequestRecipeId}, http::{ContentType, Json, Repository}, util::ResultExt, }; @@ -449,7 +449,7 @@ impl<'a> TemplateSource<'a> for EnvironmentTemplateSource<'a> { mod tests { use super::*; use crate::{ - config::RequestRecipeId, + collection::RequestRecipeId, factory::*, http::{Request, Response}, util::assert_err, diff --git a/src/tui.rs b/src/tui.rs index 1774ebd2..784f8530 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -3,7 +3,7 @@ mod message; mod view; use crate::{ - config::{ProfileId, RequestCollection, RequestRecipeId}, + collection::{ProfileId, RequestCollection, RequestRecipeId}, http::{HttpEngine, Repository, RequestBuilder}, template::{Prompter, TemplateChunk, TemplateContext, TemplateString}, tui::{ diff --git a/src/tui/message.rs b/src/tui/message.rs index 88505301..5296408f 100644 --- a/src/tui/message.rs +++ b/src/tui/message.rs @@ -2,7 +2,7 @@ //! state updates. use crate::{ - config::{ProfileId, RequestCollection, RequestRecipeId}, + collection::{ProfileId, RequestCollection, RequestRecipeId}, http::{RequestBuildError, RequestError, RequestId, RequestRecord}, template::{Prompt, Prompter, TemplateChunk, TemplateString}, util::ResultExt, diff --git a/src/tui/view.rs b/src/tui/view.rs index e770f073..aa94eece 100644 --- a/src/tui/view.rs +++ b/src/tui/view.rs @@ -8,7 +8,7 @@ pub use state::RequestState; pub use util::PreviewPrompter; use crate::{ - config::{RequestCollection, RequestRecipeId}, + collection::{RequestCollection, RequestRecipeId}, tui::{ input::{Action, InputEngine}, message::MessageSender, diff --git a/src/tui/view/component.rs b/src/tui/view/component.rs index cb8c4033..cf14828d 100644 --- a/src/tui/view/component.rs +++ b/src/tui/view/component.rs @@ -16,7 +16,7 @@ pub use modal::{IntoModal, Modal, ModalPriority}; pub use root::Root; use crate::{ - config::RequestRecipeId, + collection::RequestRecipeId, tui::{ input::{Action, InputEngine}, message::{Message, MessageSender}, diff --git a/src/tui/view/component/primary.rs b/src/tui/view/component/primary.rs index 2aae34ab..a26e0e38 100644 --- a/src/tui/view/component/primary.rs +++ b/src/tui/view/component/primary.rs @@ -1,7 +1,7 @@ //! Components for the "primary" view, which is the paned request/response view use crate::{ - config::{Profile, RequestCollection, RequestRecipe}, + collection::{Profile, RequestCollection, RequestRecipe}, tui::{ input::Action, message::Message, diff --git a/src/tui/view/component/request.rs b/src/tui/view/component/request.rs index e4ce087e..64e87304 100644 --- a/src/tui/view/component/request.rs +++ b/src/tui/view/component/request.rs @@ -1,5 +1,5 @@ use crate::{ - config::{ProfileId, RequestRecipe, RequestRecipeId}, + collection::{ProfileId, RequestRecipe, RequestRecipeId}, template::TemplateString, tui::{ input::Action, diff --git a/src/tui/view/component/root.rs b/src/tui/view/component/root.rs index b3fb8fdc..36820771 100644 --- a/src/tui/view/component/root.rs +++ b/src/tui/view/component/root.rs @@ -1,5 +1,5 @@ use crate::{ - config::{RequestCollection, RequestRecipeId}, + collection::{RequestCollection, RequestRecipeId}, tui::{ input::Action, message::Message, diff --git a/src/tui/view/component/template_preview.rs b/src/tui/view/component/template_preview.rs index ee28d56b..dd34e3d2 100644 --- a/src/tui/view/component/template_preview.rs +++ b/src/tui/view/component/template_preview.rs @@ -1,5 +1,5 @@ use crate::{ - config::ProfileId, + collection::ProfileId, template::{TemplateChunk, TemplateString}, tui::{ message::Message, diff --git a/src/tui/view/util.rs b/src/tui/view/util.rs index aea37d11..11bdca82 100644 --- a/src/tui/view/util.rs +++ b/src/tui/view/util.rs @@ -1,7 +1,7 @@ //! Helper structs and functions for building components use crate::{ - config::{Profile, RequestRecipe}, + collection::{Profile, RequestRecipe}, http::{RequestBuildError, RequestError}, template::{Prompt, Prompter}, tui::view::{