├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── renovate.json └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "autocfg" 7 | version = "1.1.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 10 | 11 | [[package]] 12 | name = "base64" 13 | version = "0.13.0" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 16 | 17 | [[package]] 18 | name = "bitflags" 19 | version = "1.3.2" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 22 | 23 | [[package]] 24 | name = "bumpalo" 25 | version = "3.10.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" 28 | 29 | [[package]] 30 | name = "bytes" 31 | version = "1.1.0" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 34 | 35 | [[package]] 36 | name = "cc" 37 | version = "1.0.73" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 40 | 41 | [[package]] 42 | name = "cfg-if" 43 | version = "1.0.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 46 | 47 | [[package]] 48 | name = "core-foundation" 49 | version = "0.9.3" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 52 | dependencies = [ 53 | "core-foundation-sys", 54 | "libc", 55 | ] 56 | 57 | [[package]] 58 | name = "core-foundation-sys" 59 | version = "0.8.3" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 62 | 63 | [[package]] 64 | name = "encoding_rs" 65 | version = "0.8.31" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" 68 | dependencies = [ 69 | "cfg-if", 70 | ] 71 | 72 | [[package]] 73 | name = "fastrand" 74 | version = "1.7.0" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 77 | dependencies = [ 78 | "instant", 79 | ] 80 | 81 | [[package]] 82 | name = "fnv" 83 | version = "1.0.7" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 86 | 87 | [[package]] 88 | name = "foreign-types" 89 | version = "0.3.2" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 92 | dependencies = [ 93 | "foreign-types-shared", 94 | ] 95 | 96 | [[package]] 97 | name = "foreign-types-shared" 98 | version = "0.1.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 101 | 102 | [[package]] 103 | name = "form_urlencoded" 104 | version = "1.0.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 107 | dependencies = [ 108 | "matches", 109 | "percent-encoding", 110 | ] 111 | 112 | [[package]] 113 | name = "futures-channel" 114 | version = "0.3.21" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 117 | dependencies = [ 118 | "futures-core", 119 | ] 120 | 121 | [[package]] 122 | name = "futures-core" 123 | version = "0.3.21" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 126 | 127 | [[package]] 128 | name = "futures-sink" 129 | version = "0.3.21" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 132 | 133 | [[package]] 134 | name = "futures-task" 135 | version = "0.3.21" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 138 | 139 | [[package]] 140 | name = "futures-util" 141 | version = "0.3.21" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 144 | dependencies = [ 145 | "futures-core", 146 | "futures-task", 147 | "pin-project-lite", 148 | "pin-utils", 149 | ] 150 | 151 | [[package]] 152 | name = "h2" 153 | version = "0.3.13" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" 156 | dependencies = [ 157 | "bytes", 158 | "fnv", 159 | "futures-core", 160 | "futures-sink", 161 | "futures-util", 162 | "http", 163 | "indexmap", 164 | "slab", 165 | "tokio", 166 | "tokio-util", 167 | "tracing", 168 | ] 169 | 170 | [[package]] 171 | name = "hashbrown" 172 | version = "0.12.1" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" 175 | 176 | [[package]] 177 | name = "hermit-abi" 178 | version = "0.1.19" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 181 | dependencies = [ 182 | "libc", 183 | ] 184 | 185 | [[package]] 186 | name = "http" 187 | version = "0.2.8" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 190 | dependencies = [ 191 | "bytes", 192 | "fnv", 193 | "itoa", 194 | ] 195 | 196 | [[package]] 197 | name = "http-body" 198 | version = "0.4.5" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 201 | dependencies = [ 202 | "bytes", 203 | "http", 204 | "pin-project-lite", 205 | ] 206 | 207 | [[package]] 208 | name = "httparse" 209 | version = "1.7.1" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" 212 | 213 | [[package]] 214 | name = "httpdate" 215 | version = "1.0.2" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 218 | 219 | [[package]] 220 | name = "hyper" 221 | version = "0.14.19" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" 224 | dependencies = [ 225 | "bytes", 226 | "futures-channel", 227 | "futures-core", 228 | "futures-util", 229 | "h2", 230 | "http", 231 | "http-body", 232 | "httparse", 233 | "httpdate", 234 | "itoa", 235 | "pin-project-lite", 236 | "socket2", 237 | "tokio", 238 | "tower-service", 239 | "tracing", 240 | "want", 241 | ] 242 | 243 | [[package]] 244 | name = "hyper-tls" 245 | version = "0.5.0" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 248 | dependencies = [ 249 | "bytes", 250 | "hyper", 251 | "native-tls", 252 | "tokio", 253 | "tokio-native-tls", 254 | ] 255 | 256 | [[package]] 257 | name = "idna" 258 | version = "0.2.3" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 261 | dependencies = [ 262 | "matches", 263 | "unicode-bidi", 264 | "unicode-normalization", 265 | ] 266 | 267 | [[package]] 268 | name = "indexmap" 269 | version = "1.9.1" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 272 | dependencies = [ 273 | "autocfg", 274 | "hashbrown", 275 | ] 276 | 277 | [[package]] 278 | name = "instant" 279 | version = "0.1.12" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 282 | dependencies = [ 283 | "cfg-if", 284 | ] 285 | 286 | [[package]] 287 | name = "ipnet" 288 | version = "2.5.0" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" 291 | 292 | [[package]] 293 | name = "itoa" 294 | version = "1.0.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" 297 | 298 | [[package]] 299 | name = "js-sys" 300 | version = "0.3.58" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" 303 | dependencies = [ 304 | "wasm-bindgen", 305 | ] 306 | 307 | [[package]] 308 | name = "lazy_static" 309 | version = "1.4.0" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 312 | 313 | [[package]] 314 | name = "libc" 315 | version = "0.2.126" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" 318 | 319 | [[package]] 320 | name = "lock_api" 321 | version = "0.4.7" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" 324 | dependencies = [ 325 | "autocfg", 326 | "scopeguard", 327 | ] 328 | 329 | [[package]] 330 | name = "log" 331 | version = "0.4.17" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 334 | dependencies = [ 335 | "cfg-if", 336 | ] 337 | 338 | [[package]] 339 | name = "matches" 340 | version = "0.1.9" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 343 | 344 | [[package]] 345 | name = "memchr" 346 | version = "2.5.0" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 349 | 350 | [[package]] 351 | name = "mime" 352 | version = "0.3.16" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 355 | 356 | [[package]] 357 | name = "mio" 358 | version = "0.8.4" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" 361 | dependencies = [ 362 | "libc", 363 | "log", 364 | "wasi", 365 | "windows-sys", 366 | ] 367 | 368 | [[package]] 369 | name = "native-tls" 370 | version = "0.2.10" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" 373 | dependencies = [ 374 | "lazy_static", 375 | "libc", 376 | "log", 377 | "openssl", 378 | "openssl-probe", 379 | "openssl-sys", 380 | "schannel", 381 | "security-framework", 382 | "security-framework-sys", 383 | "tempfile", 384 | ] 385 | 386 | [[package]] 387 | name = "num_cpus" 388 | version = "1.13.1" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 391 | dependencies = [ 392 | "hermit-abi", 393 | "libc", 394 | ] 395 | 396 | [[package]] 397 | name = "ojo" 398 | version = "0.1.0" 399 | dependencies = [ 400 | "reqwest", 401 | "serde", 402 | "serde_json", 403 | "tokio", 404 | ] 405 | 406 | [[package]] 407 | name = "once_cell" 408 | version = "1.12.0" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" 411 | 412 | [[package]] 413 | name = "openssl" 414 | version = "0.10.40" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" 417 | dependencies = [ 418 | "bitflags", 419 | "cfg-if", 420 | "foreign-types", 421 | "libc", 422 | "once_cell", 423 | "openssl-macros", 424 | "openssl-sys", 425 | ] 426 | 427 | [[package]] 428 | name = "openssl-macros" 429 | version = "0.1.0" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 432 | dependencies = [ 433 | "proc-macro2", 434 | "quote", 435 | "syn", 436 | ] 437 | 438 | [[package]] 439 | name = "openssl-probe" 440 | version = "0.1.5" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 443 | 444 | [[package]] 445 | name = "openssl-sys" 446 | version = "0.9.74" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" 449 | dependencies = [ 450 | "autocfg", 451 | "cc", 452 | "libc", 453 | "pkg-config", 454 | "vcpkg", 455 | ] 456 | 457 | [[package]] 458 | name = "parking_lot" 459 | version = "0.12.1" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 462 | dependencies = [ 463 | "lock_api", 464 | "parking_lot_core", 465 | ] 466 | 467 | [[package]] 468 | name = "parking_lot_core" 469 | version = "0.9.3" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" 472 | dependencies = [ 473 | "cfg-if", 474 | "libc", 475 | "redox_syscall", 476 | "smallvec", 477 | "windows-sys", 478 | ] 479 | 480 | [[package]] 481 | name = "percent-encoding" 482 | version = "2.1.0" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 485 | 486 | [[package]] 487 | name = "pin-project-lite" 488 | version = "0.2.9" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 491 | 492 | [[package]] 493 | name = "pin-utils" 494 | version = "0.1.0" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 497 | 498 | [[package]] 499 | name = "pkg-config" 500 | version = "0.3.25" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" 503 | 504 | [[package]] 505 | name = "proc-macro2" 506 | version = "1.0.40" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" 509 | dependencies = [ 510 | "unicode-ident", 511 | ] 512 | 513 | [[package]] 514 | name = "quote" 515 | version = "1.0.20" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" 518 | dependencies = [ 519 | "proc-macro2", 520 | ] 521 | 522 | [[package]] 523 | name = "redox_syscall" 524 | version = "0.2.13" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" 527 | dependencies = [ 528 | "bitflags", 529 | ] 530 | 531 | [[package]] 532 | name = "remove_dir_all" 533 | version = "0.5.3" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 536 | dependencies = [ 537 | "winapi", 538 | ] 539 | 540 | [[package]] 541 | name = "reqwest" 542 | version = "0.11.11" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" 545 | dependencies = [ 546 | "base64", 547 | "bytes", 548 | "encoding_rs", 549 | "futures-core", 550 | "futures-util", 551 | "h2", 552 | "http", 553 | "http-body", 554 | "hyper", 555 | "hyper-tls", 556 | "ipnet", 557 | "js-sys", 558 | "lazy_static", 559 | "log", 560 | "mime", 561 | "native-tls", 562 | "percent-encoding", 563 | "pin-project-lite", 564 | "serde", 565 | "serde_json", 566 | "serde_urlencoded", 567 | "tokio", 568 | "tokio-native-tls", 569 | "tower-service", 570 | "url", 571 | "wasm-bindgen", 572 | "wasm-bindgen-futures", 573 | "web-sys", 574 | "winreg", 575 | ] 576 | 577 | [[package]] 578 | name = "ryu" 579 | version = "1.0.10" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" 582 | 583 | [[package]] 584 | name = "schannel" 585 | version = "0.1.20" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" 588 | dependencies = [ 589 | "lazy_static", 590 | "windows-sys", 591 | ] 592 | 593 | [[package]] 594 | name = "scopeguard" 595 | version = "1.1.0" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 598 | 599 | [[package]] 600 | name = "security-framework" 601 | version = "2.6.1" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" 604 | dependencies = [ 605 | "bitflags", 606 | "core-foundation", 607 | "core-foundation-sys", 608 | "libc", 609 | "security-framework-sys", 610 | ] 611 | 612 | [[package]] 613 | name = "security-framework-sys" 614 | version = "2.6.1" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 617 | dependencies = [ 618 | "core-foundation-sys", 619 | "libc", 620 | ] 621 | 622 | [[package]] 623 | name = "serde" 624 | version = "1.0.137" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" 627 | dependencies = [ 628 | "serde_derive", 629 | ] 630 | 631 | [[package]] 632 | name = "serde_derive" 633 | version = "1.0.137" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" 636 | dependencies = [ 637 | "proc-macro2", 638 | "quote", 639 | "syn", 640 | ] 641 | 642 | [[package]] 643 | name = "serde_json" 644 | version = "1.0.81" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" 647 | dependencies = [ 648 | "itoa", 649 | "ryu", 650 | "serde", 651 | ] 652 | 653 | [[package]] 654 | name = "serde_urlencoded" 655 | version = "0.7.1" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 658 | dependencies = [ 659 | "form_urlencoded", 660 | "itoa", 661 | "ryu", 662 | "serde", 663 | ] 664 | 665 | [[package]] 666 | name = "signal-hook-registry" 667 | version = "1.4.0" 668 | source = "registry+https://github.com/rust-lang/crates.io-index" 669 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 670 | dependencies = [ 671 | "libc", 672 | ] 673 | 674 | [[package]] 675 | name = "slab" 676 | version = "0.4.6" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" 679 | 680 | [[package]] 681 | name = "smallvec" 682 | version = "1.8.0" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 685 | 686 | [[package]] 687 | name = "socket2" 688 | version = "0.4.4" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 691 | dependencies = [ 692 | "libc", 693 | "winapi", 694 | ] 695 | 696 | [[package]] 697 | name = "syn" 698 | version = "1.0.98" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" 701 | dependencies = [ 702 | "proc-macro2", 703 | "quote", 704 | "unicode-ident", 705 | ] 706 | 707 | [[package]] 708 | name = "tempfile" 709 | version = "3.3.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 712 | dependencies = [ 713 | "cfg-if", 714 | "fastrand", 715 | "libc", 716 | "redox_syscall", 717 | "remove_dir_all", 718 | "winapi", 719 | ] 720 | 721 | [[package]] 722 | name = "tinyvec" 723 | version = "1.6.0" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 726 | dependencies = [ 727 | "tinyvec_macros", 728 | ] 729 | 730 | [[package]] 731 | name = "tinyvec_macros" 732 | version = "0.1.0" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 735 | 736 | [[package]] 737 | name = "tokio" 738 | version = "1.19.2" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" 741 | dependencies = [ 742 | "bytes", 743 | "libc", 744 | "memchr", 745 | "mio", 746 | "num_cpus", 747 | "once_cell", 748 | "parking_lot", 749 | "pin-project-lite", 750 | "signal-hook-registry", 751 | "socket2", 752 | "tokio-macros", 753 | "winapi", 754 | ] 755 | 756 | [[package]] 757 | name = "tokio-macros" 758 | version = "1.8.0" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" 761 | dependencies = [ 762 | "proc-macro2", 763 | "quote", 764 | "syn", 765 | ] 766 | 767 | [[package]] 768 | name = "tokio-native-tls" 769 | version = "0.3.0" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 772 | dependencies = [ 773 | "native-tls", 774 | "tokio", 775 | ] 776 | 777 | [[package]] 778 | name = "tokio-util" 779 | version = "0.7.3" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" 782 | dependencies = [ 783 | "bytes", 784 | "futures-core", 785 | "futures-sink", 786 | "pin-project-lite", 787 | "tokio", 788 | "tracing", 789 | ] 790 | 791 | [[package]] 792 | name = "tower-service" 793 | version = "0.3.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 796 | 797 | [[package]] 798 | name = "tracing" 799 | version = "0.1.35" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" 802 | dependencies = [ 803 | "cfg-if", 804 | "pin-project-lite", 805 | "tracing-core", 806 | ] 807 | 808 | [[package]] 809 | name = "tracing-core" 810 | version = "0.1.27" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" 813 | dependencies = [ 814 | "once_cell", 815 | ] 816 | 817 | [[package]] 818 | name = "try-lock" 819 | version = "0.2.3" 820 | source = "registry+https://github.com/rust-lang/crates.io-index" 821 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 822 | 823 | [[package]] 824 | name = "unicode-bidi" 825 | version = "0.3.8" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 828 | 829 | [[package]] 830 | name = "unicode-ident" 831 | version = "1.0.1" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" 834 | 835 | [[package]] 836 | name = "unicode-normalization" 837 | version = "0.1.19" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 840 | dependencies = [ 841 | "tinyvec", 842 | ] 843 | 844 | [[package]] 845 | name = "url" 846 | version = "2.2.2" 847 | source = "registry+https://github.com/rust-lang/crates.io-index" 848 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 849 | dependencies = [ 850 | "form_urlencoded", 851 | "idna", 852 | "matches", 853 | "percent-encoding", 854 | ] 855 | 856 | [[package]] 857 | name = "vcpkg" 858 | version = "0.2.15" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 861 | 862 | [[package]] 863 | name = "want" 864 | version = "0.3.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 867 | dependencies = [ 868 | "log", 869 | "try-lock", 870 | ] 871 | 872 | [[package]] 873 | name = "wasi" 874 | version = "0.11.0+wasi-snapshot-preview1" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 877 | 878 | [[package]] 879 | name = "wasm-bindgen" 880 | version = "0.2.81" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" 883 | dependencies = [ 884 | "cfg-if", 885 | "wasm-bindgen-macro", 886 | ] 887 | 888 | [[package]] 889 | name = "wasm-bindgen-backend" 890 | version = "0.2.81" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" 893 | dependencies = [ 894 | "bumpalo", 895 | "lazy_static", 896 | "log", 897 | "proc-macro2", 898 | "quote", 899 | "syn", 900 | "wasm-bindgen-shared", 901 | ] 902 | 903 | [[package]] 904 | name = "wasm-bindgen-futures" 905 | version = "0.4.31" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" 908 | dependencies = [ 909 | "cfg-if", 910 | "js-sys", 911 | "wasm-bindgen", 912 | "web-sys", 913 | ] 914 | 915 | [[package]] 916 | name = "wasm-bindgen-macro" 917 | version = "0.2.81" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" 920 | dependencies = [ 921 | "quote", 922 | "wasm-bindgen-macro-support", 923 | ] 924 | 925 | [[package]] 926 | name = "wasm-bindgen-macro-support" 927 | version = "0.2.81" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" 930 | dependencies = [ 931 | "proc-macro2", 932 | "quote", 933 | "syn", 934 | "wasm-bindgen-backend", 935 | "wasm-bindgen-shared", 936 | ] 937 | 938 | [[package]] 939 | name = "wasm-bindgen-shared" 940 | version = "0.2.81" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" 943 | 944 | [[package]] 945 | name = "web-sys" 946 | version = "0.3.58" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" 949 | dependencies = [ 950 | "js-sys", 951 | "wasm-bindgen", 952 | ] 953 | 954 | [[package]] 955 | name = "winapi" 956 | version = "0.3.9" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 959 | dependencies = [ 960 | "winapi-i686-pc-windows-gnu", 961 | "winapi-x86_64-pc-windows-gnu", 962 | ] 963 | 964 | [[package]] 965 | name = "winapi-i686-pc-windows-gnu" 966 | version = "0.4.0" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 969 | 970 | [[package]] 971 | name = "winapi-x86_64-pc-windows-gnu" 972 | version = "0.4.0" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 975 | 976 | [[package]] 977 | name = "windows-sys" 978 | version = "0.36.1" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 981 | dependencies = [ 982 | "windows_aarch64_msvc", 983 | "windows_i686_gnu", 984 | "windows_i686_msvc", 985 | "windows_x86_64_gnu", 986 | "windows_x86_64_msvc", 987 | ] 988 | 989 | [[package]] 990 | name = "windows_aarch64_msvc" 991 | version = "0.36.1" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 994 | 995 | [[package]] 996 | name = "windows_i686_gnu" 997 | version = "0.36.1" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 1000 | 1001 | [[package]] 1002 | name = "windows_i686_msvc" 1003 | version = "0.36.1" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 1006 | 1007 | [[package]] 1008 | name = "windows_x86_64_gnu" 1009 | version = "0.36.1" 1010 | source = "registry+https://github.com/rust-lang/crates.io-index" 1011 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 1012 | 1013 | [[package]] 1014 | name = "windows_x86_64_msvc" 1015 | version = "0.36.1" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 1018 | 1019 | [[package]] 1020 | name = "winreg" 1021 | version = "0.10.1" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 1024 | dependencies = [ 1025 | "winapi", 1026 | ] 1027 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ojo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | reqwest = { version = "0.11", features = ["json"] } 10 | tokio = { version = "1", features = ["full"] } 11 | serde = { version = "1.0", features = ["derive"] } 12 | serde_json = "1.0" 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 shiyui 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ojosama-commit 2 | 3 | commit message を ojosama 風に変換して commit いたしますわ~! 4 | 5 | ## 壱百満天原サロメお嬢様について 6 | 7 | 以下を参照してくださいまし。 8 | 9 | - [壱百満天原サロメ - にじさんじ公式サイト](https://www.nijisanji.jp/members/salome-hyakumantenbara) 10 | 11 | - [壱百満天原サロメ - Twitter](https://twitter.com/1000000lome) 12 | 13 | ## プログラムの使用について 14 | 15 | 壱百満天原サロメお嬢様、及びそちらの所属の にじさんじ や、 そちらの関係者、おファンコミュニティの方の迷惑にならないように使ってくださいまし。 16 | 17 | 本プログラムは、にじさんじ所属の壱百満天原サロメお嬢様のおキャラクターをお題材にした二次創作のお一つですわ。 故に、本プログラムは以下二次創作ガイドラインに従いますわ。 18 | 19 | - [ANYCOLOR 二次創作ガイドライン](https://event.nijisanji.app/guidelines/) 20 | 21 | 本プログラムを使う場合もお上記ガイドラインを守ってお使いくださいまし。 22 | 23 | 24 | ## インストール 25 | 26 | こちらのおリポジトリを クローン して、以下のおコマンドを実行してくださいまし。 27 | 28 | ```bash 29 | $ cargo install --path . 30 | ``` 31 | とりあえず使ってみたいという時は、以下のおコマンドでインストールせずに実行することができますわ~‼ 32 | クローンしたおフォルダ内で実行してくださいまし! 33 | 34 | ```bash 35 | $ cargo run "コミットメッセージです!" 36 | [hoge huga000] コミットメッセージですわ~~! 37 | ∞ file changed, ∞ insertions(+) 38 | ``` 39 | 40 | ## 使い方 41 | 42 | ```bash 43 | $ ojo "コミットメッセージです!" 44 | [hoge huga000] コミットメッセージですわ~~! 45 | ∞ file changed, ∞ insertions(+) 46 | ``` 47 | 48 | 49 | ## 注意事項 50 | こちらを使うためにはRustがインストールされている必要がありますわ。 51 | Rustについてはこちらのおページを見てインストールしてくださいまし。 52 | [Rust-Lang](https://www.rust-lang.org/learn) 53 | 54 | Rustのおバージョンが古いとエラーが出て動かない可能性がありますわ。 55 | そちらの場合は以下のおコマンドでRustをアップデートして、再度試してみてくださいまし。 56 | 57 | ```bash 58 | $ rustup update 59 | ``` 60 | 61 | 62 | ## 感謝 63 | 64 | こちらのプログラムは[jiro4989](https://github.com/jiro4989)さんの[ojosama](https://github.com/jiro4989/ojosama)、および[Ojosama Web API](https://github.com/jiro4989/ojosama-web)を使用していますわ。 65 | お心より感謝いたしますわ。 66 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": false, 3 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 4 | "extends": [ 5 | "config:base" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use serde::Serialize; 2 | use serde_json::json; 3 | use std::collections::HashMap; 4 | use std::process::Command; 5 | 6 | #[derive(Debug, Serialize)] 7 | struct Arguments { 8 | message: String, 9 | } 10 | 11 | #[derive(Debug)] 12 | struct OjosamaError(String); 13 | 14 | impl std::fmt::Display for OjosamaError { 15 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 16 | write!(f, "エラーが発生しましたわ。理由は以下の通りですわ。\n{}", self.0) 17 | } 18 | } 19 | 20 | impl std::error::Error for OjosamaError {} 21 | 22 | #[tokio::main] 23 | async fn main() -> Result<(), Box> { 24 | let args = parse_args()?; 25 | let commit_message = send_request(&args).await?; 26 | commit_to_git(&commit_message)?; 27 | 28 | Ok(()) 29 | } 30 | 31 | fn parse_args() -> Result> { 32 | let args = std::env::args().skip(1).collect::>(); 33 | 34 | if args.len() != 1 { 35 | let error_message = format!( 36 | "引数の数が正しくありませんわ。引数の数は1つである必要がありますわ。与えられた引数は{}個でしたわ。", 37 | args.len() 38 | ); 39 | return Err(Box::new(OjosamaError(error_message))); 40 | }; 41 | 42 | let message = args[0].clone(); 43 | 44 | Ok(Arguments { message }) 45 | } 46 | 47 | async fn send_request(args: &Arguments) -> Result> { 48 | let client = reqwest::Client::new(); 49 | let res = client 50 | .post("https://api.ojosama.jiro4989.com") 51 | .header("Content-Type", "application/json") 52 | .json(&json!({ 53 | "Text": args.message, 54 | })) 55 | .send() 56 | .await? 57 | .text() 58 | .await? 59 | .trim() 60 | .to_string(); 61 | 62 | let res_text: HashMap = serde_json::from_str(&res)?; 63 | 64 | let commit_message = res_text 65 | .get("Result") 66 | .ok_or_else(|| OjosamaError("APIからかえってきたデータに異常がありましたわ。".to_string()))? 67 | .clone(); 68 | 69 | Ok(commit_message) 70 | } 71 | 72 | fn commit_to_git(commit_message: &str) -> Result<(), Box> { 73 | let is_success = Command::new("git") 74 | .args(&["commit", "-m", commit_message]) 75 | .spawn()? 76 | .wait()? 77 | .success(); 78 | 79 | if !is_success { 80 | return Err(Box::new(OjosamaError( 81 | "`git commit` に失敗してしまいましたわ。addはしましたの?".to_string(), 82 | ))); 83 | } 84 | 85 | Ok(()) 86 | } 87 | --------------------------------------------------------------------------------