diff --git a/.github/actions/setup_env/action.yml b/.github/actions/setup_env/action.yml deleted file mode 100644 index 6c67827aa..000000000 --- a/.github/actions/setup_env/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Setup Environment Variables -description: Set up the txtx .env file. - -inputs: - working_directory: - description: 'Optional working directory where .env should be created' - required: false - default: '.' - -runs: - using: 'composite' - steps: - - run: | - touch "${{ inputs.working_directory }}/.env" - echo AUTH_SERVICE_URL="https://id.txtx.run/v1" >> "${{ inputs.working_directory }}/.env" - echo TXTX_CONSOLE_URL="https://txtx.run" >> "${{ inputs.working_directory }}/.env" - shell: bash diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b7a534284..76f678276 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -26,9 +26,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Build .env file - uses: ./.github/actions/setup_env - - name: Install Rust toolchain run: | rustup toolchain install 1.79 --profile minimal --target wasm32-unknown-unknown @@ -60,9 +57,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Build .env file - uses: ./.github/actions/setup_env - - name: Install Rust toolchain run: | rustup toolchain install 1.79 --profile minimal --target wasm32-unknown-unknown diff --git a/.github/workflows/release_cli.yaml b/.github/workflows/release_cli.yaml index ac30cd28e..e4226322b 100644 --- a/.github/workflows/release_cli.yaml +++ b/.github/workflows/release_cli.yaml @@ -84,11 +84,6 @@ jobs: uses: actions/checkout@v4 with: path: txtx - - - name: Build .env file - uses: ./txtx/.github/actions/setup_env - with: - working_directory: "txtx" - name: Checkout Supervisor UI uses: actions/checkout@v4 diff --git a/.github/workflows/release_crates.yaml b/.github/workflows/release_crates.yaml index ed48e330c..0543911d5 100644 --- a/.github/workflows/release_crates.yaml +++ b/.github/workflows/release_crates.yaml @@ -16,11 +16,6 @@ jobs: with: path: txtx - - name: Build .env file - uses: ./txtx/.github/actions/setup_env - with: - working_directory: "txtx" - - name: Checkout Supervisor UI uses: actions/checkout@v4 with: diff --git a/Cargo.lock b/Cargo.lock index 8f721945c..83a625284 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3722,64 +3722,6 @@ dependencies = [ "spinning_top", ] -[[package]] -name = "graphql-introspection-query" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" -dependencies = [ - "serde", -] - -[[package]] -name = "graphql-parser" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a818c0d883d7c0801df27be910917750932be279c7bc82dc541b8769425f409" -dependencies = [ - "combine 4.6.7", - "thiserror 1.0.69", -] - -[[package]] -name = "graphql_client" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50cfdc7f34b7f01909d55c2dcb71d4c13cbcbb4a1605d6c8bd760d654c1144b" -dependencies = [ - "graphql_query_derive", - "serde", - "serde_json", -] - -[[package]] -name = "graphql_client_codegen" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e27ed0c2cf0c0cc52c6bcf3b45c907f433015e580879d14005386251842fb0a" -dependencies = [ - "graphql-introspection-query", - "graphql-parser", - "heck 0.4.1", - "lazy_static", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 1.0.109", -] - -[[package]] -name = "graphql_query_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83febfa838f898cfa73dfaa7a8eb69ff3409021ac06ee94cfb3d622f6eeb1a97" -dependencies = [ - "graphql_client_codegen", - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "group" version = "0.13.0" @@ -3921,12 +3863,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -4555,15 +4491,6 @@ dependencies = [ "serde", ] -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - [[package]] name = "is-terminal" version = "0.4.13" @@ -4575,16 +4502,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -5555,17 +5472,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "open" -version = "5.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2483562e62ea94312f3576a7aca397306df7990b8d89033e18766744377ef95" -dependencies = [ - "is-wsl", - "libc", - "pathdiff", -] - [[package]] name = "openssl" version = "0.10.66" @@ -5716,12 +5622,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - [[package]] name = "pbkdf2" version = "0.4.0" @@ -10206,7 +10106,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ - "indexmap 2.11.4", "serde", "serde_spanned 0.6.7", "toml_datetime 0.6.8", @@ -10527,7 +10426,6 @@ dependencies = [ "lazy_static", "log 0.4.27", "serde", - "serde_derive", "serde_json", "solana-account", "solana-account-decoder-client-types", @@ -10565,7 +10463,6 @@ dependencies = [ "anchor-lang-idl", "borsh", "bs58", - "convert_case 0.6.0", "lazy_static", "serde", "serde_json", @@ -10575,7 +10472,6 @@ dependencies = [ "solana-pubkey", "solana-signature", "solana-transaction", - "solana-transaction-status-client-types", "test-case", "txtx-addon-kit", ] @@ -10593,7 +10489,6 @@ dependencies = [ "colored", "console 0.15.8", "criterion", - "crossbeam-channel", "ctrlc", "dialoguer", "dotenvy", @@ -10607,7 +10502,6 @@ dependencies = [ "openssl-sys", "proptest", "serde", - "serde_derive", "serde_json", "serde_yml", "strum 0.26.3", @@ -10619,39 +10513,11 @@ dependencies = [ "txtx-addon-kit", "txtx-addon-network-evm", "txtx-addon-network-svm", - "txtx-cloud", "txtx-core", "txtx-gql", "txtx-lsp", - "txtx-serve", "txtx-supervisor-ui", "txtx-test-utils", - "unicode-width 0.2.0", -] - -[[package]] -name = "txtx-cloud" -version = "0.1.14" -dependencies = [ - "actix-cors", - "actix-web", - "ansi_term", - "atty", - "base64 0.22.1", - "clap", - "dialoguer", - "dirs 5.0.1", - "graphql_client", - "hiro-system-kit", - "jsonwebtoken", - "open", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "toml 0.8.19", - "txtx-addon-kit", - "txtx-core", ] [[package]] @@ -10672,7 +10538,6 @@ dependencies = [ "petgraph", "ripemd", "serde", - "serde_derive", "serde_json", "serde_with", "serde_yml", @@ -10717,28 +10582,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "txtx-serve" -version = "0.1.3" -dependencies = [ - "actix-cors", - "actix-web", - "ansi_term", - "atty", - "hiro-system-kit", - "juniper_actix", - "juniper_graphql_ws", - "npm_rs", - "serde", - "serde_json", - "tokio", - "txtx-addon-kit", - "txtx-addon-network-evm", - "txtx-addon-network-svm", - "txtx-core", - "txtx-gql", -] - [[package]] name = "txtx-supervisor-ui" version = "0.2.10" diff --git a/Cargo.toml b/Cargo.toml index 7ebffcb52..7f7645f98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,8 @@ members = [ "crates/txtx-cli", "crates/txtx-core", "crates/txtx-addon-kit", - "crates/txtx-cloud", "crates/txtx-lsp", "crates/txtx-supervisor-ui", - "crates/txtx-serve", "addons/evm", "addons/svm/core", ] @@ -29,10 +27,8 @@ reqwest = { version = "0.11.27", default-features = false, features = [ ]} txtx-core = { path = "crates/txtx-core", default-features = false } txtx-addon-kit = { path = "crates/txtx-addon-kit", default-features = false } -txtx-cloud = { path = "crates/txtx-cloud" } txtx-gql = { path = "crates/txtx-gql" } txtx-supervisor-ui = { path = "crates/txtx-supervisor-ui" } -txtx-serve = { path = "crates/txtx-serve" } txtx-addon-network-evm = { path = "addons/evm" } - txtx-addon-network-svm = { path = "addons/svm/core" } +txtx-addon-network-svm = { path = "addons/svm/core" } uuid = { version = "1.15.1", features = ["v4", "serde", "js"] } diff --git a/addons/svm/core/Cargo.toml b/addons/svm/core/Cargo.toml index ec958b4b9..d53d3789e 100644 --- a/addons/svm/core/Cargo.toml +++ b/addons/svm/core/Cargo.toml @@ -15,7 +15,6 @@ txtx-addon-network-svm-types = { path = "../types" } lazy_static = "1.4.0" serde_json = "1.0.113" serde = "1" -serde_derive = "1" bincode = "1.3.3" log = "0.4.27" solana-message = { version = "3.0.0", features = ["serde"] } diff --git a/addons/svm/core/examples/hellosol/Cargo.lock b/addons/svm/core/examples/hellosol/Cargo.lock new file mode 100644 index 000000000..1a042ce9d --- /dev/null +++ b/addons/svm/core/examples/hellosol/Cargo.lock @@ -0,0 +1,1974 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anchor-attribute-access-control" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" +dependencies = [ + "anchor-syn", + "bs58 0.5.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" +dependencies = [ + "anchor-lang-idl", + "anchor-syn", + "anyhow", + "bs58 0.5.1", + "heck", + "proc-macro2", + "quote", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-space" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "anchor-lang-idl", + "arrayref", + "base64 0.21.7", + "bincode", + "borsh 0.10.4", + "bytemuck", + "getrandom 0.2.17", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-lang-idl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e8599d21995f68e296265aa5ab0c3cef582fd58afec014d01bd0bce18a4418" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "regex", + "serde", + "serde_json", + "sha2 0.10.9", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + +[[package]] +name = "anchor-syn" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" +dependencies = [ + "anyhow", + "bs58 0.5.1", + "cargo_toml", + "heck", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +dependencies = [ + "borsh-derive 0.10.4", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +dependencies = [ + "borsh-derive 1.6.1", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +dependencies = [ + "borsh-derive-internal 0.10.4", + "borsh-schema-derive-internal 0.10.4", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" +dependencies = [ + "once_cell", + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cargo_toml" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" +dependencies = [ + "serde", + "toml 0.8.23", +] + +[[package]] +name = "cc" +version = "1.2.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.12", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hellosol" +version = "0.1.0" +dependencies = [ + "anchor-lang", +] + +[[package]] +name = "hellosol2" +version = "0.1.0" +dependencies = [ + "anchor-lang", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint", + "thiserror", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.8+spec-1.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "solana-frozen-abi" +version = "1.18.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ab2c30c15311b511c0d1151e4ab6bc9a3e080a37e7c6e7c2d96f5784cf9434" +dependencies = [ + "block-buffer 0.10.4", + "bs58 0.4.0", + "bv", + "either", + "generic-array", + "im", + "lazy_static", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.9", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.18.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c142f779c3633ac83c84d04ff06c70e1f558c876f13358bed77ba629c7417932" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "solana-program" +version = "1.18.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10f4588cefd716b24a1a40dd32c278e43a560ab8ce4de6b5805c9d113afdfa1" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.21.7", + "bincode", + "bitflags", + "blake3", + "borsh 0.10.4", + "borsh 0.9.3", + "borsh 1.6.1", + "bs58 0.4.0", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.17", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "light-poseidon", + "log", + "memoffset", + "num-bigint", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.9", + "sha3", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.18.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b75d0f193a27719257af19144fdaebec0415d1c9e9226ae4bd29b791be5e9bd" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.117", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16bff38f1d86c47f9ff0647e6838d7bb362522bdf44006c7068c2b1e606f1f3c" +dependencies = [ + "indexmap", + "toml_datetime 1.1.0+spec-1.1.0", + "toml_parser", + "winnow 1.0.0", +] + +[[package]] +name = "toml_parser" +version = "1.1.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" +dependencies = [ + "winnow 1.0.0", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "zerocopy" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/addons/svm/core/src/codec/utils.rs b/addons/svm/core/src/codec/utils.rs index c4b55a05a..7b5163c35 100644 --- a/addons/svm/core/src/codec/utils.rs +++ b/addons/svm/core/src/codec/utils.rs @@ -6,6 +6,7 @@ use solana_loader_v3_interface::{get_program_data_address, state::UpgradeableLoa use solana_pubkey::Pubkey; use txtx_addon_kit::types::{diagnostics::Diagnostic, types::Value}; +use txtx_addon_network_svm_types::anchor::types::Idl; use crate::commands::setup_surfnet::set_account::SurfpoolAccountUpdate; @@ -97,6 +98,51 @@ pub async fn cheatcode_deploy_program( Ok(()) } +pub fn cheatcode_register_idl( + rpc_client: &solana_client::rpc_client::RpcClient, + idl: &Idl, +) -> Result { + let value = serde_json::to_value(idl).unwrap(); + let params = serde_json::to_value(&vec![value]).unwrap(); + send_rpc_request(rpc_client, "surfnet_registerIdl", params) +} + +pub fn send_rpc_request( + rpc_client: &solana_client::rpc_client::RpcClient, + method: &'static str, + params: serde_json::Value, +) -> Result { + rpc_client + .send::( + solana_client::rpc_request::RpcRequest::Custom { method }, + params, + ) + .map_err(|e| diagnosed_error!("`{}` RPC call failed: {e}", method)) +} + +pub async fn cheatcode_register_idl_async( + rpc_client: &RpcClient, + idl: &Idl, +) -> Result { + let value = serde_json::to_value(idl).unwrap(); + let params = serde_json::to_value(&vec![value]).unwrap(); + send_rpc_request_async(rpc_client, "surfnet_registerIdl", params).await +} + +pub async fn send_rpc_request_async( + rpc_client: &RpcClient, + method: &'static str, + params: serde_json::Value, +) -> Result { + rpc_client + .send::( + solana_client::rpc_request::RpcRequest::Custom { method }, + params, + ) + .await + .map_err(|e| diagnosed_error!("`{}` RPC call failed: {e}", method)) +} + pub fn wait_n_slots(rpc_client: &solana_client::rpc_client::RpcClient, n: u64) -> u64 { let slot = rpc_client.get_slot().unwrap(); loop { diff --git a/addons/svm/core/src/commands/deploy_program.rs b/addons/svm/core/src/commands/deploy_program.rs index c2d7c5048..dfd48e1cb 100644 --- a/addons/svm/core/src/commands/deploy_program.rs +++ b/addons/svm/core/src/commands/deploy_program.rs @@ -14,7 +14,7 @@ use txtx_addon_kit::constants::{ }; use txtx_addon_kit::futures::future; use txtx_addon_kit::indexmap::IndexMap; -use txtx_addon_kit::types::cloud_interface::{CloudService, CloudServiceContext}; +use txtx_addon_kit::types::cloud_interface::CloudServiceContext; use txtx_addon_kit::types::commands::{ CommandExecutionFutureResult, CommandExecutionResult, CommandImplementation, CommandSpecification, PreCommandSpecification, @@ -37,7 +37,7 @@ use txtx_addon_network_svm_types::{SVM_KEYPAIR, SVM_PUBKEY}; use crate::codec::idl::IdlRef; use crate::codec::send_transaction::send_transaction_background_task; -use crate::codec::utils::cheatcode_deploy_program; +use crate::codec::utils::{cheatcode_deploy_program, cheatcode_register_idl}; use crate::codec::{DeploymentTransaction, ProgramArtifacts, UpgradeableProgramDeployer}; use crate::constants::{ ACTION_ITEM_PROVIDE_SIGNED_TRANSACTION, AUTHORITY, AUTO_EXTEND, BUFFER_ACCOUNT_PUBKEY, @@ -829,7 +829,7 @@ impl CommandImplementation for DeployProgram { progress_tx: &channel::Sender, _background_tasks_uuid: &Uuid, supervision_context: &RunbookSupervisionContext, - cloud_service_context: &Option, + _cloud_service_context: &Option, ) -> CommandExecutionFutureResult { let construct_did = construct_did.clone(); let spec = spec.clone(); @@ -837,7 +837,6 @@ impl CommandImplementation for DeployProgram { let outputs = outputs.clone(); let progress_tx = progress_tx.clone(); let supervision_context = supervision_context.clone(); - let cloud_service_context = cloud_service_context.clone(); let future = async move { let nested_construct_did = @@ -950,42 +949,20 @@ impl CommandImplementation for DeployProgram { result.insert(SLOT, Value::integer(slot as i128)); }; - let network_id = inputs.get_expected_string(NETWORK_ID)?; - // Todo: eventually fill in for mainnet and remove optional url - let (idl_registration_url, do_include_token) = match network_id { - "mainnet" | "mainnet-beta" => (None, false), - "devnet" => (inputs.get_expected_string(RPC_API_URL).ok(), false), - "localnet" | _ => (inputs.get_expected_string(RPC_API_URL).ok(), false), - }; - let is_surfnet = inputs .get_scoped_value(&nested_construct_did.to_string(), IS_SURFNET) .unwrap() .as_bool() .unwrap(); - if let Some(idl_registration_url) = idl_registration_url { + if is_surfnet { if let Some(idl) = inputs .get_scoped_value(&nested_construct_did.to_string(), PROGRAM_IDL) .and_then(|v| v.as_string()) { if let Ok(idl_ref) = IdlRef::from_str(idl) { - let value = serde_json::to_value(&idl_ref.idl).unwrap(); - let params = serde_json::to_value(&vec![value]).unwrap(); - - let router = cloud_service_context - .expect("cloud service context not found") - .authenticated_cloud_service_router - .expect("authenticated cloud service router not found"); - let _ = router - .route(CloudService::svm_register_idl( - idl_registration_url, - params, - do_include_token, - is_surfnet, - )) - .await - .map_err(|e| { + let _ = + cheatcode_register_idl(&rpc_client, &idl_ref.idl).map_err(|e| { diagnosed_error!("failed to register program IDL: {}", e) })?; } diff --git a/addons/svm/core/src/commands/deploy_subraph.rs b/addons/svm/core/src/commands/deploy_subraph.rs index a68454e58..250840632 100644 --- a/addons/svm/core/src/commands/deploy_subraph.rs +++ b/addons/svm/core/src/commands/deploy_subraph.rs @@ -1,11 +1,5 @@ -use std::sync::Arc; use std::vec; -use txtx_addon_kit::types::cloud_interface::{ - AuthenticatedCloudServiceRouter, CloudService, CloudServiceContext, -}; -use serde_json::json; -use txtx_addon_kit::channel; use txtx_addon_kit::types::commands::{ CommandExecutionFutureResult, CommandExecutionResult, CommandImplementation, CommandSpecification, PreCommandSpecification, @@ -13,141 +7,23 @@ use txtx_addon_kit::types::commands::{ use txtx_addon_kit::types::diagnostics::Diagnostic; use txtx_addon_kit::types::frontend::{Actions, BlockEvent, LogDispatcher}; use txtx_addon_kit::types::stores::ValueStore; -use txtx_addon_kit::types::types::{RunbookSupervisionContext, Type, Value}; +use txtx_addon_kit::types::types::{RunbookSupervisionContext, Type}; use txtx_addon_kit::types::ConstructDid; -use txtx_addon_kit::uuid::Uuid; -use txtx_addon_network_svm_types::subgraph::PluginConfig; -use txtx_addon_network_svm_types::{PDA_ACCOUNT_SUBGRAPH, TOKEN_ACCOUNT_SUBGRAPH}; - -use crate::constants::{ - DEVNET_SUBGRAPH_ENDPOINT, DO_INCLUDE_TOKEN, MAINNET_SUBGRAPH_ENDPOINT, NETWORK_ID, PROGRAM_ID, - RPC_API_URL, SUBGRAPH_ENDPOINT_URL, SUBGRAPH_REQUEST, SUBGRAPH_URL, -}; -use crate::typing::subgraph::{SubgraphPluginType, SubgraphRequest}; -use crate::typing::{SvmValue, SUBGRAPH_EVENT}; lazy_static! { pub static ref DEPLOY_SUBGRAPH: PreCommandSpecification = { - let mut command = define_command! { + let command = define_command! { DeployProgram => { name: "Deploy SVM Program Subgraph", matcher: "deploy_subgraph", - documentation: indoc!{r#" - `svm::deploy_subgraph` creates a live Graph QL database for your program. - - This command takes a program ID to index, a block height to start indexing from, and a set of events to index. - This data is encoded as a request and sent to your surfnet (when deploying to localhost) or to the Surfpool cloud services (when deploying to devnet or mainnet). - When the request is received, the associated chain is indexed and the data is stored in a Graph QL database. - "#}, + documentation: "`svm::deploy_subgraph` is deprecated. If you are using this in your runbook, it should be removed.", implements_signing_capability: false, - implements_background_task_capability: true, - inputs: [ - description: { - documentation: "A description of the subgraph.", - typing: Type::string(), - optional: true, - tainting: false, - internal: false, - sensitive: false - }, - subgraph_name: { - documentation: "The name of the subgraph. This defaults to the event name.", - typing: Type::string(), - optional: true, - tainting: true, - internal: false, - sensitive: false - }, - program_id: { - documentation: "The ID of the program to index as a subgraph.", - typing: Type::string(), - optional: false, - tainting: true, - internal: false, - sensitive: false - }, - program_idl: { - documentation: "The IDL of the program, used to decode the data to be indexed.", - typing: Type::string(), - optional: false, - tainting: true, - internal: false, - sensitive: false - }, - slot: { - documentation: "The slot to start indexing from.", - typing: Type::integer(), - optional: true, - tainting: true, - internal: false, - sensitive: false - }, - block_height: { - documentation: "Deprecated. Use slot instead.", - typing: Type::integer(), - optional: true, - tainting: true, - internal: false, - sensitive: false - }, - event: { - documentation: "A map of events to index in the subgraph.", - typing: SUBGRAPH_EVENT.clone(), - optional: true, - tainting: true, - internal: false, - sensitive: false - }, - pda: { - documentation: "The PDA account to index in the subgraph", - typing: PDA_ACCOUNT_SUBGRAPH.clone(), - optional: true, - tainting: true, - internal: false, - sensitive: false - }, - token_account: { - documentation: "The token account to index in the subgraph", - typing: TOKEN_ACCOUNT_SUBGRAPH.clone(), - optional: true, - tainting: true, - internal: false, - sensitive: false - } - ], - outputs: [ - ], - example: txtx_addon_kit::indoc! {r#" - action "transfer_event_subgraph" "svm::deploy_subgraph" { - program_id = action.deploy.program_id - program_idl = action.deploy.program_idl - slot = action.deploy.slot - event { - name = "TransferEvent" - } - } - action "account_index" "svm::deploy_subgraph" { - program_id = action.deploy.program_id - program_idl = action.deploy.program_idl - slot = action.deploy.slot - pda { - type = "CustomAccount" - instruction { - name = "" - account_name = "" - } - instruction { - name = "" - account_name = "" - } - } - } - "#}, + implements_background_task_capability: false, + inputs: [], + outputs: [], + example: "", } }; - if let PreCommandSpecification::Atomic(ref mut spec) = command { - spec.implements_cloud_service = true; - } command }; } @@ -176,166 +52,19 @@ impl CommandImplementation for DeployProgram { fn run_execution( construct_did: &ConstructDid, _spec: &CommandSpecification, - values: &ValueStore, - _progress_tx: &txtx_addon_kit::channel::Sender, + _values: &ValueStore, + progress_tx: &txtx_addon_kit::channel::Sender, _auth_ctx: &txtx_addon_kit::types::AuthorizationContext, ) -> CommandExecutionFutureResult { - use txtx_addon_kit::{constants::DESCRIPTION, types::commands::return_synchronous_ok}; - - use crate::{ - constants::{ - BLOCK_HEIGHT, PROGRAM_IDL, SLOT, SUBGRAPH_ENDPOINT_URL, SUBGRAPH_NAME, - SUBGRAPH_REQUEST, - }, - typing::subgraph::SubgraphRequest, - }; - - let network_id = values.get_expected_string(NETWORK_ID)?; - let (subgraph_url, do_include_token) = match network_id { - "mainnet" | "mainnet-beta" => (MAINNET_SUBGRAPH_ENDPOINT, true), - "devnet" => (DEVNET_SUBGRAPH_ENDPOINT, true), - "localnet" | _ => (values.get_expected_string(RPC_API_URL)?, false), - }; - - let idl_str = values.get_expected_string(PROGRAM_IDL)?; + use txtx_addon_kit::types::commands::return_synchronous_ok; - let some_slot = values.get_uint(SLOT)?; - let some_block_height = values.get_uint(BLOCK_HEIGHT)?; - if some_slot.is_some() && some_block_height.is_some() { - return Err(diagnosed_error!( - "Both slot and block height are provided. The block height field is deprecated and should not be used. Use slot instead." - )); - } - if some_slot.is_none() && some_block_height.is_none() { - return Err(diagnosed_error!("Missing expected 'slot' value.")); - } - let slot = some_slot.unwrap_or_else(|| some_block_height.unwrap()); + let logger = + LogDispatcher::new(construct_did.as_uuid(), "svm::deploy_subgraph", &progress_tx); - let program_id = SvmValue::to_pubkey(values.get_expected_value(PROGRAM_ID)?) - .map_err(|e| diagnosed_error!("{e}"))?; - - let subgraph_name = values.get_string(SUBGRAPH_NAME).and_then(|s| Some(s.to_string())); - let description = values.get_string(DESCRIPTION).and_then(|s| Some(s.to_string())); - - let subgraph_request = SubgraphRequest::parse_value_store_v0( - subgraph_name, - description, - &program_id, - idl_str, - slot, - construct_did, - values, - )?; - - let mut result = CommandExecutionResult::new(); - result.insert(SUBGRAPH_REQUEST, subgraph_request.to_value()?); - result.insert(SUBGRAPH_ENDPOINT_URL, Value::string(subgraph_url.to_string())); - result.insert(DO_INCLUDE_TOKEN, Value::bool(do_include_token)); - - return_synchronous_ok(result) - } - - fn build_background_task( - construct_did: &ConstructDid, - _spec: &CommandSpecification, - _inputs: &ValueStore, - outputs: &ValueStore, - progress_tx: &channel::Sender, - _background_tasks_uuid: &Uuid, - _supervision_context: &RunbookSupervisionContext, - cloud_service_context: &Option, - ) -> CommandExecutionFutureResult { - let outputs = outputs.clone(); - let progress_tx = progress_tx.clone(); - let construct_did = construct_did.clone(); - let cloud_service_context = cloud_service_context.clone(); - - let future = async move { - let mut result = CommandExecutionResult::new(); - let subgraph_request = - SubgraphRequest::from_value(outputs.get_expected_value(SUBGRAPH_REQUEST)?)?; - - let subgraph_url = outputs.get_expected_string(SUBGRAPH_ENDPOINT_URL)?; - let do_include_token = outputs.get_expected_bool(DO_INCLUDE_TOKEN)?; - - let logger = - LogDispatcher::new(construct_did.as_uuid(), "svm::deploy_subgraph", &progress_tx); - - let mut client = SubgraphRequestClient::new( - cloud_service_context - .expect("cloud service context not found") - .authenticated_cloud_service_router - .expect("authenticated cloud service router not found"), - subgraph_request, - SubgraphPluginType::SurfpoolSubgraph, - logger, - subgraph_url, - do_include_token, - ); - - let url = client.deploy_subgraph().await?; - - result.outputs.insert(SUBGRAPH_URL.into(), Value::string(url)); - - Ok(result) - }; - Ok(Box::pin(future)) - } -} - -pub struct SubgraphRequestClient { - router: Arc, - plugin_config: PluginConfig, - logger: LogDispatcher, - subgraph_endpoint_url: String, - do_include_token: bool, -} - -impl SubgraphRequestClient { - pub fn new( - router: Arc, - request: SubgraphRequest, - plugin_name: SubgraphPluginType, - logger: LogDispatcher, - subgraph_endpoint_url: &str, - do_include_token: bool, - ) -> Self { - Self { - router, - plugin_config: PluginConfig::new(plugin_name, request), - logger, - subgraph_endpoint_url: subgraph_endpoint_url.to_string(), - do_include_token, - } - } - - pub async fn deploy_subgraph(&mut self) -> Result { - let stringified_config = json![self.plugin_config.clone()]; - let params = serde_json::to_value(vec![stringified_config.to_string()]) - .map_err(|e| diagnosed_error!("could not serialize subgraph request: {e}"))?; - - let res = self - .router - .route(CloudService::svm_subgraph( - &self.subgraph_endpoint_url, - params, - self.do_include_token, - )) - .await - .map_err(|e| diagnosed_error!("failed to deploy subgraph: {e}"))?; - - self.logger.success_info( - "Subgraph Deployed", - format!( - "Subgraph {} for program {} has been deployed", - self.plugin_config.data.subgraph_name(), - self.plugin_config.data.program_id(), - ), + logger.warn( + "Deprecated Action", + "The svm::deploy_subgraph action is deprecated. Please remove from your runbooks.", ); - - self.logger - .success_info("Subgraph Deployed", format!("Your subgraph can be reached at {}", res)); - - Ok(res) + return_synchronous_ok(CommandExecutionResult::new()) } } diff --git a/addons/svm/core/src/constants.rs b/addons/svm/core/src/constants.rs index 0a31de5b2..f9287c32b 100644 --- a/addons/svm/core/src/constants.rs +++ b/addons/svm/core/src/constants.rs @@ -3,7 +3,6 @@ pub const SIGNERS: &str = "signers"; pub const SIGNER: &str = "signer"; pub const PAYER: &str = "payer"; pub const AUTHORITY: &str = "authority"; -pub const OWNER: &str = "owner"; pub const DEFAULT_DERIVATION_PATH: &str = "m/44'/501'/0'/0'"; pub const DEFAULT_ANCHOR_TARGET_PATH: &str = "target"; @@ -79,13 +78,7 @@ pub const REMAINING_ACCOUNT: &str = "remaining_account"; pub const SKIP_PREFLIGHT: &str = "skip_preflight"; // Subgraph keys -pub const BLOCK_HEIGHT: &str = "block_height"; pub const SLOT: &str = "slot"; -pub const SUBGRAPH_NAME: &str = "subgraph_name"; -pub const SUBGRAPH_REQUEST: &str = "subgraph_request"; -pub const SUBGRAPH_URL: &str = "subgraph_url"; -pub const SUBGRAPH_ENDPOINT_URL: &str = "subgraph_endpoint_url"; -pub const DO_INCLUDE_TOKEN: &str = "do_include_token"; // Actions items keys pub const ACTION_ITEM_CHECK_BALANCE: &str = "check_balance"; @@ -94,10 +87,6 @@ pub const ACTION_ITEM_PROVIDE_PUBLIC_KEY: &str = "provide_public_key"; pub const ACTION_ITEM_PROVIDE_SIGNED_TRANSACTION: &str = "provide_signed_transaction"; pub const ACTION_ITEM_PROVIDE_SIGNED_SQUAD_TRANSACTION: &str = "provide_signed_squad_transaction"; -// Subgraph endpoints -pub const MAINNET_SUBGRAPH_ENDPOINT: &str = "https://svm-cloud-api.txtx.run/v1/subgraphs"; -pub const DEVNET_SUBGRAPH_ENDPOINT: &str = "https://svm-cloud-api.txtx.run/v1/subgraphs"; - // Squads keys pub const VAULT_INDEX: &str = "vault_index"; pub const SQUADS_FRONTEND_URL: &str = "squads_frontend_url"; diff --git a/addons/svm/types/Cargo.toml b/addons/svm/types/Cargo.toml index 6d8d48d70..e4dd3c7ab 100644 --- a/addons/svm/types/Cargo.toml +++ b/addons/svm/types/Cargo.toml @@ -11,14 +11,12 @@ categories = { workspace = true } [dependencies] borsh = "1.5.1" bs58 = "0.5.0" -convert_case = "0.6.0" solana-pubkey = { version = "3.0.0", features = ["serde", "borsh"] } solana-clock = { version = "3.0.0", features = ["serde"] } solana-message = { version = "3.0.0", features = ["serde"] } solana-keypair = { version = "3.0.0" } solana-signature = { version = "3.0.0", features = ["serde"] } solana-transaction = { version = "3.0.0", features = ["serde", "bincode"] } -solana-transaction-status-client-types = { version = "3.0.0" } anchor-lang-idl = { version = "0.1.2", features = ["convert"] } txtx-addon-kit = { workspace = true, default-features = false } # txtx-addon-kit = { version = "0.2.6" } diff --git a/addons/svm/types/src/subgraph/fixtures/idl.json b/addons/svm/types/src/idl/fixtures/idl.json similarity index 100% rename from addons/svm/types/src/subgraph/fixtures/idl.json rename to addons/svm/types/src/idl/fixtures/idl.json diff --git a/addons/svm/types/src/subgraph/idl.rs b/addons/svm/types/src/idl/mod.rs similarity index 94% rename from addons/svm/types/src/subgraph/idl.rs rename to addons/svm/types/src/idl/mod.rs index 9931bac75..00d2ece47 100644 --- a/addons/svm/types/src/subgraph/idl.rs +++ b/addons/svm/types/src/idl/mod.rs @@ -1,8 +1,6 @@ use anchor_lang_idl::types::{ - IdlConst, IdlDefinedFields, IdlGenericArg, IdlInstruction, IdlInstructionAccountItem, IdlType, - IdlTypeDef, IdlTypeDefGeneric, IdlTypeDefTy, + IdlConst, IdlDefinedFields, IdlGenericArg, IdlType, IdlTypeDef, IdlTypeDefGeneric, IdlTypeDefTy, }; -use solana_pubkey::Pubkey; use txtx_addon_kit::{ indexmap::IndexMap, types::types::{ObjectDefinition, ObjectProperty, ObjectType, Type, Value}, @@ -650,34 +648,5 @@ pub fn parse_bytes_to_value_with_expected_idl_type_with_leftover_bytes<'a>( } } -/// Flattens nested account items into a flat ordered list -fn flatten_accounts(accounts: &[IdlInstructionAccountItem]) -> Vec { - let mut result = Vec::new(); - for item in accounts { - match item { - IdlInstructionAccountItem::Single(account) => { - result.push(account.name.clone()); - } - IdlInstructionAccountItem::Composite(nested) => { - // Prepend the parent name as a prefix if desired - result.extend(flatten_accounts(&nested.accounts)); - } - } - } - result -} - -/// Given a message account key list and a CompiledInstruction, return a mapping from IDL account names to pubkeys -pub fn match_idl_accounts( - idl_instruction: &IdlInstruction, - instruction_account_indices: &[u8], - message_account_keys: &[Pubkey], -) -> Vec<(String, Pubkey, usize)> { - let flat_idl_account_names = flatten_accounts(&idl_instruction.accounts); - - flat_idl_account_names - .into_iter() - .zip(instruction_account_indices.iter()) - .map(|(name, &index)| (name, message_account_keys[index as usize], index as usize)) - .collect() -} +#[cfg(test)] +mod tests; diff --git a/addons/svm/types/src/subgraph/tests.rs b/addons/svm/types/src/idl/tests.rs similarity index 71% rename from addons/svm/types/src/subgraph/tests.rs rename to addons/svm/types/src/idl/tests.rs index 75a7646cd..f53cb658d 100644 --- a/addons/svm/types/src/subgraph/tests.rs +++ b/addons/svm/types/src/idl/tests.rs @@ -1,13 +1,13 @@ -use crate::{subgraph::idl::parse_bytes_to_value_with_expected_idl_type_def_ty, SvmValue, SVM_U64}; +use crate::{idl::parse_bytes_to_value_with_expected_idl_type_def_ty, SvmValue}; -use super::*; use anchor_lang_idl::types::{ - IdlAccount, IdlEnumVariant, IdlEvent, IdlField, IdlGenericArg, IdlInstruction, - IdlInstructionAccount, IdlInstructionAccountItem, IdlType, IdlTypeDefGeneric, + Idl, IdlAccount, IdlDefinedFields, IdlEnumVariant, IdlEvent, IdlField, IdlGenericArg, + IdlInstruction, IdlInstructionAccount, IdlInstructionAccountItem, IdlType, IdlTypeDef, + IdlTypeDefGeneric, IdlTypeDefTy, }; use borsh::{BorshDeserialize, BorshSerialize}; use test_case::test_case; -use txtx_addon_kit::types::types::{ObjectProperty, ObjectType}; +use txtx_addon_kit::types::types::{ObjectType, Value}; lazy_static! { pub static ref IDL: Idl = @@ -32,283 +32,10 @@ lazy_static! { pub static ref EVENT_TYPE: IdlTypeDef = IDL.types.iter().find(|t| t.name == "SplitTransferEvent").unwrap().clone(); - pub static ref PDA_SOURCE_TYPE: IndexedSubgraphSourceType = IndexedSubgraphSourceType::Pda( - PdaSubgraphSource { - account: ACCOUNT.clone(), - account_type: ACCOUNT_TYPE.clone(), - instruction_accounts: vec![(INSTRUCTION_1.clone(), INSTRUCTION_1_ACCOUNT.clone())] - } - ); - pub static ref EVENT_SOURCE_TYPE: IndexedSubgraphSourceType = IndexedSubgraphSourceType::Event( - EventSubgraphSource { - event: EVENT.clone(), - ty: EVENT_TYPE.clone(), - } - ); pub static ref PUBKEY: solana_pubkey::Pubkey = solana_pubkey::Pubkey::new_unique(); } -fn defined_field( - name: Value, - idl_key: Option, - description: Option, - is_indexed: Option, -) -> Value { - let mut obj = ObjectType::from([("name", name)]); - if let Some(idl_key) = idl_key { - obj.insert("idl_key", idl_key); - } - if let Some(description) = description { - obj.insert("description", description); - } - if let Some(is_indexed) = is_indexed { - obj.insert("is_indexed", Value::bool(is_indexed)); - } - obj.to_value() -} - -#[test_case( - PDA_SOURCE_TYPE.clone(), - None; - "pda source type with no defined fields" -)] -#[test_case( - PDA_SOURCE_TYPE.clone(), - Some(vec![ - ("bool", None, None, None), - ("data", None, None, Some(true)), - ("my_number", Some("u8".into()), None, None), - ("my_u16", Some("u16".into()), Some("my u16 description".into()), None), - ]); - "pda source type with fields" -)] -#[test_case( - EVENT_SOURCE_TYPE.clone(), - None; - "event source type with no defined fields" -)] -#[test_case( - EVENT_SOURCE_TYPE.clone(), - Some(vec![ - ("bool", None, None, None), - ("data", None, None, Some(true)), - ("my_number", Some("u8".into()), None, None), - ("my_u16", Some("u16".into()), Some("my u16 description".into()), None), - ]); - "event source type with fields" -)] -fn test_parse_defined_fields( - data_source: IndexedSubgraphSourceType, - defined_fields_in: Option, Option, Option)>>, -) { - let defined_fields = defined_fields_in.as_ref().map(|fields| { - fields - .iter() - .map(|(name, idl_key, description, is_indexed)| { - defined_field( - Value::String(name.to_string()), - idl_key.clone().map(Value::String), - description.clone().map(Value::String), - is_indexed.clone(), - ) - }) - .collect::>() - }); - - let res = IndexedSubgraphField::parse_defined_field_values( - data_source, - &defined_fields, - &IDL.types, - &IDL.constants, - ) - .unwrap(); - - if let Some(defined_fields) = defined_fields_in.as_ref() { - for (i, field) in res.iter().enumerate() { - assert_eq!(res.len(), defined_fields.len()); - let (name, idl_key, description, is_indexed) = &defined_fields[i]; - - assert_eq!(field.display_name, *name); - if let Some(idl_key) = idl_key { - assert_eq!(field.source_key, *idl_key); - } else { - assert_eq!(field.source_key, *name); - } - - if let Some(description) = description { - assert_eq!(field.description, Some(description.to_string())); - } else { - assert!(field.description.is_none()); - } - - assert_eq!(field.is_indexed, is_indexed.unwrap_or(false)); - } - } - - for field in res.iter() { - assert_field_expected_types(&field.source_key, field.expected_type.clone()); - } -} - -// Hard coded test cases from the IDL -fn assert_field_expected_types(field_name: &str, expected_type: Type) { - match field_name { - "bool" => { - assert_eq!(expected_type, Type::bool()); - } - "u8" => { - assert_eq!(expected_type, Type::addon(crate::SVM_U8)); - } - "u16" => { - assert_eq!(expected_type, Type::addon(crate::SVM_U16)); - } - "u32" => { - assert_eq!(expected_type, Type::addon(crate::SVM_U32)); - } - "u64" => { - assert_eq!(expected_type, Type::addon(crate::SVM_U64)); - } - "u128" => { - assert_eq!(expected_type, Type::addon(crate::SVM_U128)); - } - "i8" => { - assert_eq!(expected_type, Type::addon(crate::SVM_I8)); - } - "i16" => { - assert_eq!(expected_type, Type::addon(crate::SVM_I16)); - } - "i32" => { - assert_eq!(expected_type, Type::addon(crate::SVM_I32)); - } - "i64" => { - assert_eq!(expected_type, Type::addon(crate::SVM_I64)); - } - "f32" => { - assert_eq!(expected_type, Type::addon(crate::SVM_F32)); - } - "f64" => { - assert_eq!(expected_type, Type::addon(crate::SVM_F64)); - } - "i128" => { - assert_eq!(expected_type, Type::addon(crate::SVM_I128)); - } - "string" => { - assert_eq!(expected_type, Type::string()); - } - "bytes" => { - assert_eq!(expected_type, Type::buffer()); - } - "pubkey" => { - assert_eq!(expected_type, Type::addon(SVM_PUBKEY)); - } - "data" => { - assert_eq!(expected_type, Type::addon(SVM_U64)); - } - "option" => { - assert_eq!(expected_type, Type::typed_null(Type::addon(SVM_U64))); - } - "additional_data" => { - assert_eq!( - expected_type, - Type::object(ObjectDefinition::Strict(vec![ - ObjectProperty { - name: "my_generic_field".into(), - documentation: "Generic field of type T".into(), - typing: Type::addon(crate::SVM_U64), - optional: false, - tainting: false, - internal: false - }, - ObjectProperty { - name: "my_other_generic_field".into(), - documentation: "Generic field of type U".into(), - typing: Type::addon(crate::SVM_U32), - optional: false, - tainting: false, - internal: false - } - ])) - ); - } - "array" => { - assert_eq!(expected_type, Type::array(Type::addon(crate::SVM_U8))); - } - "wrapper_with_const" => { - assert_eq!( - expected_type, - Type::object(ObjectDefinition::Strict(vec![ObjectProperty { - name: "data".into(), - documentation: "".into(), - typing: Type::array(Type::addon(crate::SVM_U8)), - optional: false, - tainting: false, - internal: false - }])) - ); - } - "my_tuple_enum" => { - assert_eq!( - expected_type, - Type::object(ObjectDefinition::Enum(vec![ - ObjectProperty { - name: "UnitVariant".into(), - documentation: "".into(), - typing: Type::null(), - optional: false, - tainting: false, - internal: false, - }, - ObjectProperty { - name: "NamedVariant".into(), - documentation: "".into(), - typing: Type::object(ObjectDefinition::Strict(vec![ObjectProperty { - name: "foo".into(), - documentation: "".into(), - typing: Type::addon(crate::SVM_U64), - optional: false, - tainting: false, - internal: false, - }])), - optional: false, - tainting: false, - internal: false, - }, - ObjectProperty { - name: "TupleVariant".into(), - documentation: "".into(), - typing: Type::object(ObjectDefinition::Tuple(vec![ - ObjectProperty { - name: "field_0".into(), - documentation: "".into(), - typing: Type::addon(crate::SVM_U8), - optional: false, - tainting: false, - internal: false, - }, - ObjectProperty { - name: "field_1".into(), - documentation: "".into(), - typing: Type::string(), - optional: false, - tainting: false, - internal: false, - }, - ])), - optional: false, - tainting: false, - internal: false, - }, - ])) - ); - } - "empty" => { - assert_eq!(expected_type, Type::object(ObjectDefinition::strict(vec![]))); - } - _ => {} - } -} - #[derive(BorshSerialize, BorshDeserialize)] struct NamedStructAllTypes { bool_true: bool, diff --git a/addons/svm/types/src/lib.rs b/addons/svm/types/src/lib.rs index 11378a7a8..09b3f6452 100644 --- a/addons/svm/types/src/lib.rs +++ b/addons/svm/types/src/lib.rs @@ -4,7 +4,7 @@ extern crate lazy_static; #[macro_use] extern crate txtx_addon_kit; -pub mod subgraph; +pub mod idl; use std::str::FromStr; diff --git a/addons/svm/types/src/subgraph/event.rs b/addons/svm/types/src/subgraph/event.rs deleted file mode 100644 index f4b445cff..000000000 --- a/addons/svm/types/src/subgraph/event.rs +++ /dev/null @@ -1,141 +0,0 @@ -use std::collections::HashMap; - -use anchor_lang_idl::types::Idl; -use serde::{Deserialize, Serialize}; -use solana_clock::Slot; -use solana_signature::Signature; -use solana_transaction_status_client_types::InnerInstructions; -use txtx_addon_kit::{ - diagnosed_error, - types::{diagnostics::Diagnostic, types::Value}, -}; - -use crate::subgraph::{ - idl::parse_bytes_to_value_with_expected_idl_type_def_ty, IntrinsicField, SubgraphRequest, - SubgraphSourceType, SLOT_INTRINSIC_FIELD, TRANSACTION_SIGNATURE_INTRINSIC_FIELD, -}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct EventSubgraphSource { - // The event being indexed - pub event: anchor_lang_idl::types::IdlEvent, - // The type of the event, found from the IDL - pub ty: anchor_lang_idl::types::IdlTypeDef, -} - -impl SubgraphSourceType for EventSubgraphSource { - fn intrinsic_fields() -> Vec { - vec![SLOT_INTRINSIC_FIELD.clone(), TRANSACTION_SIGNATURE_INTRINSIC_FIELD.clone()] - } -} - -impl EventSubgraphSource { - pub fn from_value( - value: &Value, - idl: &Idl, - ) -> Result<(Self, Option>, Option>), Diagnostic> { - let event_map = value.as_map().ok_or(diagnosed_error!("subgraph event must be a map"))?; - - if event_map.len() != 1 { - return Err(diagnosed_error!("exactly one 'event' should be defined")); - } - let entry = event_map.get(0).unwrap(); - - let entry = entry - .as_object() - .ok_or(diagnosed_error!("each entry of a subgraph event should contain an object"))?; - let name = entry - .get("name") - .ok_or(diagnosed_error!("could not deserialize subgraph event: expected 'name' key"))?; - let name = name.as_string().ok_or(diagnosed_error!( - "could not deserialize subgraph event: expected 'name' to be a string" - ))?; - - let fields = entry.get("field").and_then(|v| v.as_map().map(|s| s.to_vec())); - let intrinsic_fields = - entry.get("intrinsic_field").and_then(|v| v.as_map().map(|s| s.to_vec())); - let event = Self::new(name, idl)?; - return Ok((event, fields, intrinsic_fields)); - } - pub fn new(event_name: &str, idl: &Idl) -> Result { - let event = idl - .events - .iter() - .find(|e| e.name == event_name) - .ok_or(diagnosed_error!("could not find event '{}' in IDL", event_name))?; - let ty = idl - .types - .iter() - .find(|t| t.name == event_name) - .ok_or(diagnosed_error!("could not find type '{}' in IDL", event_name))?; - Ok(Self { event: event.clone(), ty: ty.clone() }) - } - - pub fn evaluate_inner_instructions( - &self, - inner_instructions: &Vec, - subgraph_request: &SubgraphRequest, - slot: Slot, - transaction_signature: Signature, - entries: &mut Vec>, - ) -> Result<(), String> { - let SubgraphRequest::V0(subgraph_request) = subgraph_request; - let empty_vec = vec![]; - let idl_type_def_generics = subgraph_request - .idl_types - .iter() - .find(|t| t.name == self.ty.name) - .map(|t| &t.generics) - .unwrap_or(&empty_vec); - for inner_instructions in inner_instructions.iter() { - for instruction in inner_instructions.instructions.iter() { - let instruction = &instruction.instruction; - // it's not valid cpi event data if there isn't an 8-byte signature - // well, that ^ is what I thought, but it looks like the _second_ 8 bytes - // are matching the discriminator - if instruction.data.len() < 16 { - continue; - } - - let eight_bytes = instruction.data[8..16].to_vec(); - let rest = instruction.data[16..].to_vec(); - - if self.event.discriminator.eq(eight_bytes.as_slice()) { - let parsed_value = - parse_bytes_to_value_with_expected_idl_type_def_ty(&rest, &self.ty.ty, &subgraph_request.idl_types, &vec![], idl_type_def_generics).map_err( - |e| format!("event '{}' was emitted in a transaction, but the data could not be parsed as the expected idl type: {e}", self.event.name) - )?; - - let obj = parsed_value.as_object().unwrap().clone(); - let mut entry = HashMap::new(); - for field in subgraph_request.defined_fields.iter() { - if let Some(v) = obj.get(&field.source_key) { - entry.insert(field.display_name.clone(), v.clone()); - } - } - - subgraph_request.intrinsic_fields.iter().for_each(|field| { - if let Some((entry_key, entry_value)) = field.extract_intrinsic( - Some(slot), - Some(transaction_signature), - None, - None, - None, - None, - None, - None, - None, - None, - None, - ) { - entry.insert(entry_key, entry_value); - } - }); - - entries.push(entry); - } - } - } - Ok(()) - } -} diff --git a/addons/svm/types/src/subgraph/mod.rs b/addons/svm/types/src/subgraph/mod.rs deleted file mode 100644 index a6e1bb816..000000000 --- a/addons/svm/types/src/subgraph/mod.rs +++ /dev/null @@ -1,738 +0,0 @@ -use std::str::FromStr; - -use anchor_lang_idl::types::{ - Idl, IdlConst, IdlDefinedFields, IdlInstructionAccount, IdlInstructionAccountItem, IdlTypeDef, - IdlTypeDefTy, -}; -use convert_case::{Case, Casing}; -use serde::{Deserialize, Serialize}; -use solana_clock::Slot; -use solana_pubkey::Pubkey; -use solana_signature::Signature; -use txtx_addon_kit::{ - diagnosed_error, - types::{ - diagnostics::Diagnostic, - stores::ValueStore, - types::{ObjectDefinition, Type, Value}, - ConstructDid, - }, -}; - -mod event; -pub mod idl; -mod pda; -pub mod token_account; - -pub use event::EventSubgraphSource; -pub use pda::PdaSubgraphSource; - -use crate::{ - subgraph::{ - idl::{get_expected_type_from_idl_type_def_ty, idl_type_to_txtx_type}, - token_account::TokenAccountSubgraphSource, - }, - SvmValue, SVM_F64, SVM_PUBKEY, SVM_SIGNATURE, SVM_U8, -}; - -// Subgraph keys -pub const SVM_SUBGRAPH_REQUEST: &str = "svm::subgraph_request"; -pub const FIELD: &str = "field"; - -lazy_static! { - pub static ref SLOT_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "slot".into(), - expected_type: Type::integer(), - description: "The slot in which the event was emitted.".into(), - is_indexed: true, - }; - pub static ref TRANSACTION_SIGNATURE_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "transaction_signature".into(), - expected_type: Type::addon(SVM_SIGNATURE), - description: "The transaction signature in which the event was emitted.".into(), - is_indexed: true, - }; - pub static ref PUBKEY_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "pubkey".into(), - expected_type: Type::addon(SVM_PUBKEY), - description: "The public key of the account.".into(), - is_indexed: true, - }; - pub static ref OWNER_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "owner".into(), - expected_type: Type::addon(SVM_PUBKEY), - description: "The owner of the account.".into(), - is_indexed: false, - }; - pub static ref LAMPORTS_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "lamports".into(), - expected_type: Type::integer(), - description: "The lamports of the account.".into(), - is_indexed: false, - }; - pub static ref TOKEN_MINT_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "mint".into(), - expected_type: Type::addon(SVM_PUBKEY), - description: "The mint address of the token.".into(), - is_indexed: false, - }; - pub static ref TOKEN_PROGRAM_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "token_program".into(), - expected_type: Type::addon(SVM_PUBKEY), - description: "The token program address.".into(), - is_indexed: false, - }; - pub static ref TOKEN_AMOUNT_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "amount".into(), - expected_type: Type::string(), - description: "A string representation of the amount of tokens in the account.".into(), - is_indexed: false, - }; - pub static ref TOKEN_DECIMALS_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "decimals".into(), - expected_type: Type::addon(SVM_U8), - description: "The number of decimals for the token.".into(), - is_indexed: false, - }; - pub static ref TOKEN_UI_AMOUNT_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "ui_amount".into(), - expected_type: Type::addon(SVM_F64), - description: "The amount of tokens in the account, formatted as a number with the correct number of decimals.".into(), - is_indexed: false, - }; - pub static ref TOKEN_UI_AMOUNT_STRING_INTRINSIC_FIELD: IntrinsicField = IntrinsicField { - name: "ui_amount_string".into(), - expected_type: Type::string(), - description: "The amount of tokens in the account, formatted as a string with the correct number of decimals.".into(), - is_indexed: false, - }; -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct PluginConfig { - pub plugin_name: SubgraphPluginType, - pub data: SubgraphRequest, - pub workspace: String, -} - -impl PluginConfig { - pub fn new(plugin_name: SubgraphPluginType, data: SubgraphRequest) -> Self { - Self { plugin_name, data, workspace: "".into() } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "kebab-case")] -pub enum SubgraphPluginType { - SurfpoolSubgraph, -} - -impl std::fmt::Display for SubgraphPluginType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let val = match self { - SubgraphPluginType::SurfpoolSubgraph => "surfpool-subgraph".to_string(), - }; - write!(f, "{}", val) - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum SubgraphRequest { - V0(SubgraphRequestV0), -} - -impl SubgraphRequest { - pub fn parse_value_store_v0( - subgraph_name: Option, - subgraph_description: Option, - program_id: &Pubkey, - idl_str: &str, - slot: u64, - construct_did: &ConstructDid, - values: &ValueStore, - ) -> Result { - let request = SubgraphRequestV0::parse_value_store( - subgraph_name, - subgraph_description, - program_id, - idl_str, - slot, - construct_did, - values, - )?; - Ok(SubgraphRequest::V0(request)) - } - - pub fn from_value_v0(value: &Value) -> Result { - Ok(SubgraphRequest::V0(SubgraphRequestV0::from_value(value)?)) - } - pub fn from_value(value: &Value) -> Result { - let addon_data = value - .as_addon_data() - .ok_or(diagnosed_error!("could not deserialize subgraph request: expected addon"))?; - if addon_data.id != SVM_SUBGRAPH_REQUEST { - return Err(diagnosed_error!( - "could not deserialize subgraph request: expected addon type '{}'", - SVM_SUBGRAPH_REQUEST - )); - } - let bytes = addon_data.bytes.clone(); - - serde_json::from_slice(&bytes) - .map_err(|e| diagnosed_error!("could not deserialize subgraph request: {e}")) - } - - pub fn to_value(&self) -> Result { - Ok(Value::addon( - serde_json::to_vec(self) - .map_err(|e| diagnosed_error!("could not serialize subgraph request: {e}"))?, - SVM_SUBGRAPH_REQUEST, - )) - } - - pub fn subgraph_name(&self) -> &str { - match self { - SubgraphRequest::V0(request) => request.subgraph_name.as_str(), - } - } - - pub fn program_id(&self) -> Pubkey { - match self { - SubgraphRequest::V0(request) => request.program_id, - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SubgraphRequestV0 { - /// The program id of the program to index. - #[serde(serialize_with = "pubkey_serialize", deserialize_with = "pubkey_deserialize")] - pub program_id: Pubkey, - /// The slot at which the subgraph begins indexing. - pub slot: u64, - /// The name of the subgraph. Either provided in the `deploy_subgraph` action, or the name of the data source. - pub subgraph_name: String, - /// The description of the subgraph. Either provided in the `deploy_subgraph` action, or the docs from the IDL for the associated data source. - pub subgraph_description: Option, - /// The data source to index, with the IDL context needed for the data source type. - pub data_source: IndexedSubgraphSourceType, - /// The metadata of the fields to index. These fields are intrinsic to the data source type. - /// For example, an event subgraph will include `slot`, while a PDA subgraph will include `pubkey`, `lamports`, and `owner`. - pub intrinsic_fields: Vec, - /// The metadata of the fields to index. These fields are defined in the IDL. - pub defined_fields: Vec, - /// The Construct Did of the subgraph request action. - pub construct_did: ConstructDid, - /// The network to index. This is used to determine the network of the subgraph. - pub network: String, - /// The IDL types defined in the IDL. - pub idl_types: Vec, -} - -fn pubkey_serialize(value: &Pubkey, serializer: S) -> Result -where - S: serde::Serializer, -{ - serializer.serialize_str(&value.to_string()) -} - -fn pubkey_deserialize<'de, D>(deserializer: D) -> Result -where - D: serde::Deserializer<'de>, -{ - let s = String::deserialize(deserializer)?; - Pubkey::from_str(&s).map_err(serde::de::Error::custom) -} - -impl SubgraphRequestV0 { - pub fn parse_value_store( - subgraph_name: Option, - subgraph_description: Option, - program_id: &Pubkey, - idl_str: &str, - slot: u64, - construct_did: &ConstructDid, - values: &ValueStore, - ) -> Result { - let idl = serde_json::from_str(idl_str) - .map_err(|e| diagnosed_error!("could not deserialize IDL: {e}"))?; - - let (data_source, defined_field_values, intrinsic_field_values) = - IndexedSubgraphSourceType::parse_values(values, &idl)?; - - let defined_fields = IndexedSubgraphField::parse_defined_field_values( - data_source.clone(), - &defined_field_values, - &idl.types, - &idl.constants, - )?; - - let intrinsic_fields = IndexedSubgraphField::parse_intrinsic_field_values( - data_source.clone(), - intrinsic_field_values, - )?; - - Ok(Self { - program_id: *program_id, - slot, - subgraph_name: subgraph_name.unwrap_or(data_source.name()), - subgraph_description: subgraph_description.or(data_source.description()), - data_source, - construct_did: construct_did.clone(), - defined_fields, - intrinsic_fields, - network: "solana-devnet".into(), - idl_types: idl.types, - }) - } - - pub fn from_value(value: &Value) -> Result { - let addon_data = value - .as_addon_data() - .ok_or(diagnosed_error!("could not deserialize subgraph request: expected addon"))?; - if addon_data.id != SVM_SUBGRAPH_REQUEST { - return Err(diagnosed_error!( - "could not deserialize subgraph request: expected addon type '{}'", - SVM_SUBGRAPH_REQUEST - )); - } - let bytes = addon_data.bytes.clone(); - - serde_json::from_slice(&bytes) - .map_err(|e| diagnosed_error!("could not deserialize subgraph request: {e}")) - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct IntrinsicField { - /// The name of the intrinsic field. - pub name: String, - /// The expected type of the intrinsic field. - pub expected_type: Type, - /// A description of the intrinsic field. - pub description: String, - /// Whether the intrinsic field is indexed in the subgraph. - pub is_indexed: bool, -} -impl IntrinsicField { - pub fn to_indexed_field(&self) -> IndexedSubgraphField { - IndexedSubgraphField { - display_name: self.name.to_case(Case::Camel), - source_key: self.name.clone(), - expected_type: self.expected_type.clone(), - description: Some(self.description.clone()), - is_indexed: self.is_indexed, - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct IndexedSubgraphField { - /// The name of the field, as it will be indexed in the graphql database. - pub display_name: String, - /// The name of the field, as it is defined in the IDL. By default, this is the same as the display name. - pub source_key: String, - /// The expected type of the field as it will appear in the graphql database. This is parsed from the associated source key in the IDL. - pub expected_type: Type, - /// A description of the field. If not provided, the docs in the IDL Event's field will be used, if available. - pub description: Option, - /// Whether the field is indexed in the subgraph. - pub is_indexed: bool, -} - -impl IndexedSubgraphField { - pub fn extract_intrinsic( - &self, - slot: Option, - transaction_signature: Option, - pubkey: Option, - owner: Option, - lamports: Option, - mint: Option, - token_program: Option, - amount: Option, - decimals: Option, - ui_amount: Option, - ui_amount_string: Option, - ) -> Option<(String, Value)> { - match self.source_key.as_str() { - "slot" => slot.map(|s| (self.display_name.clone(), Value::integer(s as i128))), - "transaction_signature" => transaction_signature.map(|s| { - (self.display_name.clone(), Value::addon(s.as_ref().to_vec(), SVM_SIGNATURE)) - }), - "pubkey" => pubkey.map(|p| { - (self.display_name.clone(), Value::addon(p.to_bytes().to_vec(), SVM_PUBKEY)) - }), - "owner" => owner.map(|o| { - (self.display_name.clone(), Value::addon(o.to_bytes().to_vec(), SVM_PUBKEY)) - }), - "lamports" => lamports.map(|l| (self.display_name.clone(), Value::integer(l as i128))), - "mint" => mint.map(|m| { - (self.display_name.clone(), Value::addon(m.to_bytes().to_vec(), SVM_PUBKEY)) - }), - "token_program" => token_program.map(|tp| { - (self.display_name.clone(), Value::addon(tp.to_bytes().to_vec(), SVM_PUBKEY)) - }), - "amount" => amount.map(|a| (self.display_name.clone(), Value::string(a))), - "decimals" => decimals.map(|d| (self.display_name.clone(), SvmValue::u8(d))), - "ui_amount" => ui_amount.map(|ua| (self.display_name.clone(), SvmValue::f64(ua))), - "ui_amount_string" => { - ui_amount_string.map(|uas| (self.display_name.clone(), Value::string(uas))) - } - _ => None, - } - } - - pub fn parse_intrinsic_field_values( - data_source: IndexedSubgraphSourceType, - intrinsic_field_values: Option>, - ) -> Result, Diagnostic> { - data_source.index_intrinsics(intrinsic_field_values) - } - - pub fn parse_defined_field_values( - data_source: IndexedSubgraphSourceType, - field_values: &Option>, - idl_types: &Vec, - idl_constants: &Vec, - ) -> Result, Diagnostic> { - match data_source { - IndexedSubgraphSourceType::Instruction(_) => { - Err(diagnosed_error!("instruction subgraph not supported yet")) - } - IndexedSubgraphSourceType::Event(event_subgraph_source) => { - IndexedSubgraphField::parse_user_defined_field_values_against_idl( - field_values, - &event_subgraph_source.ty.ty, - idl_types, - idl_constants, - ) - } - IndexedSubgraphSourceType::Pda(pda_subgraph_source) => { - IndexedSubgraphField::parse_user_defined_field_values_against_idl( - field_values, - &pda_subgraph_source.account_type.ty, - idl_types, - idl_constants, - ) - } - IndexedSubgraphSourceType::TokenAccount(_) => Ok(vec![]), - } - } - - fn parse_user_defined_field_values_against_idl( - field_values: &Option>, - idl_type_def_ty: &IdlTypeDefTy, - idl_types: &Vec, - idl_constants: &Vec, - ) -> Result, Diagnostic> { - let mut fields = vec![]; - - let expected_type_for_type_def = get_expected_type_from_idl_type_def_ty( - idl_type_def_ty, - idl_types, - idl_constants, - &vec![], - &vec![], - )?; - - if let Some(field_values) = field_values { - for field_value in field_values.iter() { - let field_value = field_value.as_object().ok_or(diagnosed_error!( - "each entry of a subgraph field should contain an object" - ))?; - let name = field_value.get("name").ok_or(diagnosed_error!( - "could not deserialize subgraph field: expected 'name' key" - ))?; - let name = name.as_string().ok_or(diagnosed_error!( - "could not deserialize subgraph field: expected 'name' to be a string" - ))?; - - let idl_key_value = field_value.get("idl_key"); - let idl_key = idl_key_value - .and_then(|v| v.as_string().map(|s| s.to_string())) - .unwrap_or(name.to_string()); - - let display_name = if idl_key_value.is_some() { - // key and name were specified, meaning the `name` field is an intentional renam - name.to_string() - } else { - name.to_case(Case::Camel) - }; - - let description = field_value - .get("description") - .and_then(|v| v.as_string().map(|s| s.to_string())); - - let expected_type = expected_type_for_type_def - .as_object() - .and_then(|obj| match obj { - ObjectDefinition::Strict(items) => items - .iter() - .find(|item| item.name == idl_key) - .map(|item| item.typing.clone()), - other => unreachable!( - "Strict object definition expected for subgraph field, found {:?}", - other - ), - }) - .ok_or(diagnosed_error!( - "could not find field '{}' in expected type for subgraph field", - idl_key - ))?; - - let is_indexed = - field_value.get("is_indexed").and_then(|v| v.as_bool()).unwrap_or(false); - - fields.push(Self { - display_name, - source_key: idl_key, - expected_type, - description, - is_indexed, - }); - } - } else { - match idl_type_def_ty { - IdlTypeDefTy::Struct { fields: idl_fields } => { - if let Some(idl_fields) = idl_fields { - match idl_fields { - IdlDefinedFields::Named(idl_fields) => { - fields.append( - &mut idl_fields - .iter() - .map(|f|{ - idl_type_to_txtx_type( - f.ty.clone(), - idl_types, - idl_constants, - &vec![], - &vec![], - ).map_err(|e| { - diagnosed_error!( - "could not determine expected type for subgraph field '{}': {e}", - f.name - ) - }).map(|expected_type| Self { - display_name: f.name.to_case(Case::Camel), - source_key: f.name.clone(), - expected_type , - description: if f.docs.is_empty() { - None - } else { - Some(f.docs.join(" ")) - }, - is_indexed: false, - }) - }) - .collect::, _>>()?, - ); - } - - IdlDefinedFields::Tuple(_) => todo!(), - } - } else { - todo!() - } - } - IdlTypeDefTy::Enum { .. } => todo!(), - IdlTypeDefTy::Type { .. } => todo!(), - } - } - Ok(fields) - } -} - -trait SubgraphSourceType { - fn intrinsic_fields() -> Vec; - fn index_intrinsics( - &self, - intrinsic_field_values: Option>, - ) -> Result, Diagnostic> { - let available_fields = Self::intrinsic_fields(); - match intrinsic_field_values { - Some(intrinsic_field_values) => { - let mut indexed = vec![]; - for field_value in intrinsic_field_values { - let field_value = field_value.as_object().ok_or(diagnosed_error!( - "each entry of a subgraph intrinsic field should contain an object" - ))?; - let name = field_value.get("name").ok_or(diagnosed_error!( - "could not deserialize subgraph intrinsic field: expected 'name' key" - ))?; - let name = name.as_string().ok_or(diagnosed_error!( - "could not deserialize subgraph intrinsic field: expected 'name' to be a string" - ))?; - - let default_display_name = name.to_case(Case::Camel); - - let display_name = field_value - .get("display_name") - .and_then(|v| v.as_string().map(|s| s.to_string())) - .unwrap_or(default_display_name); - - let description = field_value - .get("description") - .and_then(|v| v.as_string().map(|s| s.to_string())); - - let is_indexed = field_value.get("is_indexed").and_then(|v| v.as_bool()); - - let matching = available_fields.iter().find(|f| f.name == name).ok_or( - diagnosed_error!( - "could not find intrinsic field '{}' in subgraph source type", - name - ), - )?; - indexed.push(IndexedSubgraphField { - display_name, - source_key: name.to_string(), - expected_type: matching.expected_type.clone(), - description: description.or(Some(matching.description.clone())), - is_indexed: is_indexed.unwrap_or(matching.is_indexed), - }) - } - Ok(indexed) - } - None => Ok(available_fields.into_iter().map(|f| f.to_indexed_field()).collect()), - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum IndexedSubgraphSourceType { - /// Index a program instruction - Instruction(InstructionSubgraphSource), - /// Index a program event - Event(EventSubgraphSource), - // Account(AccountSubgraphSource), - /// Index a program derived account - Pda(PdaSubgraphSource), - /// Index a token account - TokenAccount(TokenAccountSubgraphSource), -} - -impl IndexedSubgraphSourceType { - pub fn parse_values( - values: &ValueStore, - idl: &Idl, - ) -> Result<(Self, Option>, Option>), Diagnostic> { - if let Some(event) = values.get_value("event") { - let (event, fields, intrinsic_fields) = EventSubgraphSource::from_value(event, idl)?; - return Ok((Self::Event(event), fields, intrinsic_fields)); - } else if let Some(_) = values.get_value("instruction") { - return Err(diagnosed_error!("subgraph instruction not supported yet")); - } else if let Some(_) = values.get_value("account") { - return Err(diagnosed_error!("subgraph account not supported yet")); - } else if let Some(pda) = values.get_value("pda") { - let (pda_source, fields, intrinsic_fields) = PdaSubgraphSource::from_value(pda, idl)?; - return Ok((Self::Pda(pda_source), fields, intrinsic_fields)); - } else if let Some(token_account) = values.get_value("token_account") { - let (token_account_source, intrinsic_fields) = - TokenAccountSubgraphSource::from_value(token_account, idl)?; - return Ok((Self::TokenAccount(token_account_source), None, intrinsic_fields)); - } - - Err(diagnosed_error!("no event, pda, or token_account map provided")) - } - - pub fn description(&self) -> Option { - match self { - IndexedSubgraphSourceType::Instruction(instruction_subgraph_source) => { - if instruction_subgraph_source.instruction.docs.is_empty() { - None - } else { - Some(instruction_subgraph_source.instruction.docs.join(" ")) - } - } - IndexedSubgraphSourceType::Event(event_subgraph_source) => { - if event_subgraph_source.ty.docs.is_empty() { - None - } else { - Some(event_subgraph_source.ty.docs.join(" ")) - } - } - IndexedSubgraphSourceType::Pda(pda_subgraph_source) => { - if pda_subgraph_source.account_type.docs.is_empty() { - None - } else { - Some(pda_subgraph_source.account_type.docs.join(" ")) - } - } - IndexedSubgraphSourceType::TokenAccount(_) => None, - } - } - - pub fn name(&self) -> String { - match self { - IndexedSubgraphSourceType::Instruction(instruction_subgraph_source) => { - instruction_subgraph_source.instruction.name.clone() - } - IndexedSubgraphSourceType::Event(event_subgraph_source) => { - event_subgraph_source.event.name.clone() - } - IndexedSubgraphSourceType::Pda(pda_subgraph_source) => { - pda_subgraph_source.account.name.clone() - } - IndexedSubgraphSourceType::TokenAccount(token_account_subgraph_source) => { - format!( - "token_account_{}", - token_account_subgraph_source - .instruction_accounts - .iter() - .map(|(_, ia)| ia.name.clone()) - .collect::>() - .join("_") - ) - } - } - } - - pub fn index_intrinsics( - &self, - intrinsic_field_values: Option>, - ) -> Result, Diagnostic> { - match self { - IndexedSubgraphSourceType::Instruction(_) => { - Err(diagnosed_error!("instruction subgraph not supported yet")) - } - IndexedSubgraphSourceType::Event(event_subgraph_source) => { - event_subgraph_source.index_intrinsics(intrinsic_field_values) - } - IndexedSubgraphSourceType::Pda(pda_subgraph_source) => { - pda_subgraph_source.index_intrinsics(intrinsic_field_values) - } - IndexedSubgraphSourceType::TokenAccount(token_account_subgraph_source) => { - token_account_subgraph_source.index_intrinsics(intrinsic_field_values) - } - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct InstructionSubgraphSource { - // The instruction being indexed - pub instruction: anchor_lang_idl::types::IdlInstruction, -} - -/// Recursively find an [IdlInstructionAccount] by name in an [IdlInstructionAccountItem]. -pub fn find_idl_instruction_account( - account_item: &IdlInstructionAccountItem, - name: &str, -) -> Option { - match account_item { - IdlInstructionAccountItem::Composite(idl_instruction_accounts) => idl_instruction_accounts - .accounts - .iter() - .find_map(|a| find_idl_instruction_account(a, name)), - IdlInstructionAccountItem::Single(idl_instruction_account) => { - if idl_instruction_account.name == name { - Some(idl_instruction_account.clone()) - } else { - None - } - } - } -} - -#[cfg(test)] -mod tests; diff --git a/addons/svm/types/src/subgraph/pda.rs b/addons/svm/types/src/subgraph/pda.rs deleted file mode 100644 index 3cb9f3ebc..000000000 --- a/addons/svm/types/src/subgraph/pda.rs +++ /dev/null @@ -1,251 +0,0 @@ -use std::collections::HashMap; - -use anchor_lang_idl::types::{Idl, IdlInstruction, IdlInstructionAccount}; -use serde::{Deserialize, Serialize}; -use solana_clock::Slot; -use solana_message::compiled_instruction::CompiledInstruction; -use solana_pubkey::Pubkey; -use txtx_addon_kit::{ - diagnosed_error, - types::{diagnostics::Diagnostic, types::Value}, -}; - -use crate::subgraph::{ - find_idl_instruction_account, - idl::{match_idl_accounts, parse_bytes_to_value_with_expected_idl_type_def_ty}, - IntrinsicField, SubgraphRequest, SubgraphSourceType, LAMPORTS_INTRINSIC_FIELD, - OWNER_INTRINSIC_FIELD, PUBKEY_INTRINSIC_FIELD, SLOT_INTRINSIC_FIELD, -}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct PdaSubgraphSource { - /// The account being indexed - pub account: anchor_lang_idl::types::IdlAccount, - /// The type of the account - pub account_type: anchor_lang_idl::types::IdlTypeDef, - /// The account definitions from the instructions that use this account type. - /// Each account definition should have the same `pda` definition. - pub instruction_accounts: Vec<( - anchor_lang_idl::types::IdlInstruction, - anchor_lang_idl::types::IdlInstructionAccount, - )>, -} - -impl SubgraphSourceType for PdaSubgraphSource { - fn intrinsic_fields() -> Vec { - vec![ - SLOT_INTRINSIC_FIELD.clone(), - PUBKEY_INTRINSIC_FIELD.clone(), - LAMPORTS_INTRINSIC_FIELD.clone(), - OWNER_INTRINSIC_FIELD.clone(), - ] - } -} - -impl PdaSubgraphSource { - pub fn from_value( - value: &Value, - idl: &Idl, - ) -> Result<(Self, Option>, Option>), Diagnostic> { - let pda_map = - value.as_map().ok_or(diagnosed_error!("subgraph 'pda' field must be a map"))?; - - if pda_map.len() != 1 { - return Err(diagnosed_error!("exactly one 'pda' map should be defined")); - } - let entry = pda_map.get(0).unwrap(); - - let entry = entry - .as_object() - .ok_or(diagnosed_error!("a subgraph 'pda' field should contain an object"))?; - - let type_name = entry - .get("type") - .ok_or(diagnosed_error!("a subgraph 'pda' field must have a 'type' key"))?; - let type_name = type_name - .as_string() - .ok_or(diagnosed_error!("a subgraph 'pda' field's 'type' value must be a string"))?; - let instruction_account_path = entry - .get("instruction") - .and_then(|v| v.as_map()) - .ok_or(diagnosed_error!("a subgraph 'pda' field must have an 'instruction' map"))?; - - let mut instruction_values = Vec::with_capacity(instruction_account_path.len()); - for instruction_value in instruction_account_path.iter() { - let instruction_value = instruction_value.as_object().ok_or(diagnosed_error!( - "each entry of a subgraph 'pda' instruction should contain an object" - ))?; - let instruction_name = instruction_value - .get("name") - .ok_or(diagnosed_error!("a subgraph 'pda' instruction must have a 'name' key"))?; - let instruction_name = instruction_name.as_string().ok_or(diagnosed_error!( - "a subgraph 'pda' instruction's 'name' value must be a string" - ))?; - let account_name = instruction_value.get("account_name").ok_or(diagnosed_error!( - "a subgraph 'pda' instruction must have an 'account_name' key" - ))?; - let account_name = account_name.as_string().ok_or(diagnosed_error!( - "a subgraph 'pda' instruction's 'account_name' value must be a string" - ))?; - instruction_values.push((instruction_name, account_name)); - } - let pda_source = Self::new(type_name, &instruction_values, idl)?; - let fields = entry.get("field").and_then(|v| v.as_map().map(|s| s.to_vec())); - let intrinsic_fields = - entry.get("intrinsic_field").and_then(|v| v.as_map().map(|s| s.to_vec())); - Ok((pda_source, fields, intrinsic_fields)) - } - - pub fn new( - account_name: &str, - instruction_account_path: &[(&str, &str)], - idl: &Idl, - ) -> Result { - let account = idl - .accounts - .iter() - .find(|a| a.name == account_name) - .cloned() - .ok_or(diagnosed_error!("could not find account '{}' in IDL", account_name))?; - let account_type = idl - .types - .iter() - .find(|t| t.name == account_name) - .cloned() - .ok_or(diagnosed_error!("could not find type '{}' in IDL", account_name))?; - - let mut instruction_accounts = vec![]; - for (instruction_name, account_name) in instruction_account_path { - let instruction = idl.instructions.iter().find(|i| i.name.eq(instruction_name)).ok_or( - diagnosed_error!("could not find instruction '{}' in IDL", instruction_name), - )?; - let account_item = instruction - .accounts - .iter() - .find_map(|a| find_idl_instruction_account(a, account_name)) - .ok_or(diagnosed_error!( - "could not find account '{}' in instruction '{}' in IDL", - account_name, - instruction_name - ))?; - - if account_item.pda.is_none() { - return Err(diagnosed_error!( - "account '{}' in instruction '{}' is not a PDA", - account_name, - instruction_name - )); - } - - if instruction_accounts.len() > 1 { - let last: &(IdlInstruction, IdlInstructionAccount) = - instruction_accounts.last().unwrap(); - if last.1.pda != account_item.pda { - return Err(diagnosed_error!( - "account '{}' in instruction '{}' has different PDA definitions", - account_name, - instruction_name - )); - } - } - - instruction_accounts.push((instruction.clone(), account_item)); - } - Ok(Self { account, account_type, instruction_accounts }) - } - - pub fn evaluate_account_update( - &self, - data: &[u8], - subgraph_request: &SubgraphRequest, - slot: Slot, - pubkey: Pubkey, - owner: Pubkey, - lamports: u64, - entries: &mut Vec>, - ) -> Result<(), String> { - let SubgraphRequest::V0(subgraph_request) = subgraph_request; - let actual_account_discriminator = data[0..8].to_vec(); - if actual_account_discriminator != self.account.discriminator { - // This is not the expected account, so we skip it - return Ok(()); - } - let rest = data[8..].to_vec(); - - let idl_type_def_generics = subgraph_request - .idl_types - .iter() - .find(|t| t.name == self.account_type.name) - .map(|t| &t.generics); - let empty_vec = vec![]; - let parsed_value = parse_bytes_to_value_with_expected_idl_type_def_ty( - &rest, - &self.account_type.ty, - &subgraph_request.idl_types, - &vec![], - idl_type_def_generics.unwrap_or(&empty_vec), - )?; - - let obj = parsed_value.as_object().unwrap().clone(); - let mut entry = HashMap::new(); - for field in subgraph_request.defined_fields.iter() { - let v = obj.get(&field.source_key).unwrap().clone(); - entry.insert(field.display_name.clone(), v); - } - - subgraph_request.intrinsic_fields.iter().for_each(|field| { - if let Some((entry_key, entry_value)) = field.extract_intrinsic( - Some(slot), - None, - Some(pubkey), - Some(owner), - Some(lamports), - None, - None, - None, - None, - None, - None, - ) { - entry.insert(entry_key, entry_value); - } - }); - - if !entry.is_empty() { - entries.push(entry); - } - - Ok(()) - } - - pub fn evaluate_instruction( - &self, - instruction: &CompiledInstruction, - account_pubkeys: &[Pubkey], - ) -> Option { - let Some((matching_idl_instruction, idl_instruction_account)) = - self.instruction_accounts.iter().find_map(|(ix, ix_account)| { - if instruction.data.starts_with(&ix.discriminator) { - Some((ix, ix_account)) - } else { - None - } - }) - else { - // This instruction does not match any of the instructions that use this PDA account type - return None; - }; - - let idl_accounts = - match_idl_accounts(matching_idl_instruction, &instruction.accounts, &account_pubkeys); - let some_pda = idl_accounts.iter().find_map(|(name, pubkey, _)| { - if idl_instruction_account.name.eq(name) { - Some(*pubkey) - } else { - None - } - }); - - some_pda - } -} diff --git a/addons/svm/types/src/subgraph/token_account.rs b/addons/svm/types/src/subgraph/token_account.rs deleted file mode 100644 index f838bfda1..000000000 --- a/addons/svm/types/src/subgraph/token_account.rs +++ /dev/null @@ -1,296 +0,0 @@ -use std::collections::HashMap; - -use anchor_lang_idl::types::{Idl, IdlInstruction, IdlInstructionAccount}; -use serde::{Deserialize, Serialize}; -use solana_clock::Slot; -use solana_message::compiled_instruction::CompiledInstruction; -use solana_pubkey::Pubkey; -use solana_signature::Signature; -use solana_transaction_status_client_types::TransactionStatusMeta; -use txtx_addon_kit::{ - diagnosed_error, - types::{diagnostics::Diagnostic, types::Value}, -}; - -use crate::subgraph::{ - find_idl_instruction_account, idl::match_idl_accounts, IntrinsicField, SubgraphRequest, - SubgraphSourceType, LAMPORTS_INTRINSIC_FIELD, OWNER_INTRINSIC_FIELD, PUBKEY_INTRINSIC_FIELD, - SLOT_INTRINSIC_FIELD, TOKEN_AMOUNT_INTRINSIC_FIELD, TOKEN_DECIMALS_INTRINSIC_FIELD, - TOKEN_MINT_INTRINSIC_FIELD, TOKEN_PROGRAM_INTRINSIC_FIELD, TOKEN_UI_AMOUNT_INTRINSIC_FIELD, - TOKEN_UI_AMOUNT_STRING_INTRINSIC_FIELD, TRANSACTION_SIGNATURE_INTRINSIC_FIELD, -}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct TokenAccountSubgraphSource { - /// The account definitions from the instructions that use this account type. - /// Each account definition should have the same `pda` definition. - pub instruction_accounts: Vec<( - anchor_lang_idl::types::IdlInstruction, - anchor_lang_idl::types::IdlInstructionAccount, - )>, -} - -impl SubgraphSourceType for TokenAccountSubgraphSource { - fn intrinsic_fields() -> Vec { - vec![ - SLOT_INTRINSIC_FIELD.clone(), - TRANSACTION_SIGNATURE_INTRINSIC_FIELD.clone(), - PUBKEY_INTRINSIC_FIELD.clone(), - LAMPORTS_INTRINSIC_FIELD.clone(), - OWNER_INTRINSIC_FIELD.clone(), - TOKEN_MINT_INTRINSIC_FIELD.clone(), - TOKEN_PROGRAM_INTRINSIC_FIELD.clone(), - TOKEN_AMOUNT_INTRINSIC_FIELD.clone(), - TOKEN_DECIMALS_INTRINSIC_FIELD.clone(), - TOKEN_UI_AMOUNT_INTRINSIC_FIELD.clone(), - TOKEN_UI_AMOUNT_STRING_INTRINSIC_FIELD.clone(), - ] - } -} - -impl TokenAccountSubgraphSource { - pub fn from_value(value: &Value, idl: &Idl) -> Result<(Self, Option>), Diagnostic> { - let token_account_map = value - .as_map() - .ok_or(diagnosed_error!("subgraph 'token_account' field must be a map"))?; - - if token_account_map.len() != 1 { - return Err(diagnosed_error!("exactly one 'token_account' map should be defined")); - } - let entry = token_account_map.get(0).unwrap(); - - let entry = entry - .as_object() - .ok_or(diagnosed_error!("a subgraph 'token_account' field should contain an object"))?; - - let instruction_account_path = entry.get("instruction").and_then(|v| v.as_map()).ok_or( - diagnosed_error!("a subgraph 'token_account' field must have an 'instruction' map"), - )?; - - let mut instruction_values = Vec::with_capacity(instruction_account_path.len()); - for instruction_value in instruction_account_path.iter() { - let instruction_value = instruction_value.as_object().ok_or(diagnosed_error!( - "each entry of a subgraph 'token_account' instruction should contain an object" - ))?; - let instruction_name = instruction_value.get("name").ok_or(diagnosed_error!( - "a subgraph 'token_account' instruction must have a 'name' key" - ))?; - let instruction_name = instruction_name.as_string().ok_or(diagnosed_error!( - "a subgraph 'token_account' instruction's 'name' value must be a string" - ))?; - let account_name = instruction_value.get("account_name").ok_or(diagnosed_error!( - "a subgraph 'token_account' instruction must have an 'account_name' key" - ))?; - let account_name = account_name.as_string().ok_or(diagnosed_error!( - "a subgraph 'token_account' instruction's 'account_name' value must be a string" - ))?; - instruction_values.push((instruction_name, account_name)); - } - let token_account_source = Self::new(&instruction_values, idl)?; - let intrinsic_fields = - entry.get("intrinsic_field").and_then(|v| v.as_map().map(|s| s.to_vec())); - Ok((token_account_source, intrinsic_fields)) - } - - pub fn new(instruction_account_path: &[(&str, &str)], idl: &Idl) -> Result { - let mut instruction_accounts = vec![]; - for (instruction_name, account_name) in instruction_account_path { - let instruction = idl.instructions.iter().find(|i| i.name.eq(instruction_name)).ok_or( - diagnosed_error!("could not find instruction '{}' in IDL", instruction_name), - )?; - let account_item = instruction - .accounts - .iter() - .find_map(|a| find_idl_instruction_account(a, account_name)) - .ok_or(diagnosed_error!( - "could not find account '{}' in instruction '{}' in IDL", - account_name, - instruction_name - ))?; - - if account_item.pda.is_none() { - return Err(diagnosed_error!( - "account '{}' in instruction '{}' is not a PDA", - account_name, - instruction_name - )); - } - - if instruction_accounts.len() > 1 { - let last: &(IdlInstruction, IdlInstructionAccount) = - instruction_accounts.last().unwrap(); - if last.1.pda != account_item.pda { - return Err(diagnosed_error!( - "account '{}' in instruction '{}' has different PDA definitions", - account_name, - instruction_name - )); - } - } - - instruction_accounts.push((instruction.clone(), account_item)); - } - Ok(Self { instruction_accounts }) - } - - pub fn evaluate_instruction( - &self, - instruction: &CompiledInstruction, - account_pubkeys: &[Pubkey], - transaction_status_meta: &TransactionStatusMeta, - slot: Slot, - transaction_signature: Signature, - subgraph_request: &SubgraphRequest, - already_found_token_accounts: &mut Vec, - entries: &mut Vec>, - ) -> Result<(), String> { - let SubgraphRequest::V0(subgraph_request) = subgraph_request; - let Some((matching_idl_instruction, idl_instruction_account)) = - self.instruction_accounts.iter().find_map(|(ix, ix_account)| { - if instruction.data.starts_with(&ix.discriminator) { - Some((ix, ix_account)) - } else { - None - } - }) - else { - // This instruction does not match any of the instructions that use this Token Account - return Ok(()); - }; - - let idl_accounts = - match_idl_accounts(matching_idl_instruction, &instruction.accounts, &account_pubkeys); - - let Some((token_account_pubkey, token_account_index)) = - idl_accounts.iter().find_map(|(name, pubkey, index)| { - if idl_instruction_account.name.eq(name) { - Some((*pubkey, index)) - } else { - None - } - }) - else { - return Ok(()); - }; - - if already_found_token_accounts.contains(&token_account_pubkey) { - // This token account has already been processed, prevent double processing - return Ok(()); - } - - let some_pre_balance_entry = if let Some(pre_token_balances) = - transaction_status_meta.pre_token_balances.as_ref() - { - if let Some(pre_token_balance) = - pre_token_balances.iter().find(|b| b.account_index == *token_account_index as u8) - { - let mint = Pubkey::from_str_const(&pre_token_balance.mint); - let owner = Pubkey::from_str_const(&pre_token_balance.owner); - let token_program = Pubkey::from_str_const(&pre_token_balance.program_id); - let amount = pre_token_balance.ui_token_amount.amount.clone(); - let decimals = pre_token_balance.ui_token_amount.decimals; - let ui_amount = pre_token_balance.ui_token_amount.ui_amount; - let ui_amount_string = pre_token_balance.ui_token_amount.ui_amount_string.clone(); - let lamports = transaction_status_meta - .pre_balances - .get(*token_account_index) - .ok_or(format!( - "could not find pre-balance for token account {}", - token_account_pubkey - ))?; - let mut entry = HashMap::new(); - subgraph_request.intrinsic_fields.iter().for_each(|field| { - if let Some((entry_key, entry_value)) = field.extract_intrinsic( - Some(slot), - Some(transaction_signature), - Some(token_account_pubkey), - Some(owner), - Some(*lamports), - Some(mint), - Some(token_program), - Some(amount.clone()), - Some(decimals), - ui_amount, - Some(ui_amount_string.clone()), - ) { - entry.insert(entry_key, entry_value); - } - }); - Some(entry) - } else { - None - } - } else { - None - }; - - let some_post_balance_entry = if let Some(post_token_balances) = - transaction_status_meta.post_token_balances.as_ref() - { - if let Some(post_token_balance) = - post_token_balances.iter().find(|b| b.account_index == *token_account_index as u8) - { - let mint = Pubkey::from_str_const(&post_token_balance.mint); - let owner = Pubkey::from_str_const(&post_token_balance.owner); - let token_program = Pubkey::from_str_const(&post_token_balance.program_id); - let amount = post_token_balance.ui_token_amount.amount.clone(); - let decimals = post_token_balance.ui_token_amount.decimals; - let ui_amount = post_token_balance.ui_token_amount.ui_amount; - let ui_amount_string = post_token_balance.ui_token_amount.ui_amount_string.clone(); - let lamports = transaction_status_meta - .post_balances - .get(*token_account_index) - .ok_or(format!( - "could not find post-balance for token account {}", - token_account_pubkey - ))?; - let mut entry = HashMap::new(); - subgraph_request.intrinsic_fields.iter().for_each(|field| { - if let Some((entry_key, entry_value)) = field.extract_intrinsic( - Some(slot), - Some(transaction_signature), - Some(token_account_pubkey), - Some(owner), - Some(*lamports), - Some(mint), - Some(token_program), - Some(amount.clone()), - Some(decimals), - ui_amount, - Some(ui_amount_string.clone()), - ) { - entry.insert(entry_key, entry_value); - } - }); - Some(entry) - } else { - None - } - } else { - None - }; - - match (some_pre_balance_entry, some_post_balance_entry) { - (Some(pre_entry), Some(post_entry)) => { - if pre_entry.eq(&post_entry) { - // If both pre and post entries are the same, we only need to add one entry - entries.push(pre_entry); - } else { - // If they are different, we add both - entries.push(pre_entry); - entries.push(post_entry); - } - } - (Some(entry), None) | (None, Some(entry)) => { - entries.push(entry); - } - (None, None) => {} - } - - if !already_found_token_accounts.contains(&token_account_pubkey) { - already_found_token_accounts.push(token_account_pubkey); - } - - Ok(()) - } -} diff --git a/crates/txtx-addon-kit/src/types/cloud_interface.rs b/crates/txtx-addon-kit/src/types/cloud_interface.rs index 91e0f604e..98b0e8c66 100644 --- a/crates/txtx-addon-kit/src/types/cloud_interface.rs +++ b/crates/txtx-addon-kit/src/types/cloud_interface.rs @@ -1,19 +1,15 @@ use serde_json::Value as JsonValue; -use std::{fmt::Debug, future::Future, pin::Pin, sync::Arc}; +use std::{fmt::Debug, future::Future, pin::Pin}; #[derive(Debug, Clone)] -pub struct CloudServiceContext { - pub authenticated_cloud_service_router: Option>, -} +pub struct CloudServiceContext {} impl CloudServiceContext { - pub fn new( - authenticated_cloud_service_router: Option>, - ) -> Self { - Self { authenticated_cloud_service_router } + pub fn new() -> Self { + Self {} } pub fn empty() -> Self { - Self { authenticated_cloud_service_router: None } + Self {} } } diff --git a/crates/txtx-cli/Cargo.toml b/crates/txtx-cli/Cargo.toml index e4db05543..6a08b1c37 100644 --- a/crates/txtx-cli/Cargo.toml +++ b/crates/txtx-cli/Cargo.toml @@ -16,8 +16,6 @@ txtx-core = { workspace = true } txtx-addon-kit = { workspace = true } txtx-lsp = { path = "../txtx-lsp" } txtx-supervisor-ui = { workspace = true, optional = true } -txtx-cloud = { workspace = true } -txtx-serve = { workspace = true, optional = true } txtx-addon-network-svm = { workspace = true } txtx-addon-network-evm = { workspace = true } txtx-gql = { workspace = true } @@ -27,11 +25,9 @@ ctrlc = { version = "3.2.2", optional = true } dotenvy = "0.15.7" serde = "1" serde_json = "1" -serde_derive = "1" serde_yml = "0.0.11" ascii_table = "4.0.3" itertools = "0.12.0" -unicode-width = "0.2.0" ansi_term = "0.12.1" atty = "0.2.14" tokio = "1.37.0" @@ -40,7 +36,6 @@ openssl-sys = { version = "*", features = ["vendored"] } dialoguer = "0.11.0" console = "0.15.8" tower-lsp = "0.20.0" -crossbeam-channel = "0.5" chrono = "0.4.38" actix-web = "4" indicatif = "0.18.0" @@ -55,7 +50,6 @@ strum = { version = "0.26", features = ["derive"] } default = ["cli", "supervisor_ui"] cli = ["clap", "ctrlc", "hiro-system-kit/log"] supervisor_ui = ["txtx-supervisor-ui"] -txtx_serve = ["txtx-serve"] debug = ["hiro-system-kit/debug"] release = ["hiro-system-kit/release"] diff --git a/crates/txtx-cli/src/cli/env.rs b/crates/txtx-cli/src/cli/env.rs deleted file mode 100644 index 422e5e06c..000000000 --- a/crates/txtx-cli/src/cli/env.rs +++ /dev/null @@ -1,45 +0,0 @@ -use dotenvy::dotenv; - -pub const AUTH_SERVICE_URL_KEY: &str = "AUTH_SERVICE_URL"; -pub const AUTH_CALLBACK_PORT_KEY: &str = "AUTH_CALLBACK_PORT"; -pub const TXTX_CONSOLE_URL_KEY: &str = "TXTX_CONSOLE_URL"; -pub const TXTX_ID_SERVICE_URL_KEY: &str = "TXTX_ID_SERVICE_URL"; -pub const REGISTRY_GQL_URL_KEY: &str = "REGISTRY_GQL_URL"; - -pub const DEFAULT_AUTH_SERVICE_URL: &str = "https://auth.txtx.run"; -pub const DEFAULT_AUTH_CALLBACK_PORT: u16 = 8488; -pub const DEFAULT_TXTX_CONSOLE_URL: &str = "https://txtx.run"; -pub const DEFAULT_TXTX_ID_SERVICE_URL: &str = "https://id.txtx.run/v1"; -pub const DEFAULT_REGISTRY_GQL_URL: &str = "https://registry.gql.txtx.run/v1"; - -pub fn get_env_var(key: &str, default: T) -> String { - dotenv().ok(); - std::env::var(key).unwrap_or(default.to_string()) -} - -#[derive(Debug, Clone)] -pub struct TxtxEnv { - pub auth_service_url: String, - pub auth_callback_port: String, - pub txtx_console_url: String, - pub id_service_url: String, - pub registry_gql_url: String, -} - -impl TxtxEnv { - pub fn load() -> Self { - let auth_service_url = get_env_var(AUTH_SERVICE_URL_KEY, DEFAULT_AUTH_SERVICE_URL); - let auth_callback_port = get_env_var(AUTH_CALLBACK_PORT_KEY, DEFAULT_AUTH_CALLBACK_PORT); - let txtx_console_url = get_env_var(TXTX_CONSOLE_URL_KEY, DEFAULT_TXTX_CONSOLE_URL); - let txtx_id_service_url = get_env_var(TXTX_ID_SERVICE_URL_KEY, DEFAULT_TXTX_ID_SERVICE_URL); - let registry_gql_url = get_env_var(REGISTRY_GQL_URL_KEY, DEFAULT_REGISTRY_GQL_URL); - - Self { - auth_service_url, - auth_callback_port, - txtx_console_url, - id_service_url: txtx_id_service_url, - registry_gql_url, - } - } -} diff --git a/crates/txtx-cli/src/cli/mod.rs b/crates/txtx-cli/src/cli/mod.rs index 2f0646826..5a06c0167 100644 --- a/crates/txtx-cli/src/cli/mod.rs +++ b/crates/txtx-cli/src/cli/mod.rs @@ -1,32 +1,16 @@ use atty::Stream; use clap::{ArgAction, Parser, Subcommand}; use dotenvy::dotenv; -use env::TxtxEnv; use hiro_system_kit::{self, Logger}; -use runbooks::load_runbook_from_manifest; use std::process; -use txtx_cloud::{LoginCommand, PublishRunbook}; mod common; mod docs; -mod env; mod lint; mod lsp; mod runbooks; mod snapshots; -pub const AUTH_SERVICE_URL_KEY: &str = "AUTH_SERVICE_URL"; -pub const AUTH_CALLBACK_PORT_KEY: &str = "AUTH_CALLBACK_PORT"; -pub const TXTX_CONSOLE_URL_KEY: &str = "TXTX_CONSOLE_URL"; -pub const TXTX_ID_SERVICE_URL_KEY: &str = "TXTX_ID_SERVICE_URL"; -pub const REGISTRY_GQL_URL_KEY: &str = "REGISTRY_GQL_URL"; - -pub const DEFAULT_AUTH_SERVICE_URL: &str = "https://auth.txtx.run"; -pub const DEFAULT_AUTH_CALLBACK_PORT: u16 = 8488; -pub const DEFAULT_TXTX_CONSOLE_URL: &str = "https://txtx.run"; -pub const DEFAULT_TXTX_ID_SERVICE_URL: &str = "https://id.gql.txtx.run/v1"; -pub const DEFAULT_REGISTRY_GQL_URL: &str = "https://registry.gql.txtx.run/v1"; - #[derive(Clone)] pub struct Context { pub logger: Option, @@ -83,16 +67,9 @@ enum Command { /// Start the txtx language server #[clap(name = "lsp", bin_name = "lsp")] Lsp, - /// Start a server to listen for requests to execute runbooks - #[clap(name = "serve", bin_name = "serve")] - #[cfg(feature = "txtx_serve")] - Serve(StartServer), /// Snapshot management (work in progress) #[clap(subcommand)] Snapshots(SnapshotCommand), - /// Txtx cloud commands - #[clap(subcommand, name = "cloud", bin_name = "cloud")] - Cloud(CloudCommand), } #[derive(Subcommand, PartialEq, Clone, Debug)] @@ -272,38 +249,6 @@ pub struct LintRunbook { pub gen_cli_full: bool, } -#[derive(Parser, PartialEq, Clone, Debug)] -#[cfg(feature = "txtx_serve")] -pub struct StartServer { - /// Serve runbooks from a specific project - #[arg(long = "manifest-file-path", short = 'm', default_value = "./txtx.yml")] - pub manifest_path: Option, - /// When running in unsupervised mode, print outputs in JSON format - #[arg(long = "output-json", action=ArgAction::SetTrue)] - pub output_json: bool, - /// Pick a specific output to stdout at the end of the execution - #[arg(long = "output", conflicts_with = "output_json")] - pub output: Option, - /// Set the port for hosting the web UI - #[arg(long = "port", short = 'p', default_value = txtx_serve::SERVE_BINDING_PORT )] - pub network_binding_port: u16, - /// Set the port for hosting the web UI - #[arg(long = "ip", short = 'i', default_value = txtx_serve::SERVE_BINDING_ADDRESS )] - pub network_binding_ip_address: String, -} - -#[derive(Subcommand, PartialEq, Clone, Debug)] -pub enum CloudCommand { - /// Login to the Txtx Cloud - #[clap(name = "login", bin_name = "login")] - Login(LoginCommand), - /// Publish a runbook to the cloud, allowing it to be called by other runbooks. - /// In order to package the runbook for publishing, it will be simulated, and thus requires all required inputs to be provided. - /// However, the published runbook will have the inputs removed. - #[clap(name = "publish", bin_name = "publish")] - Publish(PublishRunbook), -} - fn load_stdin() -> Option { if atty::is(Stream::Stdin) { return None; @@ -340,13 +285,12 @@ async fn handle_command( ctx: &Context, buffer_stdin: Option, ) -> Result<(), String> { - let env = TxtxEnv::load(); match opts.command { Command::Check(cmd) => { - runbooks::handle_check_command(&cmd, buffer_stdin, ctx, &env).await?; + runbooks::handle_check_command(&cmd, buffer_stdin, ctx).await?; } Command::Run(cmd) => { - runbooks::handle_run_command(&cmd, buffer_stdin, ctx, &env).await?; + runbooks::handle_run_command(&cmd, buffer_stdin, ctx).await?; } Command::List(cmd) => { runbooks::handle_list_command(&cmd, ctx).await?; @@ -369,29 +313,14 @@ async fn handle_command( Command::Lsp => { lsp::run_lsp().await?; } - #[cfg(feature = "txtx_serve")] - Command::Serve(cmd) => { - warn!( - ctx.expect_logger(), - "The command `txtx serve` is experimental and will run for 30 minutes." - ); - let addr = format!("{}:{}", cmd.network_binding_ip_address, cmd.network_binding_port); - let _ = txtx_serve::start_server(&addr).await.unwrap(); - ctrlc::set_handler(move || { - std::process::exit(1); - }) - .expect("Error setting Ctrl-C handler"); - // Consider making the duration configurable or running indefinitely - thread::sleep(std::time::Duration::new(1800, 0)); - } - Command::Cloud(cmd) => handle_cloud_commands(&cmd, buffer_stdin, &env).await?, } Ok(()) } fn handle_lint_command(cmd: &LintRunbook) -> Result<(), lint::LinterError> { // Parse CLI inputs from "key=value" strings - let cli_inputs: Vec<(String, String)> = cmd.inputs + let cli_inputs: Vec<(String, String)> = cmd + .inputs .iter() .filter_map(|input| { let parts: Vec<&str> = input.splitn(2, '=').collect(); @@ -403,10 +332,7 @@ fn handle_lint_command(cmd: &LintRunbook) -> Result<(), lint::LinterError> { }) .collect(); - let linter_options = lint::LinterOptions { - config_path: cmd.config.clone(), - init: cmd.init, - }; + let linter_options = lint::LinterOptions { config_path: cmd.config.clone(), init: cmd.init }; lint::run_lint( cmd.runbook.clone(), @@ -420,44 +346,6 @@ fn handle_lint_command(cmd: &LintRunbook) -> Result<(), lint::LinterError> { ) } -async fn handle_cloud_commands( - cmd: &CloudCommand, - buffer_stdin: Option, - env: &TxtxEnv, -) -> Result<(), String> { - match cmd { - CloudCommand::Login(cmd) => { - txtx_cloud::login::handle_login_command( - cmd, - &env.auth_service_url, - &env.auth_callback_port, - &env.id_service_url, - ) - .await - } - CloudCommand::Publish(cmd) => { - let (_manifest, _runbook_name, runbook, _runbook_state) = load_runbook_from_manifest( - &cmd.manifest_path, - &cmd.runbook, - &cmd.environment, - &cmd.inputs, - buffer_stdin, - env, - ) - .await?; - - txtx_cloud::publish::handle_publish_command( - cmd, - runbook, - &env.id_service_url, - &env.txtx_console_url, - &env.registry_gql_url, - ) - .await - } - } -} - pub fn get_env_var(key: &str, default: T) -> String { dotenv().ok(); std::env::var(key).unwrap_or(default.to_string()) diff --git a/crates/txtx-cli/src/cli/runbooks/mod.rs b/crates/txtx-cli/src/cli/runbooks/mod.rs index 4b5f89f9f..8398dca3e 100644 --- a/crates/txtx-cli/src/cli/runbooks/mod.rs +++ b/crates/txtx-cli/src/cli/runbooks/mod.rs @@ -1,4 +1,4 @@ -use super::{env::TxtxEnv, CheckRunbook, Context, CreateRunbook, ExecuteRunbook, ListRunbooks}; +use super::{CheckRunbook, Context, CreateRunbook, ExecuteRunbook, ListRunbooks}; use crate::{get_addon_by_namespace, get_available_addons}; use ascii_table::AsciiTable; use console::Style; @@ -15,7 +15,6 @@ use std::{ time::Duration, }; use tokio::sync::RwLock; -use txtx_cloud::router::TxtxAuthenticatedCloudServiceRouter; use txtx_core::{ kit::types::{commands::UnevaluatedInputsMap, stores::ValueStore}, mustache, @@ -67,7 +66,6 @@ use actix_web::dev::ServerHandle; #[cfg(feature = "supervisor_ui")] use txtx_gql::kit::types::frontend::SupervisorAddonData; - lazy_static::lazy_static! { static ref CLI_SPINNER_STYLE: ProgressStyle = { let style = ProgressStyle::with_template("{spinner} {msg}") @@ -169,7 +167,6 @@ pub async fn handle_check_command( cmd: &CheckRunbook, buffer_stdin: Option, _ctx: &Context, - env: &TxtxEnv, ) -> Result<(), String> { let (_manifest, _runbook_name, mut runbook, runbook_state) = load_runbook_from_manifest( &cmd.manifest_path, @@ -177,7 +174,6 @@ pub async fn handle_check_command( &cmd.environment, &cmd.inputs, buffer_stdin, - env, ) .await?; @@ -503,7 +499,6 @@ pub async fn handle_run_command( cmd: &ExecuteRunbook, buffer_stdin: Option, _ctx: &Context, - env: &TxtxEnv, ) -> Result<(), String> { let is_execution_unsupervised = cmd.unsupervised; @@ -527,7 +522,6 @@ pub async fn handle_run_command( &cmd.environment, &cmd.inputs, buffer_stdin.clone(), - env, ) .await; let (runbook_name, mut runbook, runbook_state_location) = match res { @@ -536,7 +530,7 @@ pub async fn handle_run_command( } Err(_) => { let (runbook_name, runbook) = - load_runbook_from_file_path(&cmd.runbook, &cmd.inputs, buffer_stdin, env).await?; + load_runbook_from_file_path(&cmd.runbook, &cmd.inputs, buffer_stdin).await?; (runbook_name, runbook, None) } }; @@ -935,7 +929,6 @@ pub async fn load_runbook_from_manifest( environment_selector: &Option, cli_inputs: &Vec, buffer_stdin: Option, - env: &TxtxEnv, ) -> Result<(WorkspaceManifest, String, Runbook, Option), String> { let manifest = load_workspace_manifest_from_manifest_path(manifest_path)?; let top_level_inputs_map = @@ -954,9 +947,7 @@ pub async fn load_runbook_from_manifest( let authorization_context = AuthorizationContext::new(manifest.location.clone().unwrap()); - let cloud_svc_context = CloudServiceContext::new(Some(Arc::new( - TxtxAuthenticatedCloudServiceRouter::new(&env.id_service_url), - ))); + let cloud_svc_context = CloudServiceContext::new(); let res = runbook .build_contexts_from_sources( @@ -983,7 +974,6 @@ pub async fn load_runbook_from_file_path( file_path: &str, cli_inputs: &Vec, buffer_stdin: Option, - env: &TxtxEnv, ) -> Result<(String, Runbook), String> { let location = FileLocation::from_path_string(file_path)?; let (runbook_name, mut runbook, runbook_sources) = @@ -995,9 +985,7 @@ pub async fn load_runbook_from_file_path( let authorization_context = AuthorizationContext::new(location); - let cloud_svc_context = CloudServiceContext::new(Some(Arc::new( - TxtxAuthenticatedCloudServiceRouter::new(&env.id_service_url), - ))); + let cloud_svc_context = CloudServiceContext::new(); let res = runbook .build_contexts_from_sources( diff --git a/crates/txtx-cloud/Cargo.toml b/crates/txtx-cloud/Cargo.toml deleted file mode 100644 index 2268d9275..000000000 --- a/crates/txtx-cloud/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "txtx-cloud" -description = "Crate for interacting with txtx Cloud Services" -version = "0.1.14" -edition = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -keywords = { workspace = true } -categories = { workspace = true } - - -[dependencies] -txtx-addon-kit = { workspace = true } -txtx-core = { workspace = true } -actix-cors = "0.7.0" -actix-web = "4" -ansi_term = "0.12.1" -atty = "0.2.14" -base64 = "0.22.1" -clap = { version = "4.4.6", features = ["derive"], optional = true } -dialoguer = "0.11.0" -dirs = "5.0.1" -graphql_client = "0.14.0" -hiro-system-kit = "0.3.1" -jsonwebtoken = "9.3.1" -open = "5.3.1" -serde = "1" -serde_json = "1" -serde_urlencoded = "0.7.1" -tokio = "1.37.0" -toml = { version = "0.8.2", features = ["preserve_order"], optional = true } - -[features] -default = ["cli"] -cli = ["clap", "toml", "hiro-system-kit/log"] - -[lib] -crate-type = ["lib", "cdylib"] diff --git a/crates/txtx-cloud/src/auth/jwt.rs b/crates/txtx-cloud/src/auth/jwt.rs deleted file mode 100644 index 8e3995cb9..000000000 --- a/crates/txtx-cloud/src/auth/jwt.rs +++ /dev/null @@ -1,79 +0,0 @@ -use jsonwebtoken::{decode, jwk::JwkSet, Algorithm, DecodingKey, Validation}; -use serde::{Deserialize, Deserializer}; -use txtx_addon_kit::reqwest::Client; - -const JWT_KEY_ID: &str = "id-svc-key-id"; - -pub struct JwtManager { - jwks: JwkSet, -} - -impl JwtManager { - pub fn new(jwks: JwkSet) -> Self { - Self { jwks } - } - - pub async fn initialize(id_service_url: &str) -> Result { - let client = Client::new(); - let url = format!("{}/.well-known/jwks.json", id_service_url); - let res = - client.get(&url).send().await.map_err(|e| format!("Unable to retrieve JWKS: {e}"))?; - let jwks = res.json::().await.map_err(|e| format!("Unable to parse JWKS: {e}"))?; - - Ok(Self { jwks }) - } - - pub fn decode_jwt(&self, token: &str, do_validate_time: bool) -> Result { - let jwk = self.jwks.find(JWT_KEY_ID).ok_or(format!("unable to load JWK"))?; - - let decoding_key = - DecodingKey::from_jwk(jwk).map_err(|e| format!("unable to load JWK: {}", e))?; - - let mut validation = Validation::new(Algorithm::RS256); - validation.validate_exp = do_validate_time; - validation.validate_nbf = do_validate_time; - - decode::(&token, &decoding_key, &validation) - .map_err(|e| format!("unable to validate JWT: {}", e)) - .map(|token_data| token_data.claims) - } -} - -#[derive(Debug, Deserialize)] -pub struct Claims { - pub exp: u64, - pub iat: u64, - pub iss: String, - pub sub: String, - #[serde(rename = "https://hasura.io/jwt/claims")] - pub hasura: HasuraClaims, -} - -#[derive(Debug, Deserialize)] -pub struct HasuraClaims { - #[serde(rename = "x-hasura-allowed-roles")] - pub allowed_roles: Vec, - #[serde(rename = "x-hasura-default-role")] - pub default_role: String, - #[serde(rename = "x-hasura-team-ids", deserialize_with = "deserialize_set_string")] - pub team_ids: Vec, - #[serde(rename = "x-hasura-user-id")] - pub user_id: String, - #[serde(rename = "x-hasura-user-is-anonymous")] - pub user_is_anonymous: String, -} - -pub fn deserialize_set_string<'de, D>(deserializer: D) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - let s = String::deserialize(deserializer)?; - let trimmed = s.trim_matches(|c| c == '{' || c == '}'); - Ok(trimmed - .split(',') - .map(|part| { - let part = part.trim_matches('"'); // remove optional double quotes - part.to_string() - }) - .collect()) -} diff --git a/crates/txtx-cloud/src/auth/mod.rs b/crates/txtx-cloud/src/auth/mod.rs deleted file mode 100644 index 72450c189..000000000 --- a/crates/txtx-cloud/src/auth/mod.rs +++ /dev/null @@ -1,163 +0,0 @@ -pub mod jwt; - -use serde::{Deserialize, Serialize}; -use std::io::{Read, Write}; -use txtx_core::kit::reqwest; - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct AuthConfig { - pub access_token: String, - pub exp: u64, - pub refresh_token: String, - pub pat: Option, - pub user: AuthUser, -} - -impl AuthConfig { - pub fn new( - access_token: String, - exp: u64, - refresh_token: String, - pat: Option, - user: AuthUser, - ) -> Self { - Self { access_token, exp, refresh_token, pat, user } - } - - async fn from_refresh_session_response( - id_service_url: &str, - RefreshSessionResponse { access_token, refresh_token, user }: &RefreshSessionResponse, - pat: &Option, - ) -> Result { - let jwt_manager = jwt::JwtManager::initialize(id_service_url) - .await - .map_err(|e| format!("Failed to initialize JWT manager: {}", e))?; - - let access_token_claims = jwt_manager - .decode_jwt(access_token, true) - .map_err(|e| format!("Failed to decode access token: {}", e))?; - - Ok(Self { - access_token: access_token.clone(), - exp: access_token_claims.exp, - refresh_token: refresh_token.clone(), - pat: pat.clone(), - user: user.clone(), - }) - } - - /// Write auth config to system data directory. - pub fn write_to_system_config(&self) -> Result<(), String> { - let data_dir = dirs::data_dir().ok_or("Failed to get system data directory")?; - - std::fs::create_dir_all(data_dir.join("txtx")) - .map_err(|e| format!("Failed to create data directory: {}", e))?; - - let path = data_dir.join("txtx/auth.toml"); - - let mut file = std::fs::File::create(&path) - .map_err(|e| format!("Failed to create config file: {}", e))?; - - let toml = toml::to_string(&self) - .map_err(|e| format!("Failed to serialize auth config: {}", e))?; - - file.write_all(toml.as_bytes()) - .map_err(|e| format!("Failed to write auth config: {}", e))?; - Ok(()) - } - - /// Read auth config from system data directory. - pub fn read_from_system_config() -> Result, String> { - let data_dir = dirs::data_dir().ok_or("Failed to get system data directory")?; - let path = data_dir.join("txtx/auth.toml"); - - if !path.exists() { - return Ok(None); - } - - let mut file = - std::fs::File::open(&path).map_err(|e| format!("Failed to open config file: {}", e))?; - let mut buf = String::new(); - - file.read_to_string(&mut buf).map_err(|e| format!("Failed to read config file: {}", e))?; - - let config = - toml::from_str(&buf).map_err(|e| format!("Failed to parse auth config file: {}", e))?; - Ok(Some(config)) - } - - pub async fn refresh_session_if_needed(&mut self, id_service_url: &str) -> Result<(), String> { - if self.is_access_token_expired() { - let refreshed_auth_config = self.get_refreshed_session(id_service_url).await.map_err(|e| { - format!("Failed to refresh session. Run `txtx cloud login` to log in again. Downstream error: {e}") - })?; - self.access_token = refreshed_auth_config.access_token; - self.exp = refreshed_auth_config.exp; - self.refresh_token = refreshed_auth_config.refresh_token; - self.write_to_system_config() - .map_err(|e| format!("Failed to write refreshed session to config: {}", e))?; - return Ok(()); - } - Ok(()) - } - - /// Get a new access token by sending a POST request to the auth service with the refresh token. - /// If the request is successful, the new auth config is written to the system config. - async fn get_refreshed_session(&self, id_service_url: &str) -> Result { - let client = reqwest::Client::new(); - let res = client - .post(&format!("{id_service_url}/token")) - .json(&serde_json::json!({ - "refreshToken": &self.refresh_token, - })) - .send() - .await - .map_err(|e| format!("Failed to send request to refresh session: {}", e))?; - - if res.status().is_success() { - let res = res - .json::() - .await - .map_err(|e| format!("Failed to parse response: {}", e))?; - - let auth_config = - AuthConfig::from_refresh_session_response(id_service_url, &res, &self.pat) - .await - .map_err(|e| format!("Failed to parse refresh session response: {e}"))?; - - auth_config - .write_to_system_config() - .map_err(|e| format!("Failed to write refreshed session to config: {}", e))?; - return Ok(auth_config); - } else { - let err = res.text().await.unwrap_or_else(|_| "Unknown error".to_string()); - return Err(format!("Received error from refresh session request: {}", err)); - } - } - - pub fn is_access_token_expired(&self) -> bool { - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("SystemTime before UNIX EPOCH") - .as_secs() as i64; - - self.exp < now as u64 - } -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct RefreshSessionResponse { - pub access_token: String, - pub refresh_token: String, - pub user: AuthUser, -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct AuthUser { - pub id: String, - pub email: Option, - pub display_name: String, -} diff --git a/crates/txtx-cloud/src/callback.html b/crates/txtx-cloud/src/callback.html deleted file mode 100644 index ffe3c4b35..000000000 --- a/crates/txtx-cloud/src/callback.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - Authentication Successful - - - -
-
-
-
-

Authentication successful

-

This tab can be closed and you can return to your Terminal

-
- - \ No newline at end of file diff --git a/crates/txtx-cloud/src/gql/fixtures/queries.graphql b/crates/txtx-cloud/src/gql/fixtures/queries.graphql deleted file mode 100644 index 7c299b38e..000000000 --- a/crates/txtx-cloud/src/gql/fixtures/queries.graphql +++ /dev/null @@ -1,28 +0,0 @@ -mutation InsertRunbooksOne( - $name:String!, - $description: String - $documentation: jsonb!, - $raw_runbook: jsonb!, - $read_permissions: permissions_obj_rel_insert_input!, - $update_permissions: permissions_obj_rel_insert_input!, - $delete_permissions: permissions_obj_rel_insert_input! -) { - insert_runbooks_one(object: { - name: $name, - description: $description, - documentation: $documentation, - raw_runbook: $raw_runbook, - permissionByReadPermissionsId: $read_permissions, - permissionByUpdatePermissionsId: $update_permissions, - permissionByDeletePermissionsId: $delete_permissions - }) { - id - } -} - -query OrgsForUser($user_id: uuid) { - organizations(where: {organization_users: { user_id: {_eq: $user_id}}}) { - id, - name - } -} diff --git a/crates/txtx-cloud/src/gql/fixtures/schema.graphql b/crates/txtx-cloud/src/gql/fixtures/schema.graphql deleted file mode 100644 index 10e1b829b..000000000 --- a/crates/txtx-cloud/src/gql/fixtures/schema.graphql +++ /dev/null @@ -1,10205 +0,0 @@ -schema { - query: query_root - mutation: mutation_root - subscription: subscription_root -} - -"""whether this query should be cached (Hasura Cloud only)""" -directive @cached( - """measured in seconds""" - ttl: Int! = 60 - - """refresh the cache entry""" - refresh: Boolean! = false -) on QUERY - -""" -Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. -""" -input Boolean_comparison_exp { - _eq: Boolean - _gt: Boolean - _gte: Boolean - _in: [Boolean!] - _is_null: Boolean - _lt: Boolean - _lte: Boolean - _neq: Boolean - _nin: [Boolean!] -} - -""" -Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. -""" -input Int_comparison_exp { - _eq: Int - _gt: Int - _gte: Int - _in: [Int!] - _is_null: Boolean - _lt: Int - _lte: Int - _neq: Int - _nin: [Int!] -} - -""" -Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. -""" -input String_comparison_exp { - _eq: String - _gt: String - _gte: String - - """does the column match the given case-insensitive pattern""" - _ilike: String - _in: [String!] - - """ - does the column match the given POSIX regular expression, case insensitive - """ - _iregex: String - _is_null: Boolean - - """does the column match the given pattern""" - _like: String - _lt: String - _lte: String - _neq: String - - """does the column NOT match the given case-insensitive pattern""" - _nilike: String - _nin: [String!] - - """ - does the column NOT match the given POSIX regular expression, case insensitive - """ - _niregex: String - - """does the column NOT match the given pattern""" - _nlike: String - - """ - does the column NOT match the given POSIX regular expression, case sensitive - """ - _nregex: String - - """does the column NOT match the given SQL regular expression""" - _nsimilar: String - - """ - does the column match the given POSIX regular expression, case sensitive - """ - _regex: String - - """does the column match the given SQL regular expression""" - _similar: String -} - -""" -Oauth requests, inserted before redirecting to the provider's site. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authProviderRequests { - id: uuid! - options( - """JSON select path""" - path: String - ): jsonb -} - -""" -aggregated selection of "auth.provider_requests" -""" -type authProviderRequests_aggregate { - aggregate: authProviderRequests_aggregate_fields - nodes: [authProviderRequests!]! -} - -""" -aggregate fields of "auth.provider_requests" -""" -type authProviderRequests_aggregate_fields { - count(columns: [authProviderRequests_select_column!], distinct: Boolean): Int! - max: authProviderRequests_max_fields - min: authProviderRequests_min_fields -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input authProviderRequests_append_input { - options: jsonb -} - -""" -Boolean expression to filter rows from the table "auth.provider_requests". All fields are combined with a logical 'AND'. -""" -input authProviderRequests_bool_exp { - _and: [authProviderRequests_bool_exp!] - _not: authProviderRequests_bool_exp - _or: [authProviderRequests_bool_exp!] - id: uuid_comparison_exp - options: jsonb_comparison_exp -} - -""" -unique or primary key constraints on table "auth.provider_requests" -""" -enum authProviderRequests_constraint { - """ - unique or primary key constraint on columns "id" - """ - provider_requests_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input authProviderRequests_delete_at_path_input { - options: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input authProviderRequests_delete_elem_input { - options: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input authProviderRequests_delete_key_input { - options: String -} - -""" -input type for inserting data into table "auth.provider_requests" -""" -input authProviderRequests_insert_input { - id: uuid - options: jsonb -} - -"""aggregate max on columns""" -type authProviderRequests_max_fields { - id: uuid -} - -"""aggregate min on columns""" -type authProviderRequests_min_fields { - id: uuid -} - -""" -response of any mutation on the table "auth.provider_requests" -""" -type authProviderRequests_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authProviderRequests!]! -} - -""" -on_conflict condition type for table "auth.provider_requests" -""" -input authProviderRequests_on_conflict { - constraint: authProviderRequests_constraint! - update_columns: [authProviderRequests_update_column!]! = [] - where: authProviderRequests_bool_exp -} - -"""Ordering options when selecting data from "auth.provider_requests".""" -input authProviderRequests_order_by { - id: order_by - options: order_by -} - -"""primary key columns input for table: auth.provider_requests""" -input authProviderRequests_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input authProviderRequests_prepend_input { - options: jsonb -} - -""" -select columns of table "auth.provider_requests" -""" -enum authProviderRequests_select_column { - """column name""" - id - - """column name""" - options -} - -""" -input type for updating data in table "auth.provider_requests" -""" -input authProviderRequests_set_input { - id: uuid - options: jsonb -} - -""" -Streaming cursor of the table "authProviderRequests" -""" -input authProviderRequests_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authProviderRequests_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authProviderRequests_stream_cursor_value_input { - id: uuid - options: jsonb -} - -""" -update columns of table "auth.provider_requests" -""" -enum authProviderRequests_update_column { - """column name""" - id - - """column name""" - options -} - -input authProviderRequests_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authProviderRequests_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authProviderRequests_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authProviderRequests_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authProviderRequests_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authProviderRequests_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authProviderRequests_set_input - - """filter the rows which have to be updated""" - where: authProviderRequests_bool_exp! -} - -""" -List of available Oauth providers. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authProviders { - id: String! - - """An array relationship""" - userProviders( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): [authUserProviders!]! - - """An aggregate relationship""" - userProviders_aggregate( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): authUserProviders_aggregate! -} - -""" -aggregated selection of "auth.providers" -""" -type authProviders_aggregate { - aggregate: authProviders_aggregate_fields - nodes: [authProviders!]! -} - -""" -aggregate fields of "auth.providers" -""" -type authProviders_aggregate_fields { - count(columns: [authProviders_select_column!], distinct: Boolean): Int! - max: authProviders_max_fields - min: authProviders_min_fields -} - -""" -Boolean expression to filter rows from the table "auth.providers". All fields are combined with a logical 'AND'. -""" -input authProviders_bool_exp { - _and: [authProviders_bool_exp!] - _not: authProviders_bool_exp - _or: [authProviders_bool_exp!] - id: String_comparison_exp - userProviders: authUserProviders_bool_exp - userProviders_aggregate: authUserProviders_aggregate_bool_exp -} - -""" -unique or primary key constraints on table "auth.providers" -""" -enum authProviders_constraint { - """ - unique or primary key constraint on columns "id" - """ - providers_pkey -} - -""" -input type for inserting data into table "auth.providers" -""" -input authProviders_insert_input { - id: String - userProviders: authUserProviders_arr_rel_insert_input -} - -"""aggregate max on columns""" -type authProviders_max_fields { - id: String -} - -"""aggregate min on columns""" -type authProviders_min_fields { - id: String -} - -""" -response of any mutation on the table "auth.providers" -""" -type authProviders_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authProviders!]! -} - -""" -input type for inserting object relation for remote table "auth.providers" -""" -input authProviders_obj_rel_insert_input { - data: authProviders_insert_input! - - """upsert condition""" - on_conflict: authProviders_on_conflict -} - -""" -on_conflict condition type for table "auth.providers" -""" -input authProviders_on_conflict { - constraint: authProviders_constraint! - update_columns: [authProviders_update_column!]! = [] - where: authProviders_bool_exp -} - -"""Ordering options when selecting data from "auth.providers".""" -input authProviders_order_by { - id: order_by - userProviders_aggregate: authUserProviders_aggregate_order_by -} - -"""primary key columns input for table: auth.providers""" -input authProviders_pk_columns_input { - id: String! -} - -""" -select columns of table "auth.providers" -""" -enum authProviders_select_column { - """column name""" - id -} - -""" -input type for updating data in table "auth.providers" -""" -input authProviders_set_input { - id: String -} - -""" -Streaming cursor of the table "authProviders" -""" -input authProviders_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authProviders_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authProviders_stream_cursor_value_input { - id: String -} - -""" -update columns of table "auth.providers" -""" -enum authProviders_update_column { - """column name""" - id -} - -input authProviders_updates { - """sets the columns of the filtered rows to the given values""" - _set: authProviders_set_input - - """filter the rows which have to be updated""" - where: authProviders_bool_exp! -} - -""" -columns and relationships of "auth.refresh_token_types" -""" -type authRefreshTokenTypes { - comment: String - - """An array relationship""" - refreshTokens( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): [authRefreshTokens!]! - - """An aggregate relationship""" - refreshTokens_aggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): authRefreshTokens_aggregate! - value: String! -} - -""" -aggregated selection of "auth.refresh_token_types" -""" -type authRefreshTokenTypes_aggregate { - aggregate: authRefreshTokenTypes_aggregate_fields - nodes: [authRefreshTokenTypes!]! -} - -""" -aggregate fields of "auth.refresh_token_types" -""" -type authRefreshTokenTypes_aggregate_fields { - count(columns: [authRefreshTokenTypes_select_column!], distinct: Boolean): Int! - max: authRefreshTokenTypes_max_fields - min: authRefreshTokenTypes_min_fields -} - -""" -Boolean expression to filter rows from the table "auth.refresh_token_types". All fields are combined with a logical 'AND'. -""" -input authRefreshTokenTypes_bool_exp { - _and: [authRefreshTokenTypes_bool_exp!] - _not: authRefreshTokenTypes_bool_exp - _or: [authRefreshTokenTypes_bool_exp!] - comment: String_comparison_exp - refreshTokens: authRefreshTokens_bool_exp - refreshTokens_aggregate: authRefreshTokens_aggregate_bool_exp - value: String_comparison_exp -} - -""" -unique or primary key constraints on table "auth.refresh_token_types" -""" -enum authRefreshTokenTypes_constraint { - """ - unique or primary key constraint on columns "value" - """ - refresh_token_types_pkey -} - -enum authRefreshTokenTypes_enum { - """Personal access token""" - pat - - """Regular refresh token""" - regular -} - -""" -Boolean expression to compare columns of type "authRefreshTokenTypes_enum". All fields are combined with logical 'AND'. -""" -input authRefreshTokenTypes_enum_comparison_exp { - _eq: authRefreshTokenTypes_enum - _in: [authRefreshTokenTypes_enum!] - _is_null: Boolean - _neq: authRefreshTokenTypes_enum - _nin: [authRefreshTokenTypes_enum!] -} - -""" -input type for inserting data into table "auth.refresh_token_types" -""" -input authRefreshTokenTypes_insert_input { - comment: String - refreshTokens: authRefreshTokens_arr_rel_insert_input - value: String -} - -"""aggregate max on columns""" -type authRefreshTokenTypes_max_fields { - comment: String - value: String -} - -"""aggregate min on columns""" -type authRefreshTokenTypes_min_fields { - comment: String - value: String -} - -""" -response of any mutation on the table "auth.refresh_token_types" -""" -type authRefreshTokenTypes_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authRefreshTokenTypes!]! -} - -""" -input type for inserting object relation for remote table "auth.refresh_token_types" -""" -input authRefreshTokenTypes_obj_rel_insert_input { - data: authRefreshTokenTypes_insert_input! - - """upsert condition""" - on_conflict: authRefreshTokenTypes_on_conflict -} - -""" -on_conflict condition type for table "auth.refresh_token_types" -""" -input authRefreshTokenTypes_on_conflict { - constraint: authRefreshTokenTypes_constraint! - update_columns: [authRefreshTokenTypes_update_column!]! = [] - where: authRefreshTokenTypes_bool_exp -} - -"""Ordering options when selecting data from "auth.refresh_token_types".""" -input authRefreshTokenTypes_order_by { - comment: order_by - refreshTokens_aggregate: authRefreshTokens_aggregate_order_by - value: order_by -} - -"""primary key columns input for table: auth.refresh_token_types""" -input authRefreshTokenTypes_pk_columns_input { - value: String! -} - -""" -select columns of table "auth.refresh_token_types" -""" -enum authRefreshTokenTypes_select_column { - """column name""" - comment - - """column name""" - value -} - -""" -input type for updating data in table "auth.refresh_token_types" -""" -input authRefreshTokenTypes_set_input { - comment: String - value: String -} - -""" -Streaming cursor of the table "authRefreshTokenTypes" -""" -input authRefreshTokenTypes_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authRefreshTokenTypes_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authRefreshTokenTypes_stream_cursor_value_input { - comment: String - value: String -} - -""" -update columns of table "auth.refresh_token_types" -""" -enum authRefreshTokenTypes_update_column { - """column name""" - comment - - """column name""" - value -} - -input authRefreshTokenTypes_updates { - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokenTypes_set_input - - """filter the rows which have to be updated""" - where: authRefreshTokenTypes_bool_exp! -} - -""" -User refresh tokens. Hasura auth uses them to rotate new access tokens as long as the refresh token is not expired. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authRefreshTokens { - createdAt: timestamptz! - expiresAt: timestamptz! - id: uuid! - metadata( - """JSON select path""" - path: String - ): jsonb - refreshTokenHash: String - - """An object relationship""" - refresh_token_type: authRefreshTokenTypes! - type: authRefreshTokenTypes_enum! - - """An object relationship""" - user: users! - userId: uuid! -} - -""" -aggregated selection of "auth.refresh_tokens" -""" -type authRefreshTokens_aggregate { - aggregate: authRefreshTokens_aggregate_fields - nodes: [authRefreshTokens!]! -} - -input authRefreshTokens_aggregate_bool_exp { - count: authRefreshTokens_aggregate_bool_exp_count -} - -input authRefreshTokens_aggregate_bool_exp_count { - arguments: [authRefreshTokens_select_column!] - distinct: Boolean - filter: authRefreshTokens_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "auth.refresh_tokens" -""" -type authRefreshTokens_aggregate_fields { - count(columns: [authRefreshTokens_select_column!], distinct: Boolean): Int! - max: authRefreshTokens_max_fields - min: authRefreshTokens_min_fields -} - -""" -order by aggregate values of table "auth.refresh_tokens" -""" -input authRefreshTokens_aggregate_order_by { - count: order_by - max: authRefreshTokens_max_order_by - min: authRefreshTokens_min_order_by -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input authRefreshTokens_append_input { - metadata: jsonb -} - -""" -input type for inserting array relation for remote table "auth.refresh_tokens" -""" -input authRefreshTokens_arr_rel_insert_input { - data: [authRefreshTokens_insert_input!]! - - """upsert condition""" - on_conflict: authRefreshTokens_on_conflict -} - -""" -Boolean expression to filter rows from the table "auth.refresh_tokens". All fields are combined with a logical 'AND'. -""" -input authRefreshTokens_bool_exp { - _and: [authRefreshTokens_bool_exp!] - _not: authRefreshTokens_bool_exp - _or: [authRefreshTokens_bool_exp!] - createdAt: timestamptz_comparison_exp - expiresAt: timestamptz_comparison_exp - id: uuid_comparison_exp - metadata: jsonb_comparison_exp - refreshTokenHash: String_comparison_exp - refresh_token_type: authRefreshTokenTypes_bool_exp - type: authRefreshTokenTypes_enum_comparison_exp - user: users_bool_exp - userId: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "auth.refresh_tokens" -""" -enum authRefreshTokens_constraint { - """ - unique or primary key constraint on columns "id" - """ - refresh_tokens_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input authRefreshTokens_delete_at_path_input { - metadata: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input authRefreshTokens_delete_elem_input { - metadata: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input authRefreshTokens_delete_key_input { - metadata: String -} - -""" -input type for inserting data into table "auth.refresh_tokens" -""" -input authRefreshTokens_insert_input { - createdAt: timestamptz - expiresAt: timestamptz - id: uuid - metadata: jsonb - refreshTokenHash: String - refresh_token_type: authRefreshTokenTypes_obj_rel_insert_input - type: authRefreshTokenTypes_enum - user: users_obj_rel_insert_input - userId: uuid -} - -"""aggregate max on columns""" -type authRefreshTokens_max_fields { - createdAt: timestamptz - expiresAt: timestamptz - id: uuid - refreshTokenHash: String - userId: uuid -} - -""" -order by max() on columns of table "auth.refresh_tokens" -""" -input authRefreshTokens_max_order_by { - createdAt: order_by - expiresAt: order_by - id: order_by - refreshTokenHash: order_by - userId: order_by -} - -"""aggregate min on columns""" -type authRefreshTokens_min_fields { - createdAt: timestamptz - expiresAt: timestamptz - id: uuid - refreshTokenHash: String - userId: uuid -} - -""" -order by min() on columns of table "auth.refresh_tokens" -""" -input authRefreshTokens_min_order_by { - createdAt: order_by - expiresAt: order_by - id: order_by - refreshTokenHash: order_by - userId: order_by -} - -""" -response of any mutation on the table "auth.refresh_tokens" -""" -type authRefreshTokens_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authRefreshTokens!]! -} - -""" -on_conflict condition type for table "auth.refresh_tokens" -""" -input authRefreshTokens_on_conflict { - constraint: authRefreshTokens_constraint! - update_columns: [authRefreshTokens_update_column!]! = [] - where: authRefreshTokens_bool_exp -} - -"""Ordering options when selecting data from "auth.refresh_tokens".""" -input authRefreshTokens_order_by { - createdAt: order_by - expiresAt: order_by - id: order_by - metadata: order_by - refreshTokenHash: order_by - refresh_token_type: authRefreshTokenTypes_order_by - type: order_by - user: users_order_by - userId: order_by -} - -"""primary key columns input for table: auth.refresh_tokens""" -input authRefreshTokens_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input authRefreshTokens_prepend_input { - metadata: jsonb -} - -""" -select columns of table "auth.refresh_tokens" -""" -enum authRefreshTokens_select_column { - """column name""" - createdAt - - """column name""" - expiresAt - - """column name""" - id - - """column name""" - metadata - - """column name""" - refreshTokenHash - - """column name""" - type - - """column name""" - userId -} - -""" -input type for updating data in table "auth.refresh_tokens" -""" -input authRefreshTokens_set_input { - createdAt: timestamptz - expiresAt: timestamptz - id: uuid - metadata: jsonb - refreshTokenHash: String - type: authRefreshTokenTypes_enum - userId: uuid -} - -""" -Streaming cursor of the table "authRefreshTokens" -""" -input authRefreshTokens_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authRefreshTokens_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authRefreshTokens_stream_cursor_value_input { - createdAt: timestamptz - expiresAt: timestamptz - id: uuid - metadata: jsonb - refreshTokenHash: String - type: authRefreshTokenTypes_enum - userId: uuid -} - -""" -update columns of table "auth.refresh_tokens" -""" -enum authRefreshTokens_update_column { - """column name""" - createdAt - - """column name""" - expiresAt - - """column name""" - id - - """column name""" - metadata - - """column name""" - refreshTokenHash - - """column name""" - type - - """column name""" - userId -} - -input authRefreshTokens_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authRefreshTokens_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authRefreshTokens_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authRefreshTokens_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authRefreshTokens_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authRefreshTokens_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokens_set_input - - """filter the rows which have to be updated""" - where: authRefreshTokens_bool_exp! -} - -""" -Persistent Hasura roles for users. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authRoles { - role: String! - - """An array relationship""" - userRoles( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): [authUserRoles!]! - - """An aggregate relationship""" - userRoles_aggregate( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): authUserRoles_aggregate! - - """An array relationship""" - usersByDefaultRole( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): [users!]! - - """An aggregate relationship""" - usersByDefaultRole_aggregate( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): users_aggregate! -} - -""" -aggregated selection of "auth.roles" -""" -type authRoles_aggregate { - aggregate: authRoles_aggregate_fields - nodes: [authRoles!]! -} - -""" -aggregate fields of "auth.roles" -""" -type authRoles_aggregate_fields { - count(columns: [authRoles_select_column!], distinct: Boolean): Int! - max: authRoles_max_fields - min: authRoles_min_fields -} - -""" -Boolean expression to filter rows from the table "auth.roles". All fields are combined with a logical 'AND'. -""" -input authRoles_bool_exp { - _and: [authRoles_bool_exp!] - _not: authRoles_bool_exp - _or: [authRoles_bool_exp!] - role: String_comparison_exp - userRoles: authUserRoles_bool_exp - userRoles_aggregate: authUserRoles_aggregate_bool_exp - usersByDefaultRole: users_bool_exp - usersByDefaultRole_aggregate: users_aggregate_bool_exp -} - -""" -unique or primary key constraints on table "auth.roles" -""" -enum authRoles_constraint { - """ - unique or primary key constraint on columns "role" - """ - roles_pkey -} - -""" -input type for inserting data into table "auth.roles" -""" -input authRoles_insert_input { - role: String - userRoles: authUserRoles_arr_rel_insert_input - usersByDefaultRole: users_arr_rel_insert_input -} - -"""aggregate max on columns""" -type authRoles_max_fields { - role: String -} - -"""aggregate min on columns""" -type authRoles_min_fields { - role: String -} - -""" -response of any mutation on the table "auth.roles" -""" -type authRoles_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authRoles!]! -} - -""" -input type for inserting object relation for remote table "auth.roles" -""" -input authRoles_obj_rel_insert_input { - data: authRoles_insert_input! - - """upsert condition""" - on_conflict: authRoles_on_conflict -} - -""" -on_conflict condition type for table "auth.roles" -""" -input authRoles_on_conflict { - constraint: authRoles_constraint! - update_columns: [authRoles_update_column!]! = [] - where: authRoles_bool_exp -} - -"""Ordering options when selecting data from "auth.roles".""" -input authRoles_order_by { - role: order_by - userRoles_aggregate: authUserRoles_aggregate_order_by - usersByDefaultRole_aggregate: users_aggregate_order_by -} - -"""primary key columns input for table: auth.roles""" -input authRoles_pk_columns_input { - role: String! -} - -""" -select columns of table "auth.roles" -""" -enum authRoles_select_column { - """column name""" - role -} - -""" -input type for updating data in table "auth.roles" -""" -input authRoles_set_input { - role: String -} - -""" -Streaming cursor of the table "authRoles" -""" -input authRoles_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authRoles_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authRoles_stream_cursor_value_input { - role: String -} - -""" -update columns of table "auth.roles" -""" -enum authRoles_update_column { - """column name""" - role -} - -input authRoles_updates { - """sets the columns of the filtered rows to the given values""" - _set: authRoles_set_input - - """filter the rows which have to be updated""" - where: authRoles_bool_exp! -} - -""" -Active providers for a given user. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authUserProviders { - accessToken: String! - createdAt: timestamptz! - id: uuid! - - """An object relationship""" - provider: authProviders! - providerId: String! - providerUserId: String! - refreshToken: String - updatedAt: timestamptz! - - """An object relationship""" - user: users! - userId: uuid! -} - -""" -aggregated selection of "auth.user_providers" -""" -type authUserProviders_aggregate { - aggregate: authUserProviders_aggregate_fields - nodes: [authUserProviders!]! -} - -input authUserProviders_aggregate_bool_exp { - count: authUserProviders_aggregate_bool_exp_count -} - -input authUserProviders_aggregate_bool_exp_count { - arguments: [authUserProviders_select_column!] - distinct: Boolean - filter: authUserProviders_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "auth.user_providers" -""" -type authUserProviders_aggregate_fields { - count(columns: [authUserProviders_select_column!], distinct: Boolean): Int! - max: authUserProviders_max_fields - min: authUserProviders_min_fields -} - -""" -order by aggregate values of table "auth.user_providers" -""" -input authUserProviders_aggregate_order_by { - count: order_by - max: authUserProviders_max_order_by - min: authUserProviders_min_order_by -} - -""" -input type for inserting array relation for remote table "auth.user_providers" -""" -input authUserProviders_arr_rel_insert_input { - data: [authUserProviders_insert_input!]! - - """upsert condition""" - on_conflict: authUserProviders_on_conflict -} - -""" -Boolean expression to filter rows from the table "auth.user_providers". All fields are combined with a logical 'AND'. -""" -input authUserProviders_bool_exp { - _and: [authUserProviders_bool_exp!] - _not: authUserProviders_bool_exp - _or: [authUserProviders_bool_exp!] - accessToken: String_comparison_exp - createdAt: timestamptz_comparison_exp - id: uuid_comparison_exp - provider: authProviders_bool_exp - providerId: String_comparison_exp - providerUserId: String_comparison_exp - refreshToken: String_comparison_exp - updatedAt: timestamptz_comparison_exp - user: users_bool_exp - userId: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "auth.user_providers" -""" -enum authUserProviders_constraint { - """ - unique or primary key constraint on columns "id" - """ - user_providers_pkey - - """ - unique or primary key constraint on columns "provider_user_id", "provider_id" - """ - user_providers_provider_id_provider_user_id_key - - """ - unique or primary key constraint on columns "user_id", "provider_id" - """ - user_providers_user_id_provider_id_key -} - -""" -input type for inserting data into table "auth.user_providers" -""" -input authUserProviders_insert_input { - accessToken: String - createdAt: timestamptz - id: uuid - provider: authProviders_obj_rel_insert_input - providerId: String - providerUserId: String - refreshToken: String - updatedAt: timestamptz - user: users_obj_rel_insert_input - userId: uuid -} - -"""aggregate max on columns""" -type authUserProviders_max_fields { - accessToken: String - createdAt: timestamptz - id: uuid - providerId: String - providerUserId: String - refreshToken: String - updatedAt: timestamptz - userId: uuid -} - -""" -order by max() on columns of table "auth.user_providers" -""" -input authUserProviders_max_order_by { - accessToken: order_by - createdAt: order_by - id: order_by - providerId: order_by - providerUserId: order_by - refreshToken: order_by - updatedAt: order_by - userId: order_by -} - -"""aggregate min on columns""" -type authUserProviders_min_fields { - accessToken: String - createdAt: timestamptz - id: uuid - providerId: String - providerUserId: String - refreshToken: String - updatedAt: timestamptz - userId: uuid -} - -""" -order by min() on columns of table "auth.user_providers" -""" -input authUserProviders_min_order_by { - accessToken: order_by - createdAt: order_by - id: order_by - providerId: order_by - providerUserId: order_by - refreshToken: order_by - updatedAt: order_by - userId: order_by -} - -""" -response of any mutation on the table "auth.user_providers" -""" -type authUserProviders_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authUserProviders!]! -} - -""" -on_conflict condition type for table "auth.user_providers" -""" -input authUserProviders_on_conflict { - constraint: authUserProviders_constraint! - update_columns: [authUserProviders_update_column!]! = [] - where: authUserProviders_bool_exp -} - -"""Ordering options when selecting data from "auth.user_providers".""" -input authUserProviders_order_by { - accessToken: order_by - createdAt: order_by - id: order_by - provider: authProviders_order_by - providerId: order_by - providerUserId: order_by - refreshToken: order_by - updatedAt: order_by - user: users_order_by - userId: order_by -} - -"""primary key columns input for table: auth.user_providers""" -input authUserProviders_pk_columns_input { - id: uuid! -} - -""" -select columns of table "auth.user_providers" -""" -enum authUserProviders_select_column { - """column name""" - accessToken - - """column name""" - createdAt - - """column name""" - id - - """column name""" - providerId - - """column name""" - providerUserId - - """column name""" - refreshToken - - """column name""" - updatedAt - - """column name""" - userId -} - -""" -input type for updating data in table "auth.user_providers" -""" -input authUserProviders_set_input { - accessToken: String - createdAt: timestamptz - id: uuid - providerId: String - providerUserId: String - refreshToken: String - updatedAt: timestamptz - userId: uuid -} - -""" -Streaming cursor of the table "authUserProviders" -""" -input authUserProviders_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authUserProviders_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authUserProviders_stream_cursor_value_input { - accessToken: String - createdAt: timestamptz - id: uuid - providerId: String - providerUserId: String - refreshToken: String - updatedAt: timestamptz - userId: uuid -} - -""" -update columns of table "auth.user_providers" -""" -enum authUserProviders_update_column { - """column name""" - accessToken - - """column name""" - createdAt - - """column name""" - id - - """column name""" - providerId - - """column name""" - providerUserId - - """column name""" - refreshToken - - """column name""" - updatedAt - - """column name""" - userId -} - -input authUserProviders_updates { - """sets the columns of the filtered rows to the given values""" - _set: authUserProviders_set_input - - """filter the rows which have to be updated""" - where: authUserProviders_bool_exp! -} - -""" -Roles of users. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authUserRoles { - createdAt: timestamptz! - id: uuid! - role: String! - - """An object relationship""" - roleByRole: authRoles! - - """An object relationship""" - user: users! - userId: uuid! -} - -""" -aggregated selection of "auth.user_roles" -""" -type authUserRoles_aggregate { - aggregate: authUserRoles_aggregate_fields - nodes: [authUserRoles!]! -} - -input authUserRoles_aggregate_bool_exp { - count: authUserRoles_aggregate_bool_exp_count -} - -input authUserRoles_aggregate_bool_exp_count { - arguments: [authUserRoles_select_column!] - distinct: Boolean - filter: authUserRoles_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "auth.user_roles" -""" -type authUserRoles_aggregate_fields { - count(columns: [authUserRoles_select_column!], distinct: Boolean): Int! - max: authUserRoles_max_fields - min: authUserRoles_min_fields -} - -""" -order by aggregate values of table "auth.user_roles" -""" -input authUserRoles_aggregate_order_by { - count: order_by - max: authUserRoles_max_order_by - min: authUserRoles_min_order_by -} - -""" -input type for inserting array relation for remote table "auth.user_roles" -""" -input authUserRoles_arr_rel_insert_input { - data: [authUserRoles_insert_input!]! - - """upsert condition""" - on_conflict: authUserRoles_on_conflict -} - -""" -Boolean expression to filter rows from the table "auth.user_roles". All fields are combined with a logical 'AND'. -""" -input authUserRoles_bool_exp { - _and: [authUserRoles_bool_exp!] - _not: authUserRoles_bool_exp - _or: [authUserRoles_bool_exp!] - createdAt: timestamptz_comparison_exp - id: uuid_comparison_exp - role: String_comparison_exp - roleByRole: authRoles_bool_exp - user: users_bool_exp - userId: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "auth.user_roles" -""" -enum authUserRoles_constraint { - """ - unique or primary key constraint on columns "id" - """ - user_roles_pkey - - """ - unique or primary key constraint on columns "user_id", "role" - """ - user_roles_user_id_role_key -} - -""" -input type for inserting data into table "auth.user_roles" -""" -input authUserRoles_insert_input { - createdAt: timestamptz - id: uuid - role: String - roleByRole: authRoles_obj_rel_insert_input - user: users_obj_rel_insert_input - userId: uuid -} - -"""aggregate max on columns""" -type authUserRoles_max_fields { - createdAt: timestamptz - id: uuid - role: String - userId: uuid -} - -""" -order by max() on columns of table "auth.user_roles" -""" -input authUserRoles_max_order_by { - createdAt: order_by - id: order_by - role: order_by - userId: order_by -} - -"""aggregate min on columns""" -type authUserRoles_min_fields { - createdAt: timestamptz - id: uuid - role: String - userId: uuid -} - -""" -order by min() on columns of table "auth.user_roles" -""" -input authUserRoles_min_order_by { - createdAt: order_by - id: order_by - role: order_by - userId: order_by -} - -""" -response of any mutation on the table "auth.user_roles" -""" -type authUserRoles_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authUserRoles!]! -} - -""" -on_conflict condition type for table "auth.user_roles" -""" -input authUserRoles_on_conflict { - constraint: authUserRoles_constraint! - update_columns: [authUserRoles_update_column!]! = [] - where: authUserRoles_bool_exp -} - -"""Ordering options when selecting data from "auth.user_roles".""" -input authUserRoles_order_by { - createdAt: order_by - id: order_by - role: order_by - roleByRole: authRoles_order_by - user: users_order_by - userId: order_by -} - -"""primary key columns input for table: auth.user_roles""" -input authUserRoles_pk_columns_input { - id: uuid! -} - -""" -select columns of table "auth.user_roles" -""" -enum authUserRoles_select_column { - """column name""" - createdAt - - """column name""" - id - - """column name""" - role - - """column name""" - userId -} - -""" -input type for updating data in table "auth.user_roles" -""" -input authUserRoles_set_input { - createdAt: timestamptz - id: uuid - role: String - userId: uuid -} - -""" -Streaming cursor of the table "authUserRoles" -""" -input authUserRoles_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authUserRoles_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authUserRoles_stream_cursor_value_input { - createdAt: timestamptz - id: uuid - role: String - userId: uuid -} - -""" -update columns of table "auth.user_roles" -""" -enum authUserRoles_update_column { - """column name""" - createdAt - - """column name""" - id - - """column name""" - role - - """column name""" - userId -} - -input authUserRoles_updates { - """sets the columns of the filtered rows to the given values""" - _set: authUserRoles_set_input - - """filter the rows which have to be updated""" - where: authUserRoles_bool_exp! -} - -""" -User webauthn security keys. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type authUserSecurityKeys { - counter: bigint! - credentialId: String! - credentialPublicKey: bytea - id: uuid! - nickname: String - transports: String! - - """An object relationship""" - user: users! - userId: uuid! -} - -""" -aggregated selection of "auth.user_security_keys" -""" -type authUserSecurityKeys_aggregate { - aggregate: authUserSecurityKeys_aggregate_fields - nodes: [authUserSecurityKeys!]! -} - -input authUserSecurityKeys_aggregate_bool_exp { - count: authUserSecurityKeys_aggregate_bool_exp_count -} - -input authUserSecurityKeys_aggregate_bool_exp_count { - arguments: [authUserSecurityKeys_select_column!] - distinct: Boolean - filter: authUserSecurityKeys_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "auth.user_security_keys" -""" -type authUserSecurityKeys_aggregate_fields { - avg: authUserSecurityKeys_avg_fields - count(columns: [authUserSecurityKeys_select_column!], distinct: Boolean): Int! - max: authUserSecurityKeys_max_fields - min: authUserSecurityKeys_min_fields - stddev: authUserSecurityKeys_stddev_fields - stddev_pop: authUserSecurityKeys_stddev_pop_fields - stddev_samp: authUserSecurityKeys_stddev_samp_fields - sum: authUserSecurityKeys_sum_fields - var_pop: authUserSecurityKeys_var_pop_fields - var_samp: authUserSecurityKeys_var_samp_fields - variance: authUserSecurityKeys_variance_fields -} - -""" -order by aggregate values of table "auth.user_security_keys" -""" -input authUserSecurityKeys_aggregate_order_by { - avg: authUserSecurityKeys_avg_order_by - count: order_by - max: authUserSecurityKeys_max_order_by - min: authUserSecurityKeys_min_order_by - stddev: authUserSecurityKeys_stddev_order_by - stddev_pop: authUserSecurityKeys_stddev_pop_order_by - stddev_samp: authUserSecurityKeys_stddev_samp_order_by - sum: authUserSecurityKeys_sum_order_by - var_pop: authUserSecurityKeys_var_pop_order_by - var_samp: authUserSecurityKeys_var_samp_order_by - variance: authUserSecurityKeys_variance_order_by -} - -""" -input type for inserting array relation for remote table "auth.user_security_keys" -""" -input authUserSecurityKeys_arr_rel_insert_input { - data: [authUserSecurityKeys_insert_input!]! - - """upsert condition""" - on_conflict: authUserSecurityKeys_on_conflict -} - -"""aggregate avg on columns""" -type authUserSecurityKeys_avg_fields { - counter: Float -} - -""" -order by avg() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_avg_order_by { - counter: order_by -} - -""" -Boolean expression to filter rows from the table "auth.user_security_keys". All fields are combined with a logical 'AND'. -""" -input authUserSecurityKeys_bool_exp { - _and: [authUserSecurityKeys_bool_exp!] - _not: authUserSecurityKeys_bool_exp - _or: [authUserSecurityKeys_bool_exp!] - counter: bigint_comparison_exp - credentialId: String_comparison_exp - credentialPublicKey: bytea_comparison_exp - id: uuid_comparison_exp - nickname: String_comparison_exp - transports: String_comparison_exp - user: users_bool_exp - userId: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "auth.user_security_keys" -""" -enum authUserSecurityKeys_constraint { - """ - unique or primary key constraint on columns "credential_id" - """ - user_security_key_credential_id_key - - """ - unique or primary key constraint on columns "id" - """ - user_security_keys_pkey -} - -""" -input type for incrementing numeric columns in table "auth.user_security_keys" -""" -input authUserSecurityKeys_inc_input { - counter: bigint -} - -""" -input type for inserting data into table "auth.user_security_keys" -""" -input authUserSecurityKeys_insert_input { - counter: bigint - credentialId: String - credentialPublicKey: bytea - id: uuid - nickname: String - transports: String - user: users_obj_rel_insert_input - userId: uuid -} - -"""aggregate max on columns""" -type authUserSecurityKeys_max_fields { - counter: bigint - credentialId: String - id: uuid - nickname: String - transports: String - userId: uuid -} - -""" -order by max() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_max_order_by { - counter: order_by - credentialId: order_by - id: order_by - nickname: order_by - transports: order_by - userId: order_by -} - -"""aggregate min on columns""" -type authUserSecurityKeys_min_fields { - counter: bigint - credentialId: String - id: uuid - nickname: String - transports: String - userId: uuid -} - -""" -order by min() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_min_order_by { - counter: order_by - credentialId: order_by - id: order_by - nickname: order_by - transports: order_by - userId: order_by -} - -""" -response of any mutation on the table "auth.user_security_keys" -""" -type authUserSecurityKeys_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [authUserSecurityKeys!]! -} - -""" -on_conflict condition type for table "auth.user_security_keys" -""" -input authUserSecurityKeys_on_conflict { - constraint: authUserSecurityKeys_constraint! - update_columns: [authUserSecurityKeys_update_column!]! = [] - where: authUserSecurityKeys_bool_exp -} - -"""Ordering options when selecting data from "auth.user_security_keys".""" -input authUserSecurityKeys_order_by { - counter: order_by - credentialId: order_by - credentialPublicKey: order_by - id: order_by - nickname: order_by - transports: order_by - user: users_order_by - userId: order_by -} - -"""primary key columns input for table: auth.user_security_keys""" -input authUserSecurityKeys_pk_columns_input { - id: uuid! -} - -""" -select columns of table "auth.user_security_keys" -""" -enum authUserSecurityKeys_select_column { - """column name""" - counter - - """column name""" - credentialId - - """column name""" - credentialPublicKey - - """column name""" - id - - """column name""" - nickname - - """column name""" - transports - - """column name""" - userId -} - -""" -input type for updating data in table "auth.user_security_keys" -""" -input authUserSecurityKeys_set_input { - counter: bigint - credentialId: String - credentialPublicKey: bytea - id: uuid - nickname: String - transports: String - userId: uuid -} - -"""aggregate stddev on columns""" -type authUserSecurityKeys_stddev_fields { - counter: Float -} - -""" -order by stddev() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_stddev_order_by { - counter: order_by -} - -"""aggregate stddev_pop on columns""" -type authUserSecurityKeys_stddev_pop_fields { - counter: Float -} - -""" -order by stddev_pop() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_stddev_pop_order_by { - counter: order_by -} - -"""aggregate stddev_samp on columns""" -type authUserSecurityKeys_stddev_samp_fields { - counter: Float -} - -""" -order by stddev_samp() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_stddev_samp_order_by { - counter: order_by -} - -""" -Streaming cursor of the table "authUserSecurityKeys" -""" -input authUserSecurityKeys_stream_cursor_input { - """Stream column input with initial value""" - initial_value: authUserSecurityKeys_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input authUserSecurityKeys_stream_cursor_value_input { - counter: bigint - credentialId: String - credentialPublicKey: bytea - id: uuid - nickname: String - transports: String - userId: uuid -} - -"""aggregate sum on columns""" -type authUserSecurityKeys_sum_fields { - counter: bigint -} - -""" -order by sum() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_sum_order_by { - counter: order_by -} - -""" -update columns of table "auth.user_security_keys" -""" -enum authUserSecurityKeys_update_column { - """column name""" - counter - - """column name""" - credentialId - - """column name""" - credentialPublicKey - - """column name""" - id - - """column name""" - nickname - - """column name""" - transports - - """column name""" - userId -} - -input authUserSecurityKeys_updates { - """increments the numeric columns with given value of the filtered values""" - _inc: authUserSecurityKeys_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: authUserSecurityKeys_set_input - - """filter the rows which have to be updated""" - where: authUserSecurityKeys_bool_exp! -} - -"""aggregate var_pop on columns""" -type authUserSecurityKeys_var_pop_fields { - counter: Float -} - -""" -order by var_pop() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_var_pop_order_by { - counter: order_by -} - -"""aggregate var_samp on columns""" -type authUserSecurityKeys_var_samp_fields { - counter: Float -} - -""" -order by var_samp() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_var_samp_order_by { - counter: order_by -} - -"""aggregate variance on columns""" -type authUserSecurityKeys_variance_fields { - counter: Float -} - -""" -order by variance() on columns of table "auth.user_security_keys" -""" -input authUserSecurityKeys_variance_order_by { - counter: order_by -} - -scalar bigint - -""" -Boolean expression to compare columns of type "bigint". All fields are combined with logical 'AND'. -""" -input bigint_comparison_exp { - _eq: bigint - _gt: bigint - _gte: bigint - _in: [bigint!] - _is_null: Boolean - _lt: bigint - _lte: bigint - _neq: bigint - _nin: [bigint!] -} - -""" -columns and relationships of "storage.buckets" -""" -type buckets { - cacheControl: String - createdAt: timestamptz! - downloadExpiration: Int! - - """An array relationship""" - files( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): [files!]! - - """An aggregate relationship""" - files_aggregate( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): files_aggregate! - id: String! - maxUploadFileSize: Int! - minUploadFileSize: Int! - presignedUrlsEnabled: Boolean! - updatedAt: timestamptz! -} - -""" -aggregated selection of "storage.buckets" -""" -type buckets_aggregate { - aggregate: buckets_aggregate_fields - nodes: [buckets!]! -} - -""" -aggregate fields of "storage.buckets" -""" -type buckets_aggregate_fields { - avg: buckets_avg_fields - count(columns: [buckets_select_column!], distinct: Boolean): Int! - max: buckets_max_fields - min: buckets_min_fields - stddev: buckets_stddev_fields - stddev_pop: buckets_stddev_pop_fields - stddev_samp: buckets_stddev_samp_fields - sum: buckets_sum_fields - var_pop: buckets_var_pop_fields - var_samp: buckets_var_samp_fields - variance: buckets_variance_fields -} - -"""aggregate avg on columns""" -type buckets_avg_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -""" -Boolean expression to filter rows from the table "storage.buckets". All fields are combined with a logical 'AND'. -""" -input buckets_bool_exp { - _and: [buckets_bool_exp!] - _not: buckets_bool_exp - _or: [buckets_bool_exp!] - cacheControl: String_comparison_exp - createdAt: timestamptz_comparison_exp - downloadExpiration: Int_comparison_exp - files: files_bool_exp - files_aggregate: files_aggregate_bool_exp - id: String_comparison_exp - maxUploadFileSize: Int_comparison_exp - minUploadFileSize: Int_comparison_exp - presignedUrlsEnabled: Boolean_comparison_exp - updatedAt: timestamptz_comparison_exp -} - -""" -unique or primary key constraints on table "storage.buckets" -""" -enum buckets_constraint { - """ - unique or primary key constraint on columns "id" - """ - buckets_pkey -} - -""" -input type for incrementing numeric columns in table "storage.buckets" -""" -input buckets_inc_input { - downloadExpiration: Int - maxUploadFileSize: Int - minUploadFileSize: Int -} - -""" -input type for inserting data into table "storage.buckets" -""" -input buckets_insert_input { - cacheControl: String - createdAt: timestamptz - downloadExpiration: Int - files: files_arr_rel_insert_input - id: String - maxUploadFileSize: Int - minUploadFileSize: Int - presignedUrlsEnabled: Boolean - updatedAt: timestamptz -} - -"""aggregate max on columns""" -type buckets_max_fields { - cacheControl: String - createdAt: timestamptz - downloadExpiration: Int - id: String - maxUploadFileSize: Int - minUploadFileSize: Int - updatedAt: timestamptz -} - -"""aggregate min on columns""" -type buckets_min_fields { - cacheControl: String - createdAt: timestamptz - downloadExpiration: Int - id: String - maxUploadFileSize: Int - minUploadFileSize: Int - updatedAt: timestamptz -} - -""" -response of any mutation on the table "storage.buckets" -""" -type buckets_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [buckets!]! -} - -""" -input type for inserting object relation for remote table "storage.buckets" -""" -input buckets_obj_rel_insert_input { - data: buckets_insert_input! - - """upsert condition""" - on_conflict: buckets_on_conflict -} - -""" -on_conflict condition type for table "storage.buckets" -""" -input buckets_on_conflict { - constraint: buckets_constraint! - update_columns: [buckets_update_column!]! = [] - where: buckets_bool_exp -} - -"""Ordering options when selecting data from "storage.buckets".""" -input buckets_order_by { - cacheControl: order_by - createdAt: order_by - downloadExpiration: order_by - files_aggregate: files_aggregate_order_by - id: order_by - maxUploadFileSize: order_by - minUploadFileSize: order_by - presignedUrlsEnabled: order_by - updatedAt: order_by -} - -"""primary key columns input for table: storage.buckets""" -input buckets_pk_columns_input { - id: String! -} - -""" -select columns of table "storage.buckets" -""" -enum buckets_select_column { - """column name""" - cacheControl - - """column name""" - createdAt - - """column name""" - downloadExpiration - - """column name""" - id - - """column name""" - maxUploadFileSize - - """column name""" - minUploadFileSize - - """column name""" - presignedUrlsEnabled - - """column name""" - updatedAt -} - -""" -input type for updating data in table "storage.buckets" -""" -input buckets_set_input { - cacheControl: String - createdAt: timestamptz - downloadExpiration: Int - id: String - maxUploadFileSize: Int - minUploadFileSize: Int - presignedUrlsEnabled: Boolean - updatedAt: timestamptz -} - -"""aggregate stddev on columns""" -type buckets_stddev_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -"""aggregate stddev_pop on columns""" -type buckets_stddev_pop_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -"""aggregate stddev_samp on columns""" -type buckets_stddev_samp_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -""" -Streaming cursor of the table "buckets" -""" -input buckets_stream_cursor_input { - """Stream column input with initial value""" - initial_value: buckets_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input buckets_stream_cursor_value_input { - cacheControl: String - createdAt: timestamptz - downloadExpiration: Int - id: String - maxUploadFileSize: Int - minUploadFileSize: Int - presignedUrlsEnabled: Boolean - updatedAt: timestamptz -} - -"""aggregate sum on columns""" -type buckets_sum_fields { - downloadExpiration: Int - maxUploadFileSize: Int - minUploadFileSize: Int -} - -""" -update columns of table "storage.buckets" -""" -enum buckets_update_column { - """column name""" - cacheControl - - """column name""" - createdAt - - """column name""" - downloadExpiration - - """column name""" - id - - """column name""" - maxUploadFileSize - - """column name""" - minUploadFileSize - - """column name""" - presignedUrlsEnabled - - """column name""" - updatedAt -} - -input buckets_updates { - """increments the numeric columns with given value of the filtered values""" - _inc: buckets_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: buckets_set_input - - """filter the rows which have to be updated""" - where: buckets_bool_exp! -} - -"""aggregate var_pop on columns""" -type buckets_var_pop_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -"""aggregate var_samp on columns""" -type buckets_var_samp_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -"""aggregate variance on columns""" -type buckets_variance_fields { - downloadExpiration: Float - maxUploadFileSize: Float - minUploadFileSize: Float -} - -scalar bytea - -""" -Boolean expression to compare columns of type "bytea". All fields are combined with logical 'AND'. -""" -input bytea_comparison_exp { - _eq: bytea - _gt: bytea - _gte: bytea - _in: [bytea!] - _is_null: Boolean - _lt: bytea - _lte: bytea - _neq: bytea - _nin: [bytea!] -} - -scalar citext - -""" -Boolean expression to compare columns of type "citext". All fields are combined with logical 'AND'. -""" -input citext_comparison_exp { - _eq: citext - _gt: citext - _gte: citext - - """does the column match the given case-insensitive pattern""" - _ilike: citext - _in: [citext!] - - """ - does the column match the given POSIX regular expression, case insensitive - """ - _iregex: citext - _is_null: Boolean - - """does the column match the given pattern""" - _like: citext - _lt: citext - _lte: citext - _neq: citext - - """does the column NOT match the given case-insensitive pattern""" - _nilike: citext - _nin: [citext!] - - """ - does the column NOT match the given POSIX regular expression, case insensitive - """ - _niregex: citext - - """does the column NOT match the given pattern""" - _nlike: citext - - """ - does the column NOT match the given POSIX regular expression, case sensitive - """ - _nregex: citext - - """does the column NOT match the given SQL regular expression""" - _nsimilar: citext - - """ - does the column match the given POSIX regular expression, case sensitive - """ - _regex: citext - - """does the column match the given SQL regular expression""" - _similar: citext -} - -"""ordering argument of a cursor""" -enum cursor_ordering { - """ascending ordering of the cursor""" - ASC - - """descending ordering of the cursor""" - DESC -} - -""" -columns and relationships of "execution_results" -""" -type execution_results { - created_at: timestamptz! - executed_at: timestamptz! - execution_trace( - """JSON select path""" - path: String - ): jsonb - id: uuid! - outputs( - """JSON select path""" - path: String - ): jsonb! - - """An object relationship""" - runbook: runbooks! - runbook_id: uuid! - updated_at: timestamptz! -} - -""" -aggregated selection of "execution_results" -""" -type execution_results_aggregate { - aggregate: execution_results_aggregate_fields - nodes: [execution_results!]! -} - -input execution_results_aggregate_bool_exp { - count: execution_results_aggregate_bool_exp_count -} - -input execution_results_aggregate_bool_exp_count { - arguments: [execution_results_select_column!] - distinct: Boolean - filter: execution_results_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "execution_results" -""" -type execution_results_aggregate_fields { - count(columns: [execution_results_select_column!], distinct: Boolean): Int! - max: execution_results_max_fields - min: execution_results_min_fields -} - -""" -order by aggregate values of table "execution_results" -""" -input execution_results_aggregate_order_by { - count: order_by - max: execution_results_max_order_by - min: execution_results_min_order_by -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input execution_results_append_input { - execution_trace: jsonb - outputs: jsonb -} - -""" -input type for inserting array relation for remote table "execution_results" -""" -input execution_results_arr_rel_insert_input { - data: [execution_results_insert_input!]! - - """upsert condition""" - on_conflict: execution_results_on_conflict -} - -""" -Boolean expression to filter rows from the table "execution_results". All fields are combined with a logical 'AND'. -""" -input execution_results_bool_exp { - _and: [execution_results_bool_exp!] - _not: execution_results_bool_exp - _or: [execution_results_bool_exp!] - created_at: timestamptz_comparison_exp - executed_at: timestamptz_comparison_exp - execution_trace: jsonb_comparison_exp - id: uuid_comparison_exp - outputs: jsonb_comparison_exp - runbook: runbooks_bool_exp - runbook_id: uuid_comparison_exp - updated_at: timestamptz_comparison_exp -} - -""" -unique or primary key constraints on table "execution_results" -""" -enum execution_results_constraint { - """ - unique or primary key constraint on columns "id" - """ - runbook_executions_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input execution_results_delete_at_path_input { - execution_trace: [String!] - outputs: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input execution_results_delete_elem_input { - execution_trace: Int - outputs: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input execution_results_delete_key_input { - execution_trace: String - outputs: String -} - -""" -input type for inserting data into table "execution_results" -""" -input execution_results_insert_input { - created_at: timestamptz - executed_at: timestamptz - execution_trace: jsonb - id: uuid - outputs: jsonb - runbook: runbooks_obj_rel_insert_input - runbook_id: uuid - updated_at: timestamptz -} - -"""aggregate max on columns""" -type execution_results_max_fields { - created_at: timestamptz - executed_at: timestamptz - id: uuid - runbook_id: uuid - updated_at: timestamptz -} - -""" -order by max() on columns of table "execution_results" -""" -input execution_results_max_order_by { - created_at: order_by - executed_at: order_by - id: order_by - runbook_id: order_by - updated_at: order_by -} - -"""aggregate min on columns""" -type execution_results_min_fields { - created_at: timestamptz - executed_at: timestamptz - id: uuid - runbook_id: uuid - updated_at: timestamptz -} - -""" -order by min() on columns of table "execution_results" -""" -input execution_results_min_order_by { - created_at: order_by - executed_at: order_by - id: order_by - runbook_id: order_by - updated_at: order_by -} - -""" -response of any mutation on the table "execution_results" -""" -type execution_results_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [execution_results!]! -} - -""" -on_conflict condition type for table "execution_results" -""" -input execution_results_on_conflict { - constraint: execution_results_constraint! - update_columns: [execution_results_update_column!]! = [] - where: execution_results_bool_exp -} - -"""Ordering options when selecting data from "execution_results".""" -input execution_results_order_by { - created_at: order_by - executed_at: order_by - execution_trace: order_by - id: order_by - outputs: order_by - runbook: runbooks_order_by - runbook_id: order_by - updated_at: order_by -} - -"""primary key columns input for table: execution_results""" -input execution_results_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input execution_results_prepend_input { - execution_trace: jsonb - outputs: jsonb -} - -""" -select columns of table "execution_results" -""" -enum execution_results_select_column { - """column name""" - created_at - - """column name""" - executed_at - - """column name""" - execution_trace - - """column name""" - id - - """column name""" - outputs - - """column name""" - runbook_id - - """column name""" - updated_at -} - -""" -input type for updating data in table "execution_results" -""" -input execution_results_set_input { - created_at: timestamptz - executed_at: timestamptz - execution_trace: jsonb - id: uuid - outputs: jsonb - runbook_id: uuid - updated_at: timestamptz -} - -""" -Streaming cursor of the table "execution_results" -""" -input execution_results_stream_cursor_input { - """Stream column input with initial value""" - initial_value: execution_results_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input execution_results_stream_cursor_value_input { - created_at: timestamptz - executed_at: timestamptz - execution_trace: jsonb - id: uuid - outputs: jsonb - runbook_id: uuid - updated_at: timestamptz -} - -""" -update columns of table "execution_results" -""" -enum execution_results_update_column { - """column name""" - created_at - - """column name""" - executed_at - - """column name""" - execution_trace - - """column name""" - id - - """column name""" - outputs - - """column name""" - runbook_id - - """column name""" - updated_at -} - -input execution_results_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: execution_results_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: execution_results_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: execution_results_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: execution_results_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: execution_results_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: execution_results_set_input - - """filter the rows which have to be updated""" - where: execution_results_bool_exp! -} - -""" -columns and relationships of "storage.files" -""" -type files { - """An object relationship""" - bucket: buckets! - bucketId: String! - createdAt: timestamptz! - etag: String - id: uuid! - isUploaded: Boolean - metadata( - """JSON select path""" - path: String - ): jsonb - mimeType: String - name: String - size: Int - updatedAt: timestamptz! - uploadedByUserId: uuid -} - -""" -aggregated selection of "storage.files" -""" -type files_aggregate { - aggregate: files_aggregate_fields - nodes: [files!]! -} - -input files_aggregate_bool_exp { - bool_and: files_aggregate_bool_exp_bool_and - bool_or: files_aggregate_bool_exp_bool_or - count: files_aggregate_bool_exp_count -} - -input files_aggregate_bool_exp_bool_and { - arguments: files_select_column_files_aggregate_bool_exp_bool_and_arguments_columns! - distinct: Boolean - filter: files_bool_exp - predicate: Boolean_comparison_exp! -} - -input files_aggregate_bool_exp_bool_or { - arguments: files_select_column_files_aggregate_bool_exp_bool_or_arguments_columns! - distinct: Boolean - filter: files_bool_exp - predicate: Boolean_comparison_exp! -} - -input files_aggregate_bool_exp_count { - arguments: [files_select_column!] - distinct: Boolean - filter: files_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "storage.files" -""" -type files_aggregate_fields { - avg: files_avg_fields - count(columns: [files_select_column!], distinct: Boolean): Int! - max: files_max_fields - min: files_min_fields - stddev: files_stddev_fields - stddev_pop: files_stddev_pop_fields - stddev_samp: files_stddev_samp_fields - sum: files_sum_fields - var_pop: files_var_pop_fields - var_samp: files_var_samp_fields - variance: files_variance_fields -} - -""" -order by aggregate values of table "storage.files" -""" -input files_aggregate_order_by { - avg: files_avg_order_by - count: order_by - max: files_max_order_by - min: files_min_order_by - stddev: files_stddev_order_by - stddev_pop: files_stddev_pop_order_by - stddev_samp: files_stddev_samp_order_by - sum: files_sum_order_by - var_pop: files_var_pop_order_by - var_samp: files_var_samp_order_by - variance: files_variance_order_by -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input files_append_input { - metadata: jsonb -} - -""" -input type for inserting array relation for remote table "storage.files" -""" -input files_arr_rel_insert_input { - data: [files_insert_input!]! - - """upsert condition""" - on_conflict: files_on_conflict -} - -"""aggregate avg on columns""" -type files_avg_fields { - size: Float -} - -""" -order by avg() on columns of table "storage.files" -""" -input files_avg_order_by { - size: order_by -} - -""" -Boolean expression to filter rows from the table "storage.files". All fields are combined with a logical 'AND'. -""" -input files_bool_exp { - _and: [files_bool_exp!] - _not: files_bool_exp - _or: [files_bool_exp!] - bucket: buckets_bool_exp - bucketId: String_comparison_exp - createdAt: timestamptz_comparison_exp - etag: String_comparison_exp - id: uuid_comparison_exp - isUploaded: Boolean_comparison_exp - metadata: jsonb_comparison_exp - mimeType: String_comparison_exp - name: String_comparison_exp - size: Int_comparison_exp - updatedAt: timestamptz_comparison_exp - uploadedByUserId: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "storage.files" -""" -enum files_constraint { - """ - unique or primary key constraint on columns "id" - """ - files_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input files_delete_at_path_input { - metadata: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input files_delete_elem_input { - metadata: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input files_delete_key_input { - metadata: String -} - -""" -input type for incrementing numeric columns in table "storage.files" -""" -input files_inc_input { - size: Int -} - -""" -input type for inserting data into table "storage.files" -""" -input files_insert_input { - bucket: buckets_obj_rel_insert_input - bucketId: String - createdAt: timestamptz - etag: String - id: uuid - isUploaded: Boolean - metadata: jsonb - mimeType: String - name: String - size: Int - updatedAt: timestamptz - uploadedByUserId: uuid -} - -"""aggregate max on columns""" -type files_max_fields { - bucketId: String - createdAt: timestamptz - etag: String - id: uuid - mimeType: String - name: String - size: Int - updatedAt: timestamptz - uploadedByUserId: uuid -} - -""" -order by max() on columns of table "storage.files" -""" -input files_max_order_by { - bucketId: order_by - createdAt: order_by - etag: order_by - id: order_by - mimeType: order_by - name: order_by - size: order_by - updatedAt: order_by - uploadedByUserId: order_by -} - -"""aggregate min on columns""" -type files_min_fields { - bucketId: String - createdAt: timestamptz - etag: String - id: uuid - mimeType: String - name: String - size: Int - updatedAt: timestamptz - uploadedByUserId: uuid -} - -""" -order by min() on columns of table "storage.files" -""" -input files_min_order_by { - bucketId: order_by - createdAt: order_by - etag: order_by - id: order_by - mimeType: order_by - name: order_by - size: order_by - updatedAt: order_by - uploadedByUserId: order_by -} - -""" -response of any mutation on the table "storage.files" -""" -type files_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [files!]! -} - -""" -input type for inserting object relation for remote table "storage.files" -""" -input files_obj_rel_insert_input { - data: files_insert_input! - - """upsert condition""" - on_conflict: files_on_conflict -} - -""" -on_conflict condition type for table "storage.files" -""" -input files_on_conflict { - constraint: files_constraint! - update_columns: [files_update_column!]! = [] - where: files_bool_exp -} - -"""Ordering options when selecting data from "storage.files".""" -input files_order_by { - bucket: buckets_order_by - bucketId: order_by - createdAt: order_by - etag: order_by - id: order_by - isUploaded: order_by - metadata: order_by - mimeType: order_by - name: order_by - size: order_by - updatedAt: order_by - uploadedByUserId: order_by -} - -"""primary key columns input for table: storage.files""" -input files_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input files_prepend_input { - metadata: jsonb -} - -""" -select columns of table "storage.files" -""" -enum files_select_column { - """column name""" - bucketId - - """column name""" - createdAt - - """column name""" - etag - - """column name""" - id - - """column name""" - isUploaded - - """column name""" - metadata - - """column name""" - mimeType - - """column name""" - name - - """column name""" - size - - """column name""" - updatedAt - - """column name""" - uploadedByUserId -} - -""" -select "files_aggregate_bool_exp_bool_and_arguments_columns" columns of table "storage.files" -""" -enum files_select_column_files_aggregate_bool_exp_bool_and_arguments_columns { - """column name""" - isUploaded -} - -""" -select "files_aggregate_bool_exp_bool_or_arguments_columns" columns of table "storage.files" -""" -enum files_select_column_files_aggregate_bool_exp_bool_or_arguments_columns { - """column name""" - isUploaded -} - -""" -input type for updating data in table "storage.files" -""" -input files_set_input { - bucketId: String - createdAt: timestamptz - etag: String - id: uuid - isUploaded: Boolean - metadata: jsonb - mimeType: String - name: String - size: Int - updatedAt: timestamptz - uploadedByUserId: uuid -} - -"""aggregate stddev on columns""" -type files_stddev_fields { - size: Float -} - -""" -order by stddev() on columns of table "storage.files" -""" -input files_stddev_order_by { - size: order_by -} - -"""aggregate stddev_pop on columns""" -type files_stddev_pop_fields { - size: Float -} - -""" -order by stddev_pop() on columns of table "storage.files" -""" -input files_stddev_pop_order_by { - size: order_by -} - -"""aggregate stddev_samp on columns""" -type files_stddev_samp_fields { - size: Float -} - -""" -order by stddev_samp() on columns of table "storage.files" -""" -input files_stddev_samp_order_by { - size: order_by -} - -""" -Streaming cursor of the table "files" -""" -input files_stream_cursor_input { - """Stream column input with initial value""" - initial_value: files_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input files_stream_cursor_value_input { - bucketId: String - createdAt: timestamptz - etag: String - id: uuid - isUploaded: Boolean - metadata: jsonb - mimeType: String - name: String - size: Int - updatedAt: timestamptz - uploadedByUserId: uuid -} - -"""aggregate sum on columns""" -type files_sum_fields { - size: Int -} - -""" -order by sum() on columns of table "storage.files" -""" -input files_sum_order_by { - size: order_by -} - -""" -update columns of table "storage.files" -""" -enum files_update_column { - """column name""" - bucketId - - """column name""" - createdAt - - """column name""" - etag - - """column name""" - id - - """column name""" - isUploaded - - """column name""" - metadata - - """column name""" - mimeType - - """column name""" - name - - """column name""" - size - - """column name""" - updatedAt - - """column name""" - uploadedByUserId -} - -input files_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: files_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: files_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: files_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: files_delete_key_input - - """increments the numeric columns with given value of the filtered values""" - _inc: files_inc_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: files_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: files_set_input - - """filter the rows which have to be updated""" - where: files_bool_exp! -} - -"""aggregate var_pop on columns""" -type files_var_pop_fields { - size: Float -} - -""" -order by var_pop() on columns of table "storage.files" -""" -input files_var_pop_order_by { - size: order_by -} - -"""aggregate var_samp on columns""" -type files_var_samp_fields { - size: Float -} - -""" -order by var_samp() on columns of table "storage.files" -""" -input files_var_samp_order_by { - size: order_by -} - -"""aggregate variance on columns""" -type files_variance_fields { - size: Float -} - -""" -order by variance() on columns of table "storage.files" -""" -input files_variance_order_by { - size: order_by -} - -scalar jsonb - -input jsonb_cast_exp { - String: String_comparison_exp -} - -""" -Boolean expression to compare columns of type "jsonb". All fields are combined with logical 'AND'. -""" -input jsonb_comparison_exp { - _cast: jsonb_cast_exp - - """is the column contained in the given json value""" - _contained_in: jsonb - - """does the column contain the given json value at the top level""" - _contains: jsonb - _eq: jsonb - _gt: jsonb - _gte: jsonb - - """does the string exist as a top-level key in the column""" - _has_key: String - - """do all of these strings exist as top-level keys in the column""" - _has_keys_all: [String!] - - """do any of these strings exist as top-level keys in the column""" - _has_keys_any: [String!] - _in: [jsonb!] - _is_null: Boolean - _lt: jsonb - _lte: jsonb - _neq: jsonb - _nin: [jsonb!] -} - -"""mutation root""" -type mutation_root { - """ - delete single row from the table: "auth.providers" - """ - deleteAuthProvider(id: String!): authProviders - - """ - delete single row from the table: "auth.provider_requests" - """ - deleteAuthProviderRequest(id: uuid!): authProviderRequests - - """ - delete data from the table: "auth.provider_requests" - """ - deleteAuthProviderRequests( - """filter the rows which have to be deleted""" - where: authProviderRequests_bool_exp! - ): authProviderRequests_mutation_response - - """ - delete data from the table: "auth.providers" - """ - deleteAuthProviders( - """filter the rows which have to be deleted""" - where: authProviders_bool_exp! - ): authProviders_mutation_response - - """ - delete single row from the table: "auth.refresh_tokens" - """ - deleteAuthRefreshToken(id: uuid!): authRefreshTokens - - """ - delete single row from the table: "auth.refresh_token_types" - """ - deleteAuthRefreshTokenType(value: String!): authRefreshTokenTypes - - """ - delete data from the table: "auth.refresh_token_types" - """ - deleteAuthRefreshTokenTypes( - """filter the rows which have to be deleted""" - where: authRefreshTokenTypes_bool_exp! - ): authRefreshTokenTypes_mutation_response - - """ - delete data from the table: "auth.refresh_tokens" - """ - deleteAuthRefreshTokens( - """filter the rows which have to be deleted""" - where: authRefreshTokens_bool_exp! - ): authRefreshTokens_mutation_response - - """ - delete single row from the table: "auth.roles" - """ - deleteAuthRole(role: String!): authRoles - - """ - delete data from the table: "auth.roles" - """ - deleteAuthRoles( - """filter the rows which have to be deleted""" - where: authRoles_bool_exp! - ): authRoles_mutation_response - - """ - delete single row from the table: "auth.user_providers" - """ - deleteAuthUserProvider(id: uuid!): authUserProviders - - """ - delete data from the table: "auth.user_providers" - """ - deleteAuthUserProviders( - """filter the rows which have to be deleted""" - where: authUserProviders_bool_exp! - ): authUserProviders_mutation_response - - """ - delete single row from the table: "auth.user_roles" - """ - deleteAuthUserRole(id: uuid!): authUserRoles - - """ - delete data from the table: "auth.user_roles" - """ - deleteAuthUserRoles( - """filter the rows which have to be deleted""" - where: authUserRoles_bool_exp! - ): authUserRoles_mutation_response - - """ - delete single row from the table: "auth.user_security_keys" - """ - deleteAuthUserSecurityKey(id: uuid!): authUserSecurityKeys - - """ - delete data from the table: "auth.user_security_keys" - """ - deleteAuthUserSecurityKeys( - """filter the rows which have to be deleted""" - where: authUserSecurityKeys_bool_exp! - ): authUserSecurityKeys_mutation_response - - """ - delete single row from the table: "storage.buckets" - """ - deleteBucket(id: String!): buckets - - """ - delete data from the table: "storage.buckets" - """ - deleteBuckets( - """filter the rows which have to be deleted""" - where: buckets_bool_exp! - ): buckets_mutation_response - - """ - delete single row from the table: "storage.files" - """ - deleteFile(id: uuid!): files - - """ - delete data from the table: "storage.files" - """ - deleteFiles( - """filter the rows which have to be deleted""" - where: files_bool_exp! - ): files_mutation_response - - """ - delete single row from the table: "auth.users" - """ - deleteUser(id: uuid!): users - - """ - delete data from the table: "auth.users" - """ - deleteUsers( - """filter the rows which have to be deleted""" - where: users_bool_exp! - ): users_mutation_response - - """ - delete single row from the table: "storage.virus" - """ - deleteVirus(id: uuid!): virus - - """ - delete data from the table: "storage.virus" - """ - deleteViruses( - """filter the rows which have to be deleted""" - where: virus_bool_exp! - ): virus_mutation_response - - """ - delete data from the table: "execution_results" - """ - delete_execution_results( - """filter the rows which have to be deleted""" - where: execution_results_bool_exp! - ): execution_results_mutation_response - - """ - delete single row from the table: "execution_results" - """ - delete_execution_results_by_pk(id: uuid!): execution_results - - """ - delete data from the table: "organization_user" - """ - delete_organization_user( - """filter the rows which have to be deleted""" - where: organization_user_bool_exp! - ): organization_user_mutation_response - - """ - delete single row from the table: "organization_user" - """ - delete_organization_user_by_pk(id: uuid!): organization_user - - """ - delete data from the table: "organizations" - """ - delete_organizations( - """filter the rows which have to be deleted""" - where: organizations_bool_exp! - ): organizations_mutation_response - - """ - delete single row from the table: "organizations" - """ - delete_organizations_by_pk(id: uuid!): organizations - - """ - delete data from the table: "permission_organization" - """ - delete_permission_organization( - """filter the rows which have to be deleted""" - where: permission_organization_bool_exp! - ): permission_organization_mutation_response - - """ - delete single row from the table: "permission_organization" - """ - delete_permission_organization_by_pk(id: uuid!): permission_organization - - """ - delete data from the table: "permission_user" - """ - delete_permission_user( - """filter the rows which have to be deleted""" - where: permission_user_bool_exp! - ): permission_user_mutation_response - - """ - delete single row from the table: "permission_user" - """ - delete_permission_user_by_pk(id: uuid!): permission_user - - """ - delete data from the table: "permissions" - """ - delete_permissions( - """filter the rows which have to be deleted""" - where: permissions_bool_exp! - ): permissions_mutation_response - - """ - delete single row from the table: "permissions" - """ - delete_permissions_by_pk(id: uuid!): permissions - - """ - delete data from the table: "runbooks" - """ - delete_runbooks( - """filter the rows which have to be deleted""" - where: runbooks_bool_exp! - ): runbooks_mutation_response - - """ - delete single row from the table: "runbooks" - """ - delete_runbooks_by_pk(id: uuid!): runbooks - - """ - insert a single row into the table: "auth.providers" - """ - insertAuthProvider( - """the row to be inserted""" - object: authProviders_insert_input! - - """upsert condition""" - on_conflict: authProviders_on_conflict - ): authProviders - - """ - insert a single row into the table: "auth.provider_requests" - """ - insertAuthProviderRequest( - """the row to be inserted""" - object: authProviderRequests_insert_input! - - """upsert condition""" - on_conflict: authProviderRequests_on_conflict - ): authProviderRequests - - """ - insert data into the table: "auth.provider_requests" - """ - insertAuthProviderRequests( - """the rows to be inserted""" - objects: [authProviderRequests_insert_input!]! - - """upsert condition""" - on_conflict: authProviderRequests_on_conflict - ): authProviderRequests_mutation_response - - """ - insert data into the table: "auth.providers" - """ - insertAuthProviders( - """the rows to be inserted""" - objects: [authProviders_insert_input!]! - - """upsert condition""" - on_conflict: authProviders_on_conflict - ): authProviders_mutation_response - - """ - insert a single row into the table: "auth.refresh_tokens" - """ - insertAuthRefreshToken( - """the row to be inserted""" - object: authRefreshTokens_insert_input! - - """upsert condition""" - on_conflict: authRefreshTokens_on_conflict - ): authRefreshTokens - - """ - insert a single row into the table: "auth.refresh_token_types" - """ - insertAuthRefreshTokenType( - """the row to be inserted""" - object: authRefreshTokenTypes_insert_input! - - """upsert condition""" - on_conflict: authRefreshTokenTypes_on_conflict - ): authRefreshTokenTypes - - """ - insert data into the table: "auth.refresh_token_types" - """ - insertAuthRefreshTokenTypes( - """the rows to be inserted""" - objects: [authRefreshTokenTypes_insert_input!]! - - """upsert condition""" - on_conflict: authRefreshTokenTypes_on_conflict - ): authRefreshTokenTypes_mutation_response - - """ - insert data into the table: "auth.refresh_tokens" - """ - insertAuthRefreshTokens( - """the rows to be inserted""" - objects: [authRefreshTokens_insert_input!]! - - """upsert condition""" - on_conflict: authRefreshTokens_on_conflict - ): authRefreshTokens_mutation_response - - """ - insert a single row into the table: "auth.roles" - """ - insertAuthRole( - """the row to be inserted""" - object: authRoles_insert_input! - - """upsert condition""" - on_conflict: authRoles_on_conflict - ): authRoles - - """ - insert data into the table: "auth.roles" - """ - insertAuthRoles( - """the rows to be inserted""" - objects: [authRoles_insert_input!]! - - """upsert condition""" - on_conflict: authRoles_on_conflict - ): authRoles_mutation_response - - """ - insert a single row into the table: "auth.user_providers" - """ - insertAuthUserProvider( - """the row to be inserted""" - object: authUserProviders_insert_input! - - """upsert condition""" - on_conflict: authUserProviders_on_conflict - ): authUserProviders - - """ - insert data into the table: "auth.user_providers" - """ - insertAuthUserProviders( - """the rows to be inserted""" - objects: [authUserProviders_insert_input!]! - - """upsert condition""" - on_conflict: authUserProviders_on_conflict - ): authUserProviders_mutation_response - - """ - insert a single row into the table: "auth.user_roles" - """ - insertAuthUserRole( - """the row to be inserted""" - object: authUserRoles_insert_input! - - """upsert condition""" - on_conflict: authUserRoles_on_conflict - ): authUserRoles - - """ - insert data into the table: "auth.user_roles" - """ - insertAuthUserRoles( - """the rows to be inserted""" - objects: [authUserRoles_insert_input!]! - - """upsert condition""" - on_conflict: authUserRoles_on_conflict - ): authUserRoles_mutation_response - - """ - insert a single row into the table: "auth.user_security_keys" - """ - insertAuthUserSecurityKey( - """the row to be inserted""" - object: authUserSecurityKeys_insert_input! - - """upsert condition""" - on_conflict: authUserSecurityKeys_on_conflict - ): authUserSecurityKeys - - """ - insert data into the table: "auth.user_security_keys" - """ - insertAuthUserSecurityKeys( - """the rows to be inserted""" - objects: [authUserSecurityKeys_insert_input!]! - - """upsert condition""" - on_conflict: authUserSecurityKeys_on_conflict - ): authUserSecurityKeys_mutation_response - - """ - insert a single row into the table: "storage.buckets" - """ - insertBucket( - """the row to be inserted""" - object: buckets_insert_input! - - """upsert condition""" - on_conflict: buckets_on_conflict - ): buckets - - """ - insert data into the table: "storage.buckets" - """ - insertBuckets( - """the rows to be inserted""" - objects: [buckets_insert_input!]! - - """upsert condition""" - on_conflict: buckets_on_conflict - ): buckets_mutation_response - - """ - insert a single row into the table: "storage.files" - """ - insertFile( - """the row to be inserted""" - object: files_insert_input! - - """upsert condition""" - on_conflict: files_on_conflict - ): files - - """ - insert data into the table: "storage.files" - """ - insertFiles( - """the rows to be inserted""" - objects: [files_insert_input!]! - - """upsert condition""" - on_conflict: files_on_conflict - ): files_mutation_response - - """ - insert a single row into the table: "auth.users" - """ - insertUser( - """the row to be inserted""" - object: users_insert_input! - - """upsert condition""" - on_conflict: users_on_conflict - ): users - - """ - insert data into the table: "auth.users" - """ - insertUsers( - """the rows to be inserted""" - objects: [users_insert_input!]! - - """upsert condition""" - on_conflict: users_on_conflict - ): users_mutation_response - - """ - insert a single row into the table: "storage.virus" - """ - insertVirus( - """the row to be inserted""" - object: virus_insert_input! - - """upsert condition""" - on_conflict: virus_on_conflict - ): virus - - """ - insert data into the table: "storage.virus" - """ - insertViruses( - """the rows to be inserted""" - objects: [virus_insert_input!]! - - """upsert condition""" - on_conflict: virus_on_conflict - ): virus_mutation_response - - """ - insert data into the table: "execution_results" - """ - insert_execution_results( - """the rows to be inserted""" - objects: [execution_results_insert_input!]! - - """upsert condition""" - on_conflict: execution_results_on_conflict - ): execution_results_mutation_response - - """ - insert a single row into the table: "execution_results" - """ - insert_execution_results_one( - """the row to be inserted""" - object: execution_results_insert_input! - - """upsert condition""" - on_conflict: execution_results_on_conflict - ): execution_results - - """ - insert data into the table: "organization_user" - """ - insert_organization_user( - """the rows to be inserted""" - objects: [organization_user_insert_input!]! - - """upsert condition""" - on_conflict: organization_user_on_conflict - ): organization_user_mutation_response - - """ - insert a single row into the table: "organization_user" - """ - insert_organization_user_one( - """the row to be inserted""" - object: organization_user_insert_input! - - """upsert condition""" - on_conflict: organization_user_on_conflict - ): organization_user - - """ - insert data into the table: "organizations" - """ - insert_organizations( - """the rows to be inserted""" - objects: [organizations_insert_input!]! - - """upsert condition""" - on_conflict: organizations_on_conflict - ): organizations_mutation_response - - """ - insert a single row into the table: "organizations" - """ - insert_organizations_one( - """the row to be inserted""" - object: organizations_insert_input! - - """upsert condition""" - on_conflict: organizations_on_conflict - ): organizations - - """ - insert data into the table: "permission_organization" - """ - insert_permission_organization( - """the rows to be inserted""" - objects: [permission_organization_insert_input!]! - - """upsert condition""" - on_conflict: permission_organization_on_conflict - ): permission_organization_mutation_response - - """ - insert a single row into the table: "permission_organization" - """ - insert_permission_organization_one( - """the row to be inserted""" - object: permission_organization_insert_input! - - """upsert condition""" - on_conflict: permission_organization_on_conflict - ): permission_organization - - """ - insert data into the table: "permission_user" - """ - insert_permission_user( - """the rows to be inserted""" - objects: [permission_user_insert_input!]! - - """upsert condition""" - on_conflict: permission_user_on_conflict - ): permission_user_mutation_response - - """ - insert a single row into the table: "permission_user" - """ - insert_permission_user_one( - """the row to be inserted""" - object: permission_user_insert_input! - - """upsert condition""" - on_conflict: permission_user_on_conflict - ): permission_user - - """ - insert data into the table: "permissions" - """ - insert_permissions( - """the rows to be inserted""" - objects: [permissions_insert_input!]! - - """upsert condition""" - on_conflict: permissions_on_conflict - ): permissions_mutation_response - - """ - insert a single row into the table: "permissions" - """ - insert_permissions_one( - """the row to be inserted""" - object: permissions_insert_input! - - """upsert condition""" - on_conflict: permissions_on_conflict - ): permissions - - """ - insert data into the table: "runbooks" - """ - insert_runbooks( - """the rows to be inserted""" - objects: [runbooks_insert_input!]! - - """upsert condition""" - on_conflict: runbooks_on_conflict - ): runbooks_mutation_response - - """ - insert a single row into the table: "runbooks" - """ - insert_runbooks_one( - """the row to be inserted""" - object: runbooks_insert_input! - - """upsert condition""" - on_conflict: runbooks_on_conflict - ): runbooks - - """ - update single row of the table: "auth.providers" - """ - updateAuthProvider( - """sets the columns of the filtered rows to the given values""" - _set: authProviders_set_input - pk_columns: authProviders_pk_columns_input! - ): authProviders - - """ - update single row of the table: "auth.provider_requests" - """ - updateAuthProviderRequest( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authProviderRequests_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authProviderRequests_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authProviderRequests_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authProviderRequests_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authProviderRequests_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authProviderRequests_set_input - pk_columns: authProviderRequests_pk_columns_input! - ): authProviderRequests - - """ - update data of the table: "auth.provider_requests" - """ - updateAuthProviderRequests( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authProviderRequests_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authProviderRequests_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authProviderRequests_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authProviderRequests_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authProviderRequests_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authProviderRequests_set_input - - """filter the rows which have to be updated""" - where: authProviderRequests_bool_exp! - ): authProviderRequests_mutation_response - - """ - update data of the table: "auth.providers" - """ - updateAuthProviders( - """sets the columns of the filtered rows to the given values""" - _set: authProviders_set_input - - """filter the rows which have to be updated""" - where: authProviders_bool_exp! - ): authProviders_mutation_response - - """ - update single row of the table: "auth.refresh_tokens" - """ - updateAuthRefreshToken( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authRefreshTokens_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authRefreshTokens_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authRefreshTokens_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authRefreshTokens_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authRefreshTokens_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokens_set_input - pk_columns: authRefreshTokens_pk_columns_input! - ): authRefreshTokens - - """ - update single row of the table: "auth.refresh_token_types" - """ - updateAuthRefreshTokenType( - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokenTypes_set_input - pk_columns: authRefreshTokenTypes_pk_columns_input! - ): authRefreshTokenTypes - - """ - update data of the table: "auth.refresh_token_types" - """ - updateAuthRefreshTokenTypes( - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokenTypes_set_input - - """filter the rows which have to be updated""" - where: authRefreshTokenTypes_bool_exp! - ): authRefreshTokenTypes_mutation_response - - """ - update data of the table: "auth.refresh_tokens" - """ - updateAuthRefreshTokens( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: authRefreshTokens_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: authRefreshTokens_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: authRefreshTokens_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: authRefreshTokens_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: authRefreshTokens_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: authRefreshTokens_set_input - - """filter the rows which have to be updated""" - where: authRefreshTokens_bool_exp! - ): authRefreshTokens_mutation_response - - """ - update single row of the table: "auth.roles" - """ - updateAuthRole( - """sets the columns of the filtered rows to the given values""" - _set: authRoles_set_input - pk_columns: authRoles_pk_columns_input! - ): authRoles - - """ - update data of the table: "auth.roles" - """ - updateAuthRoles( - """sets the columns of the filtered rows to the given values""" - _set: authRoles_set_input - - """filter the rows which have to be updated""" - where: authRoles_bool_exp! - ): authRoles_mutation_response - - """ - update single row of the table: "auth.user_providers" - """ - updateAuthUserProvider( - """sets the columns of the filtered rows to the given values""" - _set: authUserProviders_set_input - pk_columns: authUserProviders_pk_columns_input! - ): authUserProviders - - """ - update data of the table: "auth.user_providers" - """ - updateAuthUserProviders( - """sets the columns of the filtered rows to the given values""" - _set: authUserProviders_set_input - - """filter the rows which have to be updated""" - where: authUserProviders_bool_exp! - ): authUserProviders_mutation_response - - """ - update single row of the table: "auth.user_roles" - """ - updateAuthUserRole( - """sets the columns of the filtered rows to the given values""" - _set: authUserRoles_set_input - pk_columns: authUserRoles_pk_columns_input! - ): authUserRoles - - """ - update data of the table: "auth.user_roles" - """ - updateAuthUserRoles( - """sets the columns of the filtered rows to the given values""" - _set: authUserRoles_set_input - - """filter the rows which have to be updated""" - where: authUserRoles_bool_exp! - ): authUserRoles_mutation_response - - """ - update single row of the table: "auth.user_security_keys" - """ - updateAuthUserSecurityKey( - """increments the numeric columns with given value of the filtered values""" - _inc: authUserSecurityKeys_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: authUserSecurityKeys_set_input - pk_columns: authUserSecurityKeys_pk_columns_input! - ): authUserSecurityKeys - - """ - update data of the table: "auth.user_security_keys" - """ - updateAuthUserSecurityKeys( - """increments the numeric columns with given value of the filtered values""" - _inc: authUserSecurityKeys_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: authUserSecurityKeys_set_input - - """filter the rows which have to be updated""" - where: authUserSecurityKeys_bool_exp! - ): authUserSecurityKeys_mutation_response - - """ - update single row of the table: "storage.buckets" - """ - updateBucket( - """increments the numeric columns with given value of the filtered values""" - _inc: buckets_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: buckets_set_input - pk_columns: buckets_pk_columns_input! - ): buckets - - """ - update data of the table: "storage.buckets" - """ - updateBuckets( - """increments the numeric columns with given value of the filtered values""" - _inc: buckets_inc_input - - """sets the columns of the filtered rows to the given values""" - _set: buckets_set_input - - """filter the rows which have to be updated""" - where: buckets_bool_exp! - ): buckets_mutation_response - - """ - update single row of the table: "storage.files" - """ - updateFile( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: files_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: files_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: files_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: files_delete_key_input - - """increments the numeric columns with given value of the filtered values""" - _inc: files_inc_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: files_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: files_set_input - pk_columns: files_pk_columns_input! - ): files - - """ - update data of the table: "storage.files" - """ - updateFiles( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: files_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: files_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: files_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: files_delete_key_input - - """increments the numeric columns with given value of the filtered values""" - _inc: files_inc_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: files_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: files_set_input - - """filter the rows which have to be updated""" - where: files_bool_exp! - ): files_mutation_response - - """ - update single row of the table: "auth.users" - """ - updateUser( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: users_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: users_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: users_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: users_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: users_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: users_set_input - pk_columns: users_pk_columns_input! - ): users - - """ - update data of the table: "auth.users" - """ - updateUsers( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: users_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: users_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: users_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: users_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: users_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: users_set_input - - """filter the rows which have to be updated""" - where: users_bool_exp! - ): users_mutation_response - - """ - update single row of the table: "storage.virus" - """ - updateVirus( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: virus_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: virus_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: virus_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: virus_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: virus_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: virus_set_input - pk_columns: virus_pk_columns_input! - ): virus - - """ - update data of the table: "storage.virus" - """ - updateViruses( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: virus_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: virus_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: virus_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: virus_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: virus_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: virus_set_input - - """filter the rows which have to be updated""" - where: virus_bool_exp! - ): virus_mutation_response - - """ - update multiples rows of table: "auth.provider_requests" - """ - update_authProviderRequests_many( - """updates to execute, in order""" - updates: [authProviderRequests_updates!]! - ): [authProviderRequests_mutation_response] - - """ - update multiples rows of table: "auth.providers" - """ - update_authProviders_many( - """updates to execute, in order""" - updates: [authProviders_updates!]! - ): [authProviders_mutation_response] - - """ - update multiples rows of table: "auth.refresh_token_types" - """ - update_authRefreshTokenTypes_many( - """updates to execute, in order""" - updates: [authRefreshTokenTypes_updates!]! - ): [authRefreshTokenTypes_mutation_response] - - """ - update multiples rows of table: "auth.refresh_tokens" - """ - update_authRefreshTokens_many( - """updates to execute, in order""" - updates: [authRefreshTokens_updates!]! - ): [authRefreshTokens_mutation_response] - - """ - update multiples rows of table: "auth.roles" - """ - update_authRoles_many( - """updates to execute, in order""" - updates: [authRoles_updates!]! - ): [authRoles_mutation_response] - - """ - update multiples rows of table: "auth.user_providers" - """ - update_authUserProviders_many( - """updates to execute, in order""" - updates: [authUserProviders_updates!]! - ): [authUserProviders_mutation_response] - - """ - update multiples rows of table: "auth.user_roles" - """ - update_authUserRoles_many( - """updates to execute, in order""" - updates: [authUserRoles_updates!]! - ): [authUserRoles_mutation_response] - - """ - update multiples rows of table: "auth.user_security_keys" - """ - update_authUserSecurityKeys_many( - """updates to execute, in order""" - updates: [authUserSecurityKeys_updates!]! - ): [authUserSecurityKeys_mutation_response] - - """ - update multiples rows of table: "storage.buckets" - """ - update_buckets_many( - """updates to execute, in order""" - updates: [buckets_updates!]! - ): [buckets_mutation_response] - - """ - update data of the table: "execution_results" - """ - update_execution_results( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: execution_results_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: execution_results_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: execution_results_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: execution_results_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: execution_results_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: execution_results_set_input - - """filter the rows which have to be updated""" - where: execution_results_bool_exp! - ): execution_results_mutation_response - - """ - update single row of the table: "execution_results" - """ - update_execution_results_by_pk( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: execution_results_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: execution_results_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: execution_results_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: execution_results_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: execution_results_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: execution_results_set_input - pk_columns: execution_results_pk_columns_input! - ): execution_results - - """ - update multiples rows of table: "execution_results" - """ - update_execution_results_many( - """updates to execute, in order""" - updates: [execution_results_updates!]! - ): [execution_results_mutation_response] - - """ - update multiples rows of table: "storage.files" - """ - update_files_many( - """updates to execute, in order""" - updates: [files_updates!]! - ): [files_mutation_response] - - """ - update data of the table: "organization_user" - """ - update_organization_user( - """sets the columns of the filtered rows to the given values""" - _set: organization_user_set_input - - """filter the rows which have to be updated""" - where: organization_user_bool_exp! - ): organization_user_mutation_response - - """ - update single row of the table: "organization_user" - """ - update_organization_user_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: organization_user_set_input - pk_columns: organization_user_pk_columns_input! - ): organization_user - - """ - update multiples rows of table: "organization_user" - """ - update_organization_user_many( - """updates to execute, in order""" - updates: [organization_user_updates!]! - ): [organization_user_mutation_response] - - """ - update data of the table: "organizations" - """ - update_organizations( - """sets the columns of the filtered rows to the given values""" - _set: organizations_set_input - - """filter the rows which have to be updated""" - where: organizations_bool_exp! - ): organizations_mutation_response - - """ - update single row of the table: "organizations" - """ - update_organizations_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: organizations_set_input - pk_columns: organizations_pk_columns_input! - ): organizations - - """ - update multiples rows of table: "organizations" - """ - update_organizations_many( - """updates to execute, in order""" - updates: [organizations_updates!]! - ): [organizations_mutation_response] - - """ - update data of the table: "permission_organization" - """ - update_permission_organization( - """sets the columns of the filtered rows to the given values""" - _set: permission_organization_set_input - - """filter the rows which have to be updated""" - where: permission_organization_bool_exp! - ): permission_organization_mutation_response - - """ - update single row of the table: "permission_organization" - """ - update_permission_organization_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: permission_organization_set_input - pk_columns: permission_organization_pk_columns_input! - ): permission_organization - - """ - update multiples rows of table: "permission_organization" - """ - update_permission_organization_many( - """updates to execute, in order""" - updates: [permission_organization_updates!]! - ): [permission_organization_mutation_response] - - """ - update data of the table: "permission_user" - """ - update_permission_user( - """sets the columns of the filtered rows to the given values""" - _set: permission_user_set_input - - """filter the rows which have to be updated""" - where: permission_user_bool_exp! - ): permission_user_mutation_response - - """ - update single row of the table: "permission_user" - """ - update_permission_user_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: permission_user_set_input - pk_columns: permission_user_pk_columns_input! - ): permission_user - - """ - update multiples rows of table: "permission_user" - """ - update_permission_user_many( - """updates to execute, in order""" - updates: [permission_user_updates!]! - ): [permission_user_mutation_response] - - """ - update data of the table: "permissions" - """ - update_permissions( - """sets the columns of the filtered rows to the given values""" - _set: permissions_set_input - - """filter the rows which have to be updated""" - where: permissions_bool_exp! - ): permissions_mutation_response - - """ - update single row of the table: "permissions" - """ - update_permissions_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: permissions_set_input - pk_columns: permissions_pk_columns_input! - ): permissions - - """ - update multiples rows of table: "permissions" - """ - update_permissions_many( - """updates to execute, in order""" - updates: [permissions_updates!]! - ): [permissions_mutation_response] - - """ - update data of the table: "runbooks" - """ - update_runbooks( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: runbooks_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: runbooks_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: runbooks_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: runbooks_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: runbooks_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: runbooks_set_input - - """filter the rows which have to be updated""" - where: runbooks_bool_exp! - ): runbooks_mutation_response - - """ - update single row of the table: "runbooks" - """ - update_runbooks_by_pk( - """append existing jsonb value of filtered columns with new jsonb value""" - _append: runbooks_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: runbooks_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: runbooks_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: runbooks_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: runbooks_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: runbooks_set_input - pk_columns: runbooks_pk_columns_input! - ): runbooks - - """ - update multiples rows of table: "runbooks" - """ - update_runbooks_many( - """updates to execute, in order""" - updates: [runbooks_updates!]! - ): [runbooks_mutation_response] - - """ - update multiples rows of table: "auth.users" - """ - update_users_many( - """updates to execute, in order""" - updates: [users_updates!]! - ): [users_mutation_response] - - """ - update multiples rows of table: "storage.virus" - """ - update_virus_many( - """updates to execute, in order""" - updates: [virus_updates!]! - ): [virus_mutation_response] -} - -"""column ordering options""" -enum order_by { - """in ascending order, nulls last""" - asc - - """in ascending order, nulls first""" - asc_nulls_first - - """in ascending order, nulls last""" - asc_nulls_last - - """in descending order, nulls first""" - desc - - """in descending order, nulls first""" - desc_nulls_first - - """in descending order, nulls last""" - desc_nulls_last -} - -""" -columns and relationships of "organization_user" -""" -type organization_user { - id: uuid! - - """An object relationship""" - organization: organizations - organization_id: uuid - - """An object relationship""" - user: users - user_id: uuid -} - -""" -aggregated selection of "organization_user" -""" -type organization_user_aggregate { - aggregate: organization_user_aggregate_fields - nodes: [organization_user!]! -} - -input organization_user_aggregate_bool_exp { - count: organization_user_aggregate_bool_exp_count -} - -input organization_user_aggregate_bool_exp_count { - arguments: [organization_user_select_column!] - distinct: Boolean - filter: organization_user_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "organization_user" -""" -type organization_user_aggregate_fields { - count(columns: [organization_user_select_column!], distinct: Boolean): Int! - max: organization_user_max_fields - min: organization_user_min_fields -} - -""" -order by aggregate values of table "organization_user" -""" -input organization_user_aggregate_order_by { - count: order_by - max: organization_user_max_order_by - min: organization_user_min_order_by -} - -""" -input type for inserting array relation for remote table "organization_user" -""" -input organization_user_arr_rel_insert_input { - data: [organization_user_insert_input!]! - - """upsert condition""" - on_conflict: organization_user_on_conflict -} - -""" -Boolean expression to filter rows from the table "organization_user". All fields are combined with a logical 'AND'. -""" -input organization_user_bool_exp { - _and: [organization_user_bool_exp!] - _not: organization_user_bool_exp - _or: [organization_user_bool_exp!] - id: uuid_comparison_exp - organization: organizations_bool_exp - organization_id: uuid_comparison_exp - user: users_bool_exp - user_id: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "organization_user" -""" -enum organization_user_constraint { - """ - unique or primary key constraint on columns "id" - """ - organization_user_pkey -} - -""" -input type for inserting data into table "organization_user" -""" -input organization_user_insert_input { - id: uuid - organization: organizations_obj_rel_insert_input - organization_id: uuid - user: users_obj_rel_insert_input - user_id: uuid -} - -"""aggregate max on columns""" -type organization_user_max_fields { - id: uuid - organization_id: uuid - user_id: uuid -} - -""" -order by max() on columns of table "organization_user" -""" -input organization_user_max_order_by { - id: order_by - organization_id: order_by - user_id: order_by -} - -"""aggregate min on columns""" -type organization_user_min_fields { - id: uuid - organization_id: uuid - user_id: uuid -} - -""" -order by min() on columns of table "organization_user" -""" -input organization_user_min_order_by { - id: order_by - organization_id: order_by - user_id: order_by -} - -""" -response of any mutation on the table "organization_user" -""" -type organization_user_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [organization_user!]! -} - -""" -on_conflict condition type for table "organization_user" -""" -input organization_user_on_conflict { - constraint: organization_user_constraint! - update_columns: [organization_user_update_column!]! = [] - where: organization_user_bool_exp -} - -"""Ordering options when selecting data from "organization_user".""" -input organization_user_order_by { - id: order_by - organization: organizations_order_by - organization_id: order_by - user: users_order_by - user_id: order_by -} - -"""primary key columns input for table: organization_user""" -input organization_user_pk_columns_input { - id: uuid! -} - -""" -select columns of table "organization_user" -""" -enum organization_user_select_column { - """column name""" - id - - """column name""" - organization_id - - """column name""" - user_id -} - -""" -input type for updating data in table "organization_user" -""" -input organization_user_set_input { - id: uuid - organization_id: uuid - user_id: uuid -} - -""" -Streaming cursor of the table "organization_user" -""" -input organization_user_stream_cursor_input { - """Stream column input with initial value""" - initial_value: organization_user_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input organization_user_stream_cursor_value_input { - id: uuid - organization_id: uuid - user_id: uuid -} - -""" -update columns of table "organization_user" -""" -enum organization_user_update_column { - """column name""" - id - - """column name""" - organization_id - - """column name""" - user_id -} - -input organization_user_updates { - """sets the columns of the filtered rows to the given values""" - _set: organization_user_set_input - - """filter the rows which have to be updated""" - where: organization_user_bool_exp! -} - -""" -columns and relationships of "organizations" -""" -type organizations { - created_at: timestamptz - id: uuid! - name: String - - """An array relationship""" - organization_users( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): [organization_user!]! - - """An aggregate relationship""" - organization_users_aggregate( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): organization_user_aggregate! - - """An array relationship""" - permission_organizations( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): [permission_organization!]! - - """An aggregate relationship""" - permission_organizations_aggregate( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): permission_organization_aggregate! - updated_at: timestamptz -} - -""" -aggregated selection of "organizations" -""" -type organizations_aggregate { - aggregate: organizations_aggregate_fields - nodes: [organizations!]! -} - -""" -aggregate fields of "organizations" -""" -type organizations_aggregate_fields { - count(columns: [organizations_select_column!], distinct: Boolean): Int! - max: organizations_max_fields - min: organizations_min_fields -} - -""" -Boolean expression to filter rows from the table "organizations". All fields are combined with a logical 'AND'. -""" -input organizations_bool_exp { - _and: [organizations_bool_exp!] - _not: organizations_bool_exp - _or: [organizations_bool_exp!] - created_at: timestamptz_comparison_exp - id: uuid_comparison_exp - name: String_comparison_exp - organization_users: organization_user_bool_exp - organization_users_aggregate: organization_user_aggregate_bool_exp - permission_organizations: permission_organization_bool_exp - permission_organizations_aggregate: permission_organization_aggregate_bool_exp - updated_at: timestamptz_comparison_exp -} - -""" -unique or primary key constraints on table "organizations" -""" -enum organizations_constraint { - """ - unique or primary key constraint on columns "id" - """ - organizations_pkey -} - -""" -input type for inserting data into table "organizations" -""" -input organizations_insert_input { - created_at: timestamptz - id: uuid - name: String - organization_users: organization_user_arr_rel_insert_input - permission_organizations: permission_organization_arr_rel_insert_input - updated_at: timestamptz -} - -"""aggregate max on columns""" -type organizations_max_fields { - created_at: timestamptz - id: uuid - name: String - updated_at: timestamptz -} - -"""aggregate min on columns""" -type organizations_min_fields { - created_at: timestamptz - id: uuid - name: String - updated_at: timestamptz -} - -""" -response of any mutation on the table "organizations" -""" -type organizations_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [organizations!]! -} - -""" -input type for inserting object relation for remote table "organizations" -""" -input organizations_obj_rel_insert_input { - data: organizations_insert_input! - - """upsert condition""" - on_conflict: organizations_on_conflict -} - -""" -on_conflict condition type for table "organizations" -""" -input organizations_on_conflict { - constraint: organizations_constraint! - update_columns: [organizations_update_column!]! = [] - where: organizations_bool_exp -} - -"""Ordering options when selecting data from "organizations".""" -input organizations_order_by { - created_at: order_by - id: order_by - name: order_by - organization_users_aggregate: organization_user_aggregate_order_by - permission_organizations_aggregate: permission_organization_aggregate_order_by - updated_at: order_by -} - -"""primary key columns input for table: organizations""" -input organizations_pk_columns_input { - id: uuid! -} - -""" -select columns of table "organizations" -""" -enum organizations_select_column { - """column name""" - created_at - - """column name""" - id - - """column name""" - name - - """column name""" - updated_at -} - -""" -input type for updating data in table "organizations" -""" -input organizations_set_input { - created_at: timestamptz - id: uuid - name: String - updated_at: timestamptz -} - -""" -Streaming cursor of the table "organizations" -""" -input organizations_stream_cursor_input { - """Stream column input with initial value""" - initial_value: organizations_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input organizations_stream_cursor_value_input { - created_at: timestamptz - id: uuid - name: String - updated_at: timestamptz -} - -""" -update columns of table "organizations" -""" -enum organizations_update_column { - """column name""" - created_at - - """column name""" - id - - """column name""" - name - - """column name""" - updated_at -} - -input organizations_updates { - """sets the columns of the filtered rows to the given values""" - _set: organizations_set_input - - """filter the rows which have to be updated""" - where: organizations_bool_exp! -} - -""" -columns and relationships of "permission_organization" -""" -type permission_organization { - id: uuid! - - """An object relationship""" - organization: organizations - organization_id: uuid - - """An object relationship""" - permission: permissions - permission_id: uuid -} - -""" -aggregated selection of "permission_organization" -""" -type permission_organization_aggregate { - aggregate: permission_organization_aggregate_fields - nodes: [permission_organization!]! -} - -input permission_organization_aggregate_bool_exp { - count: permission_organization_aggregate_bool_exp_count -} - -input permission_organization_aggregate_bool_exp_count { - arguments: [permission_organization_select_column!] - distinct: Boolean - filter: permission_organization_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "permission_organization" -""" -type permission_organization_aggregate_fields { - count(columns: [permission_organization_select_column!], distinct: Boolean): Int! - max: permission_organization_max_fields - min: permission_organization_min_fields -} - -""" -order by aggregate values of table "permission_organization" -""" -input permission_organization_aggregate_order_by { - count: order_by - max: permission_organization_max_order_by - min: permission_organization_min_order_by -} - -""" -input type for inserting array relation for remote table "permission_organization" -""" -input permission_organization_arr_rel_insert_input { - data: [permission_organization_insert_input!]! - - """upsert condition""" - on_conflict: permission_organization_on_conflict -} - -""" -Boolean expression to filter rows from the table "permission_organization". All fields are combined with a logical 'AND'. -""" -input permission_organization_bool_exp { - _and: [permission_organization_bool_exp!] - _not: permission_organization_bool_exp - _or: [permission_organization_bool_exp!] - id: uuid_comparison_exp - organization: organizations_bool_exp - organization_id: uuid_comparison_exp - permission: permissions_bool_exp - permission_id: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "permission_organization" -""" -enum permission_organization_constraint { - """ - unique or primary key constraint on columns "id" - """ - permission_organization_pkey -} - -""" -input type for inserting data into table "permission_organization" -""" -input permission_organization_insert_input { - id: uuid - organization: organizations_obj_rel_insert_input - organization_id: uuid - permission: permissions_obj_rel_insert_input - permission_id: uuid -} - -"""aggregate max on columns""" -type permission_organization_max_fields { - id: uuid - organization_id: uuid - permission_id: uuid -} - -""" -order by max() on columns of table "permission_organization" -""" -input permission_organization_max_order_by { - id: order_by - organization_id: order_by - permission_id: order_by -} - -"""aggregate min on columns""" -type permission_organization_min_fields { - id: uuid - organization_id: uuid - permission_id: uuid -} - -""" -order by min() on columns of table "permission_organization" -""" -input permission_organization_min_order_by { - id: order_by - organization_id: order_by - permission_id: order_by -} - -""" -response of any mutation on the table "permission_organization" -""" -type permission_organization_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [permission_organization!]! -} - -""" -on_conflict condition type for table "permission_organization" -""" -input permission_organization_on_conflict { - constraint: permission_organization_constraint! - update_columns: [permission_organization_update_column!]! = [] - where: permission_organization_bool_exp -} - -"""Ordering options when selecting data from "permission_organization".""" -input permission_organization_order_by { - id: order_by - organization: organizations_order_by - organization_id: order_by - permission: permissions_order_by - permission_id: order_by -} - -"""primary key columns input for table: permission_organization""" -input permission_organization_pk_columns_input { - id: uuid! -} - -""" -select columns of table "permission_organization" -""" -enum permission_organization_select_column { - """column name""" - id - - """column name""" - organization_id - - """column name""" - permission_id -} - -""" -input type for updating data in table "permission_organization" -""" -input permission_organization_set_input { - id: uuid - organization_id: uuid - permission_id: uuid -} - -""" -Streaming cursor of the table "permission_organization" -""" -input permission_organization_stream_cursor_input { - """Stream column input with initial value""" - initial_value: permission_organization_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input permission_organization_stream_cursor_value_input { - id: uuid - organization_id: uuid - permission_id: uuid -} - -""" -update columns of table "permission_organization" -""" -enum permission_organization_update_column { - """column name""" - id - - """column name""" - organization_id - - """column name""" - permission_id -} - -input permission_organization_updates { - """sets the columns of the filtered rows to the given values""" - _set: permission_organization_set_input - - """filter the rows which have to be updated""" - where: permission_organization_bool_exp! -} - -""" -columns and relationships of "permission_user" -""" -type permission_user { - id: uuid! - - """An object relationship""" - permission: permissions - permission_id: uuid - - """An object relationship""" - user: users - user_id: uuid -} - -""" -aggregated selection of "permission_user" -""" -type permission_user_aggregate { - aggregate: permission_user_aggregate_fields - nodes: [permission_user!]! -} - -input permission_user_aggregate_bool_exp { - count: permission_user_aggregate_bool_exp_count -} - -input permission_user_aggregate_bool_exp_count { - arguments: [permission_user_select_column!] - distinct: Boolean - filter: permission_user_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "permission_user" -""" -type permission_user_aggregate_fields { - count(columns: [permission_user_select_column!], distinct: Boolean): Int! - max: permission_user_max_fields - min: permission_user_min_fields -} - -""" -order by aggregate values of table "permission_user" -""" -input permission_user_aggregate_order_by { - count: order_by - max: permission_user_max_order_by - min: permission_user_min_order_by -} - -""" -input type for inserting array relation for remote table "permission_user" -""" -input permission_user_arr_rel_insert_input { - data: [permission_user_insert_input!]! - - """upsert condition""" - on_conflict: permission_user_on_conflict -} - -""" -Boolean expression to filter rows from the table "permission_user". All fields are combined with a logical 'AND'. -""" -input permission_user_bool_exp { - _and: [permission_user_bool_exp!] - _not: permission_user_bool_exp - _or: [permission_user_bool_exp!] - id: uuid_comparison_exp - permission: permissions_bool_exp - permission_id: uuid_comparison_exp - user: users_bool_exp - user_id: uuid_comparison_exp -} - -""" -unique or primary key constraints on table "permission_user" -""" -enum permission_user_constraint { - """ - unique or primary key constraint on columns "id" - """ - permission_user_pkey -} - -""" -input type for inserting data into table "permission_user" -""" -input permission_user_insert_input { - id: uuid - permission: permissions_obj_rel_insert_input - permission_id: uuid - user: users_obj_rel_insert_input - user_id: uuid -} - -"""aggregate max on columns""" -type permission_user_max_fields { - id: uuid - permission_id: uuid - user_id: uuid -} - -""" -order by max() on columns of table "permission_user" -""" -input permission_user_max_order_by { - id: order_by - permission_id: order_by - user_id: order_by -} - -"""aggregate min on columns""" -type permission_user_min_fields { - id: uuid - permission_id: uuid - user_id: uuid -} - -""" -order by min() on columns of table "permission_user" -""" -input permission_user_min_order_by { - id: order_by - permission_id: order_by - user_id: order_by -} - -""" -response of any mutation on the table "permission_user" -""" -type permission_user_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [permission_user!]! -} - -""" -on_conflict condition type for table "permission_user" -""" -input permission_user_on_conflict { - constraint: permission_user_constraint! - update_columns: [permission_user_update_column!]! = [] - where: permission_user_bool_exp -} - -"""Ordering options when selecting data from "permission_user".""" -input permission_user_order_by { - id: order_by - permission: permissions_order_by - permission_id: order_by - user: users_order_by - user_id: order_by -} - -"""primary key columns input for table: permission_user""" -input permission_user_pk_columns_input { - id: uuid! -} - -""" -select columns of table "permission_user" -""" -enum permission_user_select_column { - """column name""" - id - - """column name""" - permission_id - - """column name""" - user_id -} - -""" -input type for updating data in table "permission_user" -""" -input permission_user_set_input { - id: uuid - permission_id: uuid - user_id: uuid -} - -""" -Streaming cursor of the table "permission_user" -""" -input permission_user_stream_cursor_input { - """Stream column input with initial value""" - initial_value: permission_user_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input permission_user_stream_cursor_value_input { - id: uuid - permission_id: uuid - user_id: uuid -} - -""" -update columns of table "permission_user" -""" -enum permission_user_update_column { - """column name""" - id - - """column name""" - permission_id - - """column name""" - user_id -} - -input permission_user_updates { - """sets the columns of the filtered rows to the given values""" - _set: permission_user_set_input - - """filter the rows which have to be updated""" - where: permission_user_bool_exp! -} - -""" -columns and relationships of "permissions" -""" -type permissions { - id: uuid! - - """An array relationship""" - permission_organizations( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): [permission_organization!]! - - """An aggregate relationship""" - permission_organizations_aggregate( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): permission_organization_aggregate! - - """An array relationship""" - permission_users( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): [permission_user!]! - - """An aggregate relationship""" - permission_users_aggregate( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): permission_user_aggregate! - - """An object relationship""" - runbook: runbooks - - """An object relationship""" - runbookById: runbooks - - """An object relationship""" - runbookById1: runbooks - - """An array relationship""" - runbooks( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """An array relationship""" - runbooksByReadPermissionsId( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """An aggregate relationship""" - runbooksByReadPermissionsId_aggregate( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): runbooks_aggregate! - - """An array relationship""" - runbooksByUpdatePermissionsId( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """An aggregate relationship""" - runbooksByUpdatePermissionsId_aggregate( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): runbooks_aggregate! - - """An aggregate relationship""" - runbooks_aggregate( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): runbooks_aggregate! - type: String! -} - -""" -aggregated selection of "permissions" -""" -type permissions_aggregate { - aggregate: permissions_aggregate_fields - nodes: [permissions!]! -} - -""" -aggregate fields of "permissions" -""" -type permissions_aggregate_fields { - count(columns: [permissions_select_column!], distinct: Boolean): Int! - max: permissions_max_fields - min: permissions_min_fields -} - -""" -Boolean expression to filter rows from the table "permissions". All fields are combined with a logical 'AND'. -""" -input permissions_bool_exp { - _and: [permissions_bool_exp!] - _not: permissions_bool_exp - _or: [permissions_bool_exp!] - id: uuid_comparison_exp - permission_organizations: permission_organization_bool_exp - permission_organizations_aggregate: permission_organization_aggregate_bool_exp - permission_users: permission_user_bool_exp - permission_users_aggregate: permission_user_aggregate_bool_exp - runbook: runbooks_bool_exp - runbookById: runbooks_bool_exp - runbookById1: runbooks_bool_exp - runbooks: runbooks_bool_exp - runbooksByReadPermissionsId: runbooks_bool_exp - runbooksByReadPermissionsId_aggregate: runbooks_aggregate_bool_exp - runbooksByUpdatePermissionsId: runbooks_bool_exp - runbooksByUpdatePermissionsId_aggregate: runbooks_aggregate_bool_exp - runbooks_aggregate: runbooks_aggregate_bool_exp - type: String_comparison_exp -} - -""" -unique or primary key constraints on table "permissions" -""" -enum permissions_constraint { - """ - unique or primary key constraint on columns "id" - """ - permissions_pkey -} - -""" -input type for inserting data into table "permissions" -""" -input permissions_insert_input { - id: uuid - permission_organizations: permission_organization_arr_rel_insert_input - permission_users: permission_user_arr_rel_insert_input - runbook: runbooks_obj_rel_insert_input - runbookById: runbooks_obj_rel_insert_input - runbookById1: runbooks_obj_rel_insert_input - runbooks: runbooks_arr_rel_insert_input - runbooksByReadPermissionsId: runbooks_arr_rel_insert_input - runbooksByUpdatePermissionsId: runbooks_arr_rel_insert_input - type: String -} - -"""aggregate max on columns""" -type permissions_max_fields { - id: uuid - type: String -} - -"""aggregate min on columns""" -type permissions_min_fields { - id: uuid - type: String -} - -""" -response of any mutation on the table "permissions" -""" -type permissions_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [permissions!]! -} - -""" -input type for inserting object relation for remote table "permissions" -""" -input permissions_obj_rel_insert_input { - data: permissions_insert_input! - - """upsert condition""" - on_conflict: permissions_on_conflict -} - -""" -on_conflict condition type for table "permissions" -""" -input permissions_on_conflict { - constraint: permissions_constraint! - update_columns: [permissions_update_column!]! = [] - where: permissions_bool_exp -} - -"""Ordering options when selecting data from "permissions".""" -input permissions_order_by { - id: order_by - permission_organizations_aggregate: permission_organization_aggregate_order_by - permission_users_aggregate: permission_user_aggregate_order_by - runbook: runbooks_order_by - runbookById: runbooks_order_by - runbookById1: runbooks_order_by - runbooksByReadPermissionsId_aggregate: runbooks_aggregate_order_by - runbooksByUpdatePermissionsId_aggregate: runbooks_aggregate_order_by - runbooks_aggregate: runbooks_aggregate_order_by - type: order_by -} - -"""primary key columns input for table: permissions""" -input permissions_pk_columns_input { - id: uuid! -} - -""" -select columns of table "permissions" -""" -enum permissions_select_column { - """column name""" - id - - """column name""" - type -} - -""" -input type for updating data in table "permissions" -""" -input permissions_set_input { - id: uuid - type: String -} - -""" -Streaming cursor of the table "permissions" -""" -input permissions_stream_cursor_input { - """Stream column input with initial value""" - initial_value: permissions_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input permissions_stream_cursor_value_input { - id: uuid - type: String -} - -""" -update columns of table "permissions" -""" -enum permissions_update_column { - """column name""" - id - - """column name""" - type -} - -input permissions_updates { - """sets the columns of the filtered rows to the given values""" - _set: permissions_set_input - - """filter the rows which have to be updated""" - where: permissions_bool_exp! -} - -type query_root { - """fetch data from the table: "auth.providers" using primary key columns""" - authProvider(id: String!): authProviders - - """ - fetch data from the table: "auth.provider_requests" using primary key columns - """ - authProviderRequest(id: uuid!): authProviderRequests - - """ - fetch data from the table: "auth.provider_requests" - """ - authProviderRequests( - """distinct select on columns""" - distinct_on: [authProviderRequests_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviderRequests_order_by!] - - """filter the rows returned""" - where: authProviderRequests_bool_exp - ): [authProviderRequests!]! - - """ - fetch aggregated fields from the table: "auth.provider_requests" - """ - authProviderRequestsAggregate( - """distinct select on columns""" - distinct_on: [authProviderRequests_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviderRequests_order_by!] - - """filter the rows returned""" - where: authProviderRequests_bool_exp - ): authProviderRequests_aggregate! - - """ - fetch data from the table: "auth.providers" - """ - authProviders( - """distinct select on columns""" - distinct_on: [authProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviders_order_by!] - - """filter the rows returned""" - where: authProviders_bool_exp - ): [authProviders!]! - - """ - fetch aggregated fields from the table: "auth.providers" - """ - authProvidersAggregate( - """distinct select on columns""" - distinct_on: [authProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviders_order_by!] - - """filter the rows returned""" - where: authProviders_bool_exp - ): authProviders_aggregate! - - """ - fetch data from the table: "auth.refresh_tokens" using primary key columns - """ - authRefreshToken(id: uuid!): authRefreshTokens - - """ - fetch data from the table: "auth.refresh_token_types" using primary key columns - """ - authRefreshTokenType(value: String!): authRefreshTokenTypes - - """ - fetch data from the table: "auth.refresh_token_types" - """ - authRefreshTokenTypes( - """distinct select on columns""" - distinct_on: [authRefreshTokenTypes_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokenTypes_order_by!] - - """filter the rows returned""" - where: authRefreshTokenTypes_bool_exp - ): [authRefreshTokenTypes!]! - - """ - fetch aggregated fields from the table: "auth.refresh_token_types" - """ - authRefreshTokenTypesAggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokenTypes_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokenTypes_order_by!] - - """filter the rows returned""" - where: authRefreshTokenTypes_bool_exp - ): authRefreshTokenTypes_aggregate! - - """ - fetch data from the table: "auth.refresh_tokens" - """ - authRefreshTokens( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): [authRefreshTokens!]! - - """ - fetch aggregated fields from the table: "auth.refresh_tokens" - """ - authRefreshTokensAggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): authRefreshTokens_aggregate! - - """fetch data from the table: "auth.roles" using primary key columns""" - authRole(role: String!): authRoles - - """ - fetch data from the table: "auth.roles" - """ - authRoles( - """distinct select on columns""" - distinct_on: [authRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRoles_order_by!] - - """filter the rows returned""" - where: authRoles_bool_exp - ): [authRoles!]! - - """ - fetch aggregated fields from the table: "auth.roles" - """ - authRolesAggregate( - """distinct select on columns""" - distinct_on: [authRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRoles_order_by!] - - """filter the rows returned""" - where: authRoles_bool_exp - ): authRoles_aggregate! - - """ - fetch data from the table: "auth.user_providers" using primary key columns - """ - authUserProvider(id: uuid!): authUserProviders - - """ - fetch data from the table: "auth.user_providers" - """ - authUserProviders( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): [authUserProviders!]! - - """ - fetch aggregated fields from the table: "auth.user_providers" - """ - authUserProvidersAggregate( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): authUserProviders_aggregate! - - """fetch data from the table: "auth.user_roles" using primary key columns""" - authUserRole(id: uuid!): authUserRoles - - """ - fetch data from the table: "auth.user_roles" - """ - authUserRoles( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): [authUserRoles!]! - - """ - fetch aggregated fields from the table: "auth.user_roles" - """ - authUserRolesAggregate( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): authUserRoles_aggregate! - - """ - fetch data from the table: "auth.user_security_keys" using primary key columns - """ - authUserSecurityKey(id: uuid!): authUserSecurityKeys - - """ - fetch data from the table: "auth.user_security_keys" - """ - authUserSecurityKeys( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): [authUserSecurityKeys!]! - - """ - fetch aggregated fields from the table: "auth.user_security_keys" - """ - authUserSecurityKeysAggregate( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): authUserSecurityKeys_aggregate! - - """fetch data from the table: "storage.buckets" using primary key columns""" - bucket(id: String!): buckets - - """ - fetch data from the table: "storage.buckets" - """ - buckets( - """distinct select on columns""" - distinct_on: [buckets_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [buckets_order_by!] - - """filter the rows returned""" - where: buckets_bool_exp - ): [buckets!]! - - """ - fetch aggregated fields from the table: "storage.buckets" - """ - bucketsAggregate( - """distinct select on columns""" - distinct_on: [buckets_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [buckets_order_by!] - - """filter the rows returned""" - where: buckets_bool_exp - ): buckets_aggregate! - - """An array relationship""" - execution_results( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): [execution_results!]! - - """An aggregate relationship""" - execution_results_aggregate( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): execution_results_aggregate! - - """ - fetch data from the table: "execution_results" using primary key columns - """ - execution_results_by_pk(id: uuid!): execution_results - - """fetch data from the table: "storage.files" using primary key columns""" - file(id: uuid!): files - - """An array relationship""" - files( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): [files!]! - - """ - fetch aggregated fields from the table: "storage.files" - """ - filesAggregate( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): files_aggregate! - - """ - fetch data from the table: "organization_user" - """ - organization_user( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): [organization_user!]! - - """ - fetch aggregated fields from the table: "organization_user" - """ - organization_user_aggregate( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): organization_user_aggregate! - - """ - fetch data from the table: "organization_user" using primary key columns - """ - organization_user_by_pk(id: uuid!): organization_user - - """ - fetch data from the table: "organizations" - """ - organizations( - """distinct select on columns""" - distinct_on: [organizations_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organizations_order_by!] - - """filter the rows returned""" - where: organizations_bool_exp - ): [organizations!]! - - """ - fetch aggregated fields from the table: "organizations" - """ - organizations_aggregate( - """distinct select on columns""" - distinct_on: [organizations_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organizations_order_by!] - - """filter the rows returned""" - where: organizations_bool_exp - ): organizations_aggregate! - - """fetch data from the table: "organizations" using primary key columns""" - organizations_by_pk(id: uuid!): organizations - - """ - fetch data from the table: "permission_organization" - """ - permission_organization( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): [permission_organization!]! - - """ - fetch aggregated fields from the table: "permission_organization" - """ - permission_organization_aggregate( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): permission_organization_aggregate! - - """ - fetch data from the table: "permission_organization" using primary key columns - """ - permission_organization_by_pk(id: uuid!): permission_organization - - """ - fetch data from the table: "permission_user" - """ - permission_user( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): [permission_user!]! - - """ - fetch aggregated fields from the table: "permission_user" - """ - permission_user_aggregate( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): permission_user_aggregate! - - """fetch data from the table: "permission_user" using primary key columns""" - permission_user_by_pk(id: uuid!): permission_user - - """ - fetch data from the table: "permissions" - """ - permissions( - """distinct select on columns""" - distinct_on: [permissions_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permissions_order_by!] - - """filter the rows returned""" - where: permissions_bool_exp - ): [permissions!]! - - """ - fetch aggregated fields from the table: "permissions" - """ - permissions_aggregate( - """distinct select on columns""" - distinct_on: [permissions_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permissions_order_by!] - - """filter the rows returned""" - where: permissions_bool_exp - ): permissions_aggregate! - - """fetch data from the table: "permissions" using primary key columns""" - permissions_by_pk(id: uuid!): permissions - - """An array relationship""" - runbooks( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """An aggregate relationship""" - runbooks_aggregate( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): runbooks_aggregate! - - """fetch data from the table: "runbooks" using primary key columns""" - runbooks_by_pk(id: uuid!): runbooks - - """fetch data from the table: "auth.users" using primary key columns""" - user(id: uuid!): users - - """ - fetch data from the table: "auth.users" - """ - users( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): [users!]! - - """ - fetch aggregated fields from the table: "auth.users" - """ - usersAggregate( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): users_aggregate! - - """fetch data from the table: "storage.virus" using primary key columns""" - virus(id: uuid!): virus - - """ - fetch data from the table: "storage.virus" - """ - viruses( - """distinct select on columns""" - distinct_on: [virus_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [virus_order_by!] - - """filter the rows returned""" - where: virus_bool_exp - ): [virus!]! - - """ - fetch aggregated fields from the table: "storage.virus" - """ - virusesAggregate( - """distinct select on columns""" - distinct_on: [virus_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [virus_order_by!] - - """filter the rows returned""" - where: virus_bool_exp - ): virus_aggregate! -} - -""" -columns and relationships of "runbooks" -""" -type runbooks { - author_id: uuid - created_at: timestamptz! - delete_permissions_id: uuid - description: String - documentation( - """JSON select path""" - path: String - ): jsonb - - """An array relationship""" - execution_results( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): [execution_results!]! - - """An aggregate relationship""" - execution_results_aggregate( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): execution_results_aggregate! - id: uuid! - name: String - organization_id: uuid - - """An object relationship""" - permissionByDeletePermissionsId: permissions - - """An object relationship""" - permissionByReadPermissionsId: permissions! - - """An object relationship""" - permissionByUpdatePermissionsId: permissions - raw_runbook( - """JSON select path""" - path: String - ): jsonb - read_permissions_id: uuid! - - """An array relationship""" - runbook_executions( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): [execution_results!]! - - """An aggregate relationship""" - runbook_executions_aggregate( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): execution_results_aggregate! - update_permissions_id: uuid - updated_at: timestamptz! - workspace_id: String -} - -""" -aggregated selection of "runbooks" -""" -type runbooks_aggregate { - aggregate: runbooks_aggregate_fields - nodes: [runbooks!]! -} - -input runbooks_aggregate_bool_exp { - count: runbooks_aggregate_bool_exp_count -} - -input runbooks_aggregate_bool_exp_count { - arguments: [runbooks_select_column!] - distinct: Boolean - filter: runbooks_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "runbooks" -""" -type runbooks_aggregate_fields { - count(columns: [runbooks_select_column!], distinct: Boolean): Int! - max: runbooks_max_fields - min: runbooks_min_fields -} - -""" -order by aggregate values of table "runbooks" -""" -input runbooks_aggregate_order_by { - count: order_by - max: runbooks_max_order_by - min: runbooks_min_order_by -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input runbooks_append_input { - documentation: jsonb - raw_runbook: jsonb -} - -""" -input type for inserting array relation for remote table "runbooks" -""" -input runbooks_arr_rel_insert_input { - data: [runbooks_insert_input!]! - - """upsert condition""" - on_conflict: runbooks_on_conflict -} - -""" -Boolean expression to filter rows from the table "runbooks". All fields are combined with a logical 'AND'. -""" -input runbooks_bool_exp { - _and: [runbooks_bool_exp!] - _not: runbooks_bool_exp - _or: [runbooks_bool_exp!] - author_id: uuid_comparison_exp - created_at: timestamptz_comparison_exp - delete_permissions_id: uuid_comparison_exp - description: String_comparison_exp - documentation: jsonb_comparison_exp - execution_results: execution_results_bool_exp - execution_results_aggregate: execution_results_aggregate_bool_exp - id: uuid_comparison_exp - name: String_comparison_exp - organization_id: uuid_comparison_exp - permissionByDeletePermissionsId: permissions_bool_exp - permissionByReadPermissionsId: permissions_bool_exp - permissionByUpdatePermissionsId: permissions_bool_exp - raw_runbook: jsonb_comparison_exp - read_permissions_id: uuid_comparison_exp - runbook_executions: execution_results_bool_exp - runbook_executions_aggregate: execution_results_aggregate_bool_exp - update_permissions_id: uuid_comparison_exp - updated_at: timestamptz_comparison_exp - workspace_id: String_comparison_exp -} - -""" -unique or primary key constraints on table "runbooks" -""" -enum runbooks_constraint { - """ - unique or primary key constraint on columns "delete_permissions_id" - """ - runbooks_delete_permissions_id_unique - - """ - unique or primary key constraint on columns "organization_id" - """ - runbooks_organization_id_key - - """ - unique or primary key constraint on columns "id" - """ - runbooks_pkey - - """ - unique or primary key constraint on columns "read_permissions_id" - """ - runbooks_read_permissions_id_unique - - """ - unique or primary key constraint on columns "update_permissions_id" - """ - runbooks_update_permissions_id_unique -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input runbooks_delete_at_path_input { - documentation: [String!] - raw_runbook: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input runbooks_delete_elem_input { - documentation: Int - raw_runbook: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input runbooks_delete_key_input { - documentation: String - raw_runbook: String -} - -""" -input type for inserting data into table "runbooks" -""" -input runbooks_insert_input { - author_id: uuid - created_at: timestamptz - delete_permissions_id: uuid - description: String - documentation: jsonb - execution_results: execution_results_arr_rel_insert_input - id: uuid - name: String - organization_id: uuid - permissionByDeletePermissionsId: permissions_obj_rel_insert_input - permissionByReadPermissionsId: permissions_obj_rel_insert_input - permissionByUpdatePermissionsId: permissions_obj_rel_insert_input - raw_runbook: jsonb - read_permissions_id: uuid - runbook_executions: execution_results_arr_rel_insert_input - update_permissions_id: uuid - updated_at: timestamptz - workspace_id: String -} - -"""aggregate max on columns""" -type runbooks_max_fields { - author_id: uuid - created_at: timestamptz - delete_permissions_id: uuid - description: String - id: uuid - name: String - organization_id: uuid - read_permissions_id: uuid - update_permissions_id: uuid - updated_at: timestamptz - workspace_id: String -} - -""" -order by max() on columns of table "runbooks" -""" -input runbooks_max_order_by { - author_id: order_by - created_at: order_by - delete_permissions_id: order_by - description: order_by - id: order_by - name: order_by - organization_id: order_by - read_permissions_id: order_by - update_permissions_id: order_by - updated_at: order_by - workspace_id: order_by -} - -"""aggregate min on columns""" -type runbooks_min_fields { - author_id: uuid - created_at: timestamptz - delete_permissions_id: uuid - description: String - id: uuid - name: String - organization_id: uuid - read_permissions_id: uuid - update_permissions_id: uuid - updated_at: timestamptz - workspace_id: String -} - -""" -order by min() on columns of table "runbooks" -""" -input runbooks_min_order_by { - author_id: order_by - created_at: order_by - delete_permissions_id: order_by - description: order_by - id: order_by - name: order_by - organization_id: order_by - read_permissions_id: order_by - update_permissions_id: order_by - updated_at: order_by - workspace_id: order_by -} - -""" -response of any mutation on the table "runbooks" -""" -type runbooks_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [runbooks!]! -} - -""" -input type for inserting object relation for remote table "runbooks" -""" -input runbooks_obj_rel_insert_input { - data: runbooks_insert_input! - - """upsert condition""" - on_conflict: runbooks_on_conflict -} - -""" -on_conflict condition type for table "runbooks" -""" -input runbooks_on_conflict { - constraint: runbooks_constraint! - update_columns: [runbooks_update_column!]! = [] - where: runbooks_bool_exp -} - -"""Ordering options when selecting data from "runbooks".""" -input runbooks_order_by { - author_id: order_by - created_at: order_by - delete_permissions_id: order_by - description: order_by - documentation: order_by - execution_results_aggregate: execution_results_aggregate_order_by - id: order_by - name: order_by - organization_id: order_by - permissionByDeletePermissionsId: permissions_order_by - permissionByReadPermissionsId: permissions_order_by - permissionByUpdatePermissionsId: permissions_order_by - raw_runbook: order_by - read_permissions_id: order_by - runbook_executions_aggregate: execution_results_aggregate_order_by - update_permissions_id: order_by - updated_at: order_by - workspace_id: order_by -} - -"""primary key columns input for table: runbooks""" -input runbooks_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input runbooks_prepend_input { - documentation: jsonb - raw_runbook: jsonb -} - -""" -select columns of table "runbooks" -""" -enum runbooks_select_column { - """column name""" - author_id - - """column name""" - created_at - - """column name""" - delete_permissions_id - - """column name""" - description - - """column name""" - documentation - - """column name""" - id - - """column name""" - name - - """column name""" - organization_id - - """column name""" - raw_runbook - - """column name""" - read_permissions_id - - """column name""" - update_permissions_id - - """column name""" - updated_at - - """column name""" - workspace_id -} - -""" -input type for updating data in table "runbooks" -""" -input runbooks_set_input { - author_id: uuid - created_at: timestamptz - delete_permissions_id: uuid - description: String - documentation: jsonb - id: uuid - name: String - organization_id: uuid - raw_runbook: jsonb - read_permissions_id: uuid - update_permissions_id: uuid - updated_at: timestamptz - workspace_id: String -} - -""" -Streaming cursor of the table "runbooks" -""" -input runbooks_stream_cursor_input { - """Stream column input with initial value""" - initial_value: runbooks_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input runbooks_stream_cursor_value_input { - author_id: uuid - created_at: timestamptz - delete_permissions_id: uuid - description: String - documentation: jsonb - id: uuid - name: String - organization_id: uuid - raw_runbook: jsonb - read_permissions_id: uuid - update_permissions_id: uuid - updated_at: timestamptz - workspace_id: String -} - -""" -update columns of table "runbooks" -""" -enum runbooks_update_column { - """column name""" - author_id - - """column name""" - created_at - - """column name""" - delete_permissions_id - - """column name""" - description - - """column name""" - documentation - - """column name""" - id - - """column name""" - name - - """column name""" - organization_id - - """column name""" - raw_runbook - - """column name""" - read_permissions_id - - """column name""" - update_permissions_id - - """column name""" - updated_at - - """column name""" - workspace_id -} - -input runbooks_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: runbooks_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: runbooks_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: runbooks_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: runbooks_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: runbooks_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: runbooks_set_input - - """filter the rows which have to be updated""" - where: runbooks_bool_exp! -} - -type subscription_root { - """fetch data from the table: "auth.providers" using primary key columns""" - authProvider(id: String!): authProviders - - """ - fetch data from the table: "auth.provider_requests" using primary key columns - """ - authProviderRequest(id: uuid!): authProviderRequests - - """ - fetch data from the table: "auth.provider_requests" - """ - authProviderRequests( - """distinct select on columns""" - distinct_on: [authProviderRequests_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviderRequests_order_by!] - - """filter the rows returned""" - where: authProviderRequests_bool_exp - ): [authProviderRequests!]! - - """ - fetch aggregated fields from the table: "auth.provider_requests" - """ - authProviderRequestsAggregate( - """distinct select on columns""" - distinct_on: [authProviderRequests_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviderRequests_order_by!] - - """filter the rows returned""" - where: authProviderRequests_bool_exp - ): authProviderRequests_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.provider_requests" - """ - authProviderRequests_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authProviderRequests_stream_cursor_input]! - - """filter the rows returned""" - where: authProviderRequests_bool_exp - ): [authProviderRequests!]! - - """ - fetch data from the table: "auth.providers" - """ - authProviders( - """distinct select on columns""" - distinct_on: [authProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviders_order_by!] - - """filter the rows returned""" - where: authProviders_bool_exp - ): [authProviders!]! - - """ - fetch aggregated fields from the table: "auth.providers" - """ - authProvidersAggregate( - """distinct select on columns""" - distinct_on: [authProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authProviders_order_by!] - - """filter the rows returned""" - where: authProviders_bool_exp - ): authProviders_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.providers" - """ - authProviders_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authProviders_stream_cursor_input]! - - """filter the rows returned""" - where: authProviders_bool_exp - ): [authProviders!]! - - """ - fetch data from the table: "auth.refresh_tokens" using primary key columns - """ - authRefreshToken(id: uuid!): authRefreshTokens - - """ - fetch data from the table: "auth.refresh_token_types" using primary key columns - """ - authRefreshTokenType(value: String!): authRefreshTokenTypes - - """ - fetch data from the table: "auth.refresh_token_types" - """ - authRefreshTokenTypes( - """distinct select on columns""" - distinct_on: [authRefreshTokenTypes_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokenTypes_order_by!] - - """filter the rows returned""" - where: authRefreshTokenTypes_bool_exp - ): [authRefreshTokenTypes!]! - - """ - fetch aggregated fields from the table: "auth.refresh_token_types" - """ - authRefreshTokenTypesAggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokenTypes_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokenTypes_order_by!] - - """filter the rows returned""" - where: authRefreshTokenTypes_bool_exp - ): authRefreshTokenTypes_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.refresh_token_types" - """ - authRefreshTokenTypes_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authRefreshTokenTypes_stream_cursor_input]! - - """filter the rows returned""" - where: authRefreshTokenTypes_bool_exp - ): [authRefreshTokenTypes!]! - - """ - fetch data from the table: "auth.refresh_tokens" - """ - authRefreshTokens( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): [authRefreshTokens!]! - - """ - fetch aggregated fields from the table: "auth.refresh_tokens" - """ - authRefreshTokensAggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): authRefreshTokens_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.refresh_tokens" - """ - authRefreshTokens_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authRefreshTokens_stream_cursor_input]! - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): [authRefreshTokens!]! - - """fetch data from the table: "auth.roles" using primary key columns""" - authRole(role: String!): authRoles - - """ - fetch data from the table: "auth.roles" - """ - authRoles( - """distinct select on columns""" - distinct_on: [authRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRoles_order_by!] - - """filter the rows returned""" - where: authRoles_bool_exp - ): [authRoles!]! - - """ - fetch aggregated fields from the table: "auth.roles" - """ - authRolesAggregate( - """distinct select on columns""" - distinct_on: [authRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRoles_order_by!] - - """filter the rows returned""" - where: authRoles_bool_exp - ): authRoles_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.roles" - """ - authRoles_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authRoles_stream_cursor_input]! - - """filter the rows returned""" - where: authRoles_bool_exp - ): [authRoles!]! - - """ - fetch data from the table: "auth.user_providers" using primary key columns - """ - authUserProvider(id: uuid!): authUserProviders - - """ - fetch data from the table: "auth.user_providers" - """ - authUserProviders( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): [authUserProviders!]! - - """ - fetch aggregated fields from the table: "auth.user_providers" - """ - authUserProvidersAggregate( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): authUserProviders_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.user_providers" - """ - authUserProviders_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authUserProviders_stream_cursor_input]! - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): [authUserProviders!]! - - """fetch data from the table: "auth.user_roles" using primary key columns""" - authUserRole(id: uuid!): authUserRoles - - """ - fetch data from the table: "auth.user_roles" - """ - authUserRoles( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): [authUserRoles!]! - - """ - fetch aggregated fields from the table: "auth.user_roles" - """ - authUserRolesAggregate( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): authUserRoles_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.user_roles" - """ - authUserRoles_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authUserRoles_stream_cursor_input]! - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): [authUserRoles!]! - - """ - fetch data from the table: "auth.user_security_keys" using primary key columns - """ - authUserSecurityKey(id: uuid!): authUserSecurityKeys - - """ - fetch data from the table: "auth.user_security_keys" - """ - authUserSecurityKeys( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): [authUserSecurityKeys!]! - - """ - fetch aggregated fields from the table: "auth.user_security_keys" - """ - authUserSecurityKeysAggregate( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): authUserSecurityKeys_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.user_security_keys" - """ - authUserSecurityKeys_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [authUserSecurityKeys_stream_cursor_input]! - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): [authUserSecurityKeys!]! - - """fetch data from the table: "storage.buckets" using primary key columns""" - bucket(id: String!): buckets - - """ - fetch data from the table: "storage.buckets" - """ - buckets( - """distinct select on columns""" - distinct_on: [buckets_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [buckets_order_by!] - - """filter the rows returned""" - where: buckets_bool_exp - ): [buckets!]! - - """ - fetch aggregated fields from the table: "storage.buckets" - """ - bucketsAggregate( - """distinct select on columns""" - distinct_on: [buckets_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [buckets_order_by!] - - """filter the rows returned""" - where: buckets_bool_exp - ): buckets_aggregate! - - """ - fetch data from the table in a streaming manner: "storage.buckets" - """ - buckets_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [buckets_stream_cursor_input]! - - """filter the rows returned""" - where: buckets_bool_exp - ): [buckets!]! - - """An array relationship""" - execution_results( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): [execution_results!]! - - """An aggregate relationship""" - execution_results_aggregate( - """distinct select on columns""" - distinct_on: [execution_results_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [execution_results_order_by!] - - """filter the rows returned""" - where: execution_results_bool_exp - ): execution_results_aggregate! - - """ - fetch data from the table: "execution_results" using primary key columns - """ - execution_results_by_pk(id: uuid!): execution_results - - """ - fetch data from the table in a streaming manner: "execution_results" - """ - execution_results_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [execution_results_stream_cursor_input]! - - """filter the rows returned""" - where: execution_results_bool_exp - ): [execution_results!]! - - """fetch data from the table: "storage.files" using primary key columns""" - file(id: uuid!): files - - """An array relationship""" - files( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): [files!]! - - """ - fetch aggregated fields from the table: "storage.files" - """ - filesAggregate( - """distinct select on columns""" - distinct_on: [files_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [files_order_by!] - - """filter the rows returned""" - where: files_bool_exp - ): files_aggregate! - - """ - fetch data from the table in a streaming manner: "storage.files" - """ - files_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [files_stream_cursor_input]! - - """filter the rows returned""" - where: files_bool_exp - ): [files!]! - - """ - fetch data from the table: "organization_user" - """ - organization_user( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): [organization_user!]! - - """ - fetch aggregated fields from the table: "organization_user" - """ - organization_user_aggregate( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): organization_user_aggregate! - - """ - fetch data from the table: "organization_user" using primary key columns - """ - organization_user_by_pk(id: uuid!): organization_user - - """ - fetch data from the table in a streaming manner: "organization_user" - """ - organization_user_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [organization_user_stream_cursor_input]! - - """filter the rows returned""" - where: organization_user_bool_exp - ): [organization_user!]! - - """ - fetch data from the table: "organizations" - """ - organizations( - """distinct select on columns""" - distinct_on: [organizations_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organizations_order_by!] - - """filter the rows returned""" - where: organizations_bool_exp - ): [organizations!]! - - """ - fetch aggregated fields from the table: "organizations" - """ - organizations_aggregate( - """distinct select on columns""" - distinct_on: [organizations_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organizations_order_by!] - - """filter the rows returned""" - where: organizations_bool_exp - ): organizations_aggregate! - - """fetch data from the table: "organizations" using primary key columns""" - organizations_by_pk(id: uuid!): organizations - - """ - fetch data from the table in a streaming manner: "organizations" - """ - organizations_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [organizations_stream_cursor_input]! - - """filter the rows returned""" - where: organizations_bool_exp - ): [organizations!]! - - """ - fetch data from the table: "permission_organization" - """ - permission_organization( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): [permission_organization!]! - - """ - fetch aggregated fields from the table: "permission_organization" - """ - permission_organization_aggregate( - """distinct select on columns""" - distinct_on: [permission_organization_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_organization_order_by!] - - """filter the rows returned""" - where: permission_organization_bool_exp - ): permission_organization_aggregate! - - """ - fetch data from the table: "permission_organization" using primary key columns - """ - permission_organization_by_pk(id: uuid!): permission_organization - - """ - fetch data from the table in a streaming manner: "permission_organization" - """ - permission_organization_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [permission_organization_stream_cursor_input]! - - """filter the rows returned""" - where: permission_organization_bool_exp - ): [permission_organization!]! - - """ - fetch data from the table: "permission_user" - """ - permission_user( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): [permission_user!]! - - """ - fetch aggregated fields from the table: "permission_user" - """ - permission_user_aggregate( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): permission_user_aggregate! - - """fetch data from the table: "permission_user" using primary key columns""" - permission_user_by_pk(id: uuid!): permission_user - - """ - fetch data from the table in a streaming manner: "permission_user" - """ - permission_user_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [permission_user_stream_cursor_input]! - - """filter the rows returned""" - where: permission_user_bool_exp - ): [permission_user!]! - - """ - fetch data from the table: "permissions" - """ - permissions( - """distinct select on columns""" - distinct_on: [permissions_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permissions_order_by!] - - """filter the rows returned""" - where: permissions_bool_exp - ): [permissions!]! - - """ - fetch aggregated fields from the table: "permissions" - """ - permissions_aggregate( - """distinct select on columns""" - distinct_on: [permissions_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permissions_order_by!] - - """filter the rows returned""" - where: permissions_bool_exp - ): permissions_aggregate! - - """fetch data from the table: "permissions" using primary key columns""" - permissions_by_pk(id: uuid!): permissions - - """ - fetch data from the table in a streaming manner: "permissions" - """ - permissions_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [permissions_stream_cursor_input]! - - """filter the rows returned""" - where: permissions_bool_exp - ): [permissions!]! - - """An array relationship""" - runbooks( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """An aggregate relationship""" - runbooks_aggregate( - """distinct select on columns""" - distinct_on: [runbooks_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [runbooks_order_by!] - - """filter the rows returned""" - where: runbooks_bool_exp - ): runbooks_aggregate! - - """fetch data from the table: "runbooks" using primary key columns""" - runbooks_by_pk(id: uuid!): runbooks - - """ - fetch data from the table in a streaming manner: "runbooks" - """ - runbooks_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [runbooks_stream_cursor_input]! - - """filter the rows returned""" - where: runbooks_bool_exp - ): [runbooks!]! - - """fetch data from the table: "auth.users" using primary key columns""" - user(id: uuid!): users - - """ - fetch data from the table: "auth.users" - """ - users( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): [users!]! - - """ - fetch aggregated fields from the table: "auth.users" - """ - usersAggregate( - """distinct select on columns""" - distinct_on: [users_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [users_order_by!] - - """filter the rows returned""" - where: users_bool_exp - ): users_aggregate! - - """ - fetch data from the table in a streaming manner: "auth.users" - """ - users_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [users_stream_cursor_input]! - - """filter the rows returned""" - where: users_bool_exp - ): [users!]! - - """fetch data from the table: "storage.virus" using primary key columns""" - virus(id: uuid!): virus - - """ - fetch data from the table in a streaming manner: "storage.virus" - """ - virus_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [virus_stream_cursor_input]! - - """filter the rows returned""" - where: virus_bool_exp - ): [virus!]! - - """ - fetch data from the table: "storage.virus" - """ - viruses( - """distinct select on columns""" - distinct_on: [virus_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [virus_order_by!] - - """filter the rows returned""" - where: virus_bool_exp - ): [virus!]! - - """ - fetch aggregated fields from the table: "storage.virus" - """ - virusesAggregate( - """distinct select on columns""" - distinct_on: [virus_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [virus_order_by!] - - """filter the rows returned""" - where: virus_bool_exp - ): virus_aggregate! -} - -scalar timestamptz - -""" -Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. -""" -input timestamptz_comparison_exp { - _eq: timestamptz - _gt: timestamptz - _gte: timestamptz - _in: [timestamptz!] - _is_null: Boolean - _lt: timestamptz - _lte: timestamptz - _neq: timestamptz - _nin: [timestamptz!] -} - -""" -User account information. Don't modify its structure as Hasura Auth relies on it to function properly. -""" -type users { - activeMfaType: String - avatarUrl: String! - createdAt: timestamptz! - currentChallenge: String - defaultRole: String! - - """An object relationship""" - defaultRoleByRole: authRoles! - disabled: Boolean! - displayName: String! - email: citext - emailVerified: Boolean! - id: uuid! - isAnonymous: Boolean! - lastSeen: timestamptz - locale: String! - metadata( - """JSON select path""" - path: String - ): jsonb - newEmail: citext - - """An array relationship""" - organization_users( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): [organization_user!]! - - """An aggregate relationship""" - organization_users_aggregate( - """distinct select on columns""" - distinct_on: [organization_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [organization_user_order_by!] - - """filter the rows returned""" - where: organization_user_bool_exp - ): organization_user_aggregate! - otpHash: String - otpHashExpiresAt: timestamptz! - otpMethodLastUsed: String - passwordHash: String - - """An array relationship""" - permission_users( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): [permission_user!]! - - """An aggregate relationship""" - permission_users_aggregate( - """distinct select on columns""" - distinct_on: [permission_user_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [permission_user_order_by!] - - """filter the rows returned""" - where: permission_user_bool_exp - ): permission_user_aggregate! - phoneNumber: String - phoneNumberVerified: Boolean! - - """An array relationship""" - refreshTokens( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): [authRefreshTokens!]! - - """An aggregate relationship""" - refreshTokens_aggregate( - """distinct select on columns""" - distinct_on: [authRefreshTokens_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authRefreshTokens_order_by!] - - """filter the rows returned""" - where: authRefreshTokens_bool_exp - ): authRefreshTokens_aggregate! - - """An array relationship""" - roles( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): [authUserRoles!]! - - """An aggregate relationship""" - roles_aggregate( - """distinct select on columns""" - distinct_on: [authUserRoles_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserRoles_order_by!] - - """filter the rows returned""" - where: authUserRoles_bool_exp - ): authUserRoles_aggregate! - - """An array relationship""" - securityKeys( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): [authUserSecurityKeys!]! - - """An aggregate relationship""" - securityKeys_aggregate( - """distinct select on columns""" - distinct_on: [authUserSecurityKeys_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserSecurityKeys_order_by!] - - """filter the rows returned""" - where: authUserSecurityKeys_bool_exp - ): authUserSecurityKeys_aggregate! - ticket: String - ticketExpiresAt: timestamptz! - totpSecret: String - updatedAt: timestamptz! - - """An array relationship""" - userProviders( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): [authUserProviders!]! - - """An aggregate relationship""" - userProviders_aggregate( - """distinct select on columns""" - distinct_on: [authUserProviders_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [authUserProviders_order_by!] - - """filter the rows returned""" - where: authUserProviders_bool_exp - ): authUserProviders_aggregate! -} - -""" -aggregated selection of "auth.users" -""" -type users_aggregate { - aggregate: users_aggregate_fields - nodes: [users!]! -} - -input users_aggregate_bool_exp { - bool_and: users_aggregate_bool_exp_bool_and - bool_or: users_aggregate_bool_exp_bool_or - count: users_aggregate_bool_exp_count -} - -input users_aggregate_bool_exp_bool_and { - arguments: users_select_column_users_aggregate_bool_exp_bool_and_arguments_columns! - distinct: Boolean - filter: users_bool_exp - predicate: Boolean_comparison_exp! -} - -input users_aggregate_bool_exp_bool_or { - arguments: users_select_column_users_aggregate_bool_exp_bool_or_arguments_columns! - distinct: Boolean - filter: users_bool_exp - predicate: Boolean_comparison_exp! -} - -input users_aggregate_bool_exp_count { - arguments: [users_select_column!] - distinct: Boolean - filter: users_bool_exp - predicate: Int_comparison_exp! -} - -""" -aggregate fields of "auth.users" -""" -type users_aggregate_fields { - count(columns: [users_select_column!], distinct: Boolean): Int! - max: users_max_fields - min: users_min_fields -} - -""" -order by aggregate values of table "auth.users" -""" -input users_aggregate_order_by { - count: order_by - max: users_max_order_by - min: users_min_order_by -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input users_append_input { - metadata: jsonb -} - -""" -input type for inserting array relation for remote table "auth.users" -""" -input users_arr_rel_insert_input { - data: [users_insert_input!]! - - """upsert condition""" - on_conflict: users_on_conflict -} - -""" -Boolean expression to filter rows from the table "auth.users". All fields are combined with a logical 'AND'. -""" -input users_bool_exp { - _and: [users_bool_exp!] - _not: users_bool_exp - _or: [users_bool_exp!] - activeMfaType: String_comparison_exp - avatarUrl: String_comparison_exp - createdAt: timestamptz_comparison_exp - currentChallenge: String_comparison_exp - defaultRole: String_comparison_exp - defaultRoleByRole: authRoles_bool_exp - disabled: Boolean_comparison_exp - displayName: String_comparison_exp - email: citext_comparison_exp - emailVerified: Boolean_comparison_exp - id: uuid_comparison_exp - isAnonymous: Boolean_comparison_exp - lastSeen: timestamptz_comparison_exp - locale: String_comparison_exp - metadata: jsonb_comparison_exp - newEmail: citext_comparison_exp - organization_users: organization_user_bool_exp - organization_users_aggregate: organization_user_aggregate_bool_exp - otpHash: String_comparison_exp - otpHashExpiresAt: timestamptz_comparison_exp - otpMethodLastUsed: String_comparison_exp - passwordHash: String_comparison_exp - permission_users: permission_user_bool_exp - permission_users_aggregate: permission_user_aggregate_bool_exp - phoneNumber: String_comparison_exp - phoneNumberVerified: Boolean_comparison_exp - refreshTokens: authRefreshTokens_bool_exp - refreshTokens_aggregate: authRefreshTokens_aggregate_bool_exp - roles: authUserRoles_bool_exp - roles_aggregate: authUserRoles_aggregate_bool_exp - securityKeys: authUserSecurityKeys_bool_exp - securityKeys_aggregate: authUserSecurityKeys_aggregate_bool_exp - ticket: String_comparison_exp - ticketExpiresAt: timestamptz_comparison_exp - totpSecret: String_comparison_exp - updatedAt: timestamptz_comparison_exp - userProviders: authUserProviders_bool_exp - userProviders_aggregate: authUserProviders_aggregate_bool_exp -} - -""" -unique or primary key constraints on table "auth.users" -""" -enum users_constraint { - """ - unique or primary key constraint on columns "email" - """ - users_email_key - - """ - unique or primary key constraint on columns "phone_number" - """ - users_phone_number_key - - """ - unique or primary key constraint on columns "id" - """ - users_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input users_delete_at_path_input { - metadata: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input users_delete_elem_input { - metadata: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input users_delete_key_input { - metadata: String -} - -""" -input type for inserting data into table "auth.users" -""" -input users_insert_input { - activeMfaType: String - avatarUrl: String - createdAt: timestamptz - currentChallenge: String - defaultRole: String - defaultRoleByRole: authRoles_obj_rel_insert_input - disabled: Boolean - displayName: String - email: citext - emailVerified: Boolean - id: uuid - isAnonymous: Boolean - lastSeen: timestamptz - locale: String - metadata: jsonb - newEmail: citext - organization_users: organization_user_arr_rel_insert_input - otpHash: String - otpHashExpiresAt: timestamptz - otpMethodLastUsed: String - passwordHash: String - permission_users: permission_user_arr_rel_insert_input - phoneNumber: String - phoneNumberVerified: Boolean - refreshTokens: authRefreshTokens_arr_rel_insert_input - roles: authUserRoles_arr_rel_insert_input - securityKeys: authUserSecurityKeys_arr_rel_insert_input - ticket: String - ticketExpiresAt: timestamptz - totpSecret: String - updatedAt: timestamptz - userProviders: authUserProviders_arr_rel_insert_input -} - -"""aggregate max on columns""" -type users_max_fields { - activeMfaType: String - avatarUrl: String - createdAt: timestamptz - currentChallenge: String - defaultRole: String - displayName: String - email: citext - id: uuid - lastSeen: timestamptz - locale: String - newEmail: citext - otpHash: String - otpHashExpiresAt: timestamptz - otpMethodLastUsed: String - passwordHash: String - phoneNumber: String - ticket: String - ticketExpiresAt: timestamptz - totpSecret: String - updatedAt: timestamptz -} - -""" -order by max() on columns of table "auth.users" -""" -input users_max_order_by { - activeMfaType: order_by - avatarUrl: order_by - createdAt: order_by - currentChallenge: order_by - defaultRole: order_by - displayName: order_by - email: order_by - id: order_by - lastSeen: order_by - locale: order_by - newEmail: order_by - otpHash: order_by - otpHashExpiresAt: order_by - otpMethodLastUsed: order_by - passwordHash: order_by - phoneNumber: order_by - ticket: order_by - ticketExpiresAt: order_by - totpSecret: order_by - updatedAt: order_by -} - -"""aggregate min on columns""" -type users_min_fields { - activeMfaType: String - avatarUrl: String - createdAt: timestamptz - currentChallenge: String - defaultRole: String - displayName: String - email: citext - id: uuid - lastSeen: timestamptz - locale: String - newEmail: citext - otpHash: String - otpHashExpiresAt: timestamptz - otpMethodLastUsed: String - passwordHash: String - phoneNumber: String - ticket: String - ticketExpiresAt: timestamptz - totpSecret: String - updatedAt: timestamptz -} - -""" -order by min() on columns of table "auth.users" -""" -input users_min_order_by { - activeMfaType: order_by - avatarUrl: order_by - createdAt: order_by - currentChallenge: order_by - defaultRole: order_by - displayName: order_by - email: order_by - id: order_by - lastSeen: order_by - locale: order_by - newEmail: order_by - otpHash: order_by - otpHashExpiresAt: order_by - otpMethodLastUsed: order_by - passwordHash: order_by - phoneNumber: order_by - ticket: order_by - ticketExpiresAt: order_by - totpSecret: order_by - updatedAt: order_by -} - -""" -response of any mutation on the table "auth.users" -""" -type users_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [users!]! -} - -""" -input type for inserting object relation for remote table "auth.users" -""" -input users_obj_rel_insert_input { - data: users_insert_input! - - """upsert condition""" - on_conflict: users_on_conflict -} - -""" -on_conflict condition type for table "auth.users" -""" -input users_on_conflict { - constraint: users_constraint! - update_columns: [users_update_column!]! = [] - where: users_bool_exp -} - -"""Ordering options when selecting data from "auth.users".""" -input users_order_by { - activeMfaType: order_by - avatarUrl: order_by - createdAt: order_by - currentChallenge: order_by - defaultRole: order_by - defaultRoleByRole: authRoles_order_by - disabled: order_by - displayName: order_by - email: order_by - emailVerified: order_by - id: order_by - isAnonymous: order_by - lastSeen: order_by - locale: order_by - metadata: order_by - newEmail: order_by - organization_users_aggregate: organization_user_aggregate_order_by - otpHash: order_by - otpHashExpiresAt: order_by - otpMethodLastUsed: order_by - passwordHash: order_by - permission_users_aggregate: permission_user_aggregate_order_by - phoneNumber: order_by - phoneNumberVerified: order_by - refreshTokens_aggregate: authRefreshTokens_aggregate_order_by - roles_aggregate: authUserRoles_aggregate_order_by - securityKeys_aggregate: authUserSecurityKeys_aggregate_order_by - ticket: order_by - ticketExpiresAt: order_by - totpSecret: order_by - updatedAt: order_by - userProviders_aggregate: authUserProviders_aggregate_order_by -} - -"""primary key columns input for table: auth.users""" -input users_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input users_prepend_input { - metadata: jsonb -} - -""" -select columns of table "auth.users" -""" -enum users_select_column { - """column name""" - activeMfaType - - """column name""" - avatarUrl - - """column name""" - createdAt - - """column name""" - currentChallenge - - """column name""" - defaultRole - - """column name""" - disabled - - """column name""" - displayName - - """column name""" - email - - """column name""" - emailVerified - - """column name""" - id - - """column name""" - isAnonymous - - """column name""" - lastSeen - - """column name""" - locale - - """column name""" - metadata - - """column name""" - newEmail - - """column name""" - otpHash - - """column name""" - otpHashExpiresAt - - """column name""" - otpMethodLastUsed - - """column name""" - passwordHash - - """column name""" - phoneNumber - - """column name""" - phoneNumberVerified - - """column name""" - ticket - - """column name""" - ticketExpiresAt - - """column name""" - totpSecret - - """column name""" - updatedAt -} - -""" -select "users_aggregate_bool_exp_bool_and_arguments_columns" columns of table "auth.users" -""" -enum users_select_column_users_aggregate_bool_exp_bool_and_arguments_columns { - """column name""" - disabled - - """column name""" - emailVerified - - """column name""" - isAnonymous - - """column name""" - phoneNumberVerified -} - -""" -select "users_aggregate_bool_exp_bool_or_arguments_columns" columns of table "auth.users" -""" -enum users_select_column_users_aggregate_bool_exp_bool_or_arguments_columns { - """column name""" - disabled - - """column name""" - emailVerified - - """column name""" - isAnonymous - - """column name""" - phoneNumberVerified -} - -""" -input type for updating data in table "auth.users" -""" -input users_set_input { - activeMfaType: String - avatarUrl: String - createdAt: timestamptz - currentChallenge: String - defaultRole: String - disabled: Boolean - displayName: String - email: citext - emailVerified: Boolean - id: uuid - isAnonymous: Boolean - lastSeen: timestamptz - locale: String - metadata: jsonb - newEmail: citext - otpHash: String - otpHashExpiresAt: timestamptz - otpMethodLastUsed: String - passwordHash: String - phoneNumber: String - phoneNumberVerified: Boolean - ticket: String - ticketExpiresAt: timestamptz - totpSecret: String - updatedAt: timestamptz -} - -""" -Streaming cursor of the table "users" -""" -input users_stream_cursor_input { - """Stream column input with initial value""" - initial_value: users_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input users_stream_cursor_value_input { - activeMfaType: String - avatarUrl: String - createdAt: timestamptz - currentChallenge: String - defaultRole: String - disabled: Boolean - displayName: String - email: citext - emailVerified: Boolean - id: uuid - isAnonymous: Boolean - lastSeen: timestamptz - locale: String - metadata: jsonb - newEmail: citext - otpHash: String - otpHashExpiresAt: timestamptz - otpMethodLastUsed: String - passwordHash: String - phoneNumber: String - phoneNumberVerified: Boolean - ticket: String - ticketExpiresAt: timestamptz - totpSecret: String - updatedAt: timestamptz -} - -""" -update columns of table "auth.users" -""" -enum users_update_column { - """column name""" - activeMfaType - - """column name""" - avatarUrl - - """column name""" - createdAt - - """column name""" - currentChallenge - - """column name""" - defaultRole - - """column name""" - disabled - - """column name""" - displayName - - """column name""" - email - - """column name""" - emailVerified - - """column name""" - id - - """column name""" - isAnonymous - - """column name""" - lastSeen - - """column name""" - locale - - """column name""" - metadata - - """column name""" - newEmail - - """column name""" - otpHash - - """column name""" - otpHashExpiresAt - - """column name""" - otpMethodLastUsed - - """column name""" - passwordHash - - """column name""" - phoneNumber - - """column name""" - phoneNumberVerified - - """column name""" - ticket - - """column name""" - ticketExpiresAt - - """column name""" - totpSecret - - """column name""" - updatedAt -} - -input users_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: users_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: users_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: users_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: users_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: users_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: users_set_input - - """filter the rows which have to be updated""" - where: users_bool_exp! -} - -scalar uuid - -""" -Boolean expression to compare columns of type "uuid". All fields are combined with logical 'AND'. -""" -input uuid_comparison_exp { - _eq: uuid - _gt: uuid - _gte: uuid - _in: [uuid!] - _is_null: Boolean - _lt: uuid - _lte: uuid - _neq: uuid - _nin: [uuid!] -} - -""" -columns and relationships of "storage.virus" -""" -type virus { - createdAt: timestamptz! - - """An object relationship""" - file: files! - fileId: uuid! - filename: String! - id: uuid! - updatedAt: timestamptz! - userSession( - """JSON select path""" - path: String - ): jsonb! - virus: String! -} - -""" -aggregated selection of "storage.virus" -""" -type virus_aggregate { - aggregate: virus_aggregate_fields - nodes: [virus!]! -} - -""" -aggregate fields of "storage.virus" -""" -type virus_aggregate_fields { - count(columns: [virus_select_column!], distinct: Boolean): Int! - max: virus_max_fields - min: virus_min_fields -} - -"""append existing jsonb value of filtered columns with new jsonb value""" -input virus_append_input { - userSession: jsonb -} - -""" -Boolean expression to filter rows from the table "storage.virus". All fields are combined with a logical 'AND'. -""" -input virus_bool_exp { - _and: [virus_bool_exp!] - _not: virus_bool_exp - _or: [virus_bool_exp!] - createdAt: timestamptz_comparison_exp - file: files_bool_exp - fileId: uuid_comparison_exp - filename: String_comparison_exp - id: uuid_comparison_exp - updatedAt: timestamptz_comparison_exp - userSession: jsonb_comparison_exp - virus: String_comparison_exp -} - -""" -unique or primary key constraints on table "storage.virus" -""" -enum virus_constraint { - """ - unique or primary key constraint on columns "id" - """ - virus_pkey -} - -""" -delete the field or element with specified path (for JSON arrays, negative integers count from the end) -""" -input virus_delete_at_path_input { - userSession: [String!] -} - -""" -delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array -""" -input virus_delete_elem_input { - userSession: Int -} - -""" -delete key/value pair or string element. key/value pairs are matched based on their key value -""" -input virus_delete_key_input { - userSession: String -} - -""" -input type for inserting data into table "storage.virus" -""" -input virus_insert_input { - createdAt: timestamptz - file: files_obj_rel_insert_input - fileId: uuid - filename: String - id: uuid - updatedAt: timestamptz - userSession: jsonb - virus: String -} - -"""aggregate max on columns""" -type virus_max_fields { - createdAt: timestamptz - fileId: uuid - filename: String - id: uuid - updatedAt: timestamptz - virus: String -} - -"""aggregate min on columns""" -type virus_min_fields { - createdAt: timestamptz - fileId: uuid - filename: String - id: uuid - updatedAt: timestamptz - virus: String -} - -""" -response of any mutation on the table "storage.virus" -""" -type virus_mutation_response { - """number of rows affected by the mutation""" - affected_rows: Int! - - """data from the rows affected by the mutation""" - returning: [virus!]! -} - -""" -on_conflict condition type for table "storage.virus" -""" -input virus_on_conflict { - constraint: virus_constraint! - update_columns: [virus_update_column!]! = [] - where: virus_bool_exp -} - -"""Ordering options when selecting data from "storage.virus".""" -input virus_order_by { - createdAt: order_by - file: files_order_by - fileId: order_by - filename: order_by - id: order_by - updatedAt: order_by - userSession: order_by - virus: order_by -} - -"""primary key columns input for table: storage.virus""" -input virus_pk_columns_input { - id: uuid! -} - -"""prepend existing jsonb value of filtered columns with new jsonb value""" -input virus_prepend_input { - userSession: jsonb -} - -""" -select columns of table "storage.virus" -""" -enum virus_select_column { - """column name""" - createdAt - - """column name""" - fileId - - """column name""" - filename - - """column name""" - id - - """column name""" - updatedAt - - """column name""" - userSession - - """column name""" - virus -} - -""" -input type for updating data in table "storage.virus" -""" -input virus_set_input { - createdAt: timestamptz - fileId: uuid - filename: String - id: uuid - updatedAt: timestamptz - userSession: jsonb - virus: String -} - -""" -Streaming cursor of the table "virus" -""" -input virus_stream_cursor_input { - """Stream column input with initial value""" - initial_value: virus_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input virus_stream_cursor_value_input { - createdAt: timestamptz - fileId: uuid - filename: String - id: uuid - updatedAt: timestamptz - userSession: jsonb - virus: String -} - -""" -update columns of table "storage.virus" -""" -enum virus_update_column { - """column name""" - createdAt - - """column name""" - fileId - - """column name""" - filename - - """column name""" - id - - """column name""" - updatedAt - - """column name""" - userSession - - """column name""" - virus -} - -input virus_updates { - """append existing jsonb value of filtered columns with new jsonb value""" - _append: virus_append_input - - """ - delete the field or element with specified path (for JSON arrays, negative integers count from the end) - """ - _delete_at_path: virus_delete_at_path_input - - """ - delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array - """ - _delete_elem: virus_delete_elem_input - - """ - delete key/value pair or string element. key/value pairs are matched based on their key value - """ - _delete_key: virus_delete_key_input - - """prepend existing jsonb value of filtered columns with new jsonb value""" - _prepend: virus_prepend_input - - """sets the columns of the filtered rows to the given values""" - _set: virus_set_input - - """filter the rows which have to be updated""" - where: virus_bool_exp! -} - diff --git a/crates/txtx-cloud/src/gql/get_orgs_for_user.rs b/crates/txtx-cloud/src/gql/get_orgs_for_user.rs deleted file mode 100644 index 56b64bbc7..000000000 --- a/crates/txtx-cloud/src/gql/get_orgs_for_user.rs +++ /dev/null @@ -1,19 +0,0 @@ -use graphql_client::GraphQLQuery; - -type Uuid = String; -#[derive(GraphQLQuery)] -#[graphql( - schema_path = "src/gql/fixtures/schema.graphql", - query_path = "src/gql/fixtures/queries.graphql", - response_derives = "Debug", - normalization = "rust", - skip_serializing_none -)] -pub struct OrgsForUser; - -pub struct OrgsForUserHelper; -impl OrgsForUserHelper { - pub fn get_variable(user_id: &str) -> orgs_for_user::Variables { - orgs_for_user::Variables { user_id: Some(user_id.to_string()) } - } -} diff --git a/crates/txtx-cloud/src/gql/insert_runbook.rs b/crates/txtx-cloud/src/gql/insert_runbook.rs deleted file mode 100644 index d51602a52..000000000 --- a/crates/txtx-cloud/src/gql/insert_runbook.rs +++ /dev/null @@ -1,112 +0,0 @@ -use crate::publish::CloudServiceIndexedRunbook; - -use graphql_client::GraphQLQuery; - -type Timestamptz = String; -type Bigint = u64; -type Uuid = String; -type Jsonb = serde_json::Value; -type Citext = String; -type Bytea = Vec; -#[derive(GraphQLQuery)] -#[graphql( - schema_path = "src/gql/fixtures/schema.graphql", - query_path = "src/gql/fixtures/queries.graphql", - response_derives = "Debug", - normalization = "rust", - skip_serializing_none -)] -pub struct InsertRunbooksOne; - -pub struct InsertRunbookHelper; -impl InsertRunbookHelper { - pub fn get_public_permissions() -> insert_runbooks_one::PermissionsObjRelInsertInput { - insert_runbooks_one::PermissionsObjRelInsertInput { - data: Box::new(insert_runbooks_one::PermissionsInsertInput { - type_: Some("public".to_string()), - permission_users: None, - permission_organizations: None, - id: None, - runbook: Box::new(None), - runbook_by_id: Box::new(None), - runbook_by_id1: Box::new(None), - runbooks: None, - runbooks_by_read_permissions_id: None, - runbooks_by_update_permissions_id: None, - }), - on_conflict: None, - } - } - pub fn get_private_permissions( - user_id: &str, - ) -> insert_runbooks_one::PermissionsObjRelInsertInput { - insert_runbooks_one::PermissionsObjRelInsertInput { - data: Box::new(insert_runbooks_one::PermissionsInsertInput { - type_: Some("private".to_string()), - permission_users: Some(insert_runbooks_one::PermissionUserArrRelInsertInput { - data: vec![insert_runbooks_one::PermissionUserInsertInput { - user_id: Some(user_id.to_string()), - id: None, - permission: Box::new(None), - permission_id: None, - user: None, - }], - on_conflict: None, - }), - permission_organizations: None, - id: None, - runbook: Box::new(None), - runbook_by_id: Box::new(None), - runbook_by_id1: Box::new(None), - runbooks: None, - runbooks_by_read_permissions_id: None, - runbooks_by_update_permissions_id: None, - }), - on_conflict: None, - } - } - pub fn get_org_permissions(org_id: &str) -> insert_runbooks_one::PermissionsObjRelInsertInput { - insert_runbooks_one::PermissionsObjRelInsertInput { - data: Box::new(insert_runbooks_one::PermissionsInsertInput { - type_: Some("org".to_string()), - permission_users: None, - permission_organizations: Some( - insert_runbooks_one::PermissionOrganizationArrRelInsertInput { - data: vec![insert_runbooks_one::PermissionOrganizationInsertInput { - id: None, - permission: Box::new(None), - permission_id: None, - organization_id: Some(org_id.to_string()), - organization: None, - }], - on_conflict: None, - }, - ), - id: None, - runbook: Box::new(None), - runbook_by_id: Box::new(None), - runbook_by_id1: Box::new(None), - runbooks: None, - runbooks_by_read_permissions_id: None, - runbooks_by_update_permissions_id: None, - }), - on_conflict: None, - } - } - pub fn get_variable( - read_permissions: insert_runbooks_one::PermissionsObjRelInsertInput, - update_permissions: insert_runbooks_one::PermissionsObjRelInsertInput, - delete_permissions: insert_runbooks_one::PermissionsObjRelInsertInput, - indexed_runbook: CloudServiceIndexedRunbook, - ) -> insert_runbooks_one::Variables { - insert_runbooks_one::Variables { - name: indexed_runbook.name, - description: indexed_runbook.description, - raw_runbook: indexed_runbook.raw_runbook, - documentation: indexed_runbook.documentation, - read_permissions, - update_permissions, - delete_permissions, - } - } -} diff --git a/crates/txtx-cloud/src/gql/mod.rs b/crates/txtx-cloud/src/gql/mod.rs deleted file mode 100644 index d9897cab3..000000000 --- a/crates/txtx-cloud/src/gql/mod.rs +++ /dev/null @@ -1,68 +0,0 @@ -pub mod get_orgs_for_user; -pub mod insert_runbook; - -use graphql_client::GraphQLQuery; -use graphql_client::Response; -use txtx_core::kit::reqwest; - -use super::auth::AuthConfig; - -pub struct GqlClient { - client: reqwest::Client, - registry_gql_url: String, - id_service_url: String, - auth_config: AuthConfig, -} - -impl GqlClient { - pub fn new(auth_config: &AuthConfig, id_service_url: &str, registry_gql_url: &str) -> Self { - Self { - client: reqwest::Client::new(), - registry_gql_url: registry_gql_url.to_string(), - auth_config: auth_config.clone(), - id_service_url: id_service_url.to_string(), - } - } - - pub async fn send_request( - &mut self, - variables: T::Variables, - ) -> Result - where - T: GraphQLQuery, - { - let request_body = T::build_query(variables); - - self.auth_config.refresh_session_if_needed(&self.id_service_url).await?; - - let response = self - .client - .post(&self.registry_gql_url) - .bearer_auth(&self.auth_config.access_token) - .json(&request_body) - .send() - .await - .map_err(|e| format!("Failed to send graphql request to cloud service: {}", e))?; - - let response_body: Response = response - .json() - .await - .map_err(|e| format!("Failed to parse graphql response: {}", e))?; - - if let Some(error) = response_body.errors { - match response_body.extensions { - Some(extensions) => { - return Err(format!( - "Failed to execute graphql query: {:?}, extensions: {:?}", - error, extensions - )); - } - None => { - return Err(format!("Failed to execute graphql query: {:?}", error)); - } - } - } - let response_data: T::ResponseData = response_body.data.expect("missing response data"); - Ok(response_data) - } -} diff --git a/crates/txtx-cloud/src/lib.rs b/crates/txtx-cloud/src/lib.rs deleted file mode 100644 index a77adabd4..000000000 --- a/crates/txtx-cloud/src/lib.rs +++ /dev/null @@ -1,72 +0,0 @@ -use clap::{Parser, ValueEnum}; - -pub mod auth; -pub mod gql; -pub mod login; -pub mod publish; -pub mod router; -pub mod workspace; - -#[derive(Parser, PartialEq, Clone, Debug, Default)] -pub struct LoginCommand { - /// The username to use for authentication - #[arg(long = "email", short = 'e', requires = "password", conflicts_with = "pat")] - pub email: Option, - - /// The password to use for authentication - #[arg(long = "password", short = 'p', requires = "email", conflicts_with = "pat")] - pub password: Option, - - /// Automatically log in using a Personal Access Token - #[arg(long = "pat", conflicts_with_all = &["email", "password"])] - pub pat: Option, -} - -#[derive(Parser, PartialEq, Clone, Debug)] -pub struct PublishRunbook { - /// Path to the manifest - #[arg(long = "manifest-file-path", short = 'm', default_value = "./txtx.yml")] - pub manifest_path: String, - /// Name of the runbook as indexed in the txtx.yml, or the path of the .tx file to run - pub runbook: String, - /// Choose the environment variable to set from those configured in the txtx.yml - #[arg(long = "env")] - pub environment: Option, - /// A set of inputs to use for batch processing - #[arg(long = "input")] - pub inputs: Vec, - /// The destination to publish the runbook to. By default, the published runbook will be at /manifest/path/.output.json - #[arg(long = "destination", short = 'd')] - pub destination: Option, - /// The permissions to set for what users can read the runbook. - /// - `public`: Anyone can read the runbook - /// - `private`: Only the owner can read the runbook - /// - `org`: Only members of the organization can read the runbook - #[arg(long = "read-permissions", default_value = "private")] - pub read_permissions: Option, - /// The permissions to set for what users can update the runbook. - /// - `private`: Only the owner can update the runbook - /// - `org`: Only members of the organization can update the runbook - #[arg(long = "update-permissions", default_value = "private")] - pub update_permissions: Option, - /// The permissions to set for what users can delete the runbook. - /// - `private`: Only the owner can delete the runbook - /// - `org`: Only members of the organization can delete the runbook - #[arg(long = "delete-permissions", default_value = "private")] - pub delete_permissions: Option, -} - -#[derive(ValueEnum, PartialEq, Clone, Debug)] -#[clap(rename_all = "snake-case")] -pub enum PublishRunbookReadPermissions { - Public, - Private, - Org, -} - -#[derive(ValueEnum, PartialEq, Clone, Debug)] -#[clap(rename_all = "snake-case")] -pub enum PublishRunbookWritePermissions { - Private, - Org, -} diff --git a/crates/txtx-cloud/src/login.rs b/crates/txtx-cloud/src/login.rs deleted file mode 100644 index 9027cb8eb..000000000 --- a/crates/txtx-cloud/src/login.rs +++ /dev/null @@ -1,382 +0,0 @@ -use std::collections::HashMap; - -use actix_cors::Cors; -use actix_web::error::QueryPayloadError; -use actix_web::http::header; -use actix_web::web::{self, Data}; -use actix_web::{middleware, App, FromRequest, HttpRequest, HttpResponse, HttpServer, Responder}; -use base64::Engine; -use dialoguer::theme::ColorfulTheme; -use dialoguer::Confirm; - -use hiro_system_kit::{green, yellow}; -use serde::de::Error; -use txtx_core::kit::channel::{Receiver, Sender}; - -use serde::{Deserialize, Serialize}; -use txtx_core::kit::futures::future::{ready, Ready}; -use txtx_core::kit::{channel, reqwest}; - -use crate::auth::jwt::JwtManager; -use crate::auth::AuthUser; -use crate::LoginCommand; - -use super::auth::AuthConfig; - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct LoginCallbackResult { - access_token: String, - exp: u64, - refresh_token: String, - pat: String, - user: AuthUser, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -struct LoginCallbackError { - message: String, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(untagged)] -enum LoginCallbackServerEvent { - AuthCallback(LoginCallbackResult), - AuthError(LoginCallbackError), -} -// The actix_web `Query<>` extractor was having a hard time with the enums and nested objects here, -// and we wanted to base64 encode the data, so we implemented our own `FromRequest` extractor. -impl FromRequest for LoginCallbackServerEvent { - type Error = QueryPayloadError; - type Future = Ready>; - - fn from_request(req: &HttpRequest, _: &mut actix_web::dev::Payload) -> Self::Future { - // Extract the query string from the request - let query_string = req.query_string(); - - let decoded = match base64::engine::general_purpose::URL_SAFE.decode(query_string) { - Ok(decoded) => decoded, - Err(err) => { - let error = QueryPayloadError::Deserialize(serde_urlencoded::de::Error::custom( - format!("Base64 decode error: {}", err), - )); - return ready(Err(error)); - } - }; - - // Convert decoded bytes to a string - let decoded_str = match String::from_utf8(decoded) { - Ok(s) => s, - Err(err) => { - let error = QueryPayloadError::Deserialize(serde_urlencoded::de::Error::custom( - format!("UTF-8 conversion error: {}", err), - )); - return ready(Err(error)); - } - }; - - let mut params: HashMap = match serde_urlencoded::from_str(&decoded_str) { - Ok(params) => params, - Err(err) => { - let error = QueryPayloadError::Deserialize(err); - return ready(Err(error)); - } - }; - // Handle the `user` field separately if it exists - if let Some(user_json) = params.remove("user") { - let user: AuthUser = match serde_json::from_str(&user_json) { - Ok(user) => user, - Err(err) => { - let error = - QueryPayloadError::Deserialize(serde_urlencoded::de::Error::custom( - format!("Failed to parse 'user' field: {}", err), - )); - return ready(Err(error)); - } - }; - - // Reconstruct `LoginCallbackServerEvent` with the parsed `user` - if params.contains_key("accessToken") - && params.contains_key("exp") - && params.contains_key("refreshToken") - && params.contains_key("pat") - { - let result = LoginCallbackResult { - access_token: params.remove("accessToken").unwrap(), - exp: params.remove("exp").unwrap().parse().unwrap_or_default(), - refresh_token: params.remove("refreshToken").unwrap(), - pat: params.remove("pat").unwrap(), - user, - }; - - return ready(Ok(LoginCallbackServerEvent::AuthCallback(result))); - } - } - - // If no matching variant is found, return an error - ready(Err(QueryPayloadError::Deserialize(serde_urlencoded::de::Error::custom( - "Data did not match any variant", - )))) - } -} - -#[derive(Debug, Clone)] -struct LoginCallbackServerContext { - tx: Sender, -} - -impl LoginCallbackServerContext { - fn new() -> (Self, Receiver) { - let (tx, rx) = channel::unbounded::(); - (Self { tx }, rx) - } -} - -/// ## Arguments -/// -/// * `cmd` - The login command containing user-provided credentials or options. -/// * `auth_service_url` - The URL of the frontend service used to authenticate the user. -/// * `auth_callback_port` - The port for the callback server used during login. -/// * `id_service_url` - The URL of the ID service. -pub async fn handle_login_command( - cmd: &LoginCommand, - auth_service_url: &str, - auth_callback_port: &str, - id_service_url: &str, -) -> Result<(), String> { - let auth_config = AuthConfig::read_from_system_config()?; - - let jwt_manager = crate::auth::jwt::JwtManager::initialize(id_service_url) - .await - .map_err(|e| format!("Failed to initialize JWT manager: {}", e))?; - - if let Some(mut auth_config) = auth_config { - if auth_config.is_access_token_expired() { - match auth_config.refresh_session_if_needed(id_service_url).await { - Ok(()) => { - println!("{} Logged in as {}.", green!("✓"), auth_config.user.display_name); - return Ok(()); - } - Err(_e) => { - if let Some(pat) = &auth_config.pat { - if let Ok(auth_config) = pat_login(id_service_url, &jwt_manager, &pat).await - { - auth_config.write_to_system_config()?; - println!( - "{} Logged in as {}.", - green!("✓"), - auth_config.user.display_name - ); - return Ok(()); - } - } - println!("{} Auth data already found for user, but failed to refresh session; attempting login.", yellow!("-")); - } - } - } else { - println!("{} Logged in as {}.", green!("✓"), auth_config.user.display_name); - return Ok(()); - } - } - - let auth_config = if let Some(email) = &cmd.email { - let password = - cmd.password.as_ref().ok_or("Password is required when email is provided")?; - user_pass_login(id_service_url, &jwt_manager, email, password).await? - } else if let Some(pat) = &cmd.pat { - pat_login(id_service_url, &jwt_manager, &pat).await? - } else { - let Some(res) = auth_service_login(auth_service_url, auth_callback_port).await? else { - return Ok(()); - }; - let auth_config = - AuthConfig::new(res.access_token, res.exp, res.refresh_token, Some(res.pat), res.user); - auth_config - }; - - auth_config.write_to_system_config()?; - Ok(()) -} - -/// Starts a server that will only receive a POST request from the ID service with the user's auth data. -/// Directs the user to the ID service login page. -/// Upon login, the ID service will send a POST request to the server with the user's auth data. -async fn auth_service_login( - auth_service_url: &str, - auth_callback_port: &str, -) -> Result, String> { - let redirect_url = format!("localhost:{}", auth_callback_port); - - let auth_service_url = reqwest::Url::parse(&format!( - "{}?redirectUrl=http://{}/api/v1/auth", - auth_service_url, redirect_url - )) - .map_err(|e| format!("Invalid auth service URL: {e}"))?; - - let allowed_origin = auth_service_url.origin().ascii_serialization(); - let (ctx, rx) = LoginCallbackServerContext::new(); - let ctx = Data::new(ctx); - let server = HttpServer::new(move || { - App::new() - .app_data(ctx.clone()) - .wrap( - Cors::default() - .allowed_origin(&allowed_origin) - .allowed_methods(vec!["GET", "OPTIONS"]) - .allowed_headers(vec![header::CONTENT_TYPE, header::ACCEPT]) - ) - .wrap(middleware::Compress::default()) - .wrap(middleware::Logger::default()) - .service( - web::scope("/api/v1") - .route("/auth", web::get().to(auth_callback)) - ) - }) - .workers(1) - .bind(redirect_url) - .map_err(|e| format!("Failed to start auth callback server: failed to bind to port {auth_callback_port}: {e}"))? - .run(); - let handle = server.handle(); - tokio::spawn(server); - - let confirm = Confirm::with_theme(&ColorfulTheme::default()) - .with_prompt(format!("Open {} in your browser to log in?", auth_service_url)) - .default(true) - .interact(); - - let Ok(true) = confirm else { - handle.stop(true).await; - println!("\nLogin cancelled"); - return Ok(None); - }; - - if let Err(_) = open::that(auth_service_url.as_str()) { - println!("Failed to automatically open your browser. Please open the following URL in your browser: {}", auth_service_url); - }; - - let res = rx.recv(); - handle.stop(true).await; - match res { - Ok(event) => match event { - LoginCallbackServerEvent::AuthCallback(auth_callback_result) => { - Ok(Some(auth_callback_result)) - } - LoginCallbackServerEvent::AuthError(auth_callback_error) => { - Err(format!("Authentication failed: {}", auth_callback_error.message)) - } - }, - Err(e) => Err(format!("Failed to receive auth callback event: {e}")), - } -} - -async fn auth_callback( - _req: HttpRequest, - ctx: Data, - payload: LoginCallbackServerEvent, -) -> actix_web::Result { - let body = match &payload { - LoginCallbackServerEvent::AuthCallback(_) => include_str!("./callback.html").to_string(), - LoginCallbackServerEvent::AuthError(e) => format!("Authentication failed: {}", e.message), - }; - ctx.tx.send(payload).map_err(|_| { - actix_web::error::ErrorInternalServerError("Failed to send auth callback event") - })?; - Ok(HttpResponse::Ok().body(body)) -} - -/// Sends a POST request to the auth service to log in with an email and password. -async fn user_pass_login( - id_service_url: &str, - jwt_manager: &JwtManager, - email: &str, - password: &str, -) -> Result { - let client = reqwest::Client::new(); - let res = client - .post(&format!("{}/signin/email-password", id_service_url)) - .json(&serde_json::json!({ - "email": email, - "password": password, - })) - .send() - .await - .map_err(|e| format!("Failed to send username/password login request: {}", e))?; - - if res.status().is_success() { - let res = res - .json::() - .await - .map_err(|e| format!("Failed to parse username/password login response: {}", e))?; - - let access_token_claims = - jwt_manager.decode_jwt(&res.session.access_token, true).map_err(|e| { - format!("Failed to decode JWT from username/password login response: {}", e) - })?; - - let auth_config = AuthConfig::new( - res.session.access_token, - access_token_claims.exp, - res.session.refresh_token, - None, - res.session.user, - ); - return Ok(auth_config); - } else { - let err = res.text().await.unwrap_or_else(|_| "Unknown error".to_string()); - return Err(format!("Failed to login with username + password: {}", err)); - } -} - -pub async fn pat_login( - id_service_url: &str, - jwt_manager: &JwtManager, - pat: &str, -) -> Result { - let client = reqwest::Client::new(); - let res = client - .post(&format!("{}/signin/pat", id_service_url)) - .json(&serde_json::json!({ - "personalAccessToken": pat, - })) - .send() - .await - .map_err(|e| format!("Failed to send PAT login request: {}", e))?; - - if res.status().is_success() { - let res = res - .json::() - .await - .map_err(|e| format!("Failed to parse PAT login response: {}", e))?; - - let access_token_claims = jwt_manager - .decode_jwt(&res.session.access_token, true) - .map_err(|e| format!("Failed to decode JWT from PAT login response: {}", e))?; - - let auth_config = AuthConfig::new( - res.session.access_token, - access_token_claims.exp, - res.session.refresh_token, - Some(pat.to_string()), - res.session.user, - ); - return Ok(auth_config); - } else { - let err = res.text().await.unwrap_or_else(|_| "Unknown error".to_string()); - return Err(format!("Failed to login with PAT: {}", err)); - } -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct LoginResponse { - pub session: Session, -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct Session { - pub access_token: String, - pub refresh_token: String, - pub user: AuthUser, -} diff --git a/crates/txtx-cloud/src/publish.rs b/crates/txtx-cloud/src/publish.rs deleted file mode 100644 index 59ecc631f..000000000 --- a/crates/txtx-cloud/src/publish.rs +++ /dev/null @@ -1,249 +0,0 @@ -use dialoguer::{theme::ColorfulTheme, Select}; -use hiro_system_kit::green; -use serde::{Deserialize, Serialize}; -use serde_json::Value as JsonValue; -use std::collections::HashSet; -use txtx_addon_kit::helpers::fs::FileLocation; -use txtx_core::{ - kit::types::{embedded_runbooks::EmbeddedRunbookInputSpecification, types::Type}, - manifest::WorkspaceManifest, - runbook::embedded_runbook::publishable::PublishableEmbeddedRunbookSpecification, - types::Runbook, -}; - -use crate::{ - gql::{ - get_orgs_for_user::{OrgsForUser, OrgsForUserHelper}, - insert_runbook::{insert_runbooks_one, InsertRunbookHelper, InsertRunbooksOne}, - }, - PublishRunbook, PublishRunbookReadPermissions, PublishRunbookWritePermissions, -}; - -use super::{auth::AuthConfig, gql::GqlClient}; - -pub fn load_workspace_manifest_from_manifest_path( - manifest_path: &str, -) -> Result { - let manifest_location = FileLocation::from_path_string(manifest_path)?; - WorkspaceManifest::from_location(&manifest_location) -} - -pub async fn handle_publish_command( - cmd: &PublishRunbook, - mut runbook: Runbook, - id_service_url: &str, - txtx_console_url: &str, - registry_gql_url: &str, -) -> Result<(), String> { - let auth_config = AuthConfig::read_from_system_config() - .map_err(|e| format!("failed to authenticate user: {e}"))? - .ok_or(format!( - "You must be logged in to publish a runbook. Run `txtx cloud login` to log in." - ))?; - - { - let run = runbook.flow_contexts.first_mut().expect("no flow contexts found"); - let frontier = HashSet::new(); - let _res = run - .execution_context - .simulate_execution( - &runbook.runtime_context, - &run.workspace_context, - &runbook.supervision_context, - &frontier, - ) - .await; - } - - let publishable = PublishableEmbeddedRunbookSpecification::build_from_runbook(&runbook) - .map_err(|diag| { - format!("failed to build publishable version of runbook: {}", diag.message) - })?; - - publish_gql(cmd, publishable, &auth_config, id_service_url, txtx_console_url, registry_gql_url) - .await?; - - Ok(()) -} - -async fn publish_gql( - cmd: &PublishRunbook, - runbook: PublishableEmbeddedRunbookSpecification, - auth_config: &AuthConfig, - id_service_url: &str, - txtx_console_url: &str, - registry_gql_url: &str, -) -> Result<(), String> { - let user_id = auth_config.user.id.clone(); - let mut gql_client = GqlClient::new(auth_config, id_service_url, registry_gql_url); - - let indexed_runbook = CloudServiceIndexedRunbook::new(&runbook)?; - - let user_orgs = match (&cmd.read_permissions, &cmd.update_permissions, &cmd.delete_permissions) - { - (Some(PublishRunbookReadPermissions::Org), _, _) - | (_, Some(PublishRunbookWritePermissions::Org), _) - | (_, _, Some(PublishRunbookWritePermissions::Org)) => Some( - gql_client - .send_request::(OrgsForUserHelper::get_variable(&user_id)) - .await - .map_err(|e| { - format!("failed to determine user's organization membership: {}", e) - })?, - ), - _ => None, - }; - - let selected_org_id = if let Some(user_orgs) = user_orgs { - let mut org_names = vec![]; - let mut org_ids = vec![]; - for org in user_orgs.organizations.iter() { - if let Some(name) = &org.name { - org_names.push(name.clone()); - org_ids.push(org.id.clone()); - } - } - let org_name_idx = Select::with_theme(&ColorfulTheme::default()) - .with_prompt("Which organization do you want to publish to?") - .items(&org_names) - .interact() - .map_err(|e| format!("failed to select organization: {}", e))?; - let selected_org_id = org_ids[org_name_idx].clone(); - Some(selected_org_id) - } else { - None - }; - - let read_permissions = match cmd.read_permissions { - Some(PublishRunbookReadPermissions::Private) | None => { - InsertRunbookHelper::get_private_permissions(&user_id) - } - Some(PublishRunbookReadPermissions::Org) => InsertRunbookHelper::get_org_permissions( - &selected_org_id.clone().expect("missing required org data"), - ), - Some(PublishRunbookReadPermissions::Public) => { - InsertRunbookHelper::get_public_permissions() - } - }; - - let update_permissions = match cmd.update_permissions { - Some(PublishRunbookWritePermissions::Private) | None => { - InsertRunbookHelper::get_private_permissions(&user_id) - } - Some(PublishRunbookWritePermissions::Org) => InsertRunbookHelper::get_org_permissions( - &selected_org_id.clone().expect("missing required org data"), - ), - }; - - let delete_permissions = match cmd.delete_permissions { - Some(PublishRunbookWritePermissions::Private) | None => { - InsertRunbookHelper::get_private_permissions(&user_id) - } - Some(PublishRunbookWritePermissions::Org) => InsertRunbookHelper::get_org_permissions( - &selected_org_id.clone().expect("missing required org data"), - ), - }; - - let response: insert_runbooks_one::ResponseData = gql_client - .send_request::(InsertRunbookHelper::get_variable( - read_permissions, - update_permissions, - delete_permissions, - indexed_runbook, - )) - .await - .map_err(|e| format!("failed to publish runbook: {}", e))?; - - println!( - "{} Runbook published to {}/runbook/{}", - green!("✓"), - txtx_console_url, - response.insert_runbooks_one.unwrap().id - ); - - Ok(()) -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CloudServiceSignerDocumentation { - pub name: String, - pub description: Option, // todo: maybe make required? - pub namespace: String, -} -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CloudServiceInputDocumentation { - pub name: String, - pub description: Option, // todo: maybe make required? - pub optional: bool, - pub value_type: Type, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CloudServiceOutputDocumentation { - pub name: String, - pub description: Option, // todo: maybe make required? - pub value_type: Type, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CloudServiceRunbookDocumentation { - pub signers: Vec, - pub inputs: Vec, - pub outputs: Vec, -} - -impl CloudServiceRunbookDocumentation { - pub fn new(runbook: &PublishableEmbeddedRunbookSpecification) -> Self { - let mut signers = vec![]; - let mut inputs = vec![]; - for input in runbook.inputs.iter() { - match input { - EmbeddedRunbookInputSpecification::Value(value) => { - inputs.push(CloudServiceInputDocumentation { - name: value.name.clone(), - description: Some(value.documentation.clone()), - optional: false, // todo: need to find out where this comes from - value_type: value.typing.clone(), - }); - } - EmbeddedRunbookInputSpecification::Signer(signer) => { - signers.push(CloudServiceSignerDocumentation { - name: signer.name.clone(), - description: Some(signer.documentation.clone()), - namespace: signer.namespace.clone(), - }); - } - } - } - Self { - signers, - inputs, - outputs: vec![], // todo - } - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CloudServiceIndexedRunbook { - pub name: String, - pub description: Option, - pub workspace_id: Option, - pub documentation: JsonValue, - pub raw_runbook: JsonValue, // this is a serialized PublishableEmbeddedRunbookSpecification -} - -impl CloudServiceIndexedRunbook { - pub fn new(runbook: &PublishableEmbeddedRunbookSpecification) -> Result { - Ok(Self { - name: runbook.runbook_id.name.to_string(), - description: runbook.description.clone(), - workspace_id: runbook.runbook_id.workspace.clone(), - documentation: serde_json::to_value(&CloudServiceRunbookDocumentation::new(&runbook)) - .map_err(|e| { - format!("failed to serialize runbook documentation: {}", e) - })?, - raw_runbook: serde_json::to_value(&runbook) - .map_err(|e| format!("failed to serialize runbook specification: {}", e))?, - }) - } -} diff --git a/crates/txtx-cloud/src/publish_runbook.rs b/crates/txtx-cloud/src/publish_runbook.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/crates/txtx-cloud/src/router.rs b/crates/txtx-cloud/src/router.rs deleted file mode 100644 index 5d188e45e..000000000 --- a/crates/txtx-cloud/src/router.rs +++ /dev/null @@ -1,137 +0,0 @@ -use std::{future::Future, pin::Pin}; - -use serde_json::Value as JsonValue; -use txtx_addon_kit::{ - reqwest::{self, Client}, - types::cloud_interface::{ - AuthenticatedCloudServiceRouter, CloudService, DeploySubgraphCommand, RegisterIdlCommand, - SvmService, - }, -}; - -use crate::auth::AuthConfig; - -#[derive(Debug, Clone)] -pub struct TxtxAuthenticatedCloudServiceRouter { - id_service_url: String, -} - -impl AuthenticatedCloudServiceRouter for TxtxAuthenticatedCloudServiceRouter { - fn route<'a>( - &'a self, - service: CloudService, - ) -> Pin> + Send + 'a>> { - Box::pin(async move { - let token_required = service.token_required(); - let access_token = if token_required { - let Some(mut auth_config) = AuthConfig::read_from_system_config()? else { - return Err("You must be logged in to use txtx cloud services. Run `txtx cloud login` to log in.".to_string()); - }; - auth_config - .refresh_session_if_needed(&self.id_service_url) - .await - .map_err(|e| e.to_string())?; - Some(auth_config.access_token) - } else { - None - }; - TxtxCloudServiceRouter::new(service).route(access_token).await - }) - } -} - -impl TxtxAuthenticatedCloudServiceRouter { - pub fn new(id_service_url: &str) -> Self { - Self { id_service_url: id_service_url.to_string() } - } -} - -#[derive(Debug, Clone)] -pub struct TxtxCloudServiceRouter { - pub service: CloudService, -} - -impl TxtxCloudServiceRouter { - async fn route(self, token: Option) -> Result { - match &self.service { - CloudService::Registry => { - // Handle registry service - } - CloudService::Id => { - // Handle ID service - } - CloudService::Svm(svm_service) => match svm_service { - SvmService::DeploySubgraph(DeploySubgraphCommand { - url, - params, - do_include_token, - }) => { - let token = if *do_include_token { token } else { None }; - let client = Client::new(); - - let res = - rpc_call::(&client, url, "loadPlugin", params, token.as_ref()) - .await - .map_err(|e| { - format!("Failed to send request to deploy subgraph: {}", e) - })?; - - return Ok(res.to_string()); - } - SvmService::RegisterIdl(RegisterIdlCommand { - url, - params, - do_include_token, - .. - }) => { - let token = if *do_include_token { token } else { None }; - let client = Client::new(); - - let res = rpc_call::( - &client, - url, - "surfnet_registerIdl", - params, - token.as_ref(), - ) - .await - .map_err(|e| format!("Failed to send request to register IDL: {}", e))?; - - return Ok(res.to_string()); - } - }, - CloudService::Evm => { - // Handle EVM service - } - } - Ok("".into()) - } -} - -impl TxtxCloudServiceRouter { - pub fn new(service: CloudService) -> Self { - Self { service } - } -} - -async fn rpc_call serde::Deserialize<'de> + std::convert::From>( - client: &reqwest::Client, - url: &str, - method: &str, - params: &JsonValue, - token: Option<&String>, -) -> Result> { - let body = serde_json::json!({ - "jsonrpc": "2.0", - "method": method, - "params": params, - "id": 1, //todo - }); - let mut req = client.post(url).json(&body); - if let Some(token) = token { - req = req.bearer_auth(token); - } - let resp = req.send().await?.json::().await?; - - Ok(resp["result"].clone().try_into()?) -} diff --git a/crates/txtx-cloud/src/workspace.rs b/crates/txtx-cloud/src/workspace.rs deleted file mode 100644 index d64c40e2a..000000000 --- a/crates/txtx-cloud/src/workspace.rs +++ /dev/null @@ -1,108 +0,0 @@ -use serde::Deserialize; -use serde_json::json; -use txtx_addon_kit::{reqwest, uuid::Uuid}; - -pub async fn fetch_svm_workspaces( - access_token: &str, - service_gql_url: &str, -) -> Result, String> { - let client = reqwest::Client::new(); - let max_attempts = 3; - let mut attempts = 0; - loop { - attempts += 1; - let res = client - .post(service_gql_url) - .bearer_auth(access_token) - .json(&json!({ - "query": r#" - query GetWorkspaces { - svm_workspaces { - name - id - } - } - "#.to_string(), - })) - .send() - .await - .map_err(|e| e.to_string())?; - - if !res.status().is_success() { - let err = res.text().await.unwrap_or_else(|_| "Unknown error".to_string()); - return Err(format!("received error from server: {}", err)); - } - - let response: GqlResponse = - res.json().await.map_err(|e| format!("failed to parse response: {}", e))?; - - if let Some(workspace_response) = response.data { - return Ok(workspace_response.svm_workspaces.clone()); - } else { - if attempts >= max_attempts { - return Err("no workspaces found for user after multiple attempts".to_string()); - } - tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - } - } -} - -pub async fn get_workspace_id( - workspace_name: &str, - access_token: &str, - service_gql_url: &str, -) -> Result { - let client = reqwest::Client::new(); - let res = client - .post(service_gql_url) - .bearer_auth(access_token) - .json(&json!({ - "query": r#" - query GetWorkspaceByName($_eq: String = "") { - svm_workspaces(where: {name: {_eq: $_eq}}) { - name - id - } - } - "#.to_string(), - "variables": { - "_eq": workspace_name - } - })) - .send() - .await - .map_err(|e| e.to_string())?; - - if !res.status().is_success() { - let err = res.text().await.unwrap_or_else(|_| "Unknown error".to_string()); - return Err(format!("received error from server: {}", err)); - } - - let response: GqlResponse = - res.json().await.map_err(|e| format!("failed to parse response: {}", e))?; - - if let Some(workspace_response) = response.data { - if workspace_response.svm_workspaces.is_empty() { - return Err(format!("workspace '{}' not found", workspace_name)); - } - Ok(workspace_response.svm_workspaces[0].clone()) - } else { - Err("No data returned from server".to_string()) - } -} - -#[derive(Debug, Clone, Deserialize)] -pub struct GqlResponse { - pub data: Option, -} - -#[derive(Debug, Clone, Deserialize)] -pub struct WorkspaceResponse { - pub svm_workspaces: Vec, -} - -#[derive(Debug, Clone, Deserialize)] -pub struct Workspace { - pub id: Uuid, - pub name: String, -} diff --git a/crates/txtx-core/Cargo.toml b/crates/txtx-core/Cargo.toml index 390baa514..a1b79a8c3 100644 --- a/crates/txtx-core/Cargo.toml +++ b/crates/txtx-core/Cargo.toml @@ -23,7 +23,6 @@ petgraph = "0.8.2" libsecp256k1 = "0.7.0" ripemd = "0.1.3" serde = "1" -serde_derive = "1" serde_yml = "0.0.11" chrono = "0.4.38" similar = "2.5.0" diff --git a/crates/txtx-core/src/runbook/embedded_runbook/mod.rs b/crates/txtx-core/src/runbook/embedded_runbook/mod.rs index 8b63babee..b8a1f77dc 100644 --- a/crates/txtx-core/src/runbook/embedded_runbook/mod.rs +++ b/crates/txtx-core/src/runbook/embedded_runbook/mod.rs @@ -2,7 +2,6 @@ pub mod publishable; use publishable::PublishableEmbeddedRunbookSpecification; use std::collections::HashMap; -use std::str::FromStr; use txtx_addon_kit::hcl::structure::Block; use txtx_addon_kit::helpers::fs::FileLocation; use txtx_addon_kit::types::commands::DependencyExecutionResultCache; @@ -248,6 +247,7 @@ impl EmbeddedRunbookInstanceBuilder { #[cfg(test)] mod tests { use std::collections::HashSet; + use std::str::FromStr; use txtx_addon_kit::helpers::fs::FileLocation; use txtx_addon_kit::helpers::hcl::RawHclContent; diff --git a/crates/txtx-core/src/runbook/runtime_context.rs b/crates/txtx-core/src/runbook/runtime_context.rs index 63bd53cf5..62464e5b5 100644 --- a/crates/txtx-core/src/runbook/runtime_context.rs +++ b/crates/txtx-core/src/runbook/runtime_context.rs @@ -1,7 +1,5 @@ use kit::indexmap::IndexMap; use kit::types::cloud_interface::CloudServiceContext; -use serde::Deserialize; -use serde::Serialize; use std::collections::HashMap; use std::collections::VecDeque; use txtx_addon_kit::types::commands::DependencyExecutionResultCache; @@ -194,8 +192,9 @@ impl RuntimeContext { self.addons_context.register(&package_id.did(), "std", false).unwrap(); - let blocks = - raw_content.into_typed_blocks().map_err(|diag| vec![diag.location(&location)])?; + let blocks = raw_content + .into_typed_blocks() + .map_err(|diag| vec![diag.location(&location)])?; let _ = self .register_addons_from_blocks( @@ -653,10 +652,3 @@ impl AddonConstructFactory { }) } } - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct EnvironmentMetadata { - location: String, - name: String, - description: Option, -} diff --git a/crates/txtx-serve/Cargo.toml b/crates/txtx-serve/Cargo.toml deleted file mode 100644 index 129a59ddc..000000000 --- a/crates/txtx-serve/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "txtx-serve" -description = "Crate for serving a txtx runbook" -version = "0.1.3" -edition = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -keywords = { workspace = true } -categories = { workspace = true } - - -[dependencies] -txtx-addon-kit = { workspace = true } -txtx-core = { workspace = true } -txtx-gql = { workspace = true } -txtx-addon-network-svm = { workspace = true } -txtx-addon-network-evm = { workspace = true } -actix-cors = "0.7.0" -actix-web = "4" -ansi_term = "0.12.1" -atty = "0.2.14" -hiro-system-kit = "0.3.1" -juniper_actix = {version = "0.5.0", features = ["subscriptions"] } -juniper_graphql_ws = { version = "0.4.0", features = ["graphql-transport-ws"] } -serde = "1" -serde_json = "1" -tokio = "1.37.0" - -[build-dependencies] -npm_rs="1.0.0" - - -[lib] -crate-type = ["lib", "cdylib"] diff --git a/crates/txtx-serve/src/lib.rs b/crates/txtx-serve/src/lib.rs deleted file mode 100644 index de7435eda..000000000 --- a/crates/txtx-serve/src/lib.rs +++ /dev/null @@ -1,538 +0,0 @@ -use std::collections::{BTreeMap, HashSet}; -use std::sync::Arc; -use std::time::Duration; - -use actix_cors::Cors; -use actix_web::dev::ServerHandle; -use actix_web::http::header::{self}; -use actix_web::http::StatusCode; -use actix_web::web::{self, Data, Json}; -use actix_web::{middleware, App, HttpRequest, HttpResponse, HttpServer}; -use actix_web::{Error, HttpResponseBuilder, Responder}; -use hiro_system_kit::green; -use juniper_actix::{graphql_handler, subscriptions}; -use juniper_graphql_ws::ConnectionConfig; -use serde::ser::StdError; -use serde::{Deserialize, Serialize}; -use serde_json::Value as JsonValue; -use tokio::sync::RwLock; -use txtx_addon_kit::types::cloud_interface::CloudServiceContext; -use txtx_addon_kit::types::frontend::SupervisorAddonData; -use txtx_addon_kit::Addon; -use txtx_addon_network_evm::EvmNetworkAddon; -use txtx_addon_network_svm::SvmNetworkAddon; -use txtx_core::kit::channel; -use txtx_core::kit::helpers::fs::FileLocation; -use txtx_core::kit::types::frontend::{ - ActionItemRequest, BlockEvent, ClientType, DiscoveryResponse, -}; -use txtx_core::kit::types::{AuthorizationContext, RunbookId}; -use txtx_core::kit::uuid::Uuid; -use txtx_core::runbook::RunbookTopLevelInputsMap; -use txtx_core::start_supervised_runbook_runloop; -use txtx_core::std::StdAddon; -use txtx_core::types::{Runbook, RunbookSources}; -use txtx_gql::Context as GqlContext; -use txtx_gql::{new_graphql_schema, Context as GraphContext, GraphqlSchema}; - -pub const SERVE_BINDING_PORT: &str = "18488"; -pub const SERVE_BINDING_ADDRESS: &str = "localhost"; - -fn get_available_addons() -> Vec> { - vec![ - Box::new(StdAddon::new()), - Box::new(SvmNetworkAddon::new()), - Box::new(EvmNetworkAddon::new()), - ] -} - -fn get_addon_by_namespace(namespace: &str) -> Option> { - let available_addons = get_available_addons(); - for addon in available_addons.into_iter() { - if namespace.starts_with(&format!("{}", addon.get_namespace())) { - return Some(addon); - } - } - None -} - -pub async fn start_server( - network_binding: &str, - // ctx: &Context, -) -> Result> { - // info!(ctx.expect_logger(), "Starting server {}", network_binding); - - // let boxed_ctx = Data::new(ctx.clone()); - - let gql_context: Data>> = Data::new(RwLock::new(None)); - - let server = HttpServer::new(move || { - App::new() - .app_data(gql_context.clone()) - .app_data(Data::new(new_graphql_schema())) - // .app_data(boxed_ctx.clone()) - .wrap( - Cors::default() - .allow_any_origin() - .allowed_methods(vec!["POST", "GET", "OPTIONS", "DELETE"]) - .allowed_headers(vec![header::AUTHORIZATION, header::ACCEPT]) - .allowed_header(header::CONTENT_TYPE) - .supports_credentials() - .max_age(3600), - ) - .wrap(middleware::Compress::default()) - .wrap(middleware::Logger::default()) - .service( - web::scope("/api/v1") - .route("/runbooks/check", web::post().to(register_runbook)) - .route("/runbooks/run", web::post().to(execute_runbook)) - .route("/runbooks/run/state", web::get().to(execute_runbook)) - .route("/discovery", web::get().to(discovery)), - ) - .route("/ping", web::get().to(check_service_health)) - .service( - web::scope("/gql/v1") - .route("/graphql?", web::get().to(get_graphql)) - .route("/graphql", web::post().to(post_graphql)) - .route("/subscriptions", web::get().to(subscriptions)), - ) - }) - .workers(5) - .bind(network_binding)? - .run(); - - let handle = server.handle(); - tokio::spawn(server); - - // Declare a pool of threads - // - - Ok(handle) -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct RunbookRegistrationRequest { - hcl_source: String, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct RunbookRegistrationResponse { - runbook_uuid: Uuid, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct StartRunbookExecutionRequest { - id: String, - name: String, - description: String, - constructs: Vec, - hcl_source_legacy: Option, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct ConstructRequest { - construct_type: String, - id: String, - description: String, - value: Option, - action_id: Option, - namespace: Option, - inputs: Option>, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum RunbookExecutionStepState { - Succeeded, - Failed, - Current, - Next, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct RunbookExecutionStep { - state: RunbookExecutionStepState, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub struct RunbookExecutionStateResponse { - runbook_uuid: Uuid, - steps: Vec, -} - -pub async fn check_service_health( - _req: HttpRequest, - // ctx: Data, - // graph_context: Data, -) -> actix_web::Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - - Ok(HttpResponseBuilder::new(StatusCode::OK).json(true)) -} - -pub async fn register_runbook( - _req: HttpRequest, - // ctx: Data, - _payload: Json, - // relayer_context: Data, - // graph_context: Data, -) -> actix_web::Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - - Ok(HttpResponseBuilder::new(StatusCode::OK).json(true)) -} - -pub async fn execute_runbook( - _req: HttpRequest, - // ctx: Data, - payload: Json, - // relayer_context: Data, - gql_context: Data>>, -) -> actix_web::Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - - let mut reconstructed_source = "".to_string(); - let mut required_addons = HashSet::new(); - for construct in payload.constructs.iter() { - // Parse construct type to enum for type-safe handling - use std::str::FromStr; - use txtx_core::types::ConstructType; - - let construct_type = match ConstructType::from_str(&construct.construct_type) { - Ok(ct) => ct, - Err(_) => { - return Err(actix_web::error::ErrorBadRequest(format!( - "Invalid construct type: '{}'. Valid types: {:?}", - construct.construct_type, - ConstructType::all().collect::>() - ))) - } - }; - - reconstructed_source.push_str(&construct.construct_type); - reconstructed_source.push_str(&format!(" \"{}\"", &construct.id)); - if let Some(ref namespace) = construct.namespace { - required_addons.insert(namespace); - } - let command_id = match (&construct.namespace, &construct.action_id) { - (Some(namespace), Some(id)) => format!("\"{}::{}\"", namespace, id), - (None, Some(id)) => format!("\"{}\"", id), - (Some(namespace), None) => format!(" \"{}\"", namespace), - (None, None) => format!(""), - }; - reconstructed_source.push_str(&format!(" {} {{\n", &command_id)); - - // Use exhaustive match for type-safe construct handling - match construct_type { - ConstructType::Variable | ConstructType::Output => { - reconstructed_source - .push_str(&format!(" description = \"{}\"\n", construct.description)); - reconstructed_source.push_str(&format!(" editable = true\n")); - - if let Some(ref value) = construct.value { - match value { - JsonValue::Null => {} - JsonValue::String(value) if value.starts_with("$") => { - reconstructed_source.push_str(&format!(" value = {}\n", &value[1..])); - } - JsonValue::String(value) => { - reconstructed_source.push_str(&format!(" value = \"{}\"\n", value)); - } - JsonValue::Number(value) => { - reconstructed_source.push_str(&format!(" value = {}\n", &value)); - } - _ => unreachable!(), - } - } - } - ConstructType::Action => { - if let Some(ref inputs) = construct.inputs { - for (key, value) in inputs.iter() { - match value { - JsonValue::Null => {} - JsonValue::String(value) if value.eq("null") => {} - JsonValue::String(value) if value.starts_with("$") => { - reconstructed_source.push_str(&format!( - " {} = {}\n", - key, - &value[1..] - )); - } - JsonValue::String(value) => { - reconstructed_source - .push_str(&format!(" {} = \"{}\"\n", key, value)); - } - JsonValue::Number(value) => { - reconstructed_source.push_str(&format!(" {} = {}\n", key, &value)); - } - _ => unreachable!(), - } - } - } - } - ConstructType::Signer - | ConstructType::Addon - | ConstructType::Module - | ConstructType::Flow - | ConstructType::Import - | ConstructType::Prompt - | ConstructType::Runbook => { - return Err(actix_web::error::ErrorBadRequest(format!( - "Construct type '{}' is not supported in runbook execution", - construct_type - ))) - } - } - reconstructed_source.push_str(&format!("}}\n\n")); - } - for addon in required_addons.iter() { - reconstructed_source.push_str(&format!("addon \"{}\" {{\n", addon)); - reconstructed_source.push_str(&format!(" chain_id = 11155111\n")); - reconstructed_source.push_str(&format!( - " rpc_api_url = \"https://sepolia.infura.io/v3/a063e95957aa4fd29319b2a53c31d481\"\n" - )); - reconstructed_source.push_str(&format!("}}\n\n")); - - reconstructed_source - .push_str(&format!("signer \"account\" \"{}::web_wallet\" {{\n", addon)); - reconstructed_source.push_str(&format!(" description = \"Account\"\n")); - reconstructed_source.push_str(&format!("}}\n\n")); - } - println!("{}", reconstructed_source); - - let runbook_name = payload.name.clone(); - let runbook_description = Some(payload.description.clone()); - let runbook_source = reconstructed_source; - let dummy_location = - FileLocation::from_path_string("/tmp/file.tx").map_err(|e| Box::::from(e))?; - - let mut runbook_sources = RunbookSources::new(); - runbook_sources.add_source(runbook_name.clone(), dummy_location, runbook_source); - let runbook_id = RunbookId { org: None, workspace: None, name: runbook_name.clone() }; - let mut runbook = Runbook::new(runbook_id, runbook_description); - - let runbook_inputs = RunbookTopLevelInputsMap::new(); - let authorization_context = AuthorizationContext::empty(); - runbook - .build_contexts_from_sources( - runbook_sources, - runbook_inputs, - authorization_context, - get_addon_by_namespace, - CloudServiceContext::empty(), - ) - .await - .unwrap(); - - runbook.enable_full_execution_mode(); - // info!(ctx.expect_logger(), "2"); - let runbook_description = runbook.description.clone(); - let supervisor_addon_data = { - let flow = runbook.flow_contexts.first().unwrap(); - let mut addons = vec![]; - for addon in flow.execution_context.addon_instances.values() { - if let Some(addon_defaults) = flow - .workspace_context - .addons_defaults - .get(&(addon.package_id.did(), addon.addon_id.clone())) - { - if !addons.iter().any(|a: &SupervisorAddonData| a.addon_name.eq(&addon.addon_id)) { - addons.push(SupervisorAddonData::new(&addon.addon_id, addon_defaults)); - } - } - } - addons - }; - let (block_tx, block_rx) = channel::unbounded::(); - let (block_broadcaster, _) = tokio::sync::broadcast::channel(5); - let (log_broadcaster, _) = tokio::sync::broadcast::channel(5); - let (_action_item_updates_tx, _action_item_updates_rx) = - channel::unbounded::(); - let (action_item_events_tx, action_item_events_rx) = tokio::sync::broadcast::channel(32); - let block_store = Arc::new(RwLock::new(BTreeMap::new())); - let log_store = Arc::new(RwLock::new(Vec::new())); - let (kill_loops_tx, kill_loops_rx) = channel::bounded(1); - let moved_block_tx = block_tx.clone(); - let moved_kill_loops_tx = kill_loops_tx.clone(); - // let moved_ctx = ctx.clone(); - - let _ = hiro_system_kit::thread_named("Runbook Runloop").spawn(move || { - let runloop_future = - start_supervised_runbook_runloop(&mut runbook, moved_block_tx, action_item_events_rx); - if let Err(diags) = hiro_system_kit::nestable_block_on(runloop_future) { - for _diag in diags.iter() { - // error!(moved_ctx.expect_logger(), "Runbook execution failed: {}", diag.message); - } - // if let Err(e) = write_runbook_transient_state(&mut runbook, moved_runbook_state) { - // println!("{} Failed to write transient runbook state: {}", red!("x"), e); - // }; - } else { - // if let Err(e) = write_runbook_state(&mut runbook, moved_runbook_state) { - // println!("{} Failed to write runbook state: {}", red!("x"), e); - // }; - } - if let Err(_e) = moved_kill_loops_tx.send(true) { - // std::process::exit(1); - } - }); - - // start web ui server - { - let mut gql_context = gql_context.write().await; - *gql_context = Some(GqlContext { - protocol_name: runbook_name.clone(), - runbook_name: runbook_name.clone(), - supervisor_addon_data, - runbook_description, - log_store: log_store.clone(), - block_store: block_store.clone(), - block_broadcaster: block_broadcaster.clone(), - log_broadcaster: log_broadcaster.clone(), - action_item_events_tx: action_item_events_tx.clone(), - }); - } - - let _block_store_handle = tokio::spawn(async move { - loop { - if let Ok(mut block_event) = block_rx.try_recv() { - let mut block_store = block_store.write().await; - let mut do_propagate_event = true; - match block_event.clone() { - BlockEvent::Action(new_block) => { - let len = block_store.len(); - block_store.insert(len, new_block.clone()); - } - BlockEvent::Clear => { - *block_store = BTreeMap::new(); - } - BlockEvent::UpdateActionItems(updates) => { - // for action item updates, track if we actually changed anything before propagating the event - do_propagate_event = false; - let mut filtered_updates = vec![]; - for update in updates.iter() { - for (_, block) in block_store.iter_mut() { - let did_update = block.apply_action_item_updates(update.clone()); - if did_update { - do_propagate_event = true; - filtered_updates.push(update.clone()); - } - } - } - block_event = BlockEvent::UpdateActionItems(filtered_updates); - } - BlockEvent::Modal(new_block) => { - let len = block_store.len(); - block_store.insert(len, new_block.clone()); - } - BlockEvent::RunbookCompleted(_) => { - println!("\n{}", green!("Runbook complete!")); - break; - } - BlockEvent::Error(new_block) => { - let len = block_store.len(); - block_store.insert(len, new_block.clone()); - } - BlockEvent::Exit => break, - BlockEvent::LogEvent(log) => { - let mut log_store = log_store.write().await; - log_store.push(log); - } - } - - if do_propagate_event { - let _ = block_broadcaster.send(block_event.clone()); - } - } - - tokio::time::sleep(tokio::time::Duration::from_millis(50)).await; - // println!("waiting for next block event"); - } - }); - - let _ = hiro_system_kit::thread_named("Kill Runloops Thread") - .spawn(move || { - let future = async { - match kill_loops_rx.recv() { - Ok(_) => { - let _ = block_tx.send(BlockEvent::Exit); - } - Err(_) => {} - }; - }; - - hiro_system_kit::nestable_block_on(future) - }) - .unwrap(); - - // info!(ctx.expect_logger(), "Attempt to initialize execution channel"); - Ok(HttpResponseBuilder::new(StatusCode::OK).json(true)) -} - -async fn discovery() -> impl Responder { - HttpResponse::Ok() - .json(DiscoveryResponse { needs_credentials: false, client_type: ClientType::Operator }) -} - -async fn post_graphql( - req: HttpRequest, - payload: web::Payload, - schema: Data, - context: Data>>, - // ctx: Data, -) -> Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - let context = context.write().await; - let Some(context) = context.as_ref() else { - return Err(actix_web::error::ErrorServiceUnavailable("Service Unavailable")); - }; - graphql_handler(&schema, &context, req, payload).await -} - -async fn get_graphql( - req: HttpRequest, - payload: web::Payload, - schema: Data, - context: Data>>, - // ctx: Data, -) -> Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - let context = context.read().await; - let Some(context) = context.as_ref() else { - return Err(actix_web::error::ErrorServiceUnavailable("Service Unavailable")); - }; - graphql_handler(&schema, &context, req, payload).await -} - -async fn subscriptions( - req: HttpRequest, - stream: web::Payload, - schema: Data, - context: Data>>, - // ctx: Data, -) -> Result { - // info!(ctx.expect_logger(), "{} {}", req.method().as_str(), req.path()); - let context = context.read().await; - let Some(context) = context.as_ref() else { - return Err(actix_web::error::ErrorServiceUnavailable("Service Unavailable")); - }; - let ctx = GraphContext { - protocol_name: context.protocol_name.clone(), - runbook_name: context.runbook_name.clone(), - supervisor_addon_data: context.supervisor_addon_data.clone(), - runbook_description: context.runbook_description.clone(), - block_store: context.block_store.clone(), - log_store: context.log_store.clone(), - block_broadcaster: context.block_broadcaster.clone(), - log_broadcaster: context.log_broadcaster.clone(), - action_item_events_tx: context.action_item_events_tx.clone(), - }; - let config = ConnectionConfig::new(ctx); - let config = config.with_keep_alive_interval(Duration::from_secs(15)); - subscriptions::ws_handler(req, stream, schema.into_inner(), config).await -}