Compare commits

..
2 Commits
Author SHA1 Message Date
phoenix 7873d09d3e Adding license (#18)
Release Tagging / release (push) Successful in 40s
swoosh Build / Check (push) Successful in 1m6s
swoosh Build / Rustfmt (push) Successful in 28s
swoosh Build / Test Suite (push) Successful in 1m31s
swoosh Build / Clippy (push) Successful in 1m37s
swoosh Build / build (push) Successful in 2m1s
Reviewed-on: #18
2026-07-14 11:18:40 -04:00
phoenix 84ba4c21ec Dependency name change (#17)
Release Tagging / release (push) Successful in 59s
swoosh Build / Rustfmt (push) Successful in 39s
swoosh Build / Test Suite (push) Successful in 1m41s
swoosh Build / Clippy (push) Successful in 1m33s
swoosh Build / Check (push) Successful in 3m10s
swoosh Build / build (push) Successful in 1m48s
Reviewed-on: #17
2026-07-13 11:44:24 -04:00
5 changed files with 63 additions and 37 deletions
Generated
+28 -28
View File
@@ -132,9 +132,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
name = "cc"
version = "1.2.66"
version = "1.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996"
checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
dependencies = [
"find-msvc-tools",
"jobserver",
@@ -1527,9 +1527,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.41"
version = "0.23.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f"
checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138"
dependencies = [
"aws-lc-rs",
"once_cell",
@@ -1630,6 +1630,22 @@ dependencies = [
"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]]
name = "scopeguard"
version = "1.2.0"
@@ -2021,13 +2037,13 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "swoosh"
version = "0.5.3"
version = "0.5.4"
dependencies = [
"base64-ng",
"reqwest",
"schedtxt_models",
"serde",
"serde_json",
"textsender_models",
"time",
]
@@ -2096,22 +2112,6 @@ dependencies = [
"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]]
name = "thiserror"
version = "2.0.18"
@@ -2174,9 +2174,9 @@ dependencies = [
[[package]]
name = "tinyvec"
version = "1.11.0"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f"
dependencies = [
"tinyvec_macros",
]
@@ -2413,9 +2413,9 @@ dependencies = [
[[package]]
name = "uuid"
version = "1.23.4"
version = "1.23.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53"
checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a"
dependencies = [
"getrandom 0.4.3",
"js-sys",
@@ -2780,6 +2780,6 @@ dependencies = [
[[package]]
name = "zmij"
version = "1.0.21"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
+3 -2
View File
@@ -1,8 +1,9 @@
[package]
name = "swoosh"
version = "0.5.3"
version = "0.5.4"
edition = "2024"
rust-version = "1.97"
license = "MIT"
description = "Library to send text messages"
[dependencies]
@@ -11,6 +12,6 @@ serde_json = { version = "1.0.150" }
reqwest = { version = "0.13.4", features = ["form", "json", "blocking", "multipart", "stream"] }
time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
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]
+22
View File
@@ -0,0 +1,22 @@
Copyright (c) 2026 Kun Deng.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+3
View File
@@ -0,0 +1,3 @@
# swoosh
A library used to send text messages and is used in conjunction of the `schedtxt`
project.
+7 -7
View File
@@ -14,10 +14,10 @@ pub use send_message as send_mssage;
/// Send a message
pub async fn send_message(
msg: &textsender_models::message::Message,
contact: &textsender_models::contact::Contact,
msg: &schedtxt_models::message::Message,
contact: &schedtxt_models::contact::Contact,
param: &crate::twilio::types::Parameters,
config: &textsender_models::config::auxiliary::TwilioConfig,
config: &schedtxt_models::config::auxiliary::TwilioConfig,
) -> Result<reqwest::Response, std::io::Error> {
if config.account_sid.is_empty() {
Err(std::io::Error::other("Account SID is empty"))
@@ -145,9 +145,9 @@ pub fn initial_params(
}
fn init_params(
contact: &textsender_models::contact::Contact,
message: &textsender_models::message::Message,
config: &textsender_models::config::auxiliary::TwilioConfig,
contact: &schedtxt_models::contact::Contact,
message: &schedtxt_models::message::Message,
config: &schedtxt_models::config::auxiliary::TwilioConfig,
param: &crate::twilio::types::Parameters,
) -> std::collections::HashMap<String, String> {
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(
config: &textsender_models::config::auxiliary::TwilioConfig,
config: &schedtxt_models::config::auxiliary::TwilioConfig,
) -> Result<String, base64_ng::EncodeError> {
let input = format!("{}:{}", config.account_sid, config.auth_token);
match base64_ng::encode(input.as_bytes()) {