#![warn(missing_docs)]
#![warn(clippy::missing_docs_in_private_items)]
#![doc = include_str!("./../README.md")]
use sfr_types as st;
mod app_credentials;
mod config;
mod inner;
mod validation;
pub use crate::app_credentials::AppCredentials;
pub use crate::config::Config;
pub use st::SlashCommandBody;
pub use st::TextObject;
pub use st::{Block, SectionBlock};
pub use st::{OauthRedirectQuery, OauthV2AccessResponse};
use validation::Validator;
#[derive(Clone)]
pub struct Slack(inner::Inner);
impl Slack {
pub fn new(creds: AppCredentials, config: Config) -> Self {
Self(inner::Inner::new(creds, config))
}
pub fn client_id(&self) -> &str {
self.0.client_id()
}
pub fn client_secret(&self) -> &str {
self.0.client_secret()
}
pub fn verification_token(&self, body: &SlashCommandBody) -> Result<(), st::Error> {
self.0.verification_token(&body.token)
}
pub fn validate_request(
&self,
signature: &str,
timestamp: &str,
body: &[u8],
) -> Result<(), st::Error> {
self.0.validate_request(signature, timestamp, body)
}
}