Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84ba4c21ec |
Generated
+28
-28
@@ -132,9 +132,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.66"
|
version = "1.2.67"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996"
|
checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"find-msvc-tools",
|
"find-msvc-tools",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
@@ -1527,9 +1527,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.23.41"
|
version = "0.23.42"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f"
|
checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aws-lc-rs",
|
"aws-lc-rs",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -1630,6 +1630,22 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "schedtxt_models"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "git+ssh://git@git.kundeng.us/phoenix/schedtxt_models.git?tag=v0.5.3#597af4e84c082bb437cc94817bb19592614681a5"
|
||||||
|
dependencies = [
|
||||||
|
"const_format",
|
||||||
|
"dotenvy",
|
||||||
|
"josekit",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"sqlx",
|
||||||
|
"time",
|
||||||
|
"utoipa",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@@ -2021,13 +2037,13 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swoosh"
|
name = "swoosh"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64-ng",
|
"base64-ng",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
"schedtxt_models",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"textsender_models",
|
|
||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2096,22 +2112,6 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "textsender_models"
|
|
||||||
version = "0.5.2"
|
|
||||||
source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.5.2#02061bf7a380657b7bc76d64d1824388bef8e55a"
|
|
||||||
dependencies = [
|
|
||||||
"const_format",
|
|
||||||
"dotenvy",
|
|
||||||
"josekit",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"sqlx",
|
|
||||||
"time",
|
|
||||||
"utoipa",
|
|
||||||
"uuid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "2.0.18"
|
version = "2.0.18"
|
||||||
@@ -2174,9 +2174,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinyvec"
|
name = "tinyvec"
|
||||||
version = "1.11.0"
|
version = "1.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
|
checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tinyvec_macros",
|
"tinyvec_macros",
|
||||||
]
|
]
|
||||||
@@ -2413,9 +2413,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.23.4"
|
version = "1.23.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53"
|
checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom 0.4.3",
|
"getrandom 0.4.3",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
@@ -2780,6 +2780,6 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zmij"
|
name = "zmij"
|
||||||
version = "1.0.21"
|
version = "1.0.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "swoosh"
|
name = "swoosh"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.97"
|
rust-version = "1.97"
|
||||||
description = "Library to send text messages"
|
description = "Library to send text messages"
|
||||||
@@ -11,6 +11,6 @@ serde_json = { version = "1.0.150" }
|
|||||||
reqwest = { version = "0.13.4", features = ["form", "json", "blocking", "multipart", "stream"] }
|
reqwest = { version = "0.13.4", features = ["form", "json", "blocking", "multipart", "stream"] }
|
||||||
time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
|
time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
|
||||||
base64-ng = { version = "1.3.7" }
|
base64-ng = { version = "1.3.7" }
|
||||||
textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.5.2", features = ["config", "contact", "message"] }
|
schedtxt_models = { git = "ssh://git@git.kundeng.us/phoenix/schedtxt_models.git", tag = "v0.5.3", features = ["config", "contact", "message"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# swoosh
|
||||||
|
A library used to send text messages and is used in conjunction of the `schedtxt`
|
||||||
|
project.
|
||||||
@@ -14,10 +14,10 @@ pub use send_message as send_mssage;
|
|||||||
|
|
||||||
/// Send a message
|
/// Send a message
|
||||||
pub async fn send_message(
|
pub async fn send_message(
|
||||||
msg: &textsender_models::message::Message,
|
msg: &schedtxt_models::message::Message,
|
||||||
contact: &textsender_models::contact::Contact,
|
contact: &schedtxt_models::contact::Contact,
|
||||||
param: &crate::twilio::types::Parameters,
|
param: &crate::twilio::types::Parameters,
|
||||||
config: &textsender_models::config::auxiliary::TwilioConfig,
|
config: &schedtxt_models::config::auxiliary::TwilioConfig,
|
||||||
) -> Result<reqwest::Response, std::io::Error> {
|
) -> Result<reqwest::Response, std::io::Error> {
|
||||||
if config.account_sid.is_empty() {
|
if config.account_sid.is_empty() {
|
||||||
Err(std::io::Error::other("Account SID is empty"))
|
Err(std::io::Error::other("Account SID is empty"))
|
||||||
@@ -145,9 +145,9 @@ pub fn initial_params(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn init_params(
|
fn init_params(
|
||||||
contact: &textsender_models::contact::Contact,
|
contact: &schedtxt_models::contact::Contact,
|
||||||
message: &textsender_models::message::Message,
|
message: &schedtxt_models::message::Message,
|
||||||
config: &textsender_models::config::auxiliary::TwilioConfig,
|
config: &schedtxt_models::config::auxiliary::TwilioConfig,
|
||||||
param: &crate::twilio::types::Parameters,
|
param: &crate::twilio::types::Parameters,
|
||||||
) -> std::collections::HashMap<String, String> {
|
) -> std::collections::HashMap<String, String> {
|
||||||
let now = time::OffsetDateTime::now_utc();
|
let now = time::OffsetDateTime::now_utc();
|
||||||
@@ -213,7 +213,7 @@ fn convert_time_to_iso(time: time::OffsetDateTime) -> Result<String, time::error
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn generate_auth(
|
fn generate_auth(
|
||||||
config: &textsender_models::config::auxiliary::TwilioConfig,
|
config: &schedtxt_models::config::auxiliary::TwilioConfig,
|
||||||
) -> Result<String, base64_ng::EncodeError> {
|
) -> Result<String, base64_ng::EncodeError> {
|
||||||
let input = format!("{}:{}", config.account_sid, config.auth_token);
|
let input = format!("{}:{}", config.account_sid, config.auth_token);
|
||||||
match base64_ng::encode(input.as_bytes()) {
|
match base64_ng::encode(input.as_bytes()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user