From 81d19516ab181503315e00c99969de8185d5b915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Fri, 20 Nov 2020 15:04:52 -0600 Subject: [PATCH] Bootstrap 'src/ya-comiste-rust' backend I am still working on the schema design so this is just a project bootstrap so I can setup all the things around it. --- .editorconfig | 5 +- .github/dependabot.yml | 7 + ... => continuous-integration-javascript.yml} | 2 +- .../workflows/continuous-integration-rust.yml | 30 + .jest-eslint.config.js | 8 + src/eslint-runner/reporter.js | 19 +- src/ya-comiste-react-native/schema.graphql | 2 +- src/ya-comiste-rust/.gitignore | 1 + src/ya-comiste-rust/Cargo.lock | 2239 +++++++++++++++++ src/ya-comiste-rust/Cargo.toml | 5 + src/ya-comiste-rust/README.md | 145 ++ src/ya-comiste-rust/arangodb/dump/ENCRYPTION | 1 + .../arangodb/dump/_system/ENCRYPTION | 1 + .../arangodb/dump/_system/dump.json | 1 + .../arangodb/dump/ya-comiste/ENCRYPTION | 1 + .../arangodb/dump/ya-comiste/dump.json | 1 + ...6c1f9f90c0181a0fe73698084cda2c0b.data.json | 2 + ...f90c0181a0fe73698084cda2c0b.structure.json | 1 + ...6433b304283cd61ce0d26b756034a712.data.json | 2 + ...304283cd61ce0d26b756034a712.structure.json | 1 + ...ff4dee88db82e98f0e0d524d965b9aa7.data.json | 2 + ...e88db82e98f0e0d524d965b9aa7.structure.json | 1 + .../dump/ya-comiste/testsearch.view.json | 1 + ...9bc65c2abec141778ffaa729489f3e87.data.json | 1 + ...c2abec141778ffaa729489f3e87.structure.json | 1 + src/ya-comiste-rust/arangodb/masking.json | 5 + .../crates/arangodb/Cargo.toml | 11 + .../crates/arangodb/src/lib.rs | 41 + src/ya-comiste-rust/crates/server/Cargo.toml | 23 + .../crates/server/src/graphql_context.rs | 3 + .../crates/server/src/graphql_schema.rs | 33 + src/ya-comiste-rust/crates/server/src/main.rs | 32 + src/ya-comiste-rust/crates/server/src/sdui.rs | 27 + .../crates/server/src/sdui_blocks.rs | 26 + ...raphql_schema__tests__schema_snapshot.snap | 18 + 35 files changed, 2695 insertions(+), 4 deletions(-) rename .github/workflows/{continuous-integration.yml => continuous-integration-javascript.yml} (95%) create mode 100644 .github/workflows/continuous-integration-rust.yml create mode 100644 src/ya-comiste-rust/.gitignore create mode 100644 src/ya-comiste-rust/Cargo.lock create mode 100644 src/ya-comiste-rust/Cargo.toml create mode 100644 src/ya-comiste-rust/README.md create mode 100644 src/ya-comiste-rust/arangodb/dump/ENCRYPTION create mode 100644 src/ya-comiste-rust/arangodb/dump/_system/ENCRYPTION create mode 100644 src/ya-comiste-rust/arangodb/dump/_system/dump.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/ENCRYPTION create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/dump.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.data.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.structure.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.data.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.structure.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.data.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.structure.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/testsearch.view.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.data.json create mode 100644 src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.structure.json create mode 100644 src/ya-comiste-rust/arangodb/masking.json create mode 100644 src/ya-comiste-rust/crates/arangodb/Cargo.toml create mode 100644 src/ya-comiste-rust/crates/arangodb/src/lib.rs create mode 100644 src/ya-comiste-rust/crates/server/Cargo.toml create mode 100644 src/ya-comiste-rust/crates/server/src/graphql_context.rs create mode 100644 src/ya-comiste-rust/crates/server/src/graphql_schema.rs create mode 100644 src/ya-comiste-rust/crates/server/src/main.rs create mode 100644 src/ya-comiste-rust/crates/server/src/sdui.rs create mode 100644 src/ya-comiste-rust/crates/server/src/sdui_blocks.rs create mode 100644 src/ya-comiste-rust/crates/server/src/snapshots/server__graphql_schema__tests__schema_snapshot.snap diff --git a/.editorconfig b/.editorconfig index 4a7ea3036a..93e20a217f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,5 +8,8 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.md] +[*.{md,snap}] trim_trailing_whitespace = false + +[*.rs] +indent_size = 4 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e421c7cdde..a4fc9c3d81 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,3 +20,10 @@ updates: interval: 'daily' labels: - 'dependencies' + + - package-ecosystem: 'cargo' + directory: '/src/ya-comiste-rust/' + schedule: + interval: 'daily' + labels: + - 'dependencies' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration-javascript.yml similarity index 95% rename from .github/workflows/continuous-integration.yml rename to .github/workflows/continuous-integration-javascript.yml index 25314984ff..afd49116c6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration-javascript.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: Continuous Integration (JavaScript) on: [push] diff --git a/.github/workflows/continuous-integration-rust.yml b/.github/workflows/continuous-integration-rust.yml new file mode 100644 index 0000000000..0595825fbf --- /dev/null +++ b/.github/workflows/continuous-integration-rust.yml @@ -0,0 +1,30 @@ +name: Continuous Integration (Rust) + +on: + push: + paths: + - 'src/ya-comiste-rust/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.4 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + # https://github.com/actions-rs/cargo + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --manifest-path src/ya-comiste-rust/Cargo.toml + + # https://github.com/actions-rs/cargo + - name: Run all tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path src/ya-comiste-rust/Cargo.toml diff --git a/.jest-eslint.config.js b/.jest-eslint.config.js index a2f4fb1b40..e0daf7d34d 100644 --- a/.jest-eslint.config.js +++ b/.jest-eslint.config.js @@ -1,5 +1,6 @@ // @flow strict +// https://jestjs.io/docs/en/configuration module.exports = { displayName: 'lint', rootDir: __dirname, @@ -7,4 +8,11 @@ module.exports = { reporters: ['@adeira/eslint-runner/reporter'], runner: '@adeira/eslint-runner', testMatch: ['/src/**/*.js', '/scripts/**/*.js'], + testPathIgnorePatterns: [ + '/node_modules/', + + // The only reason why this is here is because Jest fails on unrelated .snap files generated by Rust Insta. + // See: https://github.com/facebook/jest/issues/8922 + '/src/ya-comiste-rust/', + ], }; diff --git a/src/eslint-runner/reporter.js b/src/eslint-runner/reporter.js index 62c9c99911..90e2341003 100644 --- a/src/eslint-runner/reporter.js +++ b/src/eslint-runner/reporter.js @@ -18,7 +18,22 @@ type RunCompleteResults = {| +numTotalTestSuites: number, +numTotalTests: number, +openHandles: $ReadOnlyArray, // TODO - +snapshot: any, // TODO + +snapshot: {| + +added: number, + +didUpdate: boolean, + +failure: boolean, + +filesAdded: number, + +filesRemoved: number, + +filesRemovedList: $ReadOnlyArray, + +filesUnmatched: number, + +filesUpdated: number, + +matched: number, + +total: number, + +unchecked: number, + +uncheckedKeysByFile: number, + +unmatched: number, + +updated: number, + |}, +startTime: number, +success: boolean, +wasInterrupted: boolean, @@ -57,6 +72,8 @@ class JestProgressBarReporter { } onRunComplete(test /*: any */, results /*: RunCompleteResults */) /*: void */ { + // TODO: there might be an obsolete .snap file which causes Eslint Runner to fail (should be handle it?) + results.testResults.forEach(({ failureMessage }) => { if (failureMessage != null) { console.log(failureMessage); diff --git a/src/ya-comiste-react-native/schema.graphql b/src/ya-comiste-react-native/schema.graphql index 5ed0965379..12e676ed54 100644 --- a/src/ya-comiste-react-native/schema.graphql +++ b/src/ya-comiste-react-native/schema.graphql @@ -15,7 +15,7 @@ type EntrypointBlock { Technically, `block` can always return any block, however, some combinations don't make sense. It's up to the server to decide which blocks can be nested/returned and which cannot in the given context. """ - block(supported: [String!]!): SDUIBlock + block(supported: [String!]!): SDUIBlock # TODO: more like `renderer` (?) } union SDUIBlock = CardBlock | DescriptionBlock | JumbotronBlock | ScrollViewHorizontalBlock diff --git a/src/ya-comiste-rust/.gitignore b/src/ya-comiste-rust/.gitignore new file mode 100644 index 0000000000..eb5a316cbd --- /dev/null +++ b/src/ya-comiste-rust/.gitignore @@ -0,0 +1 @@ +target diff --git a/src/ya-comiste-rust/Cargo.lock b/src/ya-comiste-rust/Cargo.lock new file mode 100644 index 0000000000..77ecb1fc6e --- /dev/null +++ b/src/ya-comiste-rust/Cargo.lock @@ -0,0 +1,2239 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adler" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" + +[[package]] +name = "aho-corasick" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7" + +[[package]] +name = "arangodb" +version = "0.0.0" +dependencies = [ + "arangors", +] + +[[package]] +name = "arangors" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "912f994638c5dd85a043a031bd2fef2a0e606a794888a692f8565d94722b9380" +dependencies = [ + "async-trait", + "base64 0.13.0", + "http", + "log", + "maybe-async", + "reqwest", + "serde", + "serde_json", + "serde_qs", + "thiserror", + "typed-builder", + "url", +] + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-compression" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1ff21a63d3262af46b9f33a826a8d134e2d0d9b2179c86034948b732ea8b2a" +dependencies = [ + "bytes", + "flate2", + "futures-core", + "memchr", + "pin-project-lite 0.1.11", +] + +[[package]] +name = "async-trait" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.4", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "bson" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11f16001d679cb13d14b2c93c7d0fa13bb484a87c34a6c4c39707ad936499b5" +dependencies = [ + "base64 0.12.3", + "chrono", + "hex", + "lazy_static", + "linked-hash-map", + "rand 0.7.3", + "serde", + "serde_json", +] + +[[package]] +name = "buf_redux" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" +dependencies = [ + "memchr", + "safemem", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "cc" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time", + "winapi 0.3.9", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "console" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b1aacfaffdbff75be81c15a399b4bedf78aaefe840e8af1d299ac2ade885d2" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "terminal_size", + "termios", + "winapi 0.3.9", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +dependencies = [ + "cfg-if 0.1.10", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + +[[package]] +name = "crc32fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "data-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993a608597367c6377b258c25d7120740f00ed23a2252b729b1932dd7866f908" + +[[package]] +name = "derive_utils" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64196eb9f551916167225134f1e8a90f0b5774331d3c900d6328fd94bafe3544" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", +] + +[[package]] +name = "dtoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "env_logger" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "flate2" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" +dependencies = [ + "cfg-if 1.0.0", + "crc32fast", + "libc", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" + +[[package]] +name = "futures-enum" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f3979efb3aea70991b7fd261a40decddae71f8bdfd8b2982cc8442e8f6813a" +dependencies = [ + "derive_utils", + "quote", + "syn", +] + +[[package]] +name = "futures-executor" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" + +[[package]] +name = "futures-macro" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" + +[[package]] +name = "futures-task" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project 1.0.2", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "graphql-parser" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1abd4ce5247dfc04a03ccde70f87a048458c9356c7e41d21ad8c407b3dde6f2" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", + "tracing-futures", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + +[[package]] +name = "headers" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed18eb2459bf1a09ad2d6b1547840c3e5e62882fa09b9a6a20b1de8e3228848f" +dependencies = [ + "base64 0.12.3", + "bitflags", + "bytes", + "headers-core", + "http", + "mime", + "sha-1 0.8.2", + "time", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "hermit-abi" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" + +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "humantime" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" + +[[package]] +name = "hyper" +version = "0.13.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project 1.0.2", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-tls", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +dependencies = [ + "autocfg 1.0.1", + "hashbrown", + "serde", +] + +[[package]] +name = "input_buffer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" +dependencies = [ + "bytes", +] + +[[package]] +name = "insta" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863bf97e7130bf788f29a99bc4073735af6b8ecc3da6a39c23b3a688d2d3109a" +dependencies = [ + "console", + "difference", + "lazy_static", + "serde", + "serde_json", + "serde_yaml", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipnet" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" + +[[package]] +name = "js-sys" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "juniper" +version = "0.14.2" +source = "git+https://github.com/graphql-rust/juniper#f3170c7adf4405cc119d2129f78a591fe2fcd32b" +dependencies = [ + "async-trait", + "bson", + "chrono", + "fnv", + "futures", + "futures-enum", + "graphql-parser", + "indexmap", + "juniper_codegen", + "serde", + "static_assertions", + "url", + "uuid", +] + +[[package]] +name = "juniper_codegen" +version = "0.14.2" +source = "git+https://github.com/graphql-rust/juniper#f3170c7adf4405cc119d2129f78a591fe2fcd32b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "juniper_warp" +version = "0.5.2" +source = "git+https://github.com/graphql-rust/juniper#f3170c7adf4405cc119d2129f78a591fe2fcd32b" +dependencies = [ + "anyhow", + "bytes", + "futures", + "juniper", + "serde", + "serde_json", + "thiserror", + "tokio", + "warp", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +dependencies = [ + "cfg-if 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "maybe-async" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1afac51d14f8056cd544c83239b961c464e0a98c2ca65353195df93e636a20" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +dependencies = [ + "adler", + "autocfg 1.0.1", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "multipart" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8209c33c951f07387a8497841122fc6f712165e3f9bda3e6be4645b58188f676" +dependencies = [ + "buf_redux", + "httparse", + "log", + "mime", + "mime_guess", + "quick-error", + "rand 0.6.5", + "safemem", + "tempfile", + "twoway", +] + +[[package]] +name = "native-tls" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "net2" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg 1.0.1", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg 1.0.1", +] + +[[package]] +name = "once_cell" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +dependencies = [ + "bitflags", + "cfg-if 0.1.10", + "foreign-types", + "lazy_static", + "libc", + "openssl-sys", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" + +[[package]] +name = "openssl-sys" +version = "0.9.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +dependencies = [ + "autocfg 1.0.1", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +dependencies = [ + "pin-project-internal 0.4.27", +] + +[[package]] +name = "pin-project" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +dependencies = [ + "pin-project-internal 1.0.2", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" + +[[package]] +name = "pin-project-lite" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro-nested" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.9", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[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_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[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_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.9", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "regex" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "reqwest" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb15d6255c792356a0f578d8a645c677904dc02e862bebe2ecc18e0c01b9a0ce" +dependencies = [ + "async-compression", + "base64 0.13.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding", + "pin-project-lite 0.2.0", + "serde", + "serde_json", + "serde_urlencoded 0.7.0", + "tokio", + "tokio-tls", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", + "winreg", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi 0.3.9", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "security-framework" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_qs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9408a61dabe404c76cec504ec510f7d92f41dc0a9362a0db8ab73d141cfbf93f" +dependencies = [ + "data-encoding", + "percent-encoding", + "serde", + "thiserror", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa", + "serde", + "url", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7baae0a99f1a324984bcdc5f0718384c1f69775f1c7eec8b859b71b443e3fd7" +dependencies = [ + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", +] + +[[package]] +name = "server" +version = "0.0.0" +dependencies = [ + "arangodb", + "arangors", + "env_logger", + "insta", + "juniper", + "juniper_warp", + "log", + "serde", + "serde_json", + "tokio", + "warp", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha-1" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce3cdf1b5e620a498ee6f2a171885ac7e22f0e12089ec4b3d22b84921792507c" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "socket2" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "winapi 0.3.9", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "syn" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b4f34193997d92804d359ed09953e25d5138df6bcc055a71bf68ee89fdf9223" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.9", +] + +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd2d183bd3fac5f5fe38ddbeb4dc9aec4a39a9d7d59e7491d900302da01cbe1" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "thiserror" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + +[[package]] +name = "tinyvec" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6d7ad61edd59bfcc7e80dababf0f4aed2e6d5e0ba1659356ae889752dfc12ff" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio", + "pin-project-lite 0.1.11", + "slab", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9e878ad426ca286e4dcae09cbd4e1973a7f8987d97570e2469703dd7f5720c" +dependencies = [ + "futures-util", + "log", + "pin-project 0.4.27", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.11", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" + +[[package]] +name = "tracing" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +dependencies = [ + "cfg-if 1.0.0", + "log", + "pin-project-lite 0.2.0", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "tracing-futures" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" +dependencies = [ + "pin-project 0.4.27", + "tracing", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" +dependencies = [ + "base64 0.12.3", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand 0.7.3", + "sha-1 0.9.2", + "url", + "utf-8", +] + +[[package]] +name = "twoway" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" +dependencies = [ + "memchr", +] + +[[package]] +name = "typed-builder" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f85f4270f4f449a3f2c0cf2aecc8415e388a597aeacc7d55fc749c5c968c8533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "url" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "urlencoding" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9232eb53352b4442e40d7900465dfc534e8cb2dc8f18656fcb2ac16112b5593" + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" + +[[package]] +name = "uuid" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "warp" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41be6df54c97904af01aa23e613d4521eed7ab23537cede692d4058f6449407" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "log", + "mime", + "mime_guess", + "multipart", + "pin-project 0.4.27", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded 0.6.1", + "tokio", + "tokio-tungstenite", + "tower-service", + "tracing", + "tracing-futures", + "urlencoding", +] + +[[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.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +dependencies = [ + "cfg-if 0.1.10", + "serde", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +dependencies = [ + "cfg-if 0.1.10", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d1cdc8b98a557f24733d50a1199c4b0635e465eecba9c45b214544da197f64" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fb9c67be7439ee8ab1b7db502a49c05e51e2835b66796c705134d9b8e1a585" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "web-sys" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "yaml-rust" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +dependencies = [ + "linked-hash-map", +] diff --git a/src/ya-comiste-rust/Cargo.toml b/src/ya-comiste-rust/Cargo.toml new file mode 100644 index 0000000000..0f932e80a9 --- /dev/null +++ b/src/ya-comiste-rust/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] +members = [ + "crates/arangodb", + "crates/server", +] diff --git a/src/ya-comiste-rust/README.md b/src/ya-comiste-rust/README.md new file mode 100644 index 0000000000..c1ad656763 --- /dev/null +++ b/src/ya-comiste-rust/README.md @@ -0,0 +1,145 @@ +This server is written in Rust, exposes GraphQL API (via Warp) and works with ArangoDB database behind the scenes. + +- Rust tl;dr: https://doc.rust-lang.org/stable/rust-by-example/ +- Rust book: https://doc.rust-lang.org/book/ +- Juniper: https://graphql-rust.github.io/juniper/current/ +- ArangoDB: https://www.arangodb.com/docs/stable/ (multi-model DB) +- JSON Schema validator: https://www.jsonschemavalidator.net/ + +```text +(cd src/ya-comiste-rust && cargo run) +(cd src/ya-comiste-rust && cargo fmt) +(cd src/ya-comiste-rust && cargo check) +(cd src/ya-comiste-rust && cargo clippy) +(cd src/ya-comiste-rust && cargo test --offline) +``` + +- http://127.0.0.1:8080/ + +```text +brew services start arangodb +``` + +- or - + +```text +/usr/local/opt/arangodb/sbin/arangod +``` + +- http://127.0.0.1:8529/ (user `ya-comiste`, no password) + +Example query: + +```graphql +{ + mobileEntrypointSections(id: "entrypoints/com.yaComiste.Explore") { + id + title + } +} +``` + +# TODO + +- setup CI for Rust +- DB strings and source-code translations + +# ArangoDB + +Fetching all sections inside one entrypoint (for SDUI): + +```aql +FOR vertex, edge IN 1..1 OUTBOUND 'entrypoints/com.yaComiste.Explore' entrypoint_sections +// PRUNE edge.user == 'users/87047' +// FILTER edge.user == 'users/87047' +SORT vertex.section_order ASC +RETURN vertex +``` + +See graph traversals: https://www.arangodb.com/docs/stable/aql/graphs-traversals.html + +## Arangodump & Arangorestore + +Database backup (empty password): + +```text +arangodump \ + --output-directory="src/ya-comiste-rust/arangodb/dump" \ + --all-databases=true \ + --overwrite=true \ + --compress-output=false \ + --maskings="src/ya-comiste-rust/arangodb/masking.json" +``` + +Database restore: + +```text +arangorestore \ + --input-directory="src/ya-comiste-rust/arangodb/dump" \ + --all-databases=true +``` + +## AQL (_ArangoDB Query Language_) basics + +- https://www.arangodb.com/why-arangodb/sql-aql-comparison/ + +```aql +RETURN DOCUMENT("users/335") + +INSERT { name: "Katie Foster", age: 27 } INTO users +RETURN NEW + +RETURN DOCUMENT( ["users/335", "users/680", "users/790"] ) + +FOR user IN users + RETURN user + +FOR user IN users + SORT user.age DESC + RETURN user + +FOR user IN users + FILTER user.age > 27 + SORT user.age + RETURN user.name + +# or REPLACE (to replace the whole object instead of updating it) +UPDATE "335" WITH { age: 40 } IN users +RETURN NEW + +# custom result projection +FOR user IN users + RETURN { userName: user.name, age: user.age } + +FOR user IN users + RETURN CONCAT(user.name, "'s age is ", user.age) + +FOR user1 IN users + FOR user2 IN users + FILTER user1 != user2 + RETURN [user1.name, user2.name] + +FOR user1 IN users + FOR user2 IN users + FILTER user1 != user2 + RETURN { + pair: [user1.name, user2.name], + sumOfAges: user1.age + user2.age + } + +FOR user1 IN users + FOR user2 IN users + FILTER user1 != user2 + LET sumOfAges = user1.age + user2.age + FILTER sumOfAges < 100 + RETURN { + pair: [user1.name, user2.name], + sumOfAges: sumOfAges + } + +REMOVE "335" IN users + +FOR user IN users + FILTER user.age >= 30 + REMOVE user IN users +``` diff --git a/src/ya-comiste-rust/arangodb/dump/ENCRYPTION b/src/ya-comiste-rust/arangodb/dump/ENCRYPTION new file mode 100644 index 0000000000..c86c3f3551 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ENCRYPTION @@ -0,0 +1 @@ +none \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/_system/ENCRYPTION b/src/ya-comiste-rust/arangodb/dump/_system/ENCRYPTION new file mode 100644 index 0000000000..c86c3f3551 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/_system/ENCRYPTION @@ -0,0 +1 @@ +none \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/_system/dump.json b/src/ya-comiste-rust/arangodb/dump/_system/dump.json new file mode 100644 index 0000000000..c05f33f914 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/_system/dump.json @@ -0,0 +1 @@ +{"database":"_system","lastTickAtDumpStart":"90475","properties":{"id":"1","name":"_system","isSystem":true}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/ENCRYPTION b/src/ya-comiste-rust/arangodb/dump/ya-comiste/ENCRYPTION new file mode 100644 index 0000000000..c86c3f3551 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/ENCRYPTION @@ -0,0 +1 @@ +none \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/dump.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/dump.json new file mode 100644 index 0000000000..c2273351af --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/dump.json @@ -0,0 +1 @@ +{"database":"ya-comiste","lastTickAtDumpStart":"90477","properties":{"id":"84144","name":"ya-comiste","isSystem":false}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.data.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.data.json new file mode 100644 index 0000000000..cdaf05d334 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.data.json @@ -0,0 +1,2 @@ +{"type":2300,"data":{"_key":"89538","_id":"entrypoint_sections/89538","_from":"entrypoints/com.yaComiste.Explore","_to":"sections/10771","_rev":"_bff4636---"}} +{"type":2300,"data":{"_key":"89458","_id":"entrypoint_sections/89458","_from":"entrypoints/com.yaComiste.Explore","_to":"sections/9810","_rev":"_bfgGf26---","user":"users/87047"}} diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.structure.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.structure.json new file mode 100644 index 0000000000..02f190d55d --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoint_sections_6c1f9f90c0181a0fe73698084cda2c0b.structure.json @@ -0,0 +1 @@ +{"indexes":[],"parameters":{"allowUserKeys":true,"cacheEnabled":false,"cid":"89337","deleted":false,"globallyUniqueId":"hC8B4EB76885F/89337","id":"89337","isDisjoint":false,"isSmart":false,"isSmartChild":false,"isSystem":false,"keyOptions":{"allowUserKeys":true,"type":"traditional","lastValue":89538},"minReplicationFactor":1,"name":"entrypoint_sections","numberOfShards":1,"planId":"89337","replicationFactor":1,"schema":null,"shardKeys":["_key"],"shards":{},"status":3,"tempObjectId":"0","type":3,"version":9,"waitForSync":false,"writeConcern":1}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.data.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.data.json new file mode 100644 index 0000000000..513ed8c8ac --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.data.json @@ -0,0 +1,2 @@ +{"type":2300,"data":{"_key":"com.yaComiste.Explore","_id":"entrypoints/com.yaComiste.Explore","_rev":"_bepZodO---"}} +{"type":2300,"data":{"_key":"com.yaComiste.ExploreDetail","_id":"entrypoints/com.yaComiste.ExploreDetail","_rev":"_bepZ8k6---"}} diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.structure.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.structure.json new file mode 100644 index 0000000000..cce8498b6c --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/entrypoints_6433b304283cd61ce0d26b756034a712.structure.json @@ -0,0 +1 @@ +{"indexes":[],"parameters":{"allowUserKeys":true,"cacheEnabled":false,"cid":"85194","deleted":false,"globallyUniqueId":"hC8B4EB76885F/8619","id":"85194","isDisjoint":false,"isSmart":false,"isSmartChild":false,"isSystem":false,"keyOptions":{"allowUserKeys":true,"type":"traditional","lastValue":0},"minReplicationFactor":1,"name":"entrypoints","numberOfShards":1,"planId":"8619","replicationFactor":1,"schema":null,"shardKeys":["_key"],"shards":{},"status":3,"tempObjectId":"0","type":2,"version":9,"waitForSync":false,"writeConcern":1}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.data.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.data.json new file mode 100644 index 0000000000..3c74a2ddb7 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.data.json @@ -0,0 +1,2 @@ +{"type":2300,"data":{"_key":"9810","_id":"sections/9810","_rev":"_bff1zcW---","section_order":1,"title":"Places nearby","type":"SDUIScrollViewHorizontalComponent"}} +{"type":2300,"data":{"_key":"10771","_id":"sections/10771","_rev":"_bff2ICi---","section_order":2,"title":"Bakeries nearby","type":"SDUIScrollViewHorizontalComponent"}} diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.structure.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.structure.json new file mode 100644 index 0000000000..1b5e6702b7 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/sections_ff4dee88db82e98f0e0d524d965b9aa7.structure.json @@ -0,0 +1 @@ +{"indexes":[],"parameters":{"allowUserKeys":true,"cacheEnabled":false,"cid":"85191","deleted":false,"globallyUniqueId":"hC8B4EB76885F/9751","id":"85191","isDisjoint":false,"isSmart":false,"isSmartChild":false,"isSystem":false,"keyOptions":{"allowUserKeys":true,"type":"traditional","lastValue":11596},"minReplicationFactor":1,"name":"sections","numberOfShards":1,"planId":"9751","replicationFactor":1,"schema":{"message":"","level":"strict","rule":{"type":"object","oneOf":[{"properties":{"section_order":{"type":"number"},"type":{"const":"SDUIScrollViewHorizontalComponent"},"title":{"type":"string"}},"additionalProperties":false,"required":["section_order","type","title"]},{"properties":{"section_order":{"type":"number"},"type":{"const":"SDUICardComponent"}},"additionalProperties":false,"required":["section_order","type"]}]}},"shardKeys":["_key"],"shards":{},"status":3,"tempObjectId":"0","type":2,"version":9,"waitForSync":false,"writeConcern":1}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/testsearch.view.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/testsearch.view.json new file mode 100644 index 0000000000..225adc55fb --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/testsearch.view.json @@ -0,0 +1 @@ +{"globallyUniqueId":"hC8B4EB76885F/81544","id":"81544","name":"testsearch","type":"arangosearch","cleanupIntervalStep":2,"commitIntervalMsec":1000,"consolidationIntervalMsec":10000,"consolidationPolicy":{"type":"tier","segmentsBytesFloor":2097152,"segmentsBytesMax":5368709120,"segmentsMax":10,"segmentsMin":1,"minScore":0},"primarySort":[],"primarySortCompression":"lz4","storedValues":[],"writebufferActive":0,"writebufferIdle":64,"writebufferSizeMax":33554432,"links":{"sections":{"analyzerDefinitions":[{"name":"text_en","type":"text","properties":{"locale":"en.utf-8","case":"lower","stopwords":[],"accent":false,"stemming":true},"features":["frequency","norm","position"]}],"analyzers":["text_en"],"fields":{"title":{}},"includeAllFields":false,"primarySort":[],"primarySortCompression":"lz4","storeValues":"none","storedValues":[],"trackListPositions":false}}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.data.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.data.json new file mode 100644 index 0000000000..add404fce9 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.data.json @@ -0,0 +1 @@ +{"type":2300,"data":{"_key":"87047","_id":"users/87047","_rev":"_bffnrEm---","type":"anonymous"}} diff --git a/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.structure.json b/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.structure.json new file mode 100644 index 0000000000..884cc6d2d5 --- /dev/null +++ b/src/ya-comiste-rust/arangodb/dump/ya-comiste/users_9bc65c2abec141778ffaa729489f3e87.structure.json @@ -0,0 +1 @@ +{"indexes":[],"parameters":{"allowUserKeys":true,"cacheEnabled":false,"cid":"86661","deleted":false,"globallyUniqueId":"hC8B4EB76885F/86661","id":"86661","isDisjoint":false,"isSmart":false,"isSmartChild":false,"isSystem":false,"keyOptions":{"allowUserKeys":true,"type":"traditional","lastValue":87047},"minReplicationFactor":1,"name":"users","numberOfShards":1,"planId":"86661","replicationFactor":1,"schema":null,"shardKeys":["_key"],"shards":{},"status":3,"tempObjectId":"0","type":2,"version":9,"waitForSync":false,"writeConcern":1}} \ No newline at end of file diff --git a/src/ya-comiste-rust/arangodb/masking.json b/src/ya-comiste-rust/arangodb/masking.json new file mode 100644 index 0000000000..6e7701b5be --- /dev/null +++ b/src/ya-comiste-rust/arangodb/masking.json @@ -0,0 +1,5 @@ +{ + "*": { + "type": "full" + } +} diff --git a/src/ya-comiste-rust/crates/arangodb/Cargo.toml b/src/ya-comiste-rust/crates/arangodb/Cargo.toml new file mode 100644 index 0000000000..782fc99ef1 --- /dev/null +++ b/src/ya-comiste-rust/crates/arangodb/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "arangodb" +version = "0.0.0" +authors = ["Martin Zlámal "] +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +arangors = "0.4.5" diff --git a/src/ya-comiste-rust/crates/arangodb/src/lib.rs b/src/ya-comiste-rust/crates/arangodb/src/lib.rs new file mode 100644 index 0000000000..b95a6209dd --- /dev/null +++ b/src/ya-comiste-rust/crates/arangodb/src/lib.rs @@ -0,0 +1,41 @@ +const ARANGODB_HOST: &str = "http://127.0.0.1:8529/"; +const NORMAL_USERNAME: &str = "ya-comiste-rust"; // TODO: change! +const NORMAL_PASSWORD: &str = ""; // TODO: change! + +pub fn get_normal_user() -> String { + std::env::var("ARANGO_USER").unwrap_or(NORMAL_USERNAME.to_owned()) +} + +pub fn get_normal_password() -> String { + std::env::var("ARANGO_PASSWORD").unwrap_or(NORMAL_PASSWORD.to_owned()) +} + +/// Default ArangoDB host: +/// +/// ``` +/// use arangodb::get_arangodb_host; +/// assert_eq!(get_arangodb_host(), "http://127.0.0.1:8529/") +/// ``` +/// +/// Custom ArangoDB host (via ENV): +/// +/// ``` +/// use arangodb::get_arangodb_host; +/// std::env::set_var("ARANGODB_HOST", "0.0.0.0:1234"); +/// assert_eq!(get_arangodb_host(), "http://0.0.0.0:1234") +/// ``` +pub fn get_arangodb_host() -> String { + std::env::var("ARANGODB_HOST") + .map(|s| format!("http://{}", s)) + .unwrap_or(ARANGODB_HOST.to_owned()) +} + +pub async fn connection() -> arangors::Connection { + let host = get_arangodb_host(); + let user = get_normal_user(); + let password = get_normal_password(); + + arangors::Connection::establish_basic_auth(&host, &user, &password) + .await + .unwrap() +} diff --git a/src/ya-comiste-rust/crates/server/Cargo.toml b/src/ya-comiste-rust/crates/server/Cargo.toml new file mode 100644 index 0000000000..4151efd9ea --- /dev/null +++ b/src/ya-comiste-rust/crates/server/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "server" +version = "0.0.0" +authors = ["Martin Zlámal "] +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +arangodb = { path = "../arangodb" } +arangors = "0.4.5" +env_logger = "0.8.2" +juniper = { git = "https://github.com/graphql-rust/juniper" } +juniper_warp = { git = "https://github.com/graphql-rust/juniper" } +log = "0.4.0" +serde = "1.0.117" +serde_json = "1.0.59" +tokio = { version = "0.2", features = ["rt-core", "macros"] } +warp = "0.2.5" + +[dev-dependencies] +insta = "1.3.0" diff --git a/src/ya-comiste-rust/crates/server/src/graphql_context.rs b/src/ya-comiste-rust/crates/server/src/graphql_context.rs new file mode 100644 index 0000000000..5bd20d51cd --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/graphql_context.rs @@ -0,0 +1,3 @@ +#[derive(Clone, Copy, Debug)] +pub struct Context; +impl juniper::Context for Context {} diff --git a/src/ya-comiste-rust/crates/server/src/graphql_schema.rs b/src/ya-comiste-rust/crates/server/src/graphql_schema.rs new file mode 100644 index 0000000000..62e315302a --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/graphql_schema.rs @@ -0,0 +1,33 @@ +use crate::graphql_context::Context; +use crate::sdui::SDUISection; +use crate::sdui_blocks::get_all_blocks; +use juniper::{EmptyMutation, EmptySubscription, FieldError, RootNode}; + +#[derive(Clone, Copy, Debug)] +pub struct Query; + +#[juniper::graphql_object(context = Context)] +impl Query { + async fn mobile_entrypoint_sections(id: juniper::ID) -> Result, FieldError> { + let resp = get_all_blocks(id).await; + Ok(resp) + } +} + +pub type Schema = RootNode<'static, Query, EmptyMutation, EmptySubscription>; + +pub fn create_graphql_schema() -> Schema { + Schema::new( + Query, + EmptyMutation::::new(), + EmptySubscription::::new(), + ) +} + +#[cfg(test)] +mod tests { + #[test] + fn schema_snapshot() { + insta::assert_snapshot!(super::create_graphql_schema().as_schema_language()); + } +} diff --git a/src/ya-comiste-rust/crates/server/src/main.rs b/src/ya-comiste-rust/crates/server/src/main.rs new file mode 100644 index 0000000000..734ed1081d --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/main.rs @@ -0,0 +1,32 @@ +// This declaration will look for a file named `XXX.rs` or `XXX/mod.rs` and will +// insert its contents inside a module named `XXX` under this scope +mod graphql_context; +mod graphql_schema; +mod sdui; +mod sdui_blocks; + +use crate::graphql_context::Context; +use crate::graphql_schema::create_graphql_schema; +use warp::Filter; + +#[tokio::main] +async fn main() { + std::env::set_var("RUST_LOG", "warp_server"); + env_logger::init(); + + let state = warp::any().map(|| Context); + let graphql_filter = juniper_warp::make_graphql_filter(create_graphql_schema(), state.boxed()); + let graphiql_filter = juniper_warp::graphiql_filter("/graphql", None); + + let cors = warp::cors().allow_methods(vec!["GET", "POST"]); + let log = warp::log("warp_server"); + + let filter = warp::get() + .and(warp::path::end().and(graphiql_filter)) + .or(warp::post().and(warp::path("graphql").and(graphql_filter))) + .with(cors) + .with(log); + + log::info!(target: "warp_server", "Listening on 127.0.0.1:8080"); + warp::serve(filter).run(([127, 0, 0, 1], 8080)).await +} diff --git a/src/ya-comiste-rust/crates/server/src/sdui.rs b/src/ya-comiste-rust/crates/server/src/sdui.rs new file mode 100644 index 0000000000..e8ea278b24 --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/sdui.rs @@ -0,0 +1,27 @@ +use crate::graphql_context::Context; + +/// Entrypoint represents a single entrypoint of the mobile application. +/// TODO: maybe `MobileEntrypoint` would be a better name so we are future proof? +#[derive(Clone, Debug, serde::Deserialize)] +pub struct SDUISection { + pub id: juniper::ID, + pub title: String, +} + +// impl SDUISection { +// fn not_exposed_to_graphql(&self) -> &str { +// &self.title +// } +// } + +#[juniper::graphql_object(context = Context)] +impl SDUISection { + #[graphql(description = "GraphQL description 🤯")] + fn id(&self) -> &str { + &self.id + } + + fn title(&self) -> &str { + &self.title + } +} diff --git a/src/ya-comiste-rust/crates/server/src/sdui_blocks.rs b/src/ya-comiste-rust/crates/server/src/sdui_blocks.rs new file mode 100644 index 0000000000..7d5a3fb371 --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/sdui_blocks.rs @@ -0,0 +1,26 @@ +use crate::sdui::SDUISection; +use arangodb::connection; + +pub async fn get_all_blocks(id: juniper::ID) -> Vec { + let conn = connection().await; + let db = conn.db("ya-comiste").await.unwrap(); + + // TODO: filter by `supported` arg + let aql = arangors::AqlQuery::builder() + .query( + " + FOR vertex IN 1..1 OUTBOUND @entrypoint entrypoint_sections + // FILTER vertex.type IN ['SDUIScrollViewHorizontalComponent'] + SORT vertex.section_order ASC + RETURN { + id: vertex._id, + title: vertex.title, + } + ", + ) + .bind_var("entrypoint", id.to_string()) + .batch_size(1) + .build(); + + return db.aql_query(aql).await.unwrap(); +} diff --git a/src/ya-comiste-rust/crates/server/src/snapshots/server__graphql_schema__tests__schema_snapshot.snap b/src/ya-comiste-rust/crates/server/src/snapshots/server__graphql_schema__tests__schema_snapshot.snap new file mode 100644 index 0000000000..35d751df23 --- /dev/null +++ b/src/ya-comiste-rust/crates/server/src/snapshots/server__graphql_schema__tests__schema_snapshot.snap @@ -0,0 +1,18 @@ +--- +source: crates/server/src/graphql_schema.rs +expression: "super::create_graphql_schema().as_schema_language()" +--- +type Query { + mobileEntrypointSections(id: ID!): [SDUISection!]! +} + +type SDUISection { + "GraphQL description \u129327" + id: String! + title: String! +} + +schema { + query: Query +} +