From 25c5a5f5565d5d6115c453fd7b7780231911b265 Mon Sep 17 00:00:00 2001 From: theBreadCompany Date: Tue, 21 Jan 2025 04:12:18 +0100 Subject: [PATCH] project init --- .gitignore | 1 + Cargo.lock | 1891 +++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 17 + VRN Data Database.sql | 142 ++++ diesel.toml | 9 + src/dtos.rs | 465 ++++++++++ src/main.rs | 290 +++++++ src/models.rs | 175 ++++ src/schema.rs | 232 +++++ 9 files changed, 3222 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 VRN Data Database.sql create mode 100644 diesel.toml create mode 100644 src/dtos.rs create mode 100644 src/main.rs create mode 100644 src/models.rs create mode 100644 src/schema.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..1f18ebe --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1891 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets", +] + +[[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-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "diesel" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf1bedf64cdb9643204a36dd15b19a6ce8e7aa7f7b105868e9f1fad5ffa7d12" +dependencies = [ + "bitflags", + "byteorder", + "chrono", + "diesel_derives", + "itoa", + "pq-sys", + "uuid", +] + +[[package]] +name = "diesel_derives" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" +dependencies = [ + "diesel_table_macro_syntax", + "dsl_auto_type", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +dependencies = [ + "syn", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +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 = "dsl_auto_type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d9abe6314103864cc2d8901b7ae224e0ab1a103a0a416661b4097b0779b607" +dependencies = [ + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" + +[[package]] +name = "hyper" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "maud" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df518b75016b4289cdddffa1b01f2122f4a49802c93191f3133f6dc2472ebcaa" +dependencies = [ + "itoa", + "maud_macros", +] + +[[package]] +name = "maud_macros" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa453238ec218da0af6b11fc5978d3b5c3a45ed97b722391a2a11f3306274e18" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "pq-sys" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6cc05d7ea95200187117196eee9edd0644424911821aeb28a18ce60ea0b8793" +dependencies = [ + "vcpkg", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "reqwest" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[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 = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "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.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[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.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +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 = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[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.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "willdaten" +version = "0.1.0" +dependencies = [ + "chrono", + "diesel", + "dotenvy", + "hex", + "maud", + "reqwest", + "serde", + "serde_json", + "sha2", + "tokio", + "uuid", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..86cf2e5 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "willdaten" +version = "0.1.0" +edition = "2021" + +[dependencies] +chrono = "0.4.39" +diesel = { version = "2.2.6", features = ["64-column-tables", "chrono", "postgres", "postgres_backend", "uuid"] } +dotenvy = "0.15.7" +hex = "0.4.3" +maud = "0.26.0" +reqwest = { version = "0.12.12", features = ["json"] } +serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.135" +sha2 = "0.10.8" +tokio = { version = "1.43.0", features = ["full"] } +uuid = "1.12.0" diff --git a/VRN Data Database.sql b/VRN Data Database.sql new file mode 100644 index 0000000..a199aab --- /dev/null +++ b/VRN Data Database.sql @@ -0,0 +1,142 @@ +CREATE TABLE "stop_lists" ( + "input" int PRIMARY KEY, + "point_dm" varchar(255), + "point_type" varchar(255), + "point_name" varchar(255), + "point_stateless" varchar(255), + "point_stopId" int, + "point_anytype" varchar(255), + "point_sort" int, + "point_quality" int, + "point_best" int, + "point_object" varchar(255), + "point_ref_id" int, + "point_ref_gid" varchar(50), + "point_ref_omc" int, + "point_ref_placeID" int, + "point_ref_place" varchar(50), + "point_ref_coords" varchar(50), + "itdOdvAssignedStops_stopid" int, + "itdOdvAssignedStops_name" varchar(255), + "itdOdvAssignedStops_x" float, + "itdOdvAssignedStops_y" float, + "itdOdvAssignedStops_mapName" varchar(255), + "itdOdvAssignedStops_value" varchar(255), + "itdOdvAssignedStops_place" varchar(255), + "itdOdvAssignedStops_nameWithPlace" varchar(255), + "itdOdvAssignedStops_distanceTime" int, + "itdOdvAssignedStops_isTransferStop" int, + "itdOdvAssignedStops_vm" int, + "itdOdvAssignedStops_gid" varchar(255), + "meta_lastModificationDate" timestamp +); + +CREATE TABLE "serving_lines" ( + "servingLineId" varchar(255) PRIMARY KEY, + "mode_name" varchar(255), + "mode_number" varchar(50), + "mode_product" varchar(255), + "mode_productId" int, + "mode_type" int, + "mode_code" int, + "mode_destination" varchar(255), + "mode_destID" int, + "mode_desc" varchar(255), + "mode_timetablePeriod" varchar(255), + "diva_branch" varchar(50), + "diva_line" varchar(50), + "diva_supplement" varchar(50), + "diva_dir" varchar(50), + "diva_project" varchar(50), + "diva_network" varchar(50), + "diva_stateless" varchar(255), + "diva_tripCode" int, + "diva_operator" varchar(255), + "diva_opPublicCode" varchar(50), + "diva_opCode" varchar(50), + "diva_Vf" date, + "diva_vTo" date, + "diva_lineDisplay" varchar(50), + "meta_lastModificationDate" timestamp +); + +CREATE TABLE "arrivals" ( + "depatureRequestId" serial, + "stopDetailId" serial PRIMARY KEY, + "stopID" int, + "x" float, + "y" float, + "mapName" varchar(255), + "area" varchar(50), + "platform" varchar(50), + "platformName" varchar(255), + "stopName" varchar(255), + "nameWO" varchar(255), + "pointType" varchar(50), + "countdown" int, + "arrivalTime" timestamp, + "realArrivalTime" timestamp, + "servingLine_key" varchar(255), + "servingLine_code" varchar(50), + "servingLine_number" varchar(50), + "servingLine_symbol" varchar(50), + "servingLine_motType" int, + "servingLine_mtSubcode" int, + "servingLine_realtime" boolean, + "servingLine_direction" varchar(255), + "servingLine_directionFrom" varchar(255), + "servingLine_name" varchar(255), + "servingLine_delay" int, + "servingLine_liErgRiProj_line" varchar(255), + "servingLine_liErgRiProj_project" varchar(255), + "servingLine_liErgRiProj_direction" varchar(50), + "servingLine_liErgRiProj_supplement" varchar(50), + "servingLine_liErgRiProj_network" varchar(255), + "servingLine_destID" varchar(255), + "servingLine_stateless" varchar(255), + "servingLine_lineDisplay" varchar(255), + "operator_code" varchar(50), + "operator_name" varchar(255), + "operator_publicCode" varchar(50), + "attrs_name" varchar(255), + "attrs_value" varchar(255) +); + +CREATE TABLE "depature_requests" ( + "depatureRequestId" serial PRIMARY KEY, + "stopid" int, + "serverid" varchar(255), + "requestid" varchar(255), + "sessionid" varchar(255), + "calcTime" float, + "serverTime" timestamp, + "logRequestId" varchar(255) +); + +CREATE TABLE "station_hints" ( + "infoLinkURL" varchar(255) PRIMARY KEY, + "infoLinkText" varchar(255), + "infoText" varchar(2055) +); + +CREATE TABLE "depature_requeststation_hints" ( + "infoLinkUrl" varchar(255) PRIMARY KEY, + "depatureRequestId" int +); + +CREATE TABLE "serving_line_depature_requests" ( + "depatureRequestId" int PRIMARY KEY, + "servingLineId" varchar(255) +); + +ALTER TABLE "arrivals" ADD FOREIGN KEY ("depatureRequestId") REFERENCES "depature_requests" ("depatureRequestId"); + +ALTER TABLE "depature_requests" ADD FOREIGN KEY ("stopid") REFERENCES "stop_lists" ("input"); + +ALTER TABLE "depature_requeststation_hints" ADD FOREIGN KEY ("infoLinkUrl") REFERENCES "station_hints" ("infoLinkURL"); + +ALTER TABLE "depature_requeststation_hints" ADD FOREIGN KEY ("depatureRequestId") REFERENCES "depature_requests" ("depatureRequestId"); + +ALTER TABLE "serving_line_depature_requests" ADD FOREIGN KEY ("depatureRequestId") REFERENCES "depature_requests" ("depatureRequestId"); + +ALTER TABLE "serving_line_depature_requests" ADD FOREIGN KEY ("servingLineId") REFERENCES "serving_lines" ("servingLineId"); diff --git a/diesel.toml b/diesel.toml new file mode 100644 index 0000000..6698255 --- /dev/null +++ b/diesel.toml @@ -0,0 +1,9 @@ +# For documentation on how to configure this file, +# see https://diesel.rs/guides/configuring-diesel-cli + +[print_schema] +file = "src/schema.rs" +custom_type_derives = ["diesel::query_builder::QueryId", "Clone"] + +[migrations_directory] +dir = "/home/bread/Dokumente/willdaten/migrations" diff --git a/src/dtos.rs b/src/dtos.rs new file mode 100644 index 0000000..47287d7 --- /dev/null +++ b/src/dtos.rs @@ -0,0 +1,465 @@ +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Root { + pub parameters: Vec, + pub dm: Dm, + pub arr: Arr, + pub date_time: DateTime, + pub date_range: Vec, + pub serving_lines: ServingLines, + pub departure_list: Option>, + pub arrival_list: Option>, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Parameter { + pub name: String, + pub value: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Dm { + pub input: Input, + pub points: Points, + pub itd_odv_assigned_stops: ItdOdvAssignedStops, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Input { + pub input: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Points { + pub point: Point, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Point { + pub usage: String, + #[serde(rename = "type")] + pub type_field: String, + pub name: String, + pub stateless: String, + pub any_type: String, + pub sort: String, + pub quality: String, + pub best: String, + pub object: String, + #[serde(rename = "ref")] + pub ref_field: Ref, + pub infos: Option, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Ref { + pub id: String, + pub gid: String, + pub omc: String, + #[serde(rename = "placeID")] + pub place_id: String, + pub place: String, + pub coords: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Infos { + pub info: Info, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Info { + pub info_link_text: String, + #[serde(rename = "infoLinkURL")] + pub info_link_url: String, + pub info_text: InfoText, + pub param_list: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InfoText { + pub content: String, + pub subtitle: String, + pub subject: String, + pub additional_text: String, + pub html_text: String, + pub wml_text: String, + pub sms_text: String, + pub speech_text: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ParamList { + #[serde(rename = "type")] + pub type_field: String, + pub name: String, + pub value: String, + pub edit: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ItdOdvAssignedStops { + #[serde(rename = "stopID")] + pub stop_id: String, + pub name: String, + pub x: String, + pub y: String, + pub map_name: String, + pub value: String, + pub place: String, + pub name_with_place: String, + pub distance_time: String, + pub is_transfer_stop: String, + pub vm: String, + pub gid: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Arr { + pub input: Input2, + pub points: Value, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Input2 { + pub input: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct DateTime { + pub deparr: String, + pub ttp_from: String, + pub ttp_to: String, + pub year: String, + pub month: String, + pub day: String, + pub hour: String, + pub minute: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct DateRange { + pub day: String, + pub month: String, + pub year: String, + pub weekday: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PtOption { + pub active: String, + pub max_changes: String, + pub max_time: String, + pub max_wait: String, + pub route_type: String, + pub change_speed: String, + pub line_restriction: String, + pub use_prox_foot_search: String, + pub use_prox_foot_search_origin: String, + pub use_prox_foot_search_destination: String, + pub bike: String, + pub plane: String, + pub no_crowded: String, + pub no_solid_stairs: String, + pub no_escalators: String, + pub no_elevators: String, + pub low_platform_vhcl: String, + pub wheelchair: String, + pub need_elevated_plt: String, + pub assistance: String, + #[serde(rename = "SOSAvail")] + pub sosavail: String, + pub no_lonely_transfer: String, + pub illum_transfer: String, + pub overground_transfer: String, + pub no_insecure_places: String, + pub private_transport: String, + pub excluded_means: Vec, + pub active_imp: String, + pub active_com: String, + pub active_sec: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ExcludedMean { + pub means: String, + pub value: String, + pub selected: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ServingLines { + pub lines: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Line { + pub mode: Mode, + pub index: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Mode { + pub name: String, + pub number: String, + pub product: String, + pub product_id: String, + #[serde(rename = "type")] + pub type_field: String, + pub code: String, + pub destination: String, + #[serde(rename = "destID")] + pub dest_id: String, + pub desc: String, + pub timetable_period: String, + pub diva: Diva, + pub train_type: Option, + pub train_name: Option, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Diva { + pub branch: String, + pub line: String, + pub supplement: String, + pub dir: String, + pub project: String, + pub network: String, + pub stateless: String, + pub trip_code: String, + pub operator: String, + pub op_code: String, + pub v_f: String, + pub v_to: String, + pub line_display: String, + pub attrs: Vec, + pub op_public_code: Option, + pub global_id: Option, + pub special_fares: Option, + #[serde(rename = "isTTB")] + pub is_ttb: Option, + #[serde(rename = "isSTT")] + pub is_stt: Option, + #[serde(rename = "isROP")] + pub is_rop: Option, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Attr { + pub name: String, + pub value: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct DepartureList { + #[serde(rename = "stopID")] + pub stop_id: i32, + pub x: String, + pub y: String, + pub map_name: String, + pub area: String, + pub platform: String, + pub platform_name: String, + pub stop_name: String, + #[serde(rename = "nameWO")] + pub name_wo: String, + pub point_type: Option, + pub countdown: String, + pub date_time: DateTime2, + pub serving_line: ServingLine, + pub operator: Option, + pub attrs: Option>, + pub stop_infos: Option, + pub line_infos: Value, + pub trip_infos: Value, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ArrivalList { + #[serde(rename = "stopID")] + pub stop_id: String, + pub x: String, + pub y: String, + pub map_name: String, + pub area: String, + pub platform: String, + pub platform_name: String, + pub stop_name: String, + #[serde(rename = "nameWO")] + pub name_wo: String, + pub countdown: String, + pub date_time: DateTime2, + pub real_date_time: Option, + pub serving_line: ArrServingLine, + pub operator: Option, + pub attrs: Option>, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ArrServingLine { + pub key: String, + pub code: String, + pub number: String, + pub symbol: String, + pub mot_type: String, + pub mt_subcode: String, + pub realtime: String, + pub direction: String, + pub direction_from: String, + pub train_type: Option, + pub train_name: Option, + pub train_num: Option, + pub name: String, + pub delay: Option, + pub hints: Option>, + pub li_erg_ri_proj: ArrLiErgRiProj, + #[serde(rename = "destID")] + pub dest_id: String, + pub stateless: String, + pub line_display: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct LiErgRiProj { + pub line: String, + pub project: String, + pub direction: String, + pub supplement: String, + pub network: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct DateTime2 { + pub year: String, + pub month: String, + pub day: String, + pub weekday: String, + pub hour: String, + pub minute: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ServingLine { + pub key: String, + pub code: String, + pub number: String, + pub symbol: String, + pub mot_type: String, + pub mt_subcode: String, + pub realtime: String, + pub direction: String, + pub direction_from: String, + pub name: String, + pub li_erg_ri_proj: LiErgRiProj, + #[serde(rename = "destID")] + pub dest_id: String, + pub stateless: String, + pub line_display: String, + pub train_type: Option, + pub train_name: Option, + pub train_num: Option, + #[serde(default)] + pub hints: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ArrLiErgRiProj { + pub line: String, + pub project: String, + pub direction: String, + pub supplement: String, + pub network: String, + pub gid: Option, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Hint { + pub content: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Operator { + pub code: String, + pub name: String, + pub public_code: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Attr2 { + pub name: String, + pub value: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct StopInfos { + pub stop_info: StopInfo, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct StopInfo { + pub info_link_text: String, + #[serde(rename = "infoLinkURL")] + pub info_link_url: String, + pub info_text: InfoText2, + pub param_list: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InfoText2 { + pub content: String, + pub subtitle: String, + pub subject: String, + pub additional_text: String, + pub html_text: String, + pub wml_text: String, + pub sms_text: String, + pub speech_text: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ParamList2 { + #[serde(rename = "type")] + pub type_field: String, + pub name: String, + pub value: String, + pub edit: String, +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..83fa081 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,290 @@ +#[macro_use] +extern crate diesel; + +mod dtos; +mod models; +mod schema; + +use chrono::NaiveDate; +use chrono::{Local, NaiveDateTime}; +use diesel::{dsl::insert_into, Connection, PgConnection, RunQueryDsl, SelectableHelper}; +use dotenvy::dotenv; +use dtos::Root; +use hex; +use models::{ + Arrival, DepatureRequest, NewDepatureRequest, ServingLine, ServingLineDepatureRequest, + StationHint, StopList, +}; +use serde_json; +use sha2::Digest; +use sha2::Sha256; +use std::{env, error::Error, fs, str::FromStr}; + +use crate::diesel::OptionalExtension; +use crate::schema::arrivals::dsl::arrivals; +use crate::schema::depature_requests::dsl::depature_requests; +use crate::schema::serving_line_depature_requests::dsl::serving_line_depature_requests; +use crate::schema::serving_lines::dsl::serving_lines; +use crate::schema::station_hints::dsl::station_hints; +use crate::schema::stop_lists::dsl::stop_lists; + +#[tokio::main] +async fn main() -> Result<(), Box> { + dotenv().ok(); + let url = env::var("DATABASE_URL").expect("DATABASE_URL must be set"); + let mut conn = + PgConnection::establish(&url).unwrap_or_else(|_| panic!("Error connecting to {}", url)); + + let src = "/home/bread/Downloads/2025-01-21"; + //let pool = SqlitePool::connect("sqlite::memory:").await?; + + fs::read_dir(src).unwrap().into_iter().for_each(|path| { + let path = path.unwrap(); + let content = fs::read_to_string(path.path()).unwrap(); + let data = serde_json::from_str::(&content).unwrap(); + let arrival_list = data.arrival_list.unwrap(); + let _ = insert_into(stop_lists) + .values(StopList { + input: i32::from_str(&data.dm.input.input).unwrap(), + point_dm: Some(data.dm.points.point.usage), + point_type: Some(data.dm.points.point.type_field.clone()), + point_name: Some(data.dm.points.point.name), + point_stopId: i32::from_str(&data.dm.points.point.ref_field.id).ok(), + point_stateless: Some(data.dm.points.point.stateless), + point_anytype: Some(data.dm.points.point.any_type), + point_sort: i32::from_str(&data.dm.points.point.sort).ok(), + point_quality: i32::from_str(&data.dm.points.point.quality).ok(), + point_best: i32::from_str(&data.dm.points.point.best).ok(), + point_object: Some(data.dm.points.point.object), + point_ref_id: i32::from_str(&data.dm.points.point.ref_field.id).ok(), + point_ref_gid: Some(data.dm.points.point.ref_field.gid), + point_ref_omc: i32::from_str(&data.dm.points.point.ref_field.omc).ok(), + point_ref_placeID: i32::from_str(&data.dm.points.point.ref_field.place_id).ok(), + point_ref_place: Some(data.dm.points.point.ref_field.place), + point_ref_coords: Some(data.dm.points.point.ref_field.coords), + itdOdvAssignedStops_stopid: i32::from_str(&data.dm.itd_odv_assigned_stops.stop_id) + .ok(), + itdOdvAssignedStops_name: Some(data.dm.itd_odv_assigned_stops.name), + itdOdvAssignedStops_x: f64::from_str(&data.dm.itd_odv_assigned_stops.x).ok(), + itdOdvAssignedStops_y: f64::from_str(&data.dm.itd_odv_assigned_stops.y).ok(), + itdOdvAssignedStops_mapName: Some(data.dm.itd_odv_assigned_stops.map_name), + itdOdvAssignedStops_value: Some(data.dm.itd_odv_assigned_stops.value), + itdOdvAssignedStops_place: Some(data.dm.itd_odv_assigned_stops.place), + itdOdvAssignedStops_nameWithPlace: Some( + data.dm.itd_odv_assigned_stops.name_with_place, + ), + itdOdvAssignedStops_distanceTime: i32::from_str( + &data.dm.itd_odv_assigned_stops.distance_time, + ) + .ok(), + itdOdvAssignedStops_isTransferStop: i32::from_str( + &data.dm.itd_odv_assigned_stops.is_transfer_stop, + ) + .ok(), + itdOdvAssignedStops_vm: i32::from_str(&data.dm.itd_odv_assigned_stops.vm).ok(), + itdOdvAssignedStops_gid: Some(data.dm.itd_odv_assigned_stops.gid), + meta_lastModificationDate: Some(Local::now().naive_local()), + }) + .returning(StopList::as_returning()) + .on_conflict_do_nothing() + .get_result(&mut conn) + .optional(); + let req = insert_into(depature_requests) + .values(NewDepatureRequest { + stopid: i32::from_str(&data.dm.itd_odv_assigned_stops.stop_id).ok(), + serverid: data + .parameters + .iter() + .filter(|p| p.name == "serverID") + .map(|p| p.clone().value) + .next(), + requestid: data + .parameters + .iter() + .filter(|p| p.name == "requestID") + .map(|p| p.clone().value) + .next(), + sessionid: data + .parameters + .iter() + .filter(|p| p.name == "sessionID") + .map(|p| p.clone().value) + .next(), + calcTime: Some( + f64::from_str( + &data + .parameters + .iter() + .filter(|p| p.name == "calcTime") + .map(|p| p.clone().value) + .next() + .unwrap(), + ) + .unwrap(), + ), + serverTime: data + .parameters + .iter() + .filter(|p| p.name == "serverTime") + .map(|p| p.clone().value) + .next() + .unwrap() + .parse::() + .ok(), + logRequestId: data + .parameters + .iter() + .filter(|p| p.name == "logRequestId") + .map(|p| p.clone().value) + .next(), + }) + .returning(DepatureRequest::as_returning()) + .on_conflict_do_nothing() + .get_result(&mut conn) + .optional() + .unwrap() + .unwrap(); + for line in data.serving_lines.lines { + let id = hex::encode(Sha256::digest( + serde_json::to_string(&line.mode).unwrap().into_bytes(), + )); + let _ = insert_into(serving_lines) + .values(ServingLine { + servingLineId: id.clone(), + mode_name: Some(line.mode.name), + mode_number: Some(line.mode.number), + mode_product: Some(line.mode.product), + mode_productId: i32::from_str(&line.mode.product_id).ok(), + mode_type: i32::from_str(&line.mode.type_field).ok(), + mode_code: i32::from_str(&line.mode.code).ok(), + mode_destination: Some(line.mode.destination), + mode_destID: i32::from_str(&line.mode.dest_id).ok(), + mode_desc: Some(line.mode.desc), + mode_timetablePeriod: Some(line.mode.timetable_period), + diva_branch: Some(line.mode.diva.branch), + diva_line: Some(line.mode.diva.line), + diva_supplement: Some(line.mode.diva.supplement), + diva_dir: Some(line.mode.diva.dir), + diva_project: Some(line.mode.diva.project), + diva_network: Some(line.mode.diva.network), + diva_stateless: Some(line.mode.diva.stateless), + diva_tripCode: i32::from_str(&line.mode.diva.trip_code).ok(), + diva_operator: Some(line.mode.diva.operator), + diva_opPublicCode: line.mode.diva.op_public_code, + diva_opCode: Some(line.mode.diva.op_code), + diva_Vf: NaiveDate::parse_from_str(&line.mode.diva.v_f, "%Y%m%d").ok(), + diva_vTo: NaiveDate::parse_from_str(&line.mode.diva.v_to, "%Y%m%d").ok(), + diva_lineDisplay: Some(line.mode.diva.line_display), + meta_lastModificationDate: req.serverTime, + }) + .returning(ServingLine::as_returning()) + .on_conflict_do_nothing() + .get_result(&mut conn) + .optional() + .unwrap(); + let _ = insert_into(serving_line_depature_requests) + .values(ServingLineDepatureRequest { + depatureRequestId: req.depatureRequestId, + servingLineId: id.clone(), + }) + .returning(ServingLineDepatureRequest::as_returning()) + .on_conflict_do_nothing() + .get_result(&mut conn) + .optional() + .unwrap(); + } + if let Some(infos) = data.dm.points.point.infos { + let _ = insert_into(station_hints).values(StationHint { + infoLinkURL: infos.info.info_link_url, + infoLinkText: Some(infos.info.info_link_text), + infoText: Some(infos.info.info_text.content), + }); + } + { + let _ = insert_into(arrivals) + .values(arrival_list.into_iter().map(|arrival| { Arrival { + depatureRequestId: req.depatureRequestId, + stopDetailId: 0, + stopID: i32::from_str(&arrival.stop_id).ok(), + x: f64::from_str(&arrival.x).ok(), + y: f64::from_str(&arrival.y).ok(), + mapName: Some(arrival.map_name), + area: Some(arrival.area), + platform: Some(arrival.platform), + platformName: Some(arrival.platform_name), + stopName: Some(arrival.stop_name), + nameWO: Some(arrival.name_wo), + pointType: Some(data.dm.points.point.type_field.clone()), + countdown: i32::from_str(&arrival.countdown).ok(), + arrivalTime: NaiveDate::from_ymd_opt( + i32::from_str(&arrival.date_time.year).unwrap(), + u32::from_str(&arrival.date_time.month).unwrap(), + u32::from_str(&arrival.date_time.day).unwrap(), + ) + .unwrap() + .and_hms_opt( + u32::from_str(&arrival.date_time.hour).unwrap(), + u32::from_str(&arrival.date_time.minute).unwrap(), + 0, + ), + realArrivalTime: if let Some(date_time) = arrival.real_date_time { + NaiveDate::from_ymd_opt( + i32::from_str(&date_time.year).unwrap(), + u32::from_str(&date_time.month).unwrap(), + u32::from_str(&date_time.day).unwrap(), + ) + .unwrap() + .and_hms_opt( + u32::from_str(&date_time.hour).unwrap(), + u32::from_str(&date_time.minute).unwrap(), + 0, + ) + } else { + None + }, + servingLine_key: Some(arrival.serving_line.key), + servingLine_code: Some(arrival.serving_line.code), + servingLine_number: Some(arrival.serving_line.number), + servingLine_symbol: Some(arrival.serving_line.symbol), + servingLine_motType: i32::from_str(&arrival.serving_line.mot_type).ok(), + servingLine_mtSubcode: i32::from_str(&arrival.serving_line.mt_subcode).ok(), + servingLine_realtime: bool::from_str(&arrival.serving_line.realtime).ok(), + servingLine_direction: Some(arrival.serving_line.direction), + servingLine_directionFrom: Some(arrival.serving_line.direction_from), + servingLine_name: Some(arrival.serving_line.name), + servingLine_delay: if let Some(delay) = arrival.serving_line.delay { + i32::from_str(&delay).ok() + } else { + None + }, + servingLine_liErgRiProj_line: Some(arrival.serving_line.li_erg_ri_proj.line), + servingLine_liErgRiProj_project: Some( + arrival.serving_line.li_erg_ri_proj.project, + ), + servingLine_liErgRiProj_direction: Some( + arrival.serving_line.li_erg_ri_proj.direction, + ), + servingLine_liErgRiProj_supplement: Some( + arrival.serving_line.li_erg_ri_proj.supplement, + ), + servingLine_liErgRiProj_network: Some( + arrival.serving_line.li_erg_ri_proj.network, + ), + servingLine_destID: Some(arrival.serving_line.dest_id), + servingLine_stateless: Some(arrival.serving_line.stateless), + servingLine_lineDisplay: Some(arrival.serving_line.line_display), + operator_code: arrival.operator.clone().map(|op| op.code), + operator_name: arrival.operator.clone().map(|op| op.name), + operator_publicCode: arrival.operator.map(|op| op.public_code), + attrs_name: None, + attrs_value: None, + }}).collect::>()) + .returning(Arrival::as_returning()) + .on_conflict_do_nothing() + .get_result(&mut conn) + .optional(); + } + }); + + Ok(()) +} diff --git a/src/models.rs b/src/models.rs new file mode 100644 index 0000000..d1f053e --- /dev/null +++ b/src/models.rs @@ -0,0 +1,175 @@ +// Generated by diesel_ext + +#![allow(unused)] +#![allow(clippy::all)] + +use crate::schema::*; +use chrono::NaiveDate; +use chrono::NaiveDateTime; +use diesel::pg::Pg; +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = arrivals)] +#[diesel(check_for_backend(Pg))] +#[diesel(primary_key(stopDetailId))] +pub struct Arrival { + pub depatureRequestId: i32, + pub stopDetailId: i32, + pub stopID: Option, + pub x: Option, + pub y: Option, + pub mapName: Option, + pub area: Option, + pub platform: Option, + pub platformName: Option, + pub stopName: Option, + pub nameWO: Option, + pub pointType: Option, + pub countdown: Option, + pub arrivalTime: Option, + pub realArrivalTime: Option, + pub servingLine_key: Option, + pub servingLine_code: Option, + pub servingLine_number: Option, + pub servingLine_symbol: Option, + pub servingLine_motType: Option, + pub servingLine_mtSubcode: Option, + pub servingLine_realtime: Option, + pub servingLine_direction: Option, + pub servingLine_directionFrom: Option, + pub servingLine_name: Option, + pub servingLine_delay: Option, + pub servingLine_liErgRiProj_line: Option, + pub servingLine_liErgRiProj_project: Option, + pub servingLine_liErgRiProj_direction: Option, + pub servingLine_liErgRiProj_supplement: Option, + pub servingLine_liErgRiProj_network: Option, + pub servingLine_destID: Option, + pub servingLine_stateless: Option, + pub servingLine_lineDisplay: Option, + pub operator_code: Option, + pub operator_name: Option, + pub operator_publicCode: Option, + pub attrs_name: Option, + pub attrs_value: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, QueryableByName)] +#[diesel(table_name = depature_requests)] +#[diesel(check_for_backend(Pg))] +#[diesel(primary_key(depatureRequestId))] +pub struct DepatureRequest { + pub depatureRequestId: i32, + pub stopid: Option, + pub serverid: Option, + pub requestid: Option, + pub sessionid: Option, + pub calcTime: Option, + pub serverTime: Option, + pub logRequestId: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, QueryableByName)] +#[diesel(table_name = depature_requests)] +pub struct NewDepatureRequest { + pub stopid: Option, + pub serverid: Option, + pub requestid: Option, + pub sessionid: Option, + pub calcTime: Option, + pub serverTime: Option, + pub logRequestId: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = depature_requeststation_hints)] +#[diesel(check_for_backend(Pg))] +#[diesel(primary_key(infoLinkUrl))] +pub struct DepatureRequeststationHint { + pub infoLinkUrl: String, + pub depatureRequestId: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = serving_line_depature_requests)] +#[diesel(primary_key(depatureRequestId))] +pub struct ServingLineDepatureRequest { + pub depatureRequestId: i32, + pub servingLineId: String, +} + +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = serving_lines)] +#[diesel(primary_key(servingLineId))] +pub struct ServingLine { + pub servingLineId: String, + pub mode_name: Option, + pub mode_number: Option, + pub mode_product: Option, + pub mode_productId: Option, + pub mode_type: Option, + pub mode_code: Option, + pub mode_destination: Option, + pub mode_destID: Option, + pub mode_desc: Option, + pub mode_timetablePeriod: Option, + pub diva_branch: Option, + pub diva_line: Option, + pub diva_supplement: Option, + pub diva_dir: Option, + pub diva_project: Option, + pub diva_network: Option, + pub diva_stateless: Option, + pub diva_tripCode: Option, + pub diva_operator: Option, + pub diva_opPublicCode: Option, + pub diva_opCode: Option, + pub diva_Vf: Option, + pub diva_vTo: Option, + pub diva_lineDisplay: Option, + pub meta_lastModificationDate: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = station_hints)] +#[diesel(primary_key(infoLinkURL))] +pub struct StationHint { + pub infoLinkURL: String, + pub infoLinkText: Option, + pub infoText: Option, +} + +#[derive(Queryable, Selectable, Insertable, Debug, Identifiable, QueryableByName)] +#[diesel(table_name = stop_lists)] +#[diesel(primary_key(input))] +pub struct StopList { + pub input: i32, + pub point_dm: Option, + pub point_type: Option, + pub point_name: Option, + pub point_stateless: Option, + pub point_stopId: Option, + pub point_anytype: Option, + pub point_sort: Option, + pub point_quality: Option, + pub point_best: Option, + pub point_object: Option, + pub point_ref_id: Option, + pub point_ref_gid: Option, + pub point_ref_omc: Option, + pub point_ref_placeID: Option, + pub point_ref_place: Option, + pub point_ref_coords: Option, + pub itdOdvAssignedStops_stopid: Option, + pub itdOdvAssignedStops_name: Option, + pub itdOdvAssignedStops_x: Option, + pub itdOdvAssignedStops_y: Option, + pub itdOdvAssignedStops_mapName: Option, + pub itdOdvAssignedStops_value: Option, + pub itdOdvAssignedStops_place: Option, + pub itdOdvAssignedStops_nameWithPlace: Option, + pub itdOdvAssignedStops_distanceTime: Option, + pub itdOdvAssignedStops_isTransferStop: Option, + pub itdOdvAssignedStops_vm: Option, + pub itdOdvAssignedStops_gid: Option, + pub meta_lastModificationDate: Option, +} diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..1eda837 --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,232 @@ +// @generated automatically by Diesel CLI. + +diesel::table! { + arrivals (stopDetailId) { + depatureRequestId -> Int4, + stopDetailId -> Int4, + stopID -> Nullable, + x -> Nullable, + y -> Nullable, + #[max_length = 255] + mapName -> Nullable, + #[max_length = 50] + area -> Nullable, + #[max_length = 50] + platform -> Nullable, + #[max_length = 255] + platformName -> Nullable, + #[max_length = 255] + stopName -> Nullable, + #[max_length = 255] + nameWO -> Nullable, + #[max_length = 50] + pointType -> Nullable, + countdown -> Nullable, + arrivalTime -> Nullable, + realArrivalTime -> Nullable, + #[max_length = 255] + servingLine_key -> Nullable, + #[max_length = 50] + servingLine_code -> Nullable, + #[max_length = 50] + servingLine_number -> Nullable, + #[max_length = 50] + servingLine_symbol -> Nullable, + servingLine_motType -> Nullable, + servingLine_mtSubcode -> Nullable, + servingLine_realtime -> Nullable, + #[max_length = 255] + servingLine_direction -> Nullable, + #[max_length = 255] + servingLine_directionFrom -> Nullable, + #[max_length = 255] + servingLine_name -> Nullable, + servingLine_delay -> Nullable, + #[max_length = 255] + servingLine_liErgRiProj_line -> Nullable, + #[max_length = 255] + servingLine_liErgRiProj_project -> Nullable, + #[max_length = 50] + servingLine_liErgRiProj_direction -> Nullable, + #[max_length = 50] + servingLine_liErgRiProj_supplement -> Nullable, + #[max_length = 255] + servingLine_liErgRiProj_network -> Nullable, + #[max_length = 255] + servingLine_destID -> Nullable, + #[max_length = 255] + servingLine_stateless -> Nullable, + #[max_length = 255] + servingLine_lineDisplay -> Nullable, + #[max_length = 50] + operator_code -> Nullable, + #[max_length = 255] + operator_name -> Nullable, + #[max_length = 50] + operator_publicCode -> Nullable, + #[max_length = 255] + attrs_name -> Nullable, + #[max_length = 255] + attrs_value -> Nullable, + } +} + +diesel::table! { + depature_requests (depatureRequestId) { + depatureRequestId -> Int4, + stopid -> Nullable, + #[max_length = 255] + serverid -> Nullable, + #[max_length = 255] + requestid -> Nullable, + #[max_length = 255] + sessionid -> Nullable, + calcTime -> Nullable, + serverTime -> Nullable, + #[max_length = 255] + logRequestId -> Nullable, + } +} + +diesel::table! { + depature_requeststation_hints (infoLinkUrl) { + #[max_length = 255] + infoLinkUrl -> Varchar, + depatureRequestId -> Nullable, + } +} + +diesel::table! { + serving_line_depature_requests (depatureRequestId) { + depatureRequestId -> Int4, + #[max_length = 255] + servingLineId -> VarChar, + } +} + +diesel::table! { + serving_lines (servingLineId) { + #[max_length = 255] + servingLineId -> VarChar, + #[max_length = 255] + mode_name -> Nullable, + #[max_length = 50] + mode_number -> Nullable, + #[max_length = 255] + mode_product -> Nullable, + mode_productId -> Nullable, + mode_type -> Nullable, + mode_code -> Nullable, + #[max_length = 255] + mode_destination -> Nullable, + mode_destID -> Nullable, + #[max_length = 255] + mode_desc -> Nullable, + #[max_length = 255] + mode_timetablePeriod -> Nullable, + #[max_length = 50] + diva_branch -> Nullable, + #[max_length = 50] + diva_line -> Nullable, + #[max_length = 50] + diva_supplement -> Nullable, + #[max_length = 50] + diva_dir -> Nullable, + #[max_length = 50] + diva_project -> Nullable, + #[max_length = 50] + diva_network -> Nullable, + #[max_length = 255] + diva_stateless -> Nullable, + diva_tripCode -> Nullable, + #[max_length = 255] + diva_operator -> Nullable, + #[max_length = 50] + diva_opPublicCode -> Nullable, + #[max_length = 50] + diva_opCode -> Nullable, + diva_Vf -> Nullable, + diva_vTo -> Nullable, + #[max_length = 50] + diva_lineDisplay -> Nullable, + meta_lastModificationDate -> Nullable, + } +} + +diesel::table! { + station_hints (infoLinkURL) { + #[max_length = 255] + infoLinkURL -> Varchar, + #[max_length = 255] + infoLinkText -> Nullable, + #[max_length = 2055] + infoText -> Nullable, + } +} + +diesel::table! { + stop_lists (input) { + input -> Int4, + #[max_length = 255] + point_dm -> Nullable, + #[max_length = 255] + point_type -> Nullable, + #[max_length = 255] + point_name -> Nullable, + #[max_length = 255] + point_stateless -> Nullable, + point_stopId -> Nullable, + #[max_length = 255] + point_anytype -> Nullable, + point_sort -> Nullable, + point_quality -> Nullable, + point_best -> Nullable, + #[max_length = 255] + point_object -> Nullable, + point_ref_id -> Nullable, + #[max_length = 50] + point_ref_gid -> Nullable, + point_ref_omc -> Nullable, + point_ref_placeID -> Nullable, + #[max_length = 50] + point_ref_place -> Nullable, + #[max_length = 50] + point_ref_coords -> Nullable, + itdOdvAssignedStops_stopid -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_name -> Nullable, + itdOdvAssignedStops_x -> Nullable, + itdOdvAssignedStops_y -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_mapName -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_value -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_place -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_nameWithPlace -> Nullable, + itdOdvAssignedStops_distanceTime -> Nullable, + itdOdvAssignedStops_isTransferStop -> Nullable, + itdOdvAssignedStops_vm -> Nullable, + #[max_length = 255] + itdOdvAssignedStops_gid -> Nullable, + meta_lastModificationDate -> Nullable, + } +} + +diesel::joinable!(arrivals -> depature_requests (depatureRequestId)); +diesel::joinable!(depature_requests -> stop_lists (stopid)); +diesel::joinable!(depature_requeststation_hints -> depature_requests (depatureRequestId)); +diesel::joinable!(depature_requeststation_hints -> station_hints (infoLinkUrl)); +diesel::joinable!(serving_line_depature_requests -> depature_requests (depatureRequestId)); +diesel::joinable!(serving_line_depature_requests -> serving_lines (servingLineId)); + +diesel::allow_tables_to_appear_in_same_query!( + arrivals, + depature_requests, + depature_requeststation_hints, + serving_line_depature_requests, + serving_lines, + station_hints, + stop_lists, +);