From 14309937394f64f9cc9feec7ea94c5439ff2c7a9 Mon Sep 17 00:00:00 2001 From: harshtech123 <139060630+harshtech123@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:40:02 +0530 Subject: [PATCH 1/2] /claim #373 hiii , the page is integrated into https://tailcall.run/playground , everything is done except ui since i am not good at this . /claim #373 i have checked the generated configurations are always correct. i try to have searchable dropdowns wherever possible instead of text boxes i have Ensured the schema is loaded dynamically from the above URL. The page is integrated into https://tailcall.run/playground\ thanks and regards harshtech Co-Authored-By: Tushar Mathur <194482+tusharmath@users.noreply.github.com> --- package-lock.json | 438 +++++++++- package.json | 7 +- server.js | 17 + src/pages/playground.tsx | 137 +++- static/schema.json | 1671 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 2252 insertions(+), 18 deletions(-) create mode 100644 server.js create mode 100644 static/schema.json diff --git a/package-lock.json b/package-lock.json index aad048fcdf..f905e7c059 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,16 +11,18 @@ "publish-externals" ], "dependencies": { - "@docusaurus/core": "3.4.0", + "@docusaurus/core": "^3.4.0", "@docusaurus/plugin-client-redirects": "3.4.0", "@docusaurus/plugin-content-blog": "^3.4.0", "@docusaurus/plugin-google-gtag": "^3.4.0", "@docusaurus/plugin-ideal-image": "^3.4.0", - "@docusaurus/preset-classic": "3.4.0", + "@docusaurus/preset-classic": "^3.4.0", "@mdx-js/react": "^3.0.1", + "@rjsf/core": "^5.19.3", "autoprefixer": "^10.4.19", "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.4.0", + "file-saver": "^2.0.5", "graphiql": "^3.3.1", "graphql-ws": "^5.16.0", "lottie-light-react": "^2.4.0", @@ -34,6 +36,7 @@ "react-hot-toast": "^2.4.1", "react-on-screen": "^2.1.1", "react-platform-js": "^0.0.1", + "react-select": "^5.8.0", "tailwindcss": "^3.4.4" }, "devDependencies": { @@ -2337,6 +2340,8 @@ }, "node_modules/@docusaurus/core": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.4.0.tgz", + "integrity": "sha512-g+0wwmN2UJsBqy2fQRQ6fhXruoEa62JDeEa5d8IdTJlMoaDaEDfHh7WjwGRn4opuTQWpjAwP/fbcgyHKlE+64w==", "license": "MIT", "dependencies": { "@babel/core": "^7.23.3", @@ -2879,6 +2884,8 @@ }, "node_modules/@docusaurus/preset-classic": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.4.0.tgz", + "integrity": "sha512-Ohj6KB7siKqZaQhNJVMBBUzT3Nnp6eTKqO+FXO3qu/n1hJl3YLwVKTWBg28LF7MWrKu46UuYavwMRxud0VyqHg==", "license": "MIT", "dependencies": { "@docusaurus/core": "3.4.0", @@ -3127,6 +3134,71 @@ "node": ">=18.0" } }, + "node_modules/@emotion/babel-plugin": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.12.0.tgz", + "integrity": "sha512-y2WQb+oP8Jqvvclh8Q55gLUyb7UFvgv7eJfsj7td5TToBrIUtPay2kMrZi4xjq9qw2vD0ZR5fSho0yqoFgX7Rw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/serialize": "^1.2.0", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "license": "MIT" + }, + "node_modules/@emotion/babel-plugin/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@emotion/cache": { + "version": "11.13.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.13.0.tgz", + "integrity": "sha512-hPV345J/tH0Cwk2wnU/3PBzORQ9HeX+kQSbwI+jslzpRCHE6fSGTohswksA/Ensr8znPzwfzKZCmAM9Lmlhp7g==", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.0", + "@emotion/weak-memoize": "^0.4.0", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/cache/node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/hash": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", + "license": "MIT" + }, "node_modules/@emotion/is-prop-valid": { "version": "0.8.8", "license": "MIT", @@ -3140,6 +3212,82 @@ "license": "MIT", "optional": true }, + "node_modules/@emotion/react": { + "version": "11.13.0", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.0.tgz", + "integrity": "sha512-WkL+bw1REC2VNV1goQyfxjx1GYJkcc23CRQkXX+vZNLINyfI7o+uUn/rTGPt/xJ3bJHd5GcljgnxHf4wRw5VWQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.12.0", + "@emotion/cache": "^11.13.0", + "@emotion/serialize": "^1.3.0", + "@emotion/use-insertion-effect-with-fallbacks": "^1.1.0", + "@emotion/utils": "^1.4.0", + "@emotion/weak-memoize": "^0.4.0", + "hoist-non-react-statics": "^3.3.1" + }, + "peerDependencies": { + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/serialize": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.0.tgz", + "integrity": "sha512-jACuBa9SlYajnpIVXB+XOXnfJHyckDfe6fOpORIM6yhBDlqGuExvDdZYHDQGoDf3bZXGv7tNr+LpLjJqiEQ6EA==", + "license": "MIT", + "dependencies": { + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/unitless": "^0.9.0", + "@emotion/utils": "^1.4.0", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/serialize/node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/sheet": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", + "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.9.0.tgz", + "integrity": "sha512-TP6GgNZtmtFaFcsOgExdnfxLLpRDla4Q66tnenA9CktvVSdNKDvMVuUah4QvWPIpNjrWsGg3qeGo9a43QooGZQ==", + "license": "MIT" + }, + "node_modules/@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.1.0.tgz", + "integrity": "sha512-+wBOcIV5snwGgI2ya3u99D7/FJquOIniQT1IKyDsBmEgwvpxMNeS65Oib7OnE2d2aY+3BU4OiH+0Wchf8yk3Hw==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@emotion/utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-spEnrA1b6hDR/C68lC2M7m6ALPUHZC0lIY7jAS/B/9DuuO1ZP04eov8SMv/6fwRd8pzmsn2AuJEznRREWlQrlQ==", + "license": "MIT" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", + "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", + "license": "MIT" + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "devOptional": true, @@ -5553,6 +5701,53 @@ "integrity": "sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==", "dev": true }, + "node_modules/@rjsf/core": { + "version": "5.19.3", + "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.19.3.tgz", + "integrity": "sha512-AAzolj+fcFlwk0/5THA7T2JkmYTIUa+fLPM5prFqPw55FwWOa0qC5zIOfkhPS95Z9bfwJv3BubOAiKZ7MOGe8Q==", + "license": "Apache-2.0", + "dependencies": { + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "markdown-to-jsx": "^7.4.1", + "nanoid": "^3.3.7", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.19.x", + "react": "^16.14.0 || >=17" + } + }, + "node_modules/@rjsf/utils": { + "version": "5.19.3", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.19.3.tgz", + "integrity": "sha512-1lG/uMMmnAJE48BHUl4laNY2W2j2gIR2LH4jsxeEMSuFloB06ZuUXLesD03Nz2zQjm66izNmnm5eAmAi3Pa1yQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "json-schema-merge-allof": "^0.8.1", + "jsonpointer": "^5.0.1", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.14.0 || >=17" + } + }, + "node_modules/@rjsf/utils/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT", + "peer": true + }, "node_modules/@sideway/address": { "version": "4.1.5", "license": "BSD-3-Clause", @@ -6124,6 +6319,15 @@ "@types/react-router": "*" } }, + "node_modules/@types/react-transition-group": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", + "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/retry": { "version": "0.12.0", "license": "MIT" @@ -7168,6 +7372,37 @@ "object.assign": "^4.1.0" } }, + "node_modules/babel-plugin-macros": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10", + "npm": ">=6" + } + }, + "node_modules/babel-plugin-macros/node_modules/cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "license": "MIT", + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.4.11", "license": "MIT", @@ -8320,6 +8555,29 @@ "version": "5.1.2", "license": "MIT" }, + "node_modules/compute-gcd": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz", + "integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==", + "peer": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/compute-lcm": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/compute-lcm/-/compute-lcm-1.1.2.tgz", + "integrity": "sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==", + "peer": true, + "dependencies": { + "compute-gcd": "^1.2.1", + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "license": "MIT" @@ -9410,6 +9668,16 @@ "utila": "~0.4" } }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/dom-serializer": { "version": "2.0.0", "license": "MIT", @@ -10420,6 +10688,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==", + "license": "MIT" + }, "node_modules/filesize": { "version": "8.0.7", "license": "BSD-3-Clause", @@ -10478,6 +10752,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "license": "MIT" + }, "node_modules/find-up": { "version": "5.0.0", "license": "MIT", @@ -13077,6 +13357,31 @@ "version": "2.3.1", "license": "MIT" }, + "node_modules/json-schema-compare": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz", + "integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.4" + } + }, + "node_modules/json-schema-merge-allof": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz", + "integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==", + "license": "MIT", + "peer": true, + "dependencies": { + "compute-lcm": "^1.1.2", + "json-schema-compare": "^0.2.2", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "license": "MIT" @@ -13119,6 +13424,16 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "license": "MIT", @@ -13359,6 +13674,12 @@ "version": "4.17.21", "license": "MIT" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "license": "MIT" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "license": "MIT" @@ -13694,6 +14015,18 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/markdown-to-jsx": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.7.tgz", + "integrity": "sha512-0+ls1IQZdU6cwM1yu0ZjjiVWYtkbExSyUIFU2ZeDIFuZM1W42Mh4OlJ4nb4apX4H8smxDHRdFaoIVJGwfv5hkg==", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "peerDependencies": { + "react": ">= 0.14.0" + } + }, "node_modules/mdast-util-directive": { "version": "3.0.0", "license": "MIT", @@ -14104,6 +14437,12 @@ "node": ">= 4.0.0" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "license": "MIT" + }, "node_modules/merge-descriptors": { "version": "1.0.1", "license": "MIT" @@ -18116,6 +18455,27 @@ "react": ">=15" } }, + "node_modules/react-select": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.8.0.tgz", + "integrity": "sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.0", + "@emotion/cache": "^11.4.0", + "@emotion/react": "^11.8.1", + "@floating-ui/dom": "^1.0.1", + "@types/react-transition-group": "^4.4.0", + "memoize-one": "^6.0.0", + "prop-types": "^15.6.0", + "react-transition-group": "^4.3.0", + "use-isomorphic-layout-effect": "^1.1.2" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-style-singleton": { "version": "2.2.1", "license": "MIT", @@ -18137,6 +18497,22 @@ } } }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, "node_modules/react-waypoint": { "version": "10.3.0", "license": "MIT", @@ -19754,6 +20130,12 @@ "postcss": "^8.4.31" } }, + "node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", + "license": "MIT" + }, "node_modules/sucrase": { "version": "3.35.0", "license": "MIT", @@ -20796,6 +21178,20 @@ } } }, + "node_modules/use-isomorphic-layout-effect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz", + "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-sidecar": { "version": "1.1.2", "license": "MIT", @@ -20845,6 +21241,44 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/validate.io-array": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz", + "integrity": "sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==", + "license": "MIT", + "peer": true + }, + "node_modules/validate.io-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/validate.io-function/-/validate.io-function-1.0.2.tgz", + "integrity": "sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==", + "peer": true + }, + "node_modules/validate.io-integer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/validate.io-integer/-/validate.io-integer-1.0.5.tgz", + "integrity": "sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==", + "peer": true, + "dependencies": { + "validate.io-number": "^1.0.3" + } + }, + "node_modules/validate.io-integer-array": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz", + "integrity": "sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==", + "peer": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-integer": "^1.0.4" + } + }, + "node_modules/validate.io-number": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/validate.io-number/-/validate.io-number-1.0.3.tgz", + "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==", + "peer": true + }, "node_modules/value-equal": { "version": "1.0.1", "license": "MIT" diff --git a/package.json b/package.json index 04695fbbe4..85443aa0e5 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,18 @@ "typecheck": "tsc" }, "dependencies": { - "@docusaurus/core": "3.4.0", + "@docusaurus/core": "^3.4.0", "@docusaurus/plugin-client-redirects": "3.4.0", "@docusaurus/plugin-content-blog": "^3.4.0", "@docusaurus/plugin-google-gtag": "^3.4.0", "@docusaurus/plugin-ideal-image": "^3.4.0", - "@docusaurus/preset-classic": "3.4.0", + "@docusaurus/preset-classic": "^3.4.0", "@mdx-js/react": "^3.0.1", + "@rjsf/core": "^5.19.3", "autoprefixer": "^10.4.19", "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.4.0", + "file-saver": "^2.0.5", "graphiql": "^3.3.1", "graphql-ws": "^5.16.0", "lottie-light-react": "^2.4.0", @@ -44,6 +46,7 @@ "react-hot-toast": "^2.4.1", "react-on-screen": "^2.1.1", "react-platform-js": "^0.0.1", + "react-select": "^5.8.0", "tailwindcss": "^3.4.4" }, "devDependencies": { diff --git a/server.js b/server.js new file mode 100644 index 0000000000..db64361ed1 --- /dev/null +++ b/server.js @@ -0,0 +1,17 @@ +const express = require('express'); +const path = require('path'); + +const app = express(); +const port = 3000; + +// Serve static files from the "static" directory +app.use(express.static(path.join(__dirname, 'static'))); + +// Route for the playground page (if needed) +app.get('/playground', (req, res) => { + res.sendFile(path.join(__dirname, 'src/pages/playground.html')); +}); + +app.listen(port, () => { + console.log(`Server running at http://localhost:${port}/`); +}); diff --git a/src/pages/playground.tsx b/src/pages/playground.tsx index e38dbc11c9..71cb3d0a8c 100644 --- a/src/pages/playground.tsx +++ b/src/pages/playground.tsx @@ -1,22 +1,131 @@ -import React, {useEffect} from "react" -import ReactGA from "react-ga4" -import Layout from "@theme/Layout" -import PlaygroundPage from "../components/playground" -import {useLocation} from "@docusaurus/router" -import {PageDescription, PageTitle} from "../constants/titles" +import React, { useState, useEffect } from 'react'; +import axios from 'axios'; +import Form, { IChangeEvent, Validator } from '@rjsf/core'; +import Select from 'react-select'; +import * as FileSaver from 'file-saver'; +import * as yaml from 'js-yaml'; +import { print, parse } from 'graphql'; +import Layout from '@theme/Layout'; +import { useLocation } from '@docusaurus/router'; +import { PageDescription, PageTitle } from '../constants/titles'; +import ReactGA from 'react-ga4'; +import '../css/custom.css'; +import '../css/graphiql.css'; -const Playground = () => { - const location = useLocation() +const validator: Validator = (formData, schema, errors) => { + // Add custom validation logic here if needed + return errors; +}; + +const PlaygroundPage: React.FC = () => { + const [schema, setSchema] = useState(null); + const [formData, setFormData] = useState({}); + const [format, setFormat] = useState('json'); + const [options, setOptions] = useState<{ value: string; label: string }[]>([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const location = useLocation(); + + useEffect(() => { + axios.get('/schema.json') + .then(response => { + console.log('Schema fetched:', response.data); + if (isValidSchema(response.data)) { + setSchema(response.data); + } else { + throw new Error('Invalid schema'); + } + setOptions([ + { value: 'json', label: 'JSON' }, + { value: 'yml', label: 'YAML' }, + { value: 'graphql', label: 'GraphQL' } + ]); + setLoading(false); + }) + .catch(error => { + console.error('Error fetching schema:', error); + setError('Failed to load schema'); + setLoading(false); + }); + }, []); useEffect(() => { - ReactGA.send({hitType: "pageview", page: location.pathname, title: "Playground Page"}) - }, []) + ReactGA.send({ hitType: 'pageview', page: location.pathname, title: 'Playground Page' }); + }, [location.pathname]); + + const isValidSchema = (schema: any): boolean => { + return schema && schema.type === 'object' && schema.properties; + }; + + const handleSubmit = ({ formData }: IChangeEvent) => { + setFormData(formData); + let configData; + let filename = 'config'; + switch (format) { + case 'yml': + configData = new Blob([yaml.dump(formData)], { type: 'application/x-yaml' }); + filename = 'config.yml'; + break; + case 'graphql': + const graphqlString = print(parse(JSON.stringify(formData))); + configData = new Blob([graphqlString], { type: 'application/graphql' }); + filename = 'config.graphql'; + break; + default: + configData = new Blob([JSON.stringify(formData, null, 2)], { type: 'application/json' }); + filename = 'config.json'; + } + FileSaver.saveAs(configData, filename); + }; + + if (loading) { + return ( + +
+
+

