From c6103ebba463ea7d041db1b825f85e3218f15f09 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 15:51:57 -0400 Subject: [PATCH 01/26] Adding type that maps to the response when a message is sent --- src/twilio/api/types/mod.rs | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index e69de29..fc2f1b5 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -0,0 +1,60 @@ + +#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] +pub struct APIMessage { + pub account_sid: String, + pub api_version: String, + pub body: String, + // pub date_created: time::OffsetDateTime, + pub date_sent: Option, + pub date_updated: time::OffsetDateTime, + pub direction: String, + // Not definite of what type this is + pub error_code: Option, + // Not definite of what type this is + pub error_message: Option, + pub from: String, + pub messaging_service_sid: String, + pub num_media: String, + pub num_segments: String, + pub price: Option, + pub price_unit: Option, + pub sid: String, + pub status: String, + pub subresource_uris: SubresourceURI, + pub to: String, + pub uri: String +} + +#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] +pub struct SubresourceURI { + pub media: String, +} + + + +/* +{ + "account_sid": "ACefa1ef516314c9d1a68cbd657de49277", + "api_version": "2010-04-01", + "body": "This is a test", + "date_created": "Wed, 03 Jun 2026 19:40:55 +0000", + "date_sent": null, + "date_updated": "Wed, 03 Jun 2026 19:40:55 +0000", + "direction": "outbound-api", + "error_code": null, + "error_message": null, + "from": "+12243026041", + "messaging_service_sid": "MG803f3676706b92eb02e18dd820c447f2", + "num_media": "0", + "num_segments": "0", + "price": null, + "price_unit": null, + "sid": "SMf5c09c776c931bdb00c6e274da2ce34d", + "status": "scheduled", + "subresource_uris": { + "media": "/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages/SMf5c09c776c931bdb00c6e274da2ce34d/Media.json" + }, + "to": "+16303831708", + "uri": "/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages/SMf5c09c776c931bdb00c6e274da2ce34d.json" +} +*/ -- 2.47.3 From 7c3b51d6a0f4ee6a5082389452f9ac307da4ab77 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 15:52:43 -0400 Subject: [PATCH 02/26] Renaming struct --- src/twilio/api/types/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index fc2f1b5..062c598 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -1,6 +1,6 @@ #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] -pub struct APIMessage { +pub struct TwilioAPIMessage { pub account_sid: String, pub api_version: String, pub body: String, -- 2.47.3 From 97dcb360abfc6e107b6c8ac33176a8d2bd3ae915 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 15:55:09 -0400 Subject: [PATCH 03/26] Fixed type --- src/twilio/api/types/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index 062c598..598c283 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -6,7 +6,7 @@ pub struct TwilioAPIMessage { pub body: String, // pub date_created: time::OffsetDateTime, pub date_sent: Option, - pub date_updated: time::OffsetDateTime, + pub date_updated: Option, pub direction: String, // Not definite of what type this is pub error_code: Option, -- 2.47.3 From e487a2c275dd08525c05e87deef5481a40c3488d Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 16:09:30 -0400 Subject: [PATCH 04/26] Adding type needed to send message --- src/twilio/types/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/twilio/types/mod.rs b/src/twilio/types/mod.rs index e69de29..e124435 100644 --- a/src/twilio/types/mod.rs +++ b/src/twilio/types/mod.rs @@ -0,0 +1,10 @@ + +// Things needed to send a message +// Contact - Receipient to send to (textsender-models) +// Message - The content to sent (textsender-models) +// Parameters - Controls flow of sending message +// Config - Contains info needed to send message (textsender-models) +pub struct Parameters { + pub schedule: bool, + pub schedule_at: Option, +} -- 2.47.3 From 0cbf63c78dd6856ff51fde87951b2854e9fa8925 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 16:15:33 -0400 Subject: [PATCH 05/26] Adding networking dependencies --- Cargo.lock | 1479 +++++++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 + 2 files changed, 1469 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be6bc5e..395f51e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,34 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "aws-lc-rs" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "base64" version = "0.22.1" @@ -41,6 +69,12 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + [[package]] name = "cc" version = "1.2.63" @@ -48,6 +82,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" dependencies = [ "find-msvc-tools", + "jobserver", + "libc", "shlex", ] @@ -57,6 +93,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha20" version = "0.10.0" @@ -65,7 +107,26 @@ checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", "cpufeatures", - "rand_core", + "rand_core 0.10.1", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", ] [[package]] @@ -89,6 +150,32 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.3.0" @@ -117,12 +204,38 @@ dependencies = [ "serde_core", ] +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dotenvy" version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -136,7 +249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -161,6 +274,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foldhash" version = "0.1.5" @@ -182,12 +301,60 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + [[package]] name = "futures-core" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + [[package]] name = "futures-task" version = "0.3.32" @@ -201,11 +368,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "slab", ] +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + [[package]] name = "getrandom" version = "0.4.2" @@ -214,12 +412,31 @@ checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", - "r-efi", - "rand_core", + "r-efi 6.0.0", + "rand_core 0.10.1", "wasip2", "wasip3", ] +[[package]] +name = "h2" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.15.5" @@ -241,12 +458,215 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "http" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be7462df143984c4598a256ef469b251d7d7f9e271135073e78fc535414f3d0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "id-arena" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "indexmap" version = "2.14.0" @@ -259,12 +679,77 @@ dependencies = [ "serde_core", ] +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + [[package]] name = "josekit" version = "0.10.3" @@ -327,18 +812,46 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + [[package]] name = "log" version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "113b30b4cd05f7c06868fdb2854f66a7b9fece9a48425351cd532e810d74024f" +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "memchr" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -349,6 +862,17 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mio" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + [[package]] name = "num-conv" version = "0.2.2" @@ -386,6 +910,12 @@ dependencies = [ "syn", ] +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "openssl-sys" version = "0.9.116" @@ -398,6 +928,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + [[package]] name = "pin-project-lite" version = "0.2.17" @@ -410,12 +946,30 @@ version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + [[package]] name = "prettyplease" version = "0.2.37" @@ -435,6 +989,62 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.4", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.45" @@ -444,12 +1054,28 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "r-efi" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + [[package]] name = "rand" version = "0.10.1" @@ -457,8 +1083,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ "chacha20", - "getrandom", - "rand_core", + "getrandom 0.4.2", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", ] [[package]] @@ -496,6 +1141,80 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +[[package]] +name = "reqwest" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "1.1.4" @@ -506,7 +1225,82 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -515,6 +1309,47 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.28" @@ -577,19 +1412,65 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "slab" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "swoosh" version = "0.2.1" dependencies = [ "const_format", + "http", "josekit", - "rand", + "rand 0.10.1", + "reqwest", "serde", "serde_json", "tempfile", @@ -609,6 +1490,47 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" version = "3.27.0" @@ -616,10 +1538,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom", + "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -630,7 +1552,7 @@ dependencies = [ "const_format", "dotenvy", "josekit", - "rand", + "rand 0.10.1", "serde", "serde_json", "time", @@ -689,6 +1611,144 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + [[package]] name = "unicode-ident" version = "1.0.24" @@ -701,6 +1761,30 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utoipa" version = "5.5.0" @@ -731,7 +1815,7 @@ version = "1.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d258b83ceec21034727ecee8c382cfa6c3e133699b0742c64571814fb420c9f7" dependencies = [ - "getrandom", + "getrandom 0.4.2", "js-sys", "serde_core", "wasm-bindgen", @@ -743,6 +1827,31 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + [[package]] name = "wasip2" version = "1.0.3+wasi-0.2.9" @@ -774,6 +1883,16 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.122" @@ -828,6 +1947,19 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmparser" version = "0.244.0" @@ -840,12 +1972,97 @@ dependencies = [ "semver", ] +[[package]] +name = "web-sys" +version = "0.3.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -855,6 +2072,135 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "wit-bindgen" version = "0.51.0" @@ -949,6 +2295,115 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b065d4f0e55f82fae73202e189638116a87c55ab6b8e6c2721e13dd9d854ad1" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b631b19d36a892ab55420c92dbc83ccd79274f25be714855d3074aa71cab639" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zmij" version = "1.0.21" diff --git a/Cargo.toml b/Cargo.toml index ec46ba5..6709af8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,8 @@ description = "Library to send text messages" [dependencies] serde = { version = "1.0.228", features = ["derive"] } serde_json = { version = "1.0.149" } +http = { version = "1.4.0" } +reqwest = { version = "0.13.3", features = ["json", "blocking", "multipart", "stream"] } rand = { version = "0.10.1" } time = { version = "0.3.47", features = ["formatting", "macros", "parsing", "serde"] } uuid = { version = "1.23.1", features = ["v4", "serde"] } -- 2.47.3 From 2971363d2f83159ec6d7c69cfeffe9e930a8c5f5 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 16:52:19 -0400 Subject: [PATCH 06/26] Saving changes --- src/twilio/api/mod.rs | 167 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index cd40856..1cfde89 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -1 +1,168 @@ +// use josekit::jwk::alg::ec::EcCurve::P256; + pub mod types; + +pub fn send_mssage(msg: &textsender_models::message::Message, contact: &textsender_models::contact::Contact, param: crate::twilio::types::Parameters, config: &textsender_models::config::auxiliary::TwilioConfig) -> Result { + if config.account_sid.is_nil() { + Err(std::io::Error::other("Account SID is empty")) + } else if config.auth_token.is_empty() { + Err(std::io::Error::other(" Auth token is empty")) + } else { + let now = time::OffsetDateTime::now_utc(); + match reqwest::Client::builder() .build() { + Ok(client) => { + let mut headers = reqwest::header::HeaderMap::new(); + headers.insert("Content-Type", "application/x-www-form-urlencoded".parse().unwrap()); + headers.insert("Accept", "application/json".parse().unwrap()); + // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); + + let mut params = std::collections::HashMap::new(); + params.insert("To", contact.phone_number.as_str()); + // params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); + // params.insert("MaxPrice", "1"); + params.insert("ProvideFeedback", "true"); + // params.insert("Attempt", "5"); + // params.insert("ValidityPeriod", "1537"); + params.insert("ForceDelivery", "false"); + params.insert("ContentRetention", "retain"); + params.insert("AddressRetention", "obfuscate"); + params.insert("SmartEncoded", "true"); + // params.insert("PersistentAction", "string"); + // params.insert("PersistentAction", "string"); + params.insert("ShortenUrls", "true"); + // params.insert("ScheduleType", "fixed"); + // params.insert("SendAt", "2026-06-03T19:50:00.0Z"); + params.insert("SendAsMms", "true"); + params.insert("RiskCheck", "enable"); + params.insert("From", config.phone_number.as_str()); + params.insert("MessagingServiceSid", config.service_sid.as_str()); + params.insert("Body", msg.content.as_str()); + + let url = format!("https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json"); + + let client = reqwest::Client::new(); + /* + let request = client.request(reqwest::Method::POST, url) + .headers(headers) + .form(¶ms); + */ + let request = client.post(url).headers(headers); + + match request.send().await { + Ok(response) => { + let body = response.text(); + + let mut obj = crate::twilio::api::types::TwilioAPIMessage{..Default::default()}; + Ok(obj) + } + Err(err) => { + Err(std::io::Error::other(err.to_string())) + } + } + } + Err(err) => { + Err(std::io::Error::other(err.to_string())) + } + } + } +} + + +/* +#[tokio::main] +async fn main() -> Result<(), Box> { + let client = reqwest::Client::builder() + .build()?; + + let mut headers = reqwest::header::HeaderMap::new(); + headers.insert("Content-Type", "application/x-www-form-urlencoded".parse()?); + headers.insert("Accept", "application/json".parse()?); + headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); + + let mut params = std::collections::HashMap::new(); + params.insert("To", "16303831708"); + params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); + params.insert("MaxPrice", "1"); + params.insert("ProvideFeedback", "true"); + params.insert("Attempt", "5"); + params.insert("ValidityPeriod", "1537"); + params.insert("ForceDelivery", "false"); + params.insert("ContentRetention", "retain"); + params.insert("AddressRetention", "obfuscate"); + params.insert("SmartEncoded", "true"); + params.insert("PersistentAction", "string"); + params.insert("PersistentAction", "string"); + params.insert("ShortenUrls", "true"); + params.insert("ScheduleType", "fixed"); + params.insert("SendAt", "2026-06-03T19:50:00.0Z"); + params.insert("SendAsMms", "true"); + params.insert("RiskCheck", "enable"); + params.insert("From", "12243026041"); + params.insert("MessagingServiceSid", "MG803f3676706b92eb02e18dd820c447f2"); + params.insert("Body", "This is a test"); + + let request = client.request(reqwest::Method::POST, "https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json") + .headers(headers) + .form(¶ms); + + let response = request.send().await?; + let body = response.text().await?; + + println!("{}", body); + + Ok(()) +} +*/ + + +/** + func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTime *time.Time) (*types.TwilioResult, map[string]any, error) { + if m.Config == nil { + return nil, nil, fmt.Errorf("Config has not been initialized") + } + now := time.Now() + client := twilio.NewRestClientWithParams(twilio.ClientParams{ + Username: m.Config.AccountSID, + Password: m.Config.AuthToken, + }) + + params := &twilioApi.CreateMessageParams{} + params.SetTo(number.PhoneNumber) + params.SetFrom(m.Config.Number) + params.SetMessagingServiceSid(m.Config.ServiceSID) + params.SetBody(msg.Content) + if sendTime != nil && isSchedulable(&now, sendTime) { + params.SetSendAt(*sendTime) + params.SetScheduleType(Schedule_Type) + } + + if resp, err := client.Api.CreateMessage(params); err != nil { + return nil, nil, fmt.Errorf("Error sending message: %v", err) + } else { + if twilioRespMarshaled, err := json.Marshal(*resp); err != nil { + return nil, nil, fmt.Errorf("Error parsing result: %v", err) + } else { + var rawObject map[string]any + if err := json.Unmarshal(twilioRespMarshaled, &rawObject); err != nil { + return resp, nil, err + } else { + return resp, rawObject, nil + } + } + } +} + +func isSchedulable(now *time.Time, scheduled *time.Time) bool { + early := now.Add(Schedulable_Limit_In_Seconds * time.Second) + + if scheduled.After(early) { + return true + } else { + return false + } +} +*/ + +fn is_scheduleable(now: &Option, scheduled: &Option) -> bool { + true +} -- 2.47.3 From 5752741972f7d3ce1dea7cba1129509f541d7f6d Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 16:52:46 -0400 Subject: [PATCH 07/26] cargo fmt --- src/twilio/api/mod.rs | 185 +++++++++++++++++++----------------- src/twilio/api/types/mod.rs | 5 +- src/twilio/types/mod.rs | 1 - 3 files changed, 98 insertions(+), 93 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 1cfde89..0f07fb7 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -2,72 +2,79 @@ pub mod types; -pub fn send_mssage(msg: &textsender_models::message::Message, contact: &textsender_models::contact::Contact, param: crate::twilio::types::Parameters, config: &textsender_models::config::auxiliary::TwilioConfig) -> Result { +pub fn send_mssage( + msg: &textsender_models::message::Message, + contact: &textsender_models::contact::Contact, + param: crate::twilio::types::Parameters, + config: &textsender_models::config::auxiliary::TwilioConfig, +) -> Result { if config.account_sid.is_nil() { Err(std::io::Error::other("Account SID is empty")) } else if config.auth_token.is_empty() { Err(std::io::Error::other(" Auth token is empty")) } else { let now = time::OffsetDateTime::now_utc(); - match reqwest::Client::builder() .build() { + match reqwest::Client::builder().build() { Ok(client) => { - let mut headers = reqwest::header::HeaderMap::new(); - headers.insert("Content-Type", "application/x-www-form-urlencoded".parse().unwrap()); - headers.insert("Accept", "application/json".parse().unwrap()); - // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); + let mut headers = reqwest::header::HeaderMap::new(); + headers.insert( + "Content-Type", + "application/x-www-form-urlencoded".parse().unwrap(), + ); + headers.insert("Accept", "application/json".parse().unwrap()); + // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); - let mut params = std::collections::HashMap::new(); - params.insert("To", contact.phone_number.as_str()); - // params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); - // params.insert("MaxPrice", "1"); - params.insert("ProvideFeedback", "true"); - // params.insert("Attempt", "5"); - // params.insert("ValidityPeriod", "1537"); - params.insert("ForceDelivery", "false"); - params.insert("ContentRetention", "retain"); - params.insert("AddressRetention", "obfuscate"); - params.insert("SmartEncoded", "true"); - // params.insert("PersistentAction", "string"); - // params.insert("PersistentAction", "string"); - params.insert("ShortenUrls", "true"); - // params.insert("ScheduleType", "fixed"); - // params.insert("SendAt", "2026-06-03T19:50:00.0Z"); - params.insert("SendAsMms", "true"); - params.insert("RiskCheck", "enable"); - params.insert("From", config.phone_number.as_str()); - params.insert("MessagingServiceSid", config.service_sid.as_str()); - params.insert("Body", msg.content.as_str()); + let mut params = std::collections::HashMap::new(); + params.insert("To", contact.phone_number.as_str()); + // params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); + // params.insert("MaxPrice", "1"); + params.insert("ProvideFeedback", "true"); + // params.insert("Attempt", "5"); + // params.insert("ValidityPeriod", "1537"); + params.insert("ForceDelivery", "false"); + params.insert("ContentRetention", "retain"); + params.insert("AddressRetention", "obfuscate"); + params.insert("SmartEncoded", "true"); + // params.insert("PersistentAction", "string"); + // params.insert("PersistentAction", "string"); + params.insert("ShortenUrls", "true"); + // params.insert("ScheduleType", "fixed"); + // params.insert("SendAt", "2026-06-03T19:50:00.0Z"); + params.insert("SendAsMms", "true"); + params.insert("RiskCheck", "enable"); + params.insert("From", config.phone_number.as_str()); + params.insert("MessagingServiceSid", config.service_sid.as_str()); + params.insert("Body", msg.content.as_str()); - let url = format!("https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json"); + let url = format!( + "https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json" + ); - let client = reqwest::Client::new(); - /* - let request = client.request(reqwest::Method::POST, url) - .headers(headers) - .form(¶ms); - */ - let request = client.post(url).headers(headers); + let client = reqwest::Client::new(); + /* + let request = client.request(reqwest::Method::POST, url) + .headers(headers) + .form(¶ms); + */ + let request = client.post(url).headers(headers); - match request.send().await { - Ok(response) => { - let body = response.text(); + match request.send().await { + Ok(response) => { + let body = response.text(); - let mut obj = crate::twilio::api::types::TwilioAPIMessage{..Default::default()}; - Ok(obj) - } - Err(err) => { - Err(std::io::Error::other(err.to_string())) - } - } - } - Err(err) => { - Err(std::io::Error::other(err.to_string())) + let mut obj = crate::twilio::api::types::TwilioAPIMessage { + ..Default::default() + }; + Ok(obj) + } + Err(err) => Err(std::io::Error::other(err.to_string())), + } } + Err(err) => Err(std::io::Error::other(err.to_string())), } } } - /* #[tokio::main] async fn main() -> Result<(), Box> { @@ -114,55 +121,57 @@ async fn main() -> Result<(), Box> { } */ - /** func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTime *time.Time) (*types.TwilioResult, map[string]any, error) { - if m.Config == nil { - return nil, nil, fmt.Errorf("Config has not been initialized") - } - now := time.Now() - client := twilio.NewRestClientWithParams(twilio.ClientParams{ - Username: m.Config.AccountSID, - Password: m.Config.AuthToken, - }) + if m.Config == nil { + return nil, nil, fmt.Errorf("Config has not been initialized") + } + now := time.Now() + client := twilio.NewRestClientWithParams(twilio.ClientParams{ + Username: m.Config.AccountSID, + Password: m.Config.AuthToken, + }) - params := &twilioApi.CreateMessageParams{} - params.SetTo(number.PhoneNumber) - params.SetFrom(m.Config.Number) - params.SetMessagingServiceSid(m.Config.ServiceSID) - params.SetBody(msg.Content) - if sendTime != nil && isSchedulable(&now, sendTime) { - params.SetSendAt(*sendTime) - params.SetScheduleType(Schedule_Type) - } + params := &twilioApi.CreateMessageParams{} + params.SetTo(number.PhoneNumber) + params.SetFrom(m.Config.Number) + params.SetMessagingServiceSid(m.Config.ServiceSID) + params.SetBody(msg.Content) + if sendTime != nil && isSchedulable(&now, sendTime) { + params.SetSendAt(*sendTime) + params.SetScheduleType(Schedule_Type) + } - if resp, err := client.Api.CreateMessage(params); err != nil { - return nil, nil, fmt.Errorf("Error sending message: %v", err) - } else { - if twilioRespMarshaled, err := json.Marshal(*resp); err != nil { - return nil, nil, fmt.Errorf("Error parsing result: %v", err) - } else { - var rawObject map[string]any - if err := json.Unmarshal(twilioRespMarshaled, &rawObject); err != nil { - return resp, nil, err - } else { - return resp, rawObject, nil - } - } - } + if resp, err := client.Api.CreateMessage(params); err != nil { + return nil, nil, fmt.Errorf("Error sending message: %v", err) + } else { + if twilioRespMarshaled, err := json.Marshal(*resp); err != nil { + return nil, nil, fmt.Errorf("Error parsing result: %v", err) + } else { + var rawObject map[string]any + if err := json.Unmarshal(twilioRespMarshaled, &rawObject); err != nil { + return resp, nil, err + } else { + return resp, rawObject, nil + } + } + } } func isSchedulable(now *time.Time, scheduled *time.Time) bool { - early := now.Add(Schedulable_Limit_In_Seconds * time.Second) + early := now.Add(Schedulable_Limit_In_Seconds * time.Second) - if scheduled.After(early) { - return true - } else { - return false - } + if scheduled.After(early) { + return true + } else { + return false + } } */ -fn is_scheduleable(now: &Option, scheduled: &Option) -> bool { +fn is_scheduleable( + now: &Option, + scheduled: &Option, +) -> bool { true } diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index 598c283..3a3e78e 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -1,4 +1,3 @@ - #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] pub struct TwilioAPIMessage { pub account_sid: String, @@ -22,7 +21,7 @@ pub struct TwilioAPIMessage { pub status: String, pub subresource_uris: SubresourceURI, pub to: String, - pub uri: String + pub uri: String, } #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] @@ -30,8 +29,6 @@ pub struct SubresourceURI { pub media: String, } - - /* { "account_sid": "ACefa1ef516314c9d1a68cbd657de49277", diff --git a/src/twilio/types/mod.rs b/src/twilio/types/mod.rs index e124435..e65fba3 100644 --- a/src/twilio/types/mod.rs +++ b/src/twilio/types/mod.rs @@ -1,4 +1,3 @@ - // Things needed to send a message // Contact - Receipient to send to (textsender-models) // Message - The content to sent (textsender-models) -- 2.47.3 From 3c450610268634bdbced8eb3d40e9526be93b0a8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:07:30 -0400 Subject: [PATCH 08/26] Next step --- src/twilio/api/mod.rs | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 0f07fb7..0c80601 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -2,7 +2,7 @@ pub mod types; -pub fn send_mssage( +pub async fn send_mssage( msg: &textsender_models::message::Message, contact: &textsender_models::contact::Contact, param: crate::twilio::types::Parameters, @@ -22,6 +22,7 @@ pub fn send_mssage( "application/x-www-form-urlencoded".parse().unwrap(), ); headers.insert("Accept", "application/json".parse().unwrap()); + let auth = generate_auth(&config); // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); let mut params = std::collections::HashMap::new(); @@ -38,8 +39,19 @@ pub fn send_mssage( // params.insert("PersistentAction", "string"); // params.insert("PersistentAction", "string"); params.insert("ShortenUrls", "true"); - // params.insert("ScheduleType", "fixed"); - // params.insert("SendAt", "2026-06-03T19:50:00.0Z"); + let date = match param.schedule_at { + Some(date_value) => { + let converted = date_value.to_string(); + converted + } + None => { + String::new() + } + }; + if param.schedule && is_scheduleable(&Some(now), ¶m.schedule_at) { + params.insert("ScheduleType", "fixed"); + params.insert("SendAt", date.as_str()); + } params.insert("SendAsMms", "true"); params.insert("RiskCheck", "enable"); params.insert("From", config.phone_number.as_str()); @@ -50,22 +62,28 @@ pub fn send_mssage( "https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json" ); - let client = reqwest::Client::new(); + // let client = reqwest::Client::new(); /* let request = client.request(reqwest::Method::POST, url) .headers(headers) .form(¶ms); */ - let request = client.post(url).headers(headers); + let request = client.post(url).headers(headers).form(¶ms); match request.send().await { Ok(response) => { - let body = response.text(); + match response.text().await { + Ok(body) => { + let mut obj = crate::twilio::api::types::TwilioAPIMessage { + ..Default::default() + }; - let mut obj = crate::twilio::api::types::TwilioAPIMessage { - ..Default::default() - }; - Ok(obj) + Ok(obj) + } + Err(err) => { + Err(std::io::Error::other(err)) + } + } } Err(err) => Err(std::io::Error::other(err.to_string())), } -- 2.47.3 From a065388805e2c197402e47dc1b5df4f6c05dccc2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:08:01 -0400 Subject: [PATCH 09/26] Added crates --- Cargo.lock | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 4 +- 2 files changed, 122 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 395f51e..d10a4ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,6 +316,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.32" @@ -332,6 +347,17 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.32" @@ -367,6 +393,7 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -818,6 +845,15 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.4.31" @@ -928,6 +964,29 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + [[package]] name = "percent-encoding" version = "2.3.2" @@ -1112,6 +1171,15 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.12.3" @@ -1172,6 +1240,7 @@ dependencies = [ "rustls-platform-verifier", "serde", "serde_json", + "serde_urlencoded", "sync_wrapper", "tokio", "tokio-rustls", @@ -1309,6 +1378,12 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + [[package]] name = "same-file" version = "1.0.6" @@ -1327,6 +1402,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "security-framework" version = "3.7.0" @@ -1400,12 +1481,34 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "shlex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.9" @@ -1467,6 +1570,7 @@ name = "swoosh" version = "0.2.1" dependencies = [ "const_format", + "futures", "http", "josekit", "rand 0.10.1", @@ -1476,6 +1580,7 @@ dependencies = [ "tempfile", "textsender_models", "time", + "tokio", "uuid", ] @@ -1645,11 +1750,25 @@ dependencies = [ "bytes", "libc", "mio", + "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", + "tokio-macros", "windows-sys 0.61.2", ] +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-rustls" version = "0.26.4" diff --git a/Cargo.toml b/Cargo.toml index 6709af8..09b8397 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,10 @@ description = "Library to send text messages" [dependencies] serde = { version = "1.0.228", features = ["derive"] } serde_json = { version = "1.0.149" } +tokio = { version = "1.52.2", features = ["full"] } +futures = { version = "0.3.32" } http = { version = "1.4.0" } -reqwest = { version = "0.13.3", features = ["json", "blocking", "multipart", "stream"] } +reqwest = { version = "0.13.3", features = ["form", "json", "blocking", "multipart", "stream"] } rand = { version = "0.10.1" } time = { version = "0.3.47", features = ["formatting", "macros", "parsing", "serde"] } uuid = { version = "1.23.1", features = ["v4", "serde"] } -- 2.47.3 From 57d16c6996de9336fba2a42dfd6750e81d52144e Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:28:36 -0400 Subject: [PATCH 10/26] Fixed some things --- src/twilio/api/mod.rs | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 0c80601..d3e0196 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -22,8 +22,9 @@ pub async fn send_mssage( "application/x-www-form-urlencoded".parse().unwrap(), ); headers.insert("Accept", "application/json".parse().unwrap()); - let auth = generate_auth(&config); + let auth = generate_auth(config).unwrap(); // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); + headers.insert("Authorization", auth.parse().unwrap()); let mut params = std::collections::HashMap::new(); params.insert("To", contact.phone_number.as_str()); @@ -74,8 +75,8 @@ pub async fn send_mssage( Ok(response) => { match response.text().await { Ok(body) => { - let mut obj = crate::twilio::api::types::TwilioAPIMessage { - ..Default::default() + let mut obj = crate::twilio::api::types::TwilioAPIMessage { + ..Default::default() }; Ok(obj) @@ -93,6 +94,17 @@ pub async fn send_mssage( } } +fn generate_auth(config: &textsender_models::config::auxiliary::TwilioConfig) -> Result { + let input = format!("{}:{}", config.account_sid, config.auth_token); + match base64_ng::encode(input.as_bytes()) { + Ok(encoded) => { + Ok(format!("Basic {encoded}")) + } + Err(err) => { + Err(err) + } + } +} /* #[tokio::main] async fn main() -> Result<(), Box> { @@ -191,5 +203,17 @@ fn is_scheduleable( now: &Option, scheduled: &Option, ) -> bool { - true + match scheduled { + Some(schedule_at) => { + let early = now.unwrap().checked_add(time::Duration::seconds(300)).unwrap(); + if *schedule_at > early { + true + } else { + false + } + } + None => { + false + } + } } -- 2.47.3 From f0ffc580e6d4eeb9d940035efd90dc08e2ea358d Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:29:02 -0400 Subject: [PATCH 11/26] Adding crate --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + 2 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d10a4ed..5d7b497 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,6 +57,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-ng" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452b0c98385f31f08318109d6e06a859f89e0c5e38aad6103f095443b063052" + [[package]] name = "bitflags" version = "2.12.1" @@ -1569,6 +1575,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" name = "swoosh" version = "0.2.1" dependencies = [ + "base64-ng", "const_format", "futures", "http", diff --git a/Cargo.toml b/Cargo.toml index 09b8397..b8c365a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ reqwest = { version = "0.13.3", features = ["form", "json", "blocking", "multipa rand = { version = "0.10.1" } time = { version = "0.3.47", features = ["formatting", "macros", "parsing", "serde"] } uuid = { version = "1.23.1", features = ["v4", "serde"] } +base64-ng = { version = "1.0.6" } const_format = { version = "0.2.36" } josekit = { version = "0.10.3" } textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender-models.git", tag = "v0.3.0-20-15820d5505-111" } -- 2.47.3 From 29fcf41a9cd54c8ce4f365b210eb203efa78e12c Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:40:25 -0400 Subject: [PATCH 12/26] Need to try this out --- src/twilio/api/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index d3e0196..fccd0cb 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -60,7 +60,7 @@ pub async fn send_mssage( params.insert("Body", msg.content.as_str()); let url = format!( - "https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json" + "https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json", config.account_sid ); // let client = reqwest::Client::new(); @@ -73,6 +73,15 @@ pub async fn send_mssage( match request.send().await { Ok(response) => { + match response.json::().await { + Ok(resp) => { + Ok(resp) + } + Err(err) => { + Err(std::io::Error::other(err)) + } + } + /* match response.text().await { Ok(body) => { let mut obj = crate::twilio::api::types::TwilioAPIMessage { @@ -85,6 +94,7 @@ pub async fn send_mssage( Err(std::io::Error::other(err)) } } + */ } Err(err) => Err(std::io::Error::other(err.to_string())), } -- 2.47.3 From d21d72f5961aff16693434f4863d541194cce5b1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:43:32 -0400 Subject: [PATCH 13/26] Fixed variable in workflow --- .gitea/workflows/workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index 76ce847..cfb8a60 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -21,7 +21,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MYHOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -40,7 +40,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MYHOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -60,7 +60,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MYHOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -80,7 +80,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MYHOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -99,7 +99,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MYHOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key -- 2.47.3 From 0e68debd42907bd815187769c479d6f492ded1c5 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 20:46:20 -0400 Subject: [PATCH 14/26] Fixing syntax issue --- .gitea/workflows/workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index cfb8a60..ca1166a 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -21,7 +21,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -40,7 +40,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -60,7 +60,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -80,7 +80,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key @@ -99,7 +99,7 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key chmod 600 ~/.ssh/textsender-models_deploy_key - ssh-keyscan ${{ secret.MY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add -v ~/.ssh/textsender-models_deploy_key -- 2.47.3 From a9fde833aaedd663a512ace33c550c153629857f Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 21:37:23 -0400 Subject: [PATCH 15/26] Changed type check --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/twilio/api/mod.rs | 49 +++++++++++++++++++------------------------ 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d7b497..050e8c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1658,8 +1658,8 @@ dependencies = [ [[package]] name = "textsender_models" -version = "0.3.0" -source = "git+ssh://git@git.kundeng.us/phoenix/textsender-models.git?tag=v0.3.0-20-15820d5505-111#15820d550526aea3016821c01f508d8d590292cc" +version = "0.2.5" +source = "git+ssh://git@git.kundeng.us/phoenix/textsender-models.git?tag=v0.2.5-v0.3.0-migrate-38dbcb09f7-111#38dbcb09f7c2c572f429ec382c01e14b72b1d615" dependencies = [ "const_format", "dotenvy", diff --git a/Cargo.toml b/Cargo.toml index b8c365a..0b3834e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ uuid = { version = "1.23.1", features = ["v4", "serde"] } base64-ng = { version = "1.0.6" } const_format = { version = "0.2.36" } josekit = { version = "0.10.3" } -textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender-models.git", tag = "v0.3.0-20-15820d5505-111" } +textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender-models.git", tag = "v0.2.5-v0.3.0-migrate-38dbcb09f7-111" } [dev-dependencies] tempfile = { version = "3.27.0" } diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index fccd0cb..f6ef1bd 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -8,7 +8,7 @@ pub async fn send_mssage( param: crate::twilio::types::Parameters, config: &textsender_models::config::auxiliary::TwilioConfig, ) -> Result { - if config.account_sid.is_nil() { + if config.account_sid.is_empty() { Err(std::io::Error::other("Account SID is empty")) } else if config.auth_token.is_empty() { Err(std::io::Error::other(" Auth token is empty")) @@ -45,9 +45,7 @@ pub async fn send_mssage( let converted = date_value.to_string(); converted } - None => { - String::new() - } + None => String::new(), }; if param.schedule && is_scheduleable(&Some(now), ¶m.schedule_at) { params.insert("ScheduleType", "fixed"); @@ -60,7 +58,8 @@ pub async fn send_mssage( params.insert("Body", msg.content.as_str()); let url = format!( - "https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json", config.account_sid + "https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json", + config.account_sid ); // let client = reqwest::Client::new(); @@ -73,13 +72,12 @@ pub async fn send_mssage( match request.send().await { Ok(response) => { - match response.json::().await { - Ok(resp) => { - Ok(resp) - } - Err(err) => { - Err(std::io::Error::other(err)) - } + match response + .json::() + .await + { + Ok(resp) => Ok(resp), + Err(err) => Err(std::io::Error::other(err)), } /* match response.text().await { @@ -104,15 +102,13 @@ pub async fn send_mssage( } } -fn generate_auth(config: &textsender_models::config::auxiliary::TwilioConfig) -> Result { +fn generate_auth( + config: &textsender_models::config::auxiliary::TwilioConfig, +) -> Result { let input = format!("{}:{}", config.account_sid, config.auth_token); match base64_ng::encode(input.as_bytes()) { - Ok(encoded) => { - Ok(format!("Basic {encoded}")) - } - Err(err) => { - Err(err) - } + Ok(encoded) => Ok(format!("Basic {encoded}")), + Err(err) => Err(err), } } /* @@ -215,15 +211,12 @@ fn is_scheduleable( ) -> bool { match scheduled { Some(schedule_at) => { - let early = now.unwrap().checked_add(time::Duration::seconds(300)).unwrap(); - if *schedule_at > early { - true - } else { - false - } - } - None => { - false + let early = now + .unwrap() + .checked_add(time::Duration::seconds(300)) + .unwrap(); + if *schedule_at > early { true } else { false } } + None => false, } } -- 2.47.3 From 0fde9c2edd99d4dfaae313d668bf2ec48b4216be Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 21:55:23 -0400 Subject: [PATCH 16/26] Changed types --- src/twilio/api/types/mod.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index 3a3e78e..e5f22ba 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -3,20 +3,28 @@ pub struct TwilioAPIMessage { pub account_sid: String, pub api_version: String, pub body: String, - // pub date_created: time::OffsetDateTime, + #[serde(with = "time::serde::rfc3339::option")] + pub date_created: Option, + #[serde(with = "time::serde::rfc3339::option")] pub date_sent: Option, + #[serde(with = "time::serde::rfc3339::option")] pub date_updated: Option, pub direction: String, // Not definite of what type this is - pub error_code: Option, + #[serde(skip_serializing_if = "String::is_empty")] + pub error_code: String, // Not definite of what type this is - pub error_message: Option, + #[serde(skip_serializing_if = "String::is_empty")] + pub error_message: String, pub from: String, pub messaging_service_sid: String, pub num_media: String, pub num_segments: String, - pub price: Option, - pub price_unit: Option, + #[serde(skip_serializing_if = "String::is_empty")] + pub price: String, + #[serde(skip_serializing_if = "String::is_empty")] + pub price_unit: String, + #[serde(skip_serializing_if = "String::is_empty")] pub sid: String, pub status: String, pub subresource_uris: SubresourceURI, -- 2.47.3 From 70f5261b4996de4c81f8e2104fb7b3fb325798b8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 3 Jun 2026 21:59:16 -0400 Subject: [PATCH 17/26] Changing return type --- src/twilio/api/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index f6ef1bd..2343c2d 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -7,7 +7,7 @@ pub async fn send_mssage( contact: &textsender_models::contact::Contact, param: crate::twilio::types::Parameters, config: &textsender_models::config::auxiliary::TwilioConfig, -) -> Result { +) -> Result { if config.account_sid.is_empty() { Err(std::io::Error::other("Account SID is empty")) } else if config.auth_token.is_empty() { @@ -72,6 +72,8 @@ pub async fn send_mssage( match request.send().await { Ok(response) => { + Ok(response) + /* match response .json::() .await @@ -79,7 +81,6 @@ pub async fn send_mssage( Ok(resp) => Ok(resp), Err(err) => Err(std::io::Error::other(err)), } - /* match response.text().await { Ok(body) => { let mut obj = crate::twilio::api::types::TwilioAPIMessage { -- 2.47.3 From 6d5e10857d5c68597713aa60ca7d8147bbf3094f Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:15:15 -0400 Subject: [PATCH 18/26] Updating comments --- src/twilio/types/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/twilio/types/mod.rs b/src/twilio/types/mod.rs index e65fba3..69b1bef 100644 --- a/src/twilio/types/mod.rs +++ b/src/twilio/types/mod.rs @@ -1,8 +1,4 @@ -// Things needed to send a message -// Contact - Receipient to send to (textsender-models) -// Message - The content to sent (textsender-models) -// Parameters - Controls flow of sending message -// Config - Contains info needed to send message (textsender-models) +/// Parameters - Controls flow of sending message pub struct Parameters { pub schedule: bool, pub schedule_at: Option, -- 2.47.3 From c71f5bed7a94c827015241be82ac9917cd926f15 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:18:21 -0400 Subject: [PATCH 19/26] Updated comments --- src/twilio/api/mod.rs | 67 ------------------------------------- src/twilio/api/types/mod.rs | 27 --------------- 2 files changed, 94 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 2343c2d..0000b67 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -1,5 +1,3 @@ -// use josekit::jwk::alg::ec::EcCurve::P256; - pub mod types; pub async fn send_mssage( @@ -23,7 +21,6 @@ pub async fn send_mssage( ); headers.insert("Accept", "application/json".parse().unwrap()); let auth = generate_auth(config).unwrap(); - // headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); headers.insert("Authorization", auth.parse().unwrap()); let mut params = std::collections::HashMap::new(); @@ -62,12 +59,6 @@ pub async fn send_mssage( config.account_sid ); - // let client = reqwest::Client::new(); - /* - let request = client.request(reqwest::Method::POST, url) - .headers(headers) - .form(¶ms); - */ let request = client.post(url).headers(headers).form(¶ms); match request.send().await { @@ -113,16 +104,6 @@ fn generate_auth( } } /* -#[tokio::main] -async fn main() -> Result<(), Box> { - let client = reqwest::Client::builder() - .build()?; - - let mut headers = reqwest::header::HeaderMap::new(); - headers.insert("Content-Type", "application/x-www-form-urlencoded".parse()?); - headers.insert("Accept", "application/json".parse()?); - headers.insert("Authorization", "Basic QUNlZmExZWY1MTYzMTRjOWQxYTY4Y2JkNjU3ZGU0OTI3NzpmNGExZjJiMGI3OWVhMzczNTA3OGMyZDhlZTk2ODRlMQ==".parse()?); - let mut params = std::collections::HashMap::new(); params.insert("To", "16303831708"); params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); @@ -158,54 +139,6 @@ async fn main() -> Result<(), Box> { } */ -/** - func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTime *time.Time) (*types.TwilioResult, map[string]any, error) { - if m.Config == nil { - return nil, nil, fmt.Errorf("Config has not been initialized") - } - now := time.Now() - client := twilio.NewRestClientWithParams(twilio.ClientParams{ - Username: m.Config.AccountSID, - Password: m.Config.AuthToken, - }) - - params := &twilioApi.CreateMessageParams{} - params.SetTo(number.PhoneNumber) - params.SetFrom(m.Config.Number) - params.SetMessagingServiceSid(m.Config.ServiceSID) - params.SetBody(msg.Content) - if sendTime != nil && isSchedulable(&now, sendTime) { - params.SetSendAt(*sendTime) - params.SetScheduleType(Schedule_Type) - } - - if resp, err := client.Api.CreateMessage(params); err != nil { - return nil, nil, fmt.Errorf("Error sending message: %v", err) - } else { - if twilioRespMarshaled, err := json.Marshal(*resp); err != nil { - return nil, nil, fmt.Errorf("Error parsing result: %v", err) - } else { - var rawObject map[string]any - if err := json.Unmarshal(twilioRespMarshaled, &rawObject); err != nil { - return resp, nil, err - } else { - return resp, rawObject, nil - } - } - } -} - -func isSchedulable(now *time.Time, scheduled *time.Time) bool { - early := now.Add(Schedulable_Limit_In_Seconds * time.Second) - - if scheduled.After(early) { - return true - } else { - return false - } -} -*/ - fn is_scheduleable( now: &Option, scheduled: &Option, diff --git a/src/twilio/api/types/mod.rs b/src/twilio/api/types/mod.rs index e5f22ba..f5d93af 100644 --- a/src/twilio/api/types/mod.rs +++ b/src/twilio/api/types/mod.rs @@ -36,30 +36,3 @@ pub struct TwilioAPIMessage { pub struct SubresourceURI { pub media: String, } - -/* -{ - "account_sid": "ACefa1ef516314c9d1a68cbd657de49277", - "api_version": "2010-04-01", - "body": "This is a test", - "date_created": "Wed, 03 Jun 2026 19:40:55 +0000", - "date_sent": null, - "date_updated": "Wed, 03 Jun 2026 19:40:55 +0000", - "direction": "outbound-api", - "error_code": null, - "error_message": null, - "from": "+12243026041", - "messaging_service_sid": "MG803f3676706b92eb02e18dd820c447f2", - "num_media": "0", - "num_segments": "0", - "price": null, - "price_unit": null, - "sid": "SMf5c09c776c931bdb00c6e274da2ce34d", - "status": "scheduled", - "subresource_uris": { - "media": "/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages/SMf5c09c776c931bdb00c6e274da2ce34d/Media.json" - }, - "to": "+16303831708", - "uri": "/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages/SMf5c09c776c931bdb00c6e274da2ce34d.json" -} -*/ -- 2.47.3 From bb58dafed39cd3142927565770064b1e00d508c3 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:23:43 -0400 Subject: [PATCH 20/26] Code cleanup --- src/twilio/api/mod.rs | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 0000b67..edeccd5 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -60,31 +60,16 @@ pub async fn send_mssage( ); let request = client.post(url).headers(headers).form(¶ms); - match request.send().await { Ok(response) => { - Ok(response) - /* - match response - .json::() - .await - { - Ok(resp) => Ok(resp), - Err(err) => Err(std::io::Error::other(err)), - } - match response.text().await { - Ok(body) => { - let mut obj = crate::twilio::api::types::TwilioAPIMessage { - ..Default::default() - }; - - Ok(obj) + match response.status() { + reqwest::StatusCode::OK => { + Ok(response) } - Err(err) => { - Err(std::io::Error::other(err)) + status => { + Err(std::io::Error::other(format!("Unaccounted status: {status:?}"))) } } - */ } Err(err) => Err(std::io::Error::other(err.to_string())), } -- 2.47.3 From b5fd3dbfffecc4ba1452e2fac3f5c86c6aedd076 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:23:52 -0400 Subject: [PATCH 21/26] cargo fmt --- src/twilio/api/mod.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index edeccd5..2c114c5 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -61,16 +61,12 @@ pub async fn send_mssage( let request = client.post(url).headers(headers).form(¶ms); match request.send().await { - Ok(response) => { - match response.status() { - reqwest::StatusCode::OK => { - Ok(response) - } - status => { - Err(std::io::Error::other(format!("Unaccounted status: {status:?}"))) - } - } - } + Ok(response) => match response.status() { + reqwest::StatusCode::OK => Ok(response), + status => Err(std::io::Error::other(format!( + "Unaccounted status: {status:?}" + ))), + }, Err(err) => Err(std::io::Error::other(err.to_string())), } } -- 2.47.3 From 4d3bb7778af5aaef9651d679356eb8d9a4c2cc8f Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:26:41 -0400 Subject: [PATCH 22/26] Code cleanup --- src/twilio/api/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 2c114c5..bc43e9f 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -38,10 +38,7 @@ pub async fn send_mssage( // params.insert("PersistentAction", "string"); params.insert("ShortenUrls", "true"); let date = match param.schedule_at { - Some(date_value) => { - let converted = date_value.to_string(); - converted - } + Some(date_value) => date_value.to_string(), None => String::new(), }; if param.schedule && is_scheduleable(&Some(now), ¶m.schedule_at) { @@ -130,7 +127,7 @@ fn is_scheduleable( .unwrap() .checked_add(time::Duration::seconds(300)) .unwrap(); - if *schedule_at > early { true } else { false } + *schedule_at > early } None => false, } -- 2.47.3 From fcc8c3966cf542a77ac2b02e11be4e1ce915272e Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:32:31 -0400 Subject: [PATCH 23/26] Code cleanup --- src/twilio/api/mod.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index bc43e9f..86d589d 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -83,7 +83,6 @@ fn generate_auth( } /* let mut params = std::collections::HashMap::new(); - params.insert("To", "16303831708"); params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ"); params.insert("MaxPrice", "1"); params.insert("ProvideFeedback", "true"); @@ -96,21 +95,11 @@ fn generate_auth( params.insert("PersistentAction", "string"); params.insert("PersistentAction", "string"); params.insert("ShortenUrls", "true"); - params.insert("ScheduleType", "fixed"); - params.insert("SendAt", "2026-06-03T19:50:00.0Z"); params.insert("SendAsMms", "true"); params.insert("RiskCheck", "enable"); - params.insert("From", "12243026041"); - params.insert("MessagingServiceSid", "MG803f3676706b92eb02e18dd820c447f2"); - params.insert("Body", "This is a test"); - - let request = client.request(reqwest::Method::POST, "https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json") - .headers(headers) - .form(¶ms); let response = request.send().await?; let body = response.text().await?; - println!("{}", body); Ok(()) -- 2.47.3 From a9f27a3f29f15918d74bd49676590ea125673a43 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:32:59 -0400 Subject: [PATCH 24/26] bump: swoosh --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 050e8c3..d527cd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,7 +1573,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swoosh" -version = "0.2.1" +version = "0.2.2" dependencies = [ "base64-ng", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 0b3834e..4ab490b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swoosh" -version = "0.2.1" +version = "0.2.2" edition = "2024" rust-version = "1.95" description = "Library to send text messages" -- 2.47.3 From 6fa3fabe888f2eb33683a80f6bbbbc501e649429 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:36:11 -0400 Subject: [PATCH 25/26] bump: swoosh --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d527cd0..804e9cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,7 +1573,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swoosh" -version = "0.2.2" +version = "0.3.0" dependencies = [ "base64-ng", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 4ab490b..0917518 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swoosh" -version = "0.2.2" +version = "0.3.0" edition = "2024" rust-version = "1.95" description = "Library to send text messages" -- 2.47.3 From 4792dfbfd033f8dfec6ed18d64ebdad3c0e0f073 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 20:37:01 -0400 Subject: [PATCH 26/26] Updated workflows --- .gitea/workflows/release.yml | 4 ++-- .gitea/workflows/workflow.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 19610c8..33f9065 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -3,10 +3,10 @@ name: Release Tagging on: push: branches: - - v0.3.x + - main pull_request: branches: - - v0.3.x + - main jobs: release: diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index ca1166a..4628f4c 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -3,10 +3,10 @@ name: swoosh Build on: push: branches: - - v0.3.x + - main pull_request: branches: - - v0.3.x + - main jobs: check: -- 2.47.3