summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Cargo.lock1077
-rw-r--r--Cargo.toml12
-rw-r--r--src/apis/mod.rs1
-rw-r--r--src/apis/modrinth.rs104
-rw-r--r--src/db.rs0
-rw-r--r--src/lib.rs4
-rw-r--r--src/main.rs7
-rw-r--r--src/update.rs8
9 files changed, 1215 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebdb388
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
1/target
2/api-tests \ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..815536d
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,1077 @@
1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.
3version = 3
4
5[[package]]
6name = "autocfg"
7version = "1.1.0"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
10
11[[package]]
12name = "base64"
13version = "0.13.1"
14source = "registry+https://github.com/rust-lang/crates.io-index"
15checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
16
17[[package]]
18name = "bitflags"
19version = "1.3.2"
20source = "registry+https://github.com/rust-lang/crates.io-index"
21checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
22
23[[package]]
24name = "bumpalo"
25version = "3.11.1"
26source = "registry+https://github.com/rust-lang/crates.io-index"
27checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
28
29[[package]]
30name = "bytes"
31version = "1.2.1"
32source = "registry+https://github.com/rust-lang/crates.io-index"
33checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"
34
35[[package]]
36name = "cc"
37version = "1.0.73"
38source = "registry+https://github.com/rust-lang/crates.io-index"
39checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
40
41[[package]]
42name = "cfg-if"
43version = "1.0.0"
44source = "registry+https://github.com/rust-lang/crates.io-index"
45checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
46
47[[package]]
48name = "core-foundation"
49version = "0.9.3"
50source = "registry+https://github.com/rust-lang/crates.io-index"
51checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
52dependencies = [
53 "core-foundation-sys",
54 "libc",
55]
56
57[[package]]
58name = "core-foundation-sys"
59version = "0.8.3"
60source = "registry+https://github.com/rust-lang/crates.io-index"
61checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
62
63[[package]]
64name = "encoding_rs"
65version = "0.8.31"
66source = "registry+https://github.com/rust-lang/crates.io-index"
67checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
68dependencies = [
69 "cfg-if",
70]
71
72[[package]]
73name = "fastrand"
74version = "1.8.0"
75source = "registry+https://github.com/rust-lang/crates.io-index"
76checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
77dependencies = [
78 "instant",
79]
80
81[[package]]
82name = "fnv"
83version = "1.0.7"
84source = "registry+https://github.com/rust-lang/crates.io-index"
85checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
86
87[[package]]
88name = "foreign-types"
89version = "0.3.2"
90source = "registry+https://github.com/rust-lang/crates.io-index"
91checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
92dependencies = [
93 "foreign-types-shared",
94]
95
96[[package]]
97name = "foreign-types-shared"
98version = "0.1.1"
99source = "registry+https://github.com/rust-lang/crates.io-index"
100checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
101
102[[package]]
103name = "form_urlencoded"
104version = "1.1.0"
105source = "registry+https://github.com/rust-lang/crates.io-index"
106checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
107dependencies = [
108 "percent-encoding",
109]
110
111[[package]]
112name = "futures-channel"
113version = "0.3.25"
114source = "registry+https://github.com/rust-lang/crates.io-index"
115checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed"
116dependencies = [
117 "futures-core",
118]
119
120[[package]]
121name = "futures-core"
122version = "0.3.25"
123source = "registry+https://github.com/rust-lang/crates.io-index"
124checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac"
125
126[[package]]
127name = "futures-sink"
128version = "0.3.25"
129source = "registry+https://github.com/rust-lang/crates.io-index"
130checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9"
131
132[[package]]
133name = "futures-task"
134version = "0.3.25"
135source = "registry+https://github.com/rust-lang/crates.io-index"
136checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea"
137
138[[package]]
139name = "futures-util"
140version = "0.3.25"
141source = "registry+https://github.com/rust-lang/crates.io-index"
142checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6"
143dependencies = [
144 "futures-core",
145 "futures-task",
146 "pin-project-lite",
147 "pin-utils",
148]
149
150[[package]]
151name = "h2"
152version = "0.3.15"
153source = "registry+https://github.com/rust-lang/crates.io-index"
154checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4"
155dependencies = [
156 "bytes",
157 "fnv",
158 "futures-core",
159 "futures-sink",
160 "futures-util",
161 "http",
162 "indexmap",
163 "slab",
164 "tokio",
165 "tokio-util",
166 "tracing",
167]
168
169[[package]]
170name = "hashbrown"
171version = "0.12.3"
172source = "registry+https://github.com/rust-lang/crates.io-index"
173checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
174
175[[package]]
176name = "hermit-abi"
177version = "0.1.19"
178source = "registry+https://github.com/rust-lang/crates.io-index"
179checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
180dependencies = [
181 "libc",
182]
183
184[[package]]
185name = "http"
186version = "0.2.8"
187source = "registry+https://github.com/rust-lang/crates.io-index"
188checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
189dependencies = [
190 "bytes",
191 "fnv",
192 "itoa",
193]
194
195[[package]]
196name = "http-body"
197version = "0.4.5"
198source = "registry+https://github.com/rust-lang/crates.io-index"
199checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
200dependencies = [
201 "bytes",
202 "http",
203 "pin-project-lite",
204]
205
206[[package]]
207name = "httparse"
208version = "1.8.0"
209source = "registry+https://github.com/rust-lang/crates.io-index"
210checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
211
212[[package]]
213name = "httpdate"
214version = "1.0.2"
215source = "registry+https://github.com/rust-lang/crates.io-index"
216checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
217
218[[package]]
219name = "hyper"
220version = "0.14.20"
221source = "registry+https://github.com/rust-lang/crates.io-index"
222checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac"
223dependencies = [
224 "bytes",
225 "futures-channel",
226 "futures-core",
227 "futures-util",
228 "h2",
229 "http",
230 "http-body",
231 "httparse",
232 "httpdate",
233 "itoa",
234 "pin-project-lite",
235 "socket2",
236 "tokio",
237 "tower-service",
238 "tracing",
239 "want",
240]
241
242[[package]]
243name = "hyper-tls"
244version = "0.5.0"
245source = "registry+https://github.com/rust-lang/crates.io-index"
246checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
247dependencies = [
248 "bytes",
249 "hyper",
250 "native-tls",
251 "tokio",
252 "tokio-native-tls",
253]
254
255[[package]]
256name = "idna"
257version = "0.3.0"
258source = "registry+https://github.com/rust-lang/crates.io-index"
259checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
260dependencies = [
261 "unicode-bidi",
262 "unicode-normalization",
263]
264
265[[package]]
266name = "indexmap"
267version = "1.9.1"
268source = "registry+https://github.com/rust-lang/crates.io-index"
269checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
270dependencies = [
271 "autocfg",
272 "hashbrown",
273]
274
275[[package]]
276name = "instant"
277version = "0.1.12"
278source = "registry+https://github.com/rust-lang/crates.io-index"
279checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
280dependencies = [
281 "cfg-if",
282]
283
284[[package]]
285name = "ipnet"
286version = "2.5.0"
287source = "registry+https://github.com/rust-lang/crates.io-index"
288checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b"
289
290[[package]]
291name = "itoa"
292version = "1.0.4"
293source = "registry+https://github.com/rust-lang/crates.io-index"
294checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
295
296[[package]]
297name = "js-sys"
298version = "0.3.60"
299source = "registry+https://github.com/rust-lang/crates.io-index"
300checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
301dependencies = [
302 "wasm-bindgen",
303]
304
305[[package]]
306name = "lazy_static"
307version = "1.4.0"
308source = "registry+https://github.com/rust-lang/crates.io-index"
309checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
310
311[[package]]
312name = "libc"
313version = "0.2.137"
314source = "registry+https://github.com/rust-lang/crates.io-index"
315checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
316
317[[package]]
318name = "lock_api"
319version = "0.4.9"
320source = "registry+https://github.com/rust-lang/crates.io-index"
321checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
322dependencies = [
323 "autocfg",
324 "scopeguard",
325]
326
327[[package]]
328name = "log"
329version = "0.4.17"
330source = "registry+https://github.com/rust-lang/crates.io-index"
331checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
332dependencies = [
333 "cfg-if",
334]
335
336[[package]]
337name = "memchr"
338version = "2.5.0"
339source = "registry+https://github.com/rust-lang/crates.io-index"
340checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
341
342[[package]]
343name = "mime"
344version = "0.3.16"
345source = "registry+https://github.com/rust-lang/crates.io-index"
346checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
347
348[[package]]
349name = "mio"
350version = "0.8.5"
351source = "registry+https://github.com/rust-lang/crates.io-index"
352checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
353dependencies = [
354 "libc",
355 "log",
356 "wasi",
357 "windows-sys 0.42.0",
358]
359
360[[package]]
361name = "modlist"
362version = "0.1.0"
363dependencies = [
364 "reqwest",
365 "serde",
366 "serde_json",
367 "tokio",
368]
369
370[[package]]
371name = "native-tls"
372version = "0.2.10"
373source = "registry+https://github.com/rust-lang/crates.io-index"
374checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9"
375dependencies = [
376 "lazy_static",
377 "libc",
378 "log",
379 "openssl",
380 "openssl-probe",
381 "openssl-sys",
382 "schannel",
383 "security-framework",
384 "security-framework-sys",
385 "tempfile",
386]
387
388[[package]]
389name = "num_cpus"
390version = "1.13.1"
391source = "registry+https://github.com/rust-lang/crates.io-index"
392checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
393dependencies = [
394 "hermit-abi",
395 "libc",
396]
397
398[[package]]
399name = "once_cell"
400version = "1.16.0"
401source = "registry+https://github.com/rust-lang/crates.io-index"
402checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
403
404[[package]]
405name = "openssl"
406version = "0.10.42"
407source = "registry+https://github.com/rust-lang/crates.io-index"
408checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13"
409dependencies = [
410 "bitflags",
411 "cfg-if",
412 "foreign-types",
413 "libc",
414 "once_cell",
415 "openssl-macros",
416 "openssl-sys",
417]
418
419[[package]]
420name = "openssl-macros"
421version = "0.1.0"
422source = "registry+https://github.com/rust-lang/crates.io-index"
423checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
424dependencies = [
425 "proc-macro2",
426 "quote",
427 "syn",
428]
429
430[[package]]
431name = "openssl-probe"
432version = "0.1.5"
433source = "registry+https://github.com/rust-lang/crates.io-index"
434checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
435
436[[package]]
437name = "openssl-sys"
438version = "0.9.77"
439source = "registry+https://github.com/rust-lang/crates.io-index"
440checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a"
441dependencies = [
442 "autocfg",
443 "cc",
444 "libc",
445 "pkg-config",
446 "vcpkg",
447]
448
449[[package]]
450name = "parking_lot"
451version = "0.12.1"
452source = "registry+https://github.com/rust-lang/crates.io-index"
453checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
454dependencies = [
455 "lock_api",
456 "parking_lot_core",
457]
458
459[[package]]
460name = "parking_lot_core"
461version = "0.9.4"
462source = "registry+https://github.com/rust-lang/crates.io-index"
463checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
464dependencies = [
465 "cfg-if",
466 "libc",
467 "redox_syscall",
468 "smallvec",
469 "windows-sys 0.42.0",
470]
471
472[[package]]
473name = "percent-encoding"
474version = "2.2.0"
475source = "registry+https://github.com/rust-lang/crates.io-index"
476checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
477
478[[package]]
479name = "pin-project-lite"
480version = "0.2.9"
481source = "registry+https://github.com/rust-lang/crates.io-index"
482checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
483
484[[package]]
485name = "pin-utils"
486version = "0.1.0"
487source = "registry+https://github.com/rust-lang/crates.io-index"
488checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
489
490[[package]]
491name = "pkg-config"
492version = "0.3.26"
493source = "registry+https://github.com/rust-lang/crates.io-index"
494checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
495
496[[package]]
497name = "proc-macro2"
498version = "1.0.47"
499source = "registry+https://github.com/rust-lang/crates.io-index"
500checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
501dependencies = [
502 "unicode-ident",
503]
504
505[[package]]
506name = "quote"
507version = "1.0.21"
508source = "registry+https://github.com/rust-lang/crates.io-index"
509checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
510dependencies = [
511 "proc-macro2",
512]
513
514[[package]]
515name = "redox_syscall"
516version = "0.2.16"
517source = "registry+https://github.com/rust-lang/crates.io-index"
518checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
519dependencies = [
520 "bitflags",
521]
522
523[[package]]
524name = "remove_dir_all"
525version = "0.5.3"
526source = "registry+https://github.com/rust-lang/crates.io-index"
527checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
528dependencies = [
529 "winapi",
530]
531
532[[package]]
533name = "reqwest"
534version = "0.11.12"
535source = "registry+https://github.com/rust-lang/crates.io-index"
536checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc"
537dependencies = [
538 "base64",
539 "bytes",
540 "encoding_rs",
541 "futures-core",
542 "futures-util",
543 "h2",
544 "http",
545 "http-body",
546 "hyper",
547 "hyper-tls",
548 "ipnet",
549 "js-sys",
550 "log",
551 "mime",
552 "native-tls",
553 "once_cell",
554 "percent-encoding",
555 "pin-project-lite",
556 "serde",
557 "serde_json",
558 "serde_urlencoded",
559 "tokio",
560 "tokio-native-tls",
561 "tower-service",
562 "url",
563 "wasm-bindgen",
564 "wasm-bindgen-futures",
565 "web-sys",
566 "winreg",
567]
568
569[[package]]
570name = "ryu"
571version = "1.0.11"
572source = "registry+https://github.com/rust-lang/crates.io-index"
573checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
574
575[[package]]
576name = "schannel"
577version = "0.1.20"
578source = "registry+https://github.com/rust-lang/crates.io-index"
579checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
580dependencies = [
581 "lazy_static",
582 "windows-sys 0.36.1",
583]
584
585[[package]]
586name = "scopeguard"
587version = "1.1.0"
588source = "registry+https://github.com/rust-lang/crates.io-index"
589checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
590
591[[package]]
592name = "security-framework"
593version = "2.7.0"
594source = "registry+https://github.com/rust-lang/crates.io-index"
595checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
596dependencies = [
597 "bitflags",
598 "core-foundation",
599 "core-foundation-sys",
600 "libc",
601 "security-framework-sys",
602]
603
604[[package]]
605name = "security-framework-sys"
606version = "2.6.1"
607source = "registry+https://github.com/rust-lang/crates.io-index"
608checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
609dependencies = [
610 "core-foundation-sys",
611 "libc",
612]
613
614[[package]]
615name = "serde"
616version = "1.0.147"
617source = "registry+https://github.com/rust-lang/crates.io-index"
618checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
619dependencies = [
620 "serde_derive",
621]
622
623[[package]]
624name = "serde_derive"
625version = "1.0.147"
626source = "registry+https://github.com/rust-lang/crates.io-index"
627checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
628dependencies = [
629 "proc-macro2",
630 "quote",
631 "syn",
632]
633
634[[package]]
635name = "serde_json"
636version = "1.0.87"
637source = "registry+https://github.com/rust-lang/crates.io-index"
638checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45"
639dependencies = [
640 "itoa",
641 "ryu",
642 "serde",
643]
644
645[[package]]
646name = "serde_urlencoded"
647version = "0.7.1"
648source = "registry+https://github.com/rust-lang/crates.io-index"
649checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
650dependencies = [
651 "form_urlencoded",
652 "itoa",
653 "ryu",
654 "serde",
655]
656
657[[package]]
658name = "signal-hook-registry"
659version = "1.4.0"
660source = "registry+https://github.com/rust-lang/crates.io-index"
661checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
662dependencies = [
663 "libc",
664]
665
666[[package]]
667name = "slab"
668version = "0.4.7"
669source = "registry+https://github.com/rust-lang/crates.io-index"
670checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
671dependencies = [
672 "autocfg",
673]
674
675[[package]]
676name = "smallvec"
677version = "1.10.0"
678source = "registry+https://github.com/rust-lang/crates.io-index"
679checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
680
681[[package]]
682name = "socket2"
683version = "0.4.7"
684source = "registry+https://github.com/rust-lang/crates.io-index"
685checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
686dependencies = [
687 "libc",
688 "winapi",
689]
690
691[[package]]
692name = "syn"
693version = "1.0.103"
694source = "registry+https://github.com/rust-lang/crates.io-index"
695checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
696dependencies = [
697 "proc-macro2",
698 "quote",
699 "unicode-ident",
700]
701
702[[package]]
703name = "tempfile"
704version = "3.3.0"
705source = "registry+https://github.com/rust-lang/crates.io-index"
706checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
707dependencies = [
708 "cfg-if",
709 "fastrand",
710 "libc",
711 "redox_syscall",
712 "remove_dir_all",
713 "winapi",
714]
715
716[[package]]
717name = "tinyvec"
718version = "1.6.0"
719source = "registry+https://github.com/rust-lang/crates.io-index"
720checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
721dependencies = [
722 "tinyvec_macros",
723]
724
725[[package]]
726name = "tinyvec_macros"
727version = "0.1.0"
728source = "registry+https://github.com/rust-lang/crates.io-index"
729checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
730
731[[package]]
732name = "tokio"
733version = "1.21.2"
734source = "registry+https://github.com/rust-lang/crates.io-index"
735checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099"
736dependencies = [
737 "autocfg",
738 "bytes",
739 "libc",
740 "memchr",
741 "mio",
742 "num_cpus",
743 "parking_lot",
744 "pin-project-lite",
745 "signal-hook-registry",
746 "socket2",
747 "tokio-macros",
748 "winapi",
749]
750
751[[package]]
752name = "tokio-macros"
753version = "1.8.0"
754source = "registry+https://github.com/rust-lang/crates.io-index"
755checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
756dependencies = [
757 "proc-macro2",
758 "quote",
759 "syn",
760]
761
762[[package]]
763name = "tokio-native-tls"
764version = "0.3.0"
765source = "registry+https://github.com/rust-lang/crates.io-index"
766checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
767dependencies = [
768 "native-tls",
769 "tokio",
770]
771
772[[package]]
773name = "tokio-util"
774version = "0.7.4"
775source = "registry+https://github.com/rust-lang/crates.io-index"
776checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
777dependencies = [
778 "bytes",
779 "futures-core",
780 "futures-sink",
781 "pin-project-lite",
782 "tokio",
783 "tracing",
784]
785
786[[package]]
787name = "tower-service"
788version = "0.3.2"
789source = "registry+https://github.com/rust-lang/crates.io-index"
790checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
791
792[[package]]
793name = "tracing"
794version = "0.1.37"
795source = "registry+https://github.com/rust-lang/crates.io-index"
796checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
797dependencies = [
798 "cfg-if",
799 "pin-project-lite",
800 "tracing-core",
801]
802
803[[package]]
804name = "tracing-core"
805version = "0.1.30"
806source = "registry+https://github.com/rust-lang/crates.io-index"
807checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
808dependencies = [
809 "once_cell",
810]
811
812[[package]]
813name = "try-lock"
814version = "0.2.3"
815source = "registry+https://github.com/rust-lang/crates.io-index"
816checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
817
818[[package]]
819name = "unicode-bidi"
820version = "0.3.8"
821source = "registry+https://github.com/rust-lang/crates.io-index"
822checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
823
824[[package]]
825name = "unicode-ident"
826version = "1.0.5"
827source = "registry+https://github.com/rust-lang/crates.io-index"
828checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
829
830[[package]]
831name = "unicode-normalization"
832version = "0.1.22"
833source = "registry+https://github.com/rust-lang/crates.io-index"
834checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
835dependencies = [
836 "tinyvec",
837]
838
839[[package]]
840name = "url"
841version = "2.3.1"
842source = "registry+https://github.com/rust-lang/crates.io-index"
843checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
844dependencies = [
845 "form_urlencoded",
846 "idna",
847 "percent-encoding",
848]
849
850[[package]]
851name = "vcpkg"
852version = "0.2.15"
853source = "registry+https://github.com/rust-lang/crates.io-index"
854checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
855
856[[package]]
857name = "want"
858version = "0.3.0"
859source = "registry+https://github.com/rust-lang/crates.io-index"
860checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
861dependencies = [
862 "log",
863 "try-lock",
864]
865
866[[package]]
867name = "wasi"
868version = "0.11.0+wasi-snapshot-preview1"
869source = "registry+https://github.com/rust-lang/crates.io-index"
870checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
871
872[[package]]
873name = "wasm-bindgen"
874version = "0.2.83"
875source = "registry+https://github.com/rust-lang/crates.io-index"
876checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
877dependencies = [
878 "cfg-if",
879 "wasm-bindgen-macro",
880]
881
882[[package]]
883name = "wasm-bindgen-backend"
884version = "0.2.83"
885source = "registry+https://github.com/rust-lang/crates.io-index"
886checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
887dependencies = [
888 "bumpalo",
889 "log",
890 "once_cell",
891 "proc-macro2",
892 "quote",
893 "syn",
894 "wasm-bindgen-shared",
895]
896
897[[package]]
898name = "wasm-bindgen-futures"
899version = "0.4.33"
900source = "registry+https://github.com/rust-lang/crates.io-index"
901checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
902dependencies = [
903 "cfg-if",
904 "js-sys",
905 "wasm-bindgen",
906 "web-sys",
907]
908
909[[package]]
910name = "wasm-bindgen-macro"
911version = "0.2.83"
912source = "registry+https://github.com/rust-lang/crates.io-index"
913checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
914dependencies = [
915 "quote",
916 "wasm-bindgen-macro-support",
917]
918
919[[package]]
920name = "wasm-bindgen-macro-support"
921version = "0.2.83"
922source = "registry+https://github.com/rust-lang/crates.io-index"
923checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
924dependencies = [
925 "proc-macro2",
926 "quote",
927 "syn",
928 "wasm-bindgen-backend",
929 "wasm-bindgen-shared",
930]
931
932[[package]]
933name = "wasm-bindgen-shared"
934version = "0.2.83"
935source = "registry+https://github.com/rust-lang/crates.io-index"
936checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
937
938[[package]]
939name = "web-sys"
940version = "0.3.60"
941source = "registry+https://github.com/rust-lang/crates.io-index"
942checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
943dependencies = [
944 "js-sys",
945 "wasm-bindgen",
946]
947
948[[package]]
949name = "winapi"
950version = "0.3.9"
951source = "registry+https://github.com/rust-lang/crates.io-index"
952checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
953dependencies = [
954 "winapi-i686-pc-windows-gnu",
955 "winapi-x86_64-pc-windows-gnu",
956]
957
958[[package]]
959name = "winapi-i686-pc-windows-gnu"
960version = "0.4.0"
961source = "registry+https://github.com/rust-lang/crates.io-index"
962checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
963
964[[package]]
965name = "winapi-x86_64-pc-windows-gnu"
966version = "0.4.0"
967source = "registry+https://github.com/rust-lang/crates.io-index"
968checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
969
970[[package]]
971name = "windows-sys"
972version = "0.36.1"
973source = "registry+https://github.com/rust-lang/crates.io-index"
974checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
975dependencies = [
976 "windows_aarch64_msvc 0.36.1",
977 "windows_i686_gnu 0.36.1",
978 "windows_i686_msvc 0.36.1",
979 "windows_x86_64_gnu 0.36.1",
980 "windows_x86_64_msvc 0.36.1",
981]
982
983[[package]]
984name = "windows-sys"
985version = "0.42.0"
986source = "registry+https://github.com/rust-lang/crates.io-index"
987checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
988dependencies = [
989 "windows_aarch64_gnullvm",
990 "windows_aarch64_msvc 0.42.0",
991 "windows_i686_gnu 0.42.0",
992 "windows_i686_msvc 0.42.0",
993 "windows_x86_64_gnu 0.42.0",
994 "windows_x86_64_gnullvm",
995 "windows_x86_64_msvc 0.42.0",
996]
997
998[[package]]
999name = "windows_aarch64_gnullvm"
1000version = "0.42.0"
1001source = "registry+https://github.com/rust-lang/crates.io-index"
1002checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
1003
1004[[package]]
1005name = "windows_aarch64_msvc"
1006version = "0.36.1"
1007source = "registry+https://github.com/rust-lang/crates.io-index"
1008checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
1009
1010[[package]]
1011name = "windows_aarch64_msvc"
1012version = "0.42.0"
1013source = "registry+https://github.com/rust-lang/crates.io-index"
1014checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
1015
1016[[package]]
1017name = "windows_i686_gnu"
1018version = "0.36.1"
1019source = "registry+https://github.com/rust-lang/crates.io-index"
1020checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
1021
1022[[package]]
1023name = "windows_i686_gnu"
1024version = "0.42.0"
1025source = "registry+https://github.com/rust-lang/crates.io-index"
1026checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
1027
1028[[package]]
1029name = "windows_i686_msvc"
1030version = "0.36.1"
1031source = "registry+https://github.com/rust-lang/crates.io-index"
1032checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
1033
1034[[package]]
1035name = "windows_i686_msvc"
1036version = "0.42.0"
1037source = "registry+https://github.com/rust-lang/crates.io-index"
1038checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
1039
1040[[package]]
1041name = "windows_x86_64_gnu"
1042version = "0.36.1"
1043source = "registry+https://github.com/rust-lang/crates.io-index"
1044checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
1045
1046[[package]]
1047name = "windows_x86_64_gnu"
1048version = "0.42.0"
1049source = "registry+https://github.com/rust-lang/crates.io-index"
1050checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
1051
1052[[package]]
1053name = "windows_x86_64_gnullvm"
1054version = "0.42.0"
1055source = "registry+https://github.com/rust-lang/crates.io-index"
1056checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
1057
1058[[package]]
1059name = "windows_x86_64_msvc"
1060version = "0.36.1"
1061source = "registry+https://github.com/rust-lang/crates.io-index"
1062checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
1063
1064[[package]]
1065name = "windows_x86_64_msvc"
1066version = "0.42.0"
1067source = "registry+https://github.com/rust-lang/crates.io-index"
1068checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
1069
1070[[package]]
1071name = "winreg"
1072version = "0.10.1"
1073source = "registry+https://github.com/rust-lang/crates.io-index"
1074checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
1075dependencies = [
1076 "winapi",
1077]
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..cc98e0d
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,12 @@
1[package]
2name = "modlist"
3version = "0.1.0"
4edition = "2021"
5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8[dependencies]
9reqwest = { version = "0.11", features = ["json"] }
10tokio = { version = "1", features = ["full"] }
11serde = { version = "1.0", features = ["derive"] }
12serde_json = "1.0.87"
diff --git a/src/apis/mod.rs b/src/apis/mod.rs
new file mode 100644
index 0000000..749d914
--- /dev/null
+++ b/src/apis/mod.rs
@@ -0,0 +1 @@
pub mod modrinth;
diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs
new file mode 100644
index 0000000..ce9fdd4
--- /dev/null
+++ b/src/apis/modrinth.rs
@@ -0,0 +1,104 @@
1use serde::{Deserialize, Serialize};
2
3async fn get(path: String) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
4 dbg!(&path);
5 let api = String::from("https://api.modrinth.com/v2/");
6 //let api = String::from("localhost:8080/");
7 //let api = String::from("https://www.rust-lang.org/");
8 let url = format!(r#"{}{}"#, api, path);
9
10 println!("{}", &url);
11
12
13 let data = reqwest::get(r#"https://api.modrinth.com/v2/projects?ids=["kYuIpRLv","89Wsn8GD"]"#)
14 .await?
15 .bytes()
16 .await?
17 .to_vec();
18
19 //println!("body = {:?}", data);
20
21 Ok(data)
22}
23
24#[derive(Debug, Deserialize)]
25pub struct Project {
26 pub slug: String,
27 pub title: String,
28 pub description: String,
29 pub categories: Vec<String>,
30 pub client_side: Side,
31 pub server_side: Side,
32 pub body: String,
33 pub additional_categories: Option<Vec<String>>,
34 pub project_type: Type,
35 pub downloads: u32,
36 pub icon_url: Option<String>,
37 pub id: String,
38 pub team: String,
39 pub moderator_message: Option<ModeratorMessage>,
40 pub published: String,
41 pub updated: String,
42 pub approved: Option<String>,
43 pub followers: u32,
44 pub status: Status,
45 pub license: License,
46 pub versions: Vec<String>,
47}
48
49#[derive(Debug, Deserialize)]
50pub struct License {
51 pub id: String,
52 pub name: String,
53 pub url: Option<String>,
54}
55
56#[derive(Debug, Deserialize)]
57pub struct ModeratorMessage {
58 pub message: String,
59 pub body: Option<String>,
60}
61
62#[allow(non_camel_case_types)]
63#[derive(Debug, Deserialize)]
64pub enum Side {
65 required,
66 optional,
67 unsupported
68}
69
70#[allow(non_camel_case_types)]
71#[derive(Debug, Deserialize)]
72pub enum Type {
73 r#mod,
74 modpack,
75 recourcepack
76}
77
78#[allow(non_camel_case_types)]
79#[derive(Debug, Deserialize)]
80pub enum Status {
81 approved,
82 rejected,
83 draft,
84 unlisted,
85 archived,
86 processing,
87 unknown
88}
89pub async fn project(name: &str) -> Project {
90 let url = format!("project/{}", name);
91 let data = get(url);
92
93 serde_json::from_slice(&data.await.unwrap()).unwrap()
94}
95
96pub async fn projects(ids: Vec<&str>) -> Vec<Project> {
97 let all = ids.join(r#"",""#);
98 let url = format!(r#"projects?ids=["{}"]"#, all);
99 println!("{}", url);
100
101 let data = get(url);
102
103 serde_json::from_slice(&data.await.unwrap()).unwrap()
104}
diff --git a/src/db.rs b/src/db.rs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/db.rs
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..cbb761c
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,4 @@
1pub mod update;
2pub mod apis;
3
4pub use apis::*;
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..8d1a1bd
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,7 @@
1use modlist::modrinth::projects;
2
3#[tokio::main]
4async fn main() {
5 //projects(vec!["kYuIpRLv", "89Wsn8GD"]);
6 println!("{:?}", projects(vec!["kYuIpRLv", "89Wsn8GD"]).await);
7}
diff --git a/src/update.rs b/src/update.rs
new file mode 100644
index 0000000..2e70f43
--- /dev/null
+++ b/src/update.rs
@@ -0,0 +1,8 @@
1pub fn update_mods() {
2
3}
4
5fn get_version(link: String) {
6
7
8}