Loading schema...

+
+
+ ); + } + + if (error) { + return ( + +
+

{error}

+
+
+ ); + } return ( - +
+

Tailcall Configuration Playground

+
+ + option.value === format)} - onChange={(selectedOption) => setFormat(selectedOption?.value || 'json')} + defaultValue={options.find((option) => option.value === format)} + onChange={(selectedOption) => setFormat(selectedOption?.value || "json")} className="w-full" />
@@ -120,12 +121,14 @@ const PlaygroundPage: React.FC = () => { className="bg-white p-6 rounded-lg shadow-md" >
- +
- ); -}; + ) +} -export default PlaygroundPage; +export default PlaygroundPage diff --git a/static/schema.json b/static/schema.json index 4e2248eef8..8c223d770d 100644 --- a/static/schema.json +++ b/static/schema.json @@ -2,9 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "type": "object", - "required": [ - "schema" - ], + "required": ["schema"], "properties": { "enums": { "description": "A map of all the enum types in the schema", @@ -74,10 +72,7 @@ "AddField": { "description": "The @addField operator simplifies data structures and queries by adding a field that inlines or flattens a nested field or node within your schema. more info [here](https://tailcall.run/docs/guides/operators/#addfield)", "type": "object", - "required": [ - "name", - "path" - ], + "required": ["name", "path"], "properties": { "name": { "description": "Name of the new field to be added", @@ -96,9 +91,7 @@ "Alias": { "description": "The @alias directive indicates that aliases of one enum value.", "type": "object", - "required": [ - "options" - ], + "required": ["options"], "properties": { "options": { "type": "array", @@ -111,10 +104,7 @@ }, "Apollo": { "type": "object", - "required": [ - "apiKey", - "graphRef" - ], + "required": ["apiKey", "graphRef"], "properties": { "apiKey": { "description": "Setting `apiKey` for Apollo.", @@ -126,39 +116,25 @@ }, "platform": { "description": "Setting `platform` for Apollo.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "userVersion": { "description": "Setting `userVersion` for Apollo.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "version": { "description": "Setting `version` for Apollo.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } }, "Arg": { "type": "object", - "required": [ - "type" - ], + "required": ["type"], "properties": { "default_value": true, "doc": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "list": { "type": "boolean" @@ -199,10 +175,7 @@ "uniqueItems": true }, "maxSize": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint", "minimum": 0.0 } @@ -216,9 +189,7 @@ "Cache": { "description": "The @cache operator enables caching for the query, field or type it is applied to.", "type": "object", - "required": [ - "maxAge" - ], + "required": ["maxAge"], "properties": { "maxAge": { "description": "Specifies the duration, in milliseconds, of how long the value has to be stored in the cache.", @@ -232,9 +203,7 @@ "Call": { "description": "Provides the ability to refer to multiple fields in the Query or Mutation root.", "type": "object", - "required": [ - "steps" - ], + "required": ["steps"], "properties": { "steps": { "description": "Steps are composed together to form a call. If you have multiple steps, the output of the previous step is passed as input to the next step.", @@ -251,10 +220,7 @@ "properties": { "allowCredentials": { "description": "Indicates whether the server allows credentials (e.g., cookies, authorization headers) to be sent in cross-origin requests.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "allowHeaders": { "description": "A list of allowed headers in cross-origin requests. This can be used to specify custom headers that are allowed to be included in cross-origin requests.", @@ -279,10 +245,7 @@ }, "allowPrivateNetwork": { "description": "Indicates whether requests from private network addresses are allowed in cross-origin requests. Private network addresses typically include IP addresses reserved for internal networks.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "exposeHeaders": { "description": "A list of headers that the server exposes to the browser in cross-origin responses. Exposing certain headers allows the client-side code to access them in the response.", @@ -293,20 +256,13 @@ }, "maxAge": { "description": "The maximum time (in seconds) that the client should cache preflight OPTIONS requests in order to avoid sending excessive requests to the server.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint", "minimum": 0.0 }, "vary": { "description": "A list of header names that indicate the values of which might cause the server's response to vary, potentially affecting caching.", - "default": [ - "origin", - "access-control-request-method", - "access-control-request-headers" - ], + "default": ["origin", "access-control-request-method", "access-control-request-headers"], "type": "array", "items": { "type": "string" @@ -318,9 +274,7 @@ "title": "Date", "description": "A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar.", "type": "object", - "required": [ - "Date" - ], + "required": ["Date"], "properties": { "Date": { "type": "string" @@ -331,9 +285,7 @@ "title": "Email", "description": "field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.", "type": "object", - "required": [ - "Email" - ], + "required": ["Email"], "properties": { "Email": { "type": "string", @@ -345,9 +297,7 @@ "title": "Empty", "description": "Empty scalar type represents an empty value.", "type": "object", - "required": [ - "Empty" - ], + "required": ["Empty"], "properties": { "Empty": { "type": "null" @@ -356,23 +306,15 @@ }, "Encoding": { "type": "string", - "enum": [ - "ApplicationJson", - "ApplicationXWwwFormUrlencoded" - ] + "enum": ["ApplicationJson", "ApplicationXWwwFormUrlencoded"] }, "Enum": { "description": "Definition of GraphQL enum type", "type": "object", - "required": [ - "variants" - ], + "required": ["variants"], "properties": { "doc": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "variants": { "type": "array", @@ -386,9 +328,7 @@ "Expr": { "description": "The `@expr` operators allows you to specify an expression that can evaluate to a value. The expression can be a static value or built form a Mustache template. schema.", "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": true }, @@ -432,10 +372,7 @@ }, "doc": { "description": "Publicly visible documentation for the field.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "expr": { "description": "Inserts a constant resolver for the field.", @@ -547,26 +484,18 @@ "GraphQL": { "description": "The @graphQL operator allows to specify GraphQL API server request to fetch data from.", "type": "object", - "required": [ - "name" - ], + "required": ["name"], "properties": { "args": { "description": "Named arguments for the requested field. More info [here](https://tailcall.run/docs/guides/operators/#args)", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/definitions/KeyValue" } }, "baseURL": { "description": "This refers to the base URL of the API. If not specified, the default base URL is the one specified in the `@upstream` operator.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "batch": { "description": "If the upstream GraphQL server supports request batching, you can specify the 'batch' argument to batch several requests into a single batch request.\n\nMake sure you have also specified batch settings to the `@upstream` and to the `@graphQL` operator.", @@ -589,16 +518,11 @@ "Grpc": { "description": "The @grpc operator indicates that a field or node is backed by a gRPC API.\n\nFor instance, if you add the @grpc operator to the `users` field of the Query type with a service argument of `NewsService` and method argument of `GetAllNews`, it signifies that the `users` field is backed by a gRPC API. The `service` argument specifies the name of the gRPC service. The `method` argument specifies the name of the gRPC method. In this scenario, the GraphQL server will make a gRPC request to the gRPC endpoint specified when the `users` field is queried.", "type": "object", - "required": [ - "method" - ], + "required": ["method"], "properties": { "baseURL": { "description": "This refers to the base URL of the API. If not specified, the default base URL is the one specified in the `@upstream` operator.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "batchKey": { "description": "The key path in the response which should be used to group multiple requests. For instance `[\"news\",\"id\"]`. For more details please refer out [n + 1 guide](https://tailcall.run/docs/guides/n+1#solving-using-batching).", @@ -629,10 +553,7 @@ "properties": { "cacheControl": { "description": "`cacheControl` sends `Cache-Control` headers in responses when activated. The `max-age` value is the least of the values received from upstream services. @default `false`.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "cors": { "description": "`cors` allows Cross-Origin Resource Sharing (CORS) for a server.", @@ -654,10 +575,7 @@ }, "experimental": { "description": "`experimental` allows the use of `X-*` experimental headers in the response. @default `[]`.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" }, @@ -665,26 +583,18 @@ }, "setCookies": { "description": "`setCookies` when enabled stores `set-cookie` headers and all the response will be sent with the headers.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] } } }, "Http": { "description": "The @http operator indicates that a field or node is backed by a REST API.\n\nFor instance, if you add the @http operator to the `users` field of the Query type with a path argument of `\"/users\"`, it signifies that the `users` field is backed by a REST API. The path argument specifies the path of the REST API. In this scenario, the GraphQL server will make a GET request to the API endpoint specified when the `users` field is queried.", "type": "object", - "required": [ - "path" - ], + "required": ["path"], "properties": { "baseURL": { "description": "This refers to the base URL of the API. If not specified, the default base URL is the one specified in the `@upstream` operator.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "batchKey": { "description": "The `batchKey` parameter groups multiple data requests into a single call. For more details please refer out [n + 1 guide](https://tailcall.run/docs/guides/n+1#solving-using-batching).", @@ -695,10 +605,7 @@ }, "body": { "description": "The body of the API call. It's used for methods like POST or PUT that send data to the server. You can pass it as a static object or use a Mustache template to substitute variables from the GraphQL variables.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "encoding": { "description": "The `encoding` parameter specifies the encoding of the request body. It can be `ApplicationJson` or `ApplicationXWwwFormUrlEncoded`. @default `ApplicationJson`.", @@ -736,10 +643,7 @@ }, "onRequest": { "description": "onRequest field in @http directive gives the ability to specify the request interception handler.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "output": { "description": "Schema of the output of the API call. It is automatically inferred in most cases.", @@ -768,10 +672,7 @@ }, "HttpVersion": { "type": "string", - "enum": [ - "HTTP1", - "HTTP2" - ] + "enum": ["HTTP1", "HTTP2"] }, "Int128": { "title": "Int128", @@ -805,9 +706,7 @@ }, "JS": { "type": "object", - "required": [ - "name" - ], + "required": ["name"], "properties": { "name": { "type": "string" @@ -818,9 +717,7 @@ "title": "JSON", "description": "The JSON scalar type represents JSON values as specified by [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ ECMA-404.pdf).", "type": "object", - "required": [ - "JSON" - ], + "required": ["JSON"], "properties": { "JSON": { "type": "string" @@ -829,10 +726,7 @@ }, "KeyValue": { "type": "object", - "required": [ - "key", - "value" - ], + "required": ["key", "value"], "properties": { "key": { "type": "string" @@ -848,10 +742,7 @@ "properties": { "id": { "description": "The id of the link. It is used to reference the link in the schema.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "src": { "description": "The source of the link. It can be a URL or a path to a file. If a path is provided, it is relative to the file that imports the link.", @@ -870,46 +761,20 @@ }, "LinkType": { "type": "string", - "enum": [ - "Config", - "Protobuf", - "Script", - "Cert", - "Key", - "Operation", - "Htpasswd", - "Jwks", - "Grpc" - ] + "enum": ["Config", "Protobuf", "Script", "Cert", "Key", "Operation", "Htpasswd", "Jwks", "Grpc"] }, "Method": { "type": "string", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "HEAD", - "OPTIONS", - "CONNECT", - "TRACE" - ] + "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"] }, "Modify": { "type": "object", "properties": { "name": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "omit": { - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] } }, "additionalProperties": false @@ -922,9 +787,7 @@ "OtlpExporter": { "description": "Output the opentelemetry data to otlp collector", "type": "object", - "required": [ - "url" - ], + "required": ["url"], "properties": { "headers": { "type": "array", @@ -941,9 +804,7 @@ "title": "PhoneNumber", "description": "A field whose value conforms to the standard E.164 format as specified in E.164 specification (https://en.wikipedia.org/wiki/E.164).", "type": "object", - "required": [ - "PhoneNumber" - ], + "required": ["PhoneNumber"], "properties": { "PhoneNumber": { "type": "string" @@ -966,19 +827,14 @@ "PrometheusFormat": { "description": "Output format for prometheus data", "type": "string", - "enum": [ - "text", - "protobuf" - ] + "enum": ["text", "protobuf"] }, "Protected": { "type": "object" }, "Proxy": { "type": "object", - "required": [ - "url" - ], + "required": ["url"], "properties": { "url": { "type": "string" @@ -989,22 +845,13 @@ "type": "object", "properties": { "mutation": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "query": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "subscription": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } }, @@ -1012,10 +859,7 @@ "type": "object", "properties": { "timeout": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 } @@ -1027,37 +871,22 @@ "properties": { "apolloTracing": { "description": "`apolloTracing` exposes GraphQL query performance data, including execution time of queries and individual resolvers.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "batchRequests": { "description": "`batchRequests` combines multiple requests into one, improving performance but potentially introducing latency and complicating debugging. Use judiciously. @default `false`.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "dedupe": { "description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "enableJIT": { - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "globalResponseTimeout": { "description": "`globalResponseTimeout` sets the maximum query duration before termination, acting as a safeguard against long-running queries.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "int64" }, "headers": { @@ -1073,47 +902,29 @@ }, "hostname": { "description": "`hostname` sets the server hostname.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "introspection": { "description": "`introspection` allows clients to fetch schema information directly, aiding tools and applications in understanding available types, fields, and operations. @default `true`.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "pipelineFlush": { "description": "`pipelineFlush` allows to control flushing behavior of the server pipeline.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "port": { "description": "`port` sets the Tailcall running port. @default `8000`.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint16", "minimum": 0.0 }, "queryValidation": { "description": "`queryValidation` checks incoming GraphQL queries against the schema, preventing errors from invalid queries. Can be disabled for performance. @default `false`.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "responseValidation": { "description": "`responseValidation` Tailcall automatically validates responses from upstream services using inferred schema. @default `false`.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "script": { "description": "A link to an external JS file that listens on every HTTP request response event.", @@ -1128,10 +939,7 @@ }, "showcase": { "description": "`showcase` enables the /showcase/graphql endpoint.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "vars": { "description": "This configuration defines local variables for server operations. Useful for storing constant configurations, secrets, or shared information.", @@ -1153,10 +961,7 @@ }, "workers": { "description": "`workers` sets the number of worker threads. @default the number of system cores.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint", "minimum": 0.0 } @@ -1184,26 +989,18 @@ }, "mutation": { "description": "The name of the field on the `Mutation` type that you want to call.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "query": { "description": "The name of the field on the `Query` type that you want to call.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } }, "Tag": { "description": "Used to represent an identifier for a type. Typically used via only by the configuration generators to provide additional information about the type.", "type": "object", - "required": [ - "id" - ], + "required": ["id"], "properties": { "id": { "description": "A unique identifier for the type.", @@ -1240,9 +1037,7 @@ "oneOf": [ { "type": "object", - "required": [ - "stdout" - ], + "required": ["stdout"], "properties": { "stdout": { "$ref": "#/definitions/StdoutExporter" @@ -1252,9 +1047,7 @@ }, { "type": "object", - "required": [ - "otlp" - ], + "required": ["otlp"], "properties": { "otlp": { "$ref": "#/definitions/OtlpExporter" @@ -1264,9 +1057,7 @@ }, { "type": "object", - "required": [ - "prometheus" - ], + "required": ["prometheus"], "properties": { "prometheus": { "$ref": "#/definitions/PrometheusExporter" @@ -1276,9 +1067,7 @@ }, { "type": "object", - "required": [ - "apollo" - ], + "required": ["apollo"], "properties": { "apollo": { "$ref": "#/definitions/Apollo" @@ -1291,9 +1080,7 @@ "Type": { "description": "Represents a GraphQL type. A type can be an object, interface, enum or scalar.", "type": "object", - "required": [ - "fields" - ], + "required": ["fields"], "properties": { "added_fields": { "description": "Additional fields to be added to the type", @@ -1315,10 +1102,7 @@ }, "doc": { "description": "Documentation for the type that is publicly visible.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "fields": { "description": "A map of field name and its definition.", @@ -1397,15 +1181,10 @@ }, "Union": { "type": "object", - "required": [ - "types" - ], + "required": ["types"], "properties": { "doc": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "types": { "type": "array", @@ -1422,10 +1201,7 @@ "properties": { "allowedHeaders": { "description": "`allowedHeaders` defines the HTTP headers allowed to be forwarded to upstream services. If not set, no headers are forwarded, enhancing security but possibly limiting data flow.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" }, @@ -1433,10 +1209,7 @@ }, "baseURL": { "description": "This refers to the default base URL for your APIs. If it's not explicitly mentioned in the `@upstream` operator, then each [@http](#http) operator must specify its own `baseURL`. If neither `@upstream` nor [@http](#http) provides a `baseURL`, it results in a compilation error.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "batch": { "description": "An object that specifies the batch settings, including `maxSize` (the maximum size of the batch), `delay` (the delay in milliseconds between each batch), and `headers` (an array of HTTP headers to be included in the batch).", @@ -1451,76 +1224,49 @@ }, "connectTimeout": { "description": "The time in seconds that the connection will wait for a response before timing out.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "http2Only": { "description": "The `http2Only` setting allows you to specify whether the client should always issue HTTP2 requests, without checking if the server supports it or not. By default it is set to `false` for all HTTP requests made by the server, but is automatically set to true for GRPC.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "httpCache": { "description": "Providing httpCache size enables Tailcall's HTTP caching, adhering to the [HTTP Caching RFC](https://tools.ietf.org/html/rfc7234), to enhance performance by minimizing redundant data fetches. Defaults to `0` if unspecified.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "keepAliveInterval": { "description": "The time in seconds between each keep-alive message sent to maintain the connection.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "keepAliveTimeout": { "description": "The time in seconds that the connection will wait for a keep-alive message before closing.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "keepAliveWhileIdle": { "description": "A boolean value that determines whether keep-alive messages should be sent while the connection is idle.", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "onRequest": { "description": "onRequest field gives the ability to specify the global request interception handler.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "poolIdleTimeout": { "description": "The time in seconds that the connection pool will wait before closing idle connections.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "poolMaxIdlePerHost": { "description": "The maximum number of idle connections that will be maintained per host.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint", "minimum": 0.0 }, @@ -1537,28 +1283,19 @@ }, "tcpKeepAlive": { "description": "The time in seconds between each TCP keep-alive message sent to maintain the connection.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "timeout": { "description": "The maximum time in seconds that the connection will wait for a response.", - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0.0 }, "userAgent": { "description": "The User-Agent header value to be used in HTTP requests. @default `Tailcall/1.0`", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -1567,9 +1304,7 @@ "title": "Url", "description": "A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects.", "type": "object", - "required": [ - "Url" - ], + "required": ["Url"], "properties": { "Url": { "type": "string" @@ -1579,9 +1314,7 @@ "Variant": { "description": "Definition of GraphQL value", "type": "object", - "required": [ - "name" - ], + "required": ["name"], "properties": { "alias": { "anyOf": [ @@ -1602,19 +1335,11 @@ "oneOf": [ { "type": "string", - "enum": [ - "Str", - "Num", - "Bool", - "Empty", - "Any" - ] + "enum": ["Str", "Num", "Bool", "Empty", "Any"] }, { "type": "object", - "required": [ - "Obj" - ], + "required": ["Obj"], "properties": { "Obj": { "type": "object", @@ -1627,9 +1352,7 @@ }, { "type": "object", - "required": [ - "Arr" - ], + "required": ["Arr"], "properties": { "Arr": { "$ref": "#/definitions/schema" @@ -1639,9 +1362,7 @@ }, { "type": "object", - "required": [ - "Opt" - ], + "required": ["Opt"], "properties": { "Opt": { "$ref": "#/definitions/schema" @@ -1651,9 +1372,7 @@ }, { "type": "object", - "required": [ - "Enum" - ], + "required": ["Enum"], "properties": { "Enum": { "type": "array", @@ -1668,4 +1387,4 @@ ] } } -} \ No newline at end of file +}