mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-26 00:31:10 +00:00
rename methods
This commit is contained in:
parent
c2c77d8974
commit
10bbc9ed2b
3 changed files with 416 additions and 301 deletions
266
Cargo.lock
generated
266
Cargo.lock
generated
|
@ -20,7 +20,7 @@ dependencies = [
|
||||||
"enum_delegate",
|
"enum_delegate",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-signature-normalization",
|
"http-signature-normalization",
|
||||||
"http-signature-normalization-reqwest",
|
"http-signature-normalization-reqwest",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
|
@ -214,7 +214,7 @@ dependencies = [
|
||||||
"axum-core",
|
"axum-core",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper",
|
||||||
|
@ -248,7 +248,7 @@ dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"mime",
|
"mime",
|
||||||
|
@ -271,7 +271,7 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"cookie",
|
"cookie",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"mime",
|
"mime",
|
||||||
|
@ -1440,6 +1440,108 @@ dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d15282ece24eaf4bd338d73ef580c6714c8615155c4190c781290ee3fa0fd372"
|
||||||
|
dependencies = [
|
||||||
|
"gloo-console",
|
||||||
|
"gloo-dialogs",
|
||||||
|
"gloo-events",
|
||||||
|
"gloo-file",
|
||||||
|
"gloo-history",
|
||||||
|
"gloo-net 0.5.0",
|
||||||
|
"gloo-render",
|
||||||
|
"gloo-storage",
|
||||||
|
"gloo-timers",
|
||||||
|
"gloo-utils",
|
||||||
|
"gloo-worker",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-console"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2a17868f56b4a24f677b17c8cb69958385102fa879418052d60b50bc1727e261"
|
||||||
|
dependencies = [
|
||||||
|
"gloo-utils",
|
||||||
|
"js-sys",
|
||||||
|
"serde",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-dialogs"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bf4748e10122b01435750ff530095b1217cf6546173459448b83913ebe7815df"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-events"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "27c26fb45f7c385ba980f5fa87ac677e363949e065a083722697ef1b2cc91e41"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-file"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "97563d71863fb2824b2e974e754a81d19c4a7ec47b09ced8a0e6656b6d54bd1f"
|
||||||
|
dependencies = [
|
||||||
|
"gloo-events",
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-history"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "903f432be5ba34427eac5e16048ef65604a82061fe93789f2212afc73d8617d6"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom",
|
||||||
|
"gloo-events",
|
||||||
|
"gloo-utils",
|
||||||
|
"serde",
|
||||||
|
"serde-wasm-bindgen",
|
||||||
|
"serde_urlencoded",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-net"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
"gloo-utils",
|
||||||
|
"http 0.2.12",
|
||||||
|
"js-sys",
|
||||||
|
"pin-project",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gloo-net"
|
name = "gloo-net"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
|
@ -1450,7 +1552,7 @@ dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"gloo-utils",
|
"gloo-utils",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -1461,6 +1563,31 @@ dependencies = [
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-render"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56008b6744713a8e8d98ac3dcb7d06543d5662358c9c805b4ce2167ad4649833"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-storage"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fbc8031e8c92758af912f9bc08fbbadd3c6f3cfcbf6b64cdf3d6a81f0139277a"
|
||||||
|
dependencies = [
|
||||||
|
"gloo-utils",
|
||||||
|
"js-sys",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gloo-timers"
|
name = "gloo-timers"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
@ -1486,6 +1613,37 @@ dependencies = [
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-worker"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "085f262d7604911c8150162529cefab3782e91adb20202e8658f7275d2aefe5d"
|
||||||
|
dependencies = [
|
||||||
|
"bincode",
|
||||||
|
"futures",
|
||||||
|
"gloo-utils",
|
||||||
|
"gloo-worker-macros",
|
||||||
|
"js-sys",
|
||||||
|
"pinned",
|
||||||
|
"serde",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-worker-macros"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "956caa58d4857bc9941749d55e4bd3000032d8212762586fa5705632967140e7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-crate",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.87",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "guardian"
|
name = "guardian"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
@ -1503,7 +1661,7 @@ dependencies = [
|
||||||
"fnv",
|
"fnv",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -1563,6 +1721,17 @@ dependencies = [
|
||||||
"utf8-width",
|
"utf8-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http"
|
||||||
|
version = "0.2.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"fnv",
|
||||||
|
"itoa",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http"
|
name = "http"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -1581,7 +1750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
|
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1592,7 +1761,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
@ -1667,7 +1836,7 @@ dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"httparse",
|
"httparse",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
|
@ -1685,7 +1854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333"
|
checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"hyper",
|
"hyper",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"rustls",
|
"rustls",
|
||||||
|
@ -1721,7 +1890,7 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"hyper",
|
"hyper",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
@ -1779,6 +1948,7 @@ dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"futures",
|
"futures",
|
||||||
"getrandom",
|
"getrandom",
|
||||||
|
"gloo",
|
||||||
"hex",
|
"hex",
|
||||||
"jsonwebtoken",
|
"jsonwebtoken",
|
||||||
"katex",
|
"katex",
|
||||||
|
@ -2139,7 +2309,7 @@ dependencies = [
|
||||||
"default-struct-builder",
|
"default-struct-builder",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"gloo-timers",
|
"gloo-timers",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"leptos",
|
"leptos",
|
||||||
|
@ -2285,7 +2455,7 @@ dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"either_of",
|
"either_of",
|
||||||
"futures",
|
"futures",
|
||||||
"gloo-net",
|
"gloo-net 0.6.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"leptos",
|
"leptos",
|
||||||
"leptos_router_macro",
|
"leptos_router_macro",
|
||||||
|
@ -2612,7 +2782,7 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"httparse",
|
"httparse",
|
||||||
"memchr",
|
"memchr",
|
||||||
"mime",
|
"mime",
|
||||||
|
@ -2953,6 +3123,17 @@ version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pinned"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b"
|
||||||
|
dependencies = [
|
||||||
|
"futures",
|
||||||
|
"rustversion",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkcs1"
|
name = "pkcs1"
|
||||||
version = "0.7.5"
|
version = "0.7.5"
|
||||||
|
@ -3037,6 +3218,16 @@ dependencies = [
|
||||||
"syn 2.0.87",
|
"syn 2.0.87",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-crate"
|
||||||
|
version = "1.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"toml_edit 0.19.15",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-error"
|
name = "proc-macro-error"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
|
@ -3420,7 +3611,7 @@ dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper",
|
||||||
|
@ -3466,7 +3657,7 @@ checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 1.0.69",
|
"thiserror 1.0.69",
|
||||||
|
@ -3726,6 +3917,17 @@ dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde-wasm-bindgen"
|
||||||
|
version = "0.6.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b"
|
||||||
|
dependencies = [
|
||||||
|
"js-sys",
|
||||||
|
"serde",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.215"
|
version = "1.0.215"
|
||||||
|
@ -3803,8 +4005,8 @@ dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"futures",
|
"futures",
|
||||||
"gloo-net",
|
"gloo-net 0.6.0",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper",
|
||||||
"inventory",
|
"inventory",
|
||||||
|
@ -4338,7 +4540,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime",
|
"toml_datetime",
|
||||||
"toml_edit",
|
"toml_edit 0.22.22",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4350,6 +4552,17 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_edit"
|
||||||
|
version = "0.19.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap",
|
||||||
|
"toml_datetime",
|
||||||
|
"winnow 0.5.40",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_edit"
|
name = "toml_edit"
|
||||||
version = "0.22.22"
|
version = "0.22.22"
|
||||||
|
@ -4360,7 +4573,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime",
|
"toml_datetime",
|
||||||
"winnow",
|
"winnow 0.6.20",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4403,7 +4616,7 @@ dependencies = [
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"http-range-header",
|
"http-range-header",
|
||||||
|
@ -4428,7 +4641,7 @@ dependencies = [
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 1.1.0",
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"http-range-header",
|
"http-range-header",
|
||||||
|
@ -4939,6 +5152,15 @@ version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winnow"
|
||||||
|
version = "0.5.40"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winnow"
|
name = "winnow"
|
||||||
version = "0.6.20"
|
version = "0.6.20"
|
||||||
|
|
|
@ -121,6 +121,7 @@ tower = { version = "0.5.1", optional = true }
|
||||||
tower-layer = { version = "0.3.3", optional = true }
|
tower-layer = { version = "0.3.3", optional = true }
|
||||||
console_log = "1.0.0"
|
console_log = "1.0.0"
|
||||||
send_wrapper = "0.6.0"
|
send_wrapper = "0.6.0"
|
||||||
|
gloo = "0.11.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pretty_assertions = "1.4.1"
|
pretty_assertions = "1.4.1"
|
||||||
|
|
|
@ -2,38 +2,18 @@ use crate::{
|
||||||
common::{
|
common::{
|
||||||
newtypes::{ArticleId, ConflictId},
|
newtypes::{ArticleId, ConflictId},
|
||||||
utils::http_protocol_str,
|
utils::http_protocol_str,
|
||||||
ApiConflict,
|
ApiConflict, ApproveArticleForm, ArticleView, CreateArticleForm, DbArticle, DbInstance,
|
||||||
ApproveArticleForm,
|
DbPerson, DeleteConflictForm, EditArticleForm, FollowInstance, ForkArticleForm,
|
||||||
ArticleView,
|
GetArticleForm, GetInstance, GetUserForm, InstanceView, ListArticlesForm, LocalUserView,
|
||||||
CreateArticleForm,
|
LoginUserForm, Notification, ProtectArticleForm, RegisterUserForm, ResolveObject,
|
||||||
DbArticle,
|
SearchArticleForm, SiteView,
|
||||||
DbInstance,
|
|
||||||
DbPerson,
|
|
||||||
DeleteConflictForm,
|
|
||||||
EditArticleForm,
|
|
||||||
FollowInstance,
|
|
||||||
ForkArticleForm,
|
|
||||||
GetArticleForm,
|
|
||||||
GetInstance,
|
|
||||||
GetUserForm,
|
|
||||||
InstanceView,
|
|
||||||
ListArticlesForm,
|
|
||||||
LocalUserView,
|
|
||||||
LoginUserForm,
|
|
||||||
Notification,
|
|
||||||
ProtectArticleForm,
|
|
||||||
RegisterUserForm,
|
|
||||||
ResolveObject,
|
|
||||||
SearchArticleForm,
|
|
||||||
SiteView,
|
|
||||||
},
|
},
|
||||||
frontend::error::MyResult,
|
frontend::error::MyResult,
|
||||||
};
|
};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use reqwest::{Client, RequestBuilder, StatusCode};
|
use reqwest::{Client, RequestBuilder, StatusCode};
|
||||||
use send_wrapper::SendWrapper;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{future::Future, sync::LazyLock};
|
use std::sync::LazyLock;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
pub static CLIENT: LazyLock<ApiClient> = LazyLock::new(|| ApiClient::new(Client::new(), None));
|
pub static CLIENT: LazyLock<ApiClient> = LazyLock::new(|| ApiClient::new(Client::new(), None));
|
||||||
|
@ -73,7 +53,7 @@ impl ApiClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_query<T, R>(&self, endpoint: &str, query: Option<R>) -> MyResult<T>
|
async fn get<T, R>(&self, endpoint: &str, query: Option<R>) -> MyResult<T>
|
||||||
where
|
where
|
||||||
T: for<'de> Deserialize<'de>,
|
T: for<'de> Deserialize<'de>,
|
||||||
R: Serialize,
|
R: Serialize,
|
||||||
|
@ -82,119 +62,79 @@ impl ApiClient {
|
||||||
if let Some(query) = query {
|
if let Some(query) = query {
|
||||||
req = req.query(&query);
|
req = req.query(&query);
|
||||||
}
|
}
|
||||||
handle_json_res::<T>(req).await
|
send::<T>(req).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_article(
|
pub async fn get_article(&self, data: GetArticleForm) -> MyResult<ArticleView> {
|
||||||
&self,
|
self.get("/api/v1/article", Some(data)).await
|
||||||
data: GetArticleForm,
|
|
||||||
) -> impl Future<Output = MyResult<ArticleView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/article", Some(data)).await })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn list_articles(
|
pub async fn list_articles(&self, data: ListArticlesForm) -> MyResult<Vec<DbArticle>> {
|
||||||
&self,
|
self.get("/api/v1/article/list", Some(data)).await
|
||||||
data: ListArticlesForm,
|
|
||||||
) -> impl Future<Output = MyResult<Vec<DbArticle>>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/article/list", Some(data)).await })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn register(
|
pub async fn register(&self, register_form: RegisterUserForm) -> MyResult<LocalUserView> {
|
||||||
&self,
|
|
||||||
register_form: RegisterUserForm,
|
|
||||||
) -> impl Future<Output = MyResult<LocalUserView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/account/register"))
|
.post(self.request_endpoint("/api/v1/account/register"))
|
||||||
.form(®ister_form);
|
.form(®ister_form);
|
||||||
handle_json_res::<LocalUserView>(req).await
|
send::<LocalUserView>(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn login(
|
pub async fn login(&self, login_form: LoginUserForm) -> MyResult<LocalUserView> {
|
||||||
&self,
|
|
||||||
login_form: LoginUserForm,
|
|
||||||
) -> impl Future<Output = MyResult<LocalUserView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/account/login"))
|
.post(self.request_endpoint("/api/v1/account/login"))
|
||||||
.form(&login_form);
|
.form(&login_form);
|
||||||
handle_json_res::<LocalUserView>(req).await
|
send::<LocalUserView>(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_article(
|
pub async fn create_article(&self, data: &CreateArticleForm) -> MyResult<ArticleView> {
|
||||||
&self,
|
|
||||||
data: CreateArticleForm,
|
|
||||||
) -> impl Future<Output = MyResult<ArticleView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/article"))
|
.post(self.request_endpoint("/api/v1/article"))
|
||||||
.form(&data);
|
.form(data);
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn edit_article_with_conflict(
|
pub async fn edit_article_with_conflict(
|
||||||
&self,
|
&self,
|
||||||
edit_form: EditArticleForm,
|
edit_form: &EditArticleForm,
|
||||||
) -> impl Future<Output = MyResult<Option<ApiConflict>>> + Send + '_ {
|
) -> MyResult<Option<ApiConflict>> {
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.patch(self.request_endpoint("/api/v1/article"))
|
.patch(self.request_endpoint("/api/v1/article"))
|
||||||
.form(&edit_form);
|
.form(edit_form);
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn edit_article(
|
pub async fn edit_article(&self, edit_form: &EditArticleForm) -> MyResult<ArticleView> {
|
||||||
&self,
|
|
||||||
edit_form: EditArticleForm,
|
|
||||||
) -> impl Future<Output = MyResult<ArticleView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let article_id = edit_form.article_id;
|
|
||||||
let edit_res = self.edit_article_with_conflict(edit_form).await?;
|
let edit_res = self.edit_article_with_conflict(edit_form).await?;
|
||||||
assert!(edit_res.is_none());
|
assert!(edit_res.is_none());
|
||||||
|
|
||||||
self.get_article(GetArticleForm {
|
self.get_article(GetArticleForm {
|
||||||
title: None,
|
title: None,
|
||||||
domain: None,
|
domain: None,
|
||||||
id: Some(article_id),
|
id: Some(edit_form.article_id),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn notifications_list(
|
pub async fn notifications_list(&self) -> MyResult<Vec<Notification>> {
|
||||||
&self,
|
|
||||||
) -> impl Future<Output = MyResult<Vec<Notification>>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.get(self.request_endpoint("/api/v1/user/notifications/list"));
|
.get(self.request_endpoint("/api/v1/user/notifications/list"));
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn notifications_count(&self) -> impl Future<Output = MyResult<usize>> + Send + '_ {
|
pub async fn notifications_count(&self) -> MyResult<usize> {
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.get(self.request_endpoint("/api/v1/user/notifications/count"));
|
.get(self.request_endpoint("/api/v1/user/notifications/count"));
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn approve_article(
|
pub async fn approve_article(&self, article_id: ArticleId, approve: bool) -> MyResult<()> {
|
||||||
&self,
|
|
||||||
article_id: ArticleId,
|
|
||||||
approve: bool,
|
|
||||||
) -> impl Future<Output = MyResult<()>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let form = ApproveArticleForm {
|
let form = ApproveArticleForm {
|
||||||
article_id,
|
article_id,
|
||||||
approve,
|
approve,
|
||||||
|
@ -203,59 +143,44 @@ impl ApiClient {
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/article/approve"))
|
.post(self.request_endpoint("/api/v1/article/approve"))
|
||||||
.form(&form);
|
.form(&form);
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_conflict(
|
pub async fn delete_conflict(&self, conflict_id: ConflictId) -> MyResult<()> {
|
||||||
&self,
|
|
||||||
conflict_id: ConflictId,
|
|
||||||
) -> impl Future<Output = MyResult<()>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let form = DeleteConflictForm { conflict_id };
|
let form = DeleteConflictForm { conflict_id };
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.delete(self.request_endpoint("/api/v1/conflict"))
|
.delete(self.request_endpoint("/api/v1/conflict"))
|
||||||
.form(&form);
|
.form(&form);
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn search(
|
pub async fn search(&self, search_form: &SearchArticleForm) -> MyResult<Vec<DbArticle>> {
|
||||||
|
self.get("/api/v1/search", Some(search_form)).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_local_instance(&self) -> MyResult<InstanceView> {
|
||||||
|
self.get("/api/v1/instance", None::<i32>).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_instance(&self, get_form: &GetInstance) -> MyResult<InstanceView> {
|
||||||
|
self.get("/api/v1/instance", Some(get_form)).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn list_instances(&self) -> MyResult<Vec<DbInstance>> {
|
||||||
|
self.get("/api/v1/instance/list", None::<i32>).await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn follow_instance_with_resolve(
|
||||||
&self,
|
&self,
|
||||||
search_form: SearchArticleForm,
|
follow_instance: &str,
|
||||||
) -> impl Future<Output = MyResult<Vec<DbArticle>>> + Send + '_ {
|
) -> MyResult<DbInstance> {
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/search", Some(search_form)).await })
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_local_instance(
|
|
||||||
&self,
|
|
||||||
) -> impl Future<Output = MyResult<Vec<InstanceView>>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/instance", None::<i32>).await })
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_instance(
|
|
||||||
&self,
|
|
||||||
get_form: GetInstance,
|
|
||||||
) -> impl Future<Output = MyResult<InstanceView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/instance", Some(get_form)).await })
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn list_instances(&self) -> impl Future<Output = MyResult<Vec<DbInstance>>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/instance/list", None::<i32>).await })
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn follow_instance_with_resolve(
|
|
||||||
&self,
|
|
||||||
follow_instance: String,
|
|
||||||
) -> impl Future<Output = MyResult<DbInstance>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
// fetch beta instance on alpha
|
// fetch beta instance on alpha
|
||||||
let resolve_form = ResolveObject {
|
let resolve_form = ResolveObject {
|
||||||
id: Url::parse(&format!("{}://{}", http_protocol_str(), follow_instance))?,
|
id: Url::parse(&format!("{}://{}", http_protocol_str(), follow_instance))?,
|
||||||
};
|
};
|
||||||
let instance_resolved: DbInstance = self
|
let instance_resolved: DbInstance = self
|
||||||
.get_query("/api/v1/instance/resolve", Some(resolve_form))
|
.get("/api/v1/instance/resolve", Some(resolve_form))
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// send follow
|
// send follow
|
||||||
|
@ -264,14 +189,9 @@ impl ApiClient {
|
||||||
};
|
};
|
||||||
self.follow_instance(follow_form).await?;
|
self.follow_instance(follow_form).await?;
|
||||||
Ok(instance_resolved)
|
Ok(instance_resolved)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn follow_instance(
|
pub async fn follow_instance(&self, follow_form: FollowInstance) -> MyResult<()> {
|
||||||
&self,
|
|
||||||
follow_form: FollowInstance,
|
|
||||||
) -> impl Future<Output = MyResult<()>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
// cant use post helper because follow doesnt return json
|
// cant use post helper because follow doesnt return json
|
||||||
let res = self
|
let res = self
|
||||||
.client
|
.client
|
||||||
|
@ -284,78 +204,50 @@ impl ApiClient {
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow!("API error: {}", res.text().await?).into())
|
Err(anyhow!("API error: {}", res.text().await?).into())
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn site(&self) -> impl Future<Output = MyResult<SiteView>> + Send + '_ {
|
pub async fn site(&self) -> MyResult<SiteView> {
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self.client.get(self.request_endpoint("/api/v1/site"));
|
let req = self.client.get(self.request_endpoint("/api/v1/site"));
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn logout(&self) -> impl Future<Output = MyResult<()>> + Send + '_ {
|
pub async fn logout(&self) -> MyResult<()> {
|
||||||
SendWrapper::new(async move {
|
|
||||||
self.client
|
self.client
|
||||||
.get(self.request_endpoint("/api/v1/account/logout"))
|
.get(self.request_endpoint("/api/v1/account/logout"))
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fork_article(
|
pub async fn fork_article(&self, form: &ForkArticleForm) -> MyResult<ArticleView> {
|
||||||
&self,
|
|
||||||
form: ForkArticleForm,
|
|
||||||
) -> impl Future<Output = MyResult<ArticleView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/article/fork"))
|
.post(self.request_endpoint("/api/v1/article/fork"))
|
||||||
.form(&form);
|
.form(form);
|
||||||
Ok(handle_json_res(req).await.unwrap())
|
Ok(send(req).await.unwrap())
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn protect_article(
|
pub async fn protect_article(&self, params: &ProtectArticleForm) -> MyResult<DbArticle> {
|
||||||
&self,
|
|
||||||
params: ProtectArticleForm,
|
|
||||||
) -> impl Future<Output = MyResult<DbArticle>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let req = self
|
let req = self
|
||||||
.client
|
.client
|
||||||
.post(self.request_endpoint("/api/v1/article/protect"))
|
.post(self.request_endpoint("/api/v1/article/protect"))
|
||||||
.form(¶ms);
|
.form(params);
|
||||||
handle_json_res(req).await
|
send(req).await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_article(
|
pub async fn resolve_article(&self, id: Url) -> MyResult<ArticleView> {
|
||||||
&self,
|
|
||||||
id: Url,
|
|
||||||
) -> impl Future<Output = MyResult<ArticleView>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let resolve_object = ResolveObject { id };
|
let resolve_object = ResolveObject { id };
|
||||||
self.get_query("/api/v1/article/resolve", Some(resolve_object))
|
self.get("/api/v1/article/resolve", Some(resolve_object))
|
||||||
.await
|
.await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_instance(
|
pub async fn resolve_instance(&self, id: Url) -> MyResult<DbInstance> {
|
||||||
&self,
|
|
||||||
id: Url,
|
|
||||||
) -> impl Future<Output = MyResult<DbInstance>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move {
|
|
||||||
let resolve_object = ResolveObject { id };
|
let resolve_object = ResolveObject { id };
|
||||||
self.get_query("/api/v1/instance/resolve", Some(resolve_object))
|
self.get("/api/v1/instance/resolve", Some(resolve_object))
|
||||||
.await
|
.await
|
||||||
})
|
|
||||||
}
|
}
|
||||||
pub fn get_user(
|
pub async fn get_user(&self, data: GetUserForm) -> MyResult<DbPerson> {
|
||||||
&self,
|
self.get("/api/v1/user", Some(data)).await
|
||||||
data: GetUserForm,
|
|
||||||
) -> impl Future<Output = MyResult<DbPerson>> + Send + '_ {
|
|
||||||
SendWrapper::new(async move { self.get_query("/api/v1/user", Some(data)).await })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn request_endpoint(&self, path: &str) -> String {
|
fn request_endpoint(&self, path: &str) -> String {
|
||||||
|
@ -364,7 +256,7 @@ impl ApiClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_json_res<T>(mut req: RequestBuilder) -> MyResult<T>
|
async fn send<T>(#[allow(unused_mut)] mut req: RequestBuilder) -> MyResult<T>
|
||||||
where
|
where
|
||||||
T: for<'de> Deserialize<'de>,
|
T: for<'de> Deserialize<'de>,
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue