diff --git a/Cargo.lock b/Cargo.lock index e36f881d60..51fcfce547 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "anymap2" @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "async-graphql" -version = "7.0.12" +version = "7.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10db7e8b2042f8d7ebcfebc482622411c23f88f3e9cd7fac74465b78fdab65f0" +checksum = "59fd6bd734afb8b6e4d0f84a3e77305ce0a7ccc60d70f6001cb5e1c3f38d8ff1" dependencies = [ "async-graphql-derive", "async-graphql-parser", @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "async-graphql-derive" -version = "7.0.12" +version = "7.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560d871a344178c35568a15be1bbb40cbcaced57838bf2eb1f654802000df7" +checksum = "ac38b4dd452d529d6c0248b51df23603f0a875770352e26ae8c346ce6c149b3e" dependencies = [ "Inflector", "async-graphql-parser", @@ -279,7 +279,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.90", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "async-graphql-parser" -version = "7.0.12" +version = "7.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df338e3e6469f86cce1e2b0226644e9fd82ec04790e199f8dd06416632d89ea" +checksum = "42d271ddda2f55b13970928abbcbc3423cfc18187c60e8769b48f21a93b7adaa" dependencies = [ "async-graphql-value", "pest", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "7.0.12" +version = "7.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cffd8bb84bc7895672c4e9b71d21e35526ffd645a29aedeed165a3f4a7ba9b" +checksum = "aefe909173a037eaf3281b046dc22580b59a38b765d7b8d5116f2ffef098048d" dependencies = [ "bytes", "indexmap 2.7.0", @@ -406,7 +406,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -474,7 +474,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -485,13 +485,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -535,7 +535,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "itoa", "matchit", "memchr", @@ -642,7 +642,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.10.5", "lazy_static", "lazycell", "log", @@ -652,7 +652,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.90", + "syn 2.0.96", "which 4.4.2", ] @@ -874,9 +874,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -956,9 +956,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -968,14 +968,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1259,7 +1259,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1281,7 +1281,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1333,7 +1333,7 @@ checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1384,7 +1384,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "unicode-xid", ] @@ -1397,7 +1397,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1476,7 +1476,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1761,7 +1761,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1839,6 +1839,19 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -2363,7 +2376,7 @@ dependencies = [ "crossbeam-utils", "form_urlencoded", "futures-util", - "hyper 0.14.31", + "hyper 0.14.32", "lazy_static", "levenshtein", "log", @@ -2378,9 +2391,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -2427,7 +2440,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -2441,7 +2454,7 @@ checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "log", "rustls 0.22.4", "rustls-native-certs", @@ -2460,7 +2473,7 @@ dependencies = [ "http 1.1.0", "hyper 1.5.1", "hyper-util", - "rustls 0.23.19", + "rustls 0.23.21", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -2474,7 +2487,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.31", + "hyper 0.14.32", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -2637,7 +2650,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2774,15 +2787,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.14" @@ -2995,7 +2999,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3088,7 +3092,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.8.5", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3100,6 +3104,19 @@ dependencies = [ "logos-codegen", ] +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" version = "0.12.5" @@ -3236,7 +3253,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3247,7 +3264,7 @@ checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3326,25 +3343,23 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.8" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "async-lock", - "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", "event-listener 5.3.1", "futures-util", - "once_cell", + "loom", "parking_lot", - "quanta", + "portable-atomic", "rustc_version", "smallvec", "tagptr", "thiserror 1.0.69", - "triomphe", "uuid", ] @@ -3852,7 +3867,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3887,16 +3902,15 @@ dependencies = [ [[package]] name = "phonenumber" -version = "0.3.6+8.13.36" +version = "0.3.7+8.13.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11756237b57b8cc5e97dc8b1e70ea436324d30e7075de63b14fd15073a8f692a" +checksum = "2247167dc3741816fdd4d3690e97f56a892a264b44f4c702078b72d1f8b6bd40" dependencies = [ "bincode", "either", "fnv", - "itertools 0.12.1", - "lazy_static", "nom", + "once_cell", "quick-xml", "regex", "regex-cache", @@ -3929,7 +3943,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4008,6 +4022,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "portable-atomic" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" + [[package]] name = "posthog-rs" version = "0.2.3" @@ -4057,7 +4077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4081,9 +4101,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -4131,7 +4151,7 @@ checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck", - "itertools 0.12.1", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -4140,7 +4160,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.96", "tempfile", ] @@ -4151,10 +4171,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.10.5", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4164,10 +4184,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.10.5", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4400,21 +4420,6 @@ dependencies = [ "sha2 0.9.9", ] -[[package]] -name = "quanta" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi", - "web-sys", - "winapi", -] - [[package]] name = "query_map" version = "0.7.0" @@ -4446,7 +4451,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.19", + "rustls 0.23.21", "socket2", "thiserror 2.0.3", "tokio", @@ -4464,7 +4469,7 @@ dependencies = [ "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.19", + "rustls 0.23.21", "rustls-pki-types", "slab", "thiserror 2.0.3", @@ -4489,9 +4494,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -4526,15 +4531,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "raw-cpuid" -version = "11.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" -dependencies = [ - "bitflags 2.6.0", -] - [[package]] name = "rayon" version = "1.10.0" @@ -4662,7 +4658,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-rustls 0.24.2", "ipnet", "js-sys", @@ -4714,7 +4710,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.19", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -4826,7 +4822,7 @@ dependencies = [ "proc-macro2", "quote", "rquickjs-core", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4907,9 +4903,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "once_cell", "ring", @@ -4952,9 +4948,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" dependencies = [ "web-time", ] @@ -5031,7 +5027,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5093,9 +5089,9 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -5143,13 +5139,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5160,14 +5156,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "indexmap 2.7.0", "itoa", @@ -5486,7 +5482,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5508,9 +5504,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -5540,7 +5536,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5640,7 +5636,7 @@ dependencies = [ "http-cache-reqwest", "http-cache-semantics", "httpmock", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-rustls 0.25.0", "indenter", "indexmap 2.7.0", @@ -5683,7 +5679,7 @@ dependencies = [ "reqwest-middleware", "resource", "rquickjs", - "rustls 0.23.19", + "rustls 0.23.21", "rustls-pemfile 1.0.4", "rustls-pki-types", "schemars", @@ -5734,7 +5730,7 @@ dependencies = [ "async-trait", "dotenvy", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "lambda_http", "lambda_runtime", "reqwest 0.11.27", @@ -5760,7 +5756,7 @@ dependencies = [ "async-trait", "console_error_panic_hook", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "lazy_static", "protox 0.7.1", "reqwest 0.11.27", @@ -5811,7 +5807,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5882,7 +5878,7 @@ dependencies = [ "headers", "http 0.2.12", "http-body-util", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-util", "once_cell", "opentelemetry 0.23.0", @@ -5937,7 +5933,7 @@ dependencies = [ "console_error_panic_hook", "dashmap", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "reqwest 0.11.27", "serde_json", "tailcall", @@ -6003,7 +5999,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6032,7 +6028,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6043,7 +6039,7 @@ checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6167,7 +6163,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6197,7 +6193,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.19", + "rustls 0.23.21", "rustls-pki-types", "tokio", ] @@ -6281,7 +6277,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-timeout", "percent-encoding", "pin-project", @@ -6327,7 +6323,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6340,7 +6336,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6366,7 +6362,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "opentelemetry 0.23.0", "pin-project-lite", "tonic 0.11.0", @@ -6438,7 +6434,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6522,12 +6518,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "triomphe" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" - [[package]] name = "try-lock" version = "0.2.5" @@ -6742,7 +6732,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -6777,7 +6767,7 @@ checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6811,7 +6801,7 @@ checksum = "222ebde6ea87fbfa6bdd2e9f1fd8a91d60aee5db68792632176c4e16a74fc7d8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6919,7 +6909,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -7012,7 +7002,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7023,7 +7013,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7045,7 +7035,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7056,7 +7046,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7359,7 +7349,7 @@ dependencies = [ "async-trait", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-macro-support", @@ -7387,7 +7377,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7434,7 +7424,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -7456,7 +7446,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7476,7 +7466,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -7505,5 +7495,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] diff --git a/src/core/blueprint/index.rs b/src/core/blueprint/index.rs index c32c4dd760..55b23ecdce 100644 --- a/src/core/blueprint/index.rs +++ b/src/core/blueprint/index.rs @@ -1,3 +1,5 @@ +use std::collections::HashSet; + use indexmap::IndexMap; use super::InputObjectTypeDefinition; @@ -38,6 +40,16 @@ impl Index { matches!(def, Some(Definition::Scalar(_))) || scalar::Scalar::is_predefined(type_name) } + pub fn get_interfaces(&self) -> HashSet { + self.map + .iter() + .filter_map(|(_, (def, _))| match def { + Definition::Interface(interface) => Some(interface.name.to_owned()), + _ => None, + }) + .collect() + } + pub fn type_is_enum(&self, type_name: &str) -> bool { let def = self.map.get(type_name).map(|(def, _)| def); diff --git a/src/core/jit/builder.rs b/src/core/jit/builder.rs index 04f99c45cb..6044b35b7b 100644 --- a/src/core/jit/builder.rs +++ b/src/core/jit/builder.rs @@ -75,6 +75,7 @@ pub struct Builder<'a> { impl<'a> Builder<'a> { pub fn new(blueprint: &Blueprint, document: &'a ExecutableDocument) -> Self { let index = Arc::new(blueprint.index()); + Self { document, index, @@ -128,6 +129,7 @@ impl<'a> Builder<'a> { #[inline(always)] fn iter( &self, + parent_fragment: Option<&str>, selection: &SelectionSet, type_condition: &str, fragments: &HashMap<&str, &FragmentDefinition>, @@ -168,6 +170,7 @@ impl<'a> Builder<'a> { .map(|(k, v)| (k.node.as_str().to_string(), v.node.to_owned())) .collect::>(); + let parent_fragment = parent_fragment.map(|s| s.to_owned()); // Check if the field is present in the schema index if let Some(field_def) = self.index.get_field(type_condition, field_name) { let mut args = Vec::with_capacity(request_args.len()); @@ -198,8 +201,12 @@ impl<'a> Builder<'a> { let id = FieldId::new(self.field_id.next()); // Recursively gather child fields for the selection set - let child_fields = - self.iter(&gql_field.selection_set.node, type_of.name(), fragments); + let child_fields = self.iter( + None, + &gql_field.selection_set.node, + type_of.name(), + fragments, + ); let ir = match field_def { QueryField::Field((field_def, _)) => field_def.resolver.clone(), @@ -220,6 +227,7 @@ impl<'a> Builder<'a> { let field = Field { id, selection: child_fields, + parent_fragment, name: field_name.to_string(), output_name: gql_field .alias @@ -252,6 +260,7 @@ impl<'a> Builder<'a> { args: Vec::new(), pos: selection.pos.into(), selection: vec![], // __typename has no child selection + parent_fragment, directives, is_enum: false, scalar: Some(scalar::Scalar::Empty), @@ -265,6 +274,7 @@ impl<'a> Builder<'a> { fragments.get(fragment_spread.fragment_name.node.as_str()) { fields.extend(self.iter( + Some(fragment.type_condition.node.on.node.as_str()), &fragment.selection_set.node, fragment.type_condition.node.on.node.as_str(), fragments, @@ -277,8 +287,12 @@ impl<'a> Builder<'a> { .as_ref() .map(|cond| cond.node.on.node.as_str()) .unwrap_or(type_condition); - - fields.extend(self.iter(&fragment.selection_set.node, type_of, fragments)); + fields.extend(self.iter( + Some(type_of), + &fragment.selection_set.node, + type_of, + fragments, + )); } } } @@ -334,7 +348,7 @@ impl<'a> Builder<'a> { let name = self .get_type(operation.ty) .ok_or(BuildError::RootOperationTypeNotDefined { operation: operation.ty })?; - let fields = self.iter(&operation.selection_set.node, name, &fragments); + let fields = self.iter(None, &operation.selection_set.node, name, &fragments); let is_introspection_query = operation.selection_set.node.items.iter().any(|f| { if let Selection::Field(Positioned { node: gql_field, .. }) = &f.node { @@ -351,6 +365,7 @@ impl<'a> Builder<'a> { operation.ty, self.index.clone(), is_introspection_query, + Some(self.index.get_interfaces()), ); Ok(plan) } diff --git a/src/core/jit/model.rs b/src/core/jit/model.rs index 9b2950a22a..00b4ed1db9 100644 --- a/src/core/jit/model.rs +++ b/src/core/jit/model.rs @@ -1,5 +1,5 @@ use std::borrow::Cow; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::fmt::{Debug, Display, Formatter}; use std::num::NonZeroU64; use std::sync::Arc; @@ -187,6 +187,7 @@ pub struct Field { pub include: Option, pub args: Vec>, pub selection: Vec>, + pub parent_fragment: Option, pub pos: Pos, pub directives: Vec>, pub is_enum: bool, @@ -245,6 +246,7 @@ impl Field { .into_iter() .map(|f| f.try_map(map)) .collect::>, Error>>()?, + parent_fragment: None, skip: self.skip, include: self.include, pos: self.pos, @@ -315,6 +317,7 @@ pub struct OperationPlan { pub min_cache_ttl: Option, pub selection: Vec>, pub before: Option, + pub interfaces: Option>, } impl OperationPlan { @@ -339,6 +342,7 @@ impl OperationPlan { is_protected: self.is_protected, min_cache_ttl: self.min_cache_ttl, before: self.before, + interfaces: None, }) } } @@ -351,6 +355,7 @@ impl OperationPlan { operation_type: OperationType, index: Arc, is_introspection_query: bool, + interfaces: Option>, ) -> Self where Input: Clone, @@ -366,6 +371,7 @@ impl OperationPlan { is_protected: false, min_cache_ttl: None, before: Default::default(), + interfaces, } } diff --git a/src/core/jit/transform/graphql.rs b/src/core/jit/transform/graphql.rs index 79139c9891..786b8d6a12 100644 --- a/src/core/jit/transform/graphql.rs +++ b/src/core/jit/transform/graphql.rs @@ -1,4 +1,5 @@ use std::borrow::Cow; +use std::collections::{HashMap, HashSet}; use std::convert::Infallible; use std::fmt::{Debug, Display}; use std::marker::PhantomData; @@ -20,18 +21,25 @@ impl GraphQL { } } -fn compute_selection_set(base_field: &mut [Field]) { +fn compute_selection_set( + base_field: &mut [Field], + interfaces: &HashSet, +) { for field in base_field.iter_mut() { if let Some(ir) = field.ir.as_mut() { ir.modify_io(&mut |io| { if let IO::GraphQL { req_template, .. } = io { - if let Some(v) = format_selection_set(field.selection.iter()) { + if let Some(v) = format_selection_set( + field.selection.iter(), + interfaces, + interfaces.contains(field.type_of.name()), + ) { req_template.selection = Some(Mustache::parse(&v).into()); } } }); } - compute_selection_set(field.selection.as_mut()); + compute_selection_set(field.selection.as_mut(), interfaces); } } @@ -40,7 +48,11 @@ impl Transform for GraphQL { type Error = Infallible; fn transform(&self, mut plan: Self::Value) -> Valid { - compute_selection_set(&mut plan.selection); + let interfaces = match plan.interfaces { + Some(ref interfaces) => interfaces, + None => &HashSet::new(), + }; + compute_selection_set(&mut plan.selection, interfaces); Valid::succeed(plan) } @@ -48,7 +60,12 @@ impl Transform for GraphQL { fn format_selection_set<'a, A: 'a + Display + JsonLikeOwned>( selection_set: impl Iterator>, + interfaces: &HashSet, + is_parent_interface: bool, ) -> Option { + let mut fragments_fields = HashMap::new(); + let mut normal_fields = vec![]; + let mut is_typename_requested = false; let set = selection_set .filter(|field| !matches!(&field.ir, Some(IR::IO(_)) | Some(IR::Dynamic(_)))) .map(|field| { @@ -58,7 +75,21 @@ fn format_selection_set<'a, A: 'a + Display + JsonLikeOwned>( } else { field.name.to_string() }; - format_selection_field(field, &field_name) + let is_this_field_interface = interfaces.contains(field.type_of.name()); + let formatted_selection_fields = + format_selection_field(field, &field_name, interfaces, is_this_field_interface); + is_typename_requested = is_typename_requested || field_name == "__typename"; + match &field.parent_fragment { + Some(fragment) if is_parent_interface => { + fragments_fields + .entry(fragment.to_owned()) + .or_insert_with(Vec::new) + .push(formatted_selection_fields); + } + _ => { + normal_fields.push(formatted_selection_fields); + } + } }) .collect::>(); @@ -66,12 +97,30 @@ fn format_selection_set<'a, A: 'a + Display + JsonLikeOwned>( return None; } - Some(format!("{{ {} }}", set.join(" "))) + let fragments_set: Vec = fragments_fields + .into_iter() + .map(|(fragment_name, fields)| { + format!("... on {} {{ {} }}", fragment_name, fields.join(" ")) + }) + .collect(); + + //Don't force user to query the type and get it automatically + if is_parent_interface && !is_typename_requested { + normal_fields.push("__typename".to_owned()); + } + normal_fields.extend(fragments_set); + Some(format!("{{ {} }}", normal_fields.join(" "))) } -fn format_selection_field(field: &Field, name: &str) -> String { +fn format_selection_field( + field: &Field, + name: &str, + interfaces: &HashSet, + is_parent_interface: bool, +) -> String { let arguments = format_selection_field_arguments(field); - let selection_set = format_selection_set(field.selection.iter()); + let selection_set = + format_selection_set(field.selection.iter(), interfaces, is_parent_interface); let mut output = format!("{}{}", name, arguments); diff --git a/src/core/jit/transform/input_resolver.rs b/src/core/jit/transform/input_resolver.rs index 86b5fe59ba..3787719c1d 100644 --- a/src/core/jit/transform/input_resolver.rs +++ b/src/core/jit/transform/input_resolver.rs @@ -84,6 +84,7 @@ where is_const: self.plan.is_const, is_protected: self.plan.is_protected, min_cache_ttl: self.plan.min_cache_ttl, + interfaces: None, selection, before: self.plan.before, }) diff --git a/tailcall-cloudflare/package-lock.json b/tailcall-cloudflare/package-lock.json index c9d1fc5ce7..79af4684f0 100644 --- a/tailcall-cloudflare/package-lock.json +++ b/tailcall-cloudflare/package-lock.json @@ -120,9 +120,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241205.0.tgz", - "integrity": "sha512-pj1VKRHT/ScQbHOIMFODZaNAlJHQHdBSZXNIdr9ebJzwBff9Qz8VdqhbhggV7f+aUEh8WSbrsPIo4a+WtgjUvw==", + "version": "4.20250109.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250109.0.tgz", + "integrity": "sha512-Y1zgSaEOOevl9ORpzgMcm4j535p3nK2lrblHHvYM2yxR50SBKGh+wvkRFAIxWRfjUGZEU+Fp6923EGioDBbobA==", "dev": true }, "node_modules/@cspotcode/source-map-support": { @@ -2370,9 +2370,9 @@ } }, "@cloudflare/workers-types": { - "version": "4.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241205.0.tgz", - "integrity": "sha512-pj1VKRHT/ScQbHOIMFODZaNAlJHQHdBSZXNIdr9ebJzwBff9Qz8VdqhbhggV7f+aUEh8WSbrsPIo4a+WtgjUvw==", + "version": "4.20250109.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250109.0.tgz", + "integrity": "sha512-Y1zgSaEOOevl9ORpzgMcm4j535p3nK2lrblHHvYM2yxR50SBKGh+wvkRFAIxWRfjUGZEU+Fp6923EGioDBbobA==", "dev": true }, "@cspotcode/source-map-support": { diff --git a/tests/core/snapshots/graphql-with-fragments.md_0.snap b/tests/core/snapshots/graphql-with-fragments.md_0.snap new file mode 100644 index 0000000000..16bb7cf8e6 --- /dev/null +++ b/tests/core/snapshots/graphql-with-fragments.md_0.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +snapshot_kind: text +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "queryNodeC": [ + { + "name": "nodeA", + "__typename": "NodeA", + "nodeA_id": "nodeA_id" + }, + { + "name": "nodeB", + "__typename": "NodeB", + "nodeB_id": "nodeB_id" + } + ] + } + } +} diff --git a/tests/core/snapshots/graphql-with-fragments.md_client.snap b/tests/core/snapshots/graphql-with-fragments.md_client.snap new file mode 100644 index 0000000000..1e00716ead --- /dev/null +++ b/tests/core/snapshots/graphql-with-fragments.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: formatted +snapshot_kind: text +--- +type NodeA implements NodeC { + name: String + nodeA_id: String +} + +type NodeB implements NodeC { + name: String + nodeB_id: String +} + +interface NodeC { + name: String +} + +type Query { + queryNodeA: [NodeA!] + queryNodeB: [NodeB!] + queryNodeC: [NodeC!] +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-with-fragments.md_merged.snap b/tests/core/snapshots/graphql-with-fragments.md_merged.snap new file mode 100644 index 0000000000..dd0037bd0b --- /dev/null +++ b/tests/core/snapshots/graphql-with-fragments.md_merged.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: formatter +snapshot_kind: text +--- +schema @server @upstream @link(src: "schema_0.graphql", type: Config) { + query: Query +} + +interface NodeC { + name: String +} + +type NodeA implements NodeC { + name: String + nodeA_id: String +} + +type NodeB implements NodeC { + name: String + nodeB_id: String +} + +type Query { + queryNodeA: [NodeA!] @graphQL(url: "http://upstream/graphql", name: "nodeA") + queryNodeB: [NodeB!] @graphQL(url: "http://upstream/graphql", name: "nodeB") + queryNodeC: [NodeC!] @graphQL(url: "http://upstream/graphql", name: "nodeC") +} diff --git a/tests/execution/graphql-with-fragments.md b/tests/execution/graphql-with-fragments.md new file mode 100644 index 0000000000..5a18fe14d4 --- /dev/null +++ b/tests/execution/graphql-with-fragments.md @@ -0,0 +1,63 @@ +```graphql @schema +schema @server(port: 8000, hostname: "0.0.0.0") { + query: Query +} + +type Query { + queryNodeC: [NodeC!] @graphQL(url: "http://upstream/graphql", name: "nodeC") + queryNodeA: [NodeA!] @graphQL(url: "http://upstream/graphql", name: "nodeA") + queryNodeB: [NodeB!] @graphQL(url: "http://upstream/graphql", name: "nodeB") +} + +type NodeA implements NodeC { + name: String + nodeA_id: String +} + +type NodeB implements NodeC { + name: String + nodeB_id: String +} + +interface NodeC { + name: String +} +``` + +```yml @mock +- request: + method: POST + url: http://upstream/graphql + textBody: {"query": "query { nodeC { name __typename ...on NodeA { nodeA_id } ...on NodeB { nodeB_id } } }"} + expectedHits: 1 + response: + status: 200 + body: + data: + nodeC: + - name: nodeA + __typename: NodeA + nodeA_id: nodeA_id + - name: nodeB + __typename: NodeB + nodeB_id: nodeB_id +``` + +```yml @test +- method: POST + url: http://localhost:8080/graphql + body: + query: | + query queryNodeC { + queryNodeC { + name + __typename + ...on NodeA { + nodeA_id + } + ...on NodeB { + nodeB_id + } + } + } +```