From fff32ea1675e78f1528bdc1391d0e3d890aae26d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Sep 2022 16:50:34 +0100 Subject: [PATCH 01/15] Add SDK package with automatic SDK generation --- packages/sdk/.gitignore | 4 + packages/sdk/README.md | 6 + packages/sdk/package.json | 25 ++ packages/sdk/rollup.config.js | 30 ++ packages/sdk/scripts/generate-sdk.sh | 39 ++ packages/sdk/yarn.lock | 635 +++++++++++++++++++++++++++ 6 files changed, 739 insertions(+) create mode 100644 packages/sdk/.gitignore create mode 100644 packages/sdk/README.md create mode 100644 packages/sdk/package.json create mode 100644 packages/sdk/rollup.config.js create mode 100755 packages/sdk/scripts/generate-sdk.sh create mode 100644 packages/sdk/yarn.lock diff --git a/packages/sdk/.gitignore b/packages/sdk/.gitignore new file mode 100644 index 0000000000..eb7de7eef4 --- /dev/null +++ b/packages/sdk/.gitignore @@ -0,0 +1,4 @@ +src +docs +node_modules +dist \ No newline at end of file diff --git a/packages/sdk/README.md b/packages/sdk/README.md new file mode 100644 index 0000000000..6b0fac862c --- /dev/null +++ b/packages/sdk/README.md @@ -0,0 +1,6 @@ +# Budibase Public API SDK +JS SDK for the Budibase Public API. + +This SDK is generated by [swagger-codegen](https://github.com/swagger-api/swagger-codegen). + +Docker is used to run the generator, so Java is not required. Docker is the only requirement to generate the SDK. \ No newline at end of file diff --git a/packages/sdk/package.json b/packages/sdk/package.json new file mode 100644 index 0000000000..01695f7cbf --- /dev/null +++ b/packages/sdk/package.json @@ -0,0 +1,25 @@ +{ + "name": "@budibase/sdk", + "version": "1.3.15-alpha.7", + "description": "Budibase Public API SDK", + "author": "Budibase", + "license": "MPL-2.0", + "main": "dist/sdk.cjs", + "module": "dist/sdk.mjs", + "type": "module", + "scripts": { + "generate": "cd scripts && bash generate-sdk.sh", + "build": "rollup -c", + "dev:server": "rollup -c" + }, + "dependencies": { + "superagent": "^5.3.0" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^18.0.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "rollup-plugin-polyfill-node": "^0.8.0", + "rollup": "^2.44.0", + "rollup-plugin-terser": "^7.0.2" + } +} diff --git a/packages/sdk/rollup.config.js b/packages/sdk/rollup.config.js new file mode 100644 index 0000000000..948b10f9f4 --- /dev/null +++ b/packages/sdk/rollup.config.js @@ -0,0 +1,30 @@ +import commonjs from "@rollup/plugin-commonjs" +import resolve from "@rollup/plugin-node-resolve" +import { terser } from "rollup-plugin-terser" +import nodePolyfills from "rollup-plugin-polyfill-node" + +const production = !process.env.ROLLUP_WATCH + +export default { + input: "src/index.js", + output: [ + { + sourcemap: false, + format: "esm", + file: `./dist/sdk.mjs`, + }, + { + sourcemap: false, + format: "cjs", + file: `./dist/sdk.cjs`, + }, + ], + plugins: [ + commonjs(), + nodePolyfills(), + resolve({ + preferBuiltins: true, + browser: true, + }), + ], +} diff --git a/packages/sdk/scripts/generate-sdk.sh b/packages/sdk/scripts/generate-sdk.sh new file mode 100755 index 0000000000..98dbb01b01 --- /dev/null +++ b/packages/sdk/scripts/generate-sdk.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Cleanup +if [[ -f "openapi.yaml" ]]; then + rm openapi.yaml +fi +if [[ -d "generated" ]]; then + rm -r generated +fi +if [[ -d "../docs" ]]; then + rm -r ../docs +fi +if [[ -d "../src" ]]; then + rm -r ../src +fi + +# Generate new SDK +mkdir generated +cp ../../server/specs/openapi.yaml ./ +docker run --rm \ + -v ${PWD}/openapi.yaml:/openapi.yml \ + -v ${PWD}/generated:/generated \ + -u $(id -u):$(id -g) \ + swaggerapi/swagger-codegen-cli-v3 generate \ + -i /openapi.yml \ + -l javascript \ + -o /generated + +# Use a subset of the generated files +mv generated/docs ../ +mv generated/src ../ + +# Cleanup +if [[ -f "openapi.yaml" ]]; then + rm openapi.yaml +fi +if [[ -d "generated" ]]; then + rm -r generated +fi \ No newline at end of file diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock new file mode 100644 index 0000000000..4e8d6d718f --- /dev/null +++ b/packages/sdk/yarn.lock @@ -0,0 +1,635 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.10.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/helper-validator-identifier@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" + integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@jridgewell/gen-mapping@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" + integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.9": + version "0.3.15" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" + integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@rollup/plugin-commonjs@^18.0.0": + version "18.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-18.1.0.tgz#5a760d757af168a50727c0ae080251fbfcc5eb02" + integrity sha512-h3e6T9rUxVMAQswpDIobfUHn/doMzM9sgkMrsMWCFLmB84PSoC8mV8tOloAJjSRwdqhXBqstlX2BwBpHJvbhxg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + +"@rollup/plugin-inject@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz#fbeee66e9a700782c4f65c8b0edbafe58678fbc2" + integrity sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ== + dependencies: + "@rollup/pluginutils" "^3.1.0" + estree-walker "^2.0.1" + magic-string "^0.25.7" + +"@rollup/plugin-node-resolve@^11.2.1": + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" + +"@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + +"@types/estree@*": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" + integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== + +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + +"@types/node@*": + version "18.7.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.18.tgz#633184f55c322e4fb08612307c274ee6d5ed3154" + integrity sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg== + +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + +acorn@^8.5.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +builtin-modules@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + +component-emitter@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +cookiejar@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" + integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== + +debug@^4.1.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + +fast-safe-stringify@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +formidable@^1.2.2: + version "1.2.6" + resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.6.tgz#d2a51d60162bbc9b4a055d8457a7c75315d1a168" + integrity sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-intrinsic@^1.0.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== + dependencies: + has "^1.0.3" + +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== + +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + +jest-worker@^26.2.1: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +magic-string@^0.25.7: + version "0.25.9" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== + dependencies: + sourcemap-codec "^1.4.8" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +methods@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@^2.4.6: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== + +minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picomatch@^2.2.2: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +qs@^6.9.4: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +resolve@^1.17.0, resolve@^1.19.0: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +rollup-plugin-polyfill-node@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.8.0.tgz#859c070822f5e38d221e5b4238cb34aa894c2b19" + integrity sha512-C4UeKedOmOBkB3FgR+z/v9kzRwV1Q/H8xWs1u1+CNe4XOV6hINfOrcO+TredKxYvopCmr+WKUSNsFUnD1RLHgQ== + dependencies: + "@rollup/plugin-inject" "^4.0.0" + +rollup-plugin-terser@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" + integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + +rollup@^2.44.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.0.tgz#9177992c9f09eb58c5e56cbfa641607a12b57ce2" + integrity sha512-x4KsrCgwQ7ZJPcFA/SUu6QVcYlO7uRLfLAy0DSA4NS2eG8japdbpM50ToH7z4iObodRYOJ0soneF0iaQRJ6zhA== + optionalDependencies: + fsevents "~2.3.2" + +safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +semver@^7.3.2: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" + integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== + dependencies: + randombytes "^2.1.0" + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sourcemap-codec@^1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +superagent@^5.3.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/superagent/-/superagent-5.3.1.tgz#d62f3234d76b8138c1320e90fa83dc1850ccabf1" + integrity sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ== + dependencies: + component-emitter "^1.3.0" + cookiejar "^2.1.2" + debug "^4.1.1" + fast-safe-stringify "^2.0.7" + form-data "^3.0.0" + formidable "^1.2.2" + methods "^1.1.2" + mime "^2.4.6" + qs "^6.9.4" + readable-stream "^3.6.0" + semver "^7.3.2" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +terser@^5.0.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425" + integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA== + dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" + commander "^2.20.0" + source-map-support "~0.5.20" + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From 0b95c2957c87f6216365dfa0fd8efd54e1f0daf4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Sep 2022 15:17:19 +0100 Subject: [PATCH 02/15] Improve SDK generation and wrap, promisify and simplify SDK client configuration --- packages/sdk/.gitignore | 2 +- packages/sdk/README.md | 29 +++++++++++++++- packages/sdk/package.json | 5 ++- packages/sdk/rollup.config.js | 10 +----- packages/sdk/scripts/generate-sdk.sh | 11 +++--- packages/sdk/src/index.js | 51 ++++++++++++++++++++++++++++ packages/sdk/yarn.lock | 9 ++++- 7 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 packages/sdk/src/index.js diff --git a/packages/sdk/.gitignore b/packages/sdk/.gitignore index eb7de7eef4..43e879ac90 100644 --- a/packages/sdk/.gitignore +++ b/packages/sdk/.gitignore @@ -1,4 +1,4 @@ -src +sdk docs node_modules dist \ No newline at end of file diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 6b0fac862c..64b4c0538d 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -3,4 +3,31 @@ JS SDK for the Budibase Public API. This SDK is generated by [swagger-codegen](https://github.com/swagger-api/swagger-codegen). -Docker is used to run the generator, so Java is not required. Docker is the only requirement to generate the SDK. \ No newline at end of file +Docker is used to run the generator, so Java is not required. Docker is the only requirement to generate the SDK. + +The generated code will only run in a browser. It is not currently useable in a NodeJS environment. + +## Example usage +```js +import { configure, ApplicationsApi } from "@budibase/sdk" + +// Configure the API client +configure({ + apiKey: "my-api-key", + host: "https://my.budibase.app" +}) + +// Search for an app. +// We can use the promisified version... +const res = await ApplicationsApi.applicationsSearchPost({ name: "foo" }) +console.log("Applications:", res.data) + +// ...or the callback version +ApplicationsApi.applicationsSearchPost({ name: "foo" }, ((error, data) => { + if (error) { + console.error("Failed to search:", error) + } else { + console.log("Applications:", data.data) + } +})) +``` \ No newline at end of file diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 01695f7cbf..65b57dacf3 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -4,13 +4,12 @@ "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", - "main": "dist/sdk.cjs", "module": "dist/sdk.mjs", "type": "module", "scripts": { "generate": "cd scripts && bash generate-sdk.sh", - "build": "rollup -c", - "dev:server": "rollup -c" + "build": "yarn run generate && rollup -c", + "dev:builder": "yarn run build" }, "dependencies": { "superagent": "^5.3.0" diff --git a/packages/sdk/rollup.config.js b/packages/sdk/rollup.config.js index 948b10f9f4..b9c1543c42 100644 --- a/packages/sdk/rollup.config.js +++ b/packages/sdk/rollup.config.js @@ -1,22 +1,14 @@ import commonjs from "@rollup/plugin-commonjs" import resolve from "@rollup/plugin-node-resolve" -import { terser } from "rollup-plugin-terser" import nodePolyfills from "rollup-plugin-polyfill-node" -const production = !process.env.ROLLUP_WATCH - export default { input: "src/index.js", output: [ { sourcemap: false, format: "esm", - file: `./dist/sdk.mjs`, - }, - { - sourcemap: false, - format: "cjs", - file: `./dist/sdk.cjs`, + file: "./dist/sdk.mjs", }, ], plugins: [ diff --git a/packages/sdk/scripts/generate-sdk.sh b/packages/sdk/scripts/generate-sdk.sh index 98dbb01b01..88fbde906a 100755 --- a/packages/sdk/scripts/generate-sdk.sh +++ b/packages/sdk/scripts/generate-sdk.sh @@ -7,11 +7,8 @@ fi if [[ -d "generated" ]]; then rm -r generated fi -if [[ -d "../docs" ]]; then - rm -r ../docs -fi -if [[ -d "../src" ]]; then - rm -r ../src +if [[ -d "../sdk" ]]; then + rm -r ../sdk fi # Generate new SDK @@ -25,10 +22,10 @@ docker run --rm \ -i /openapi.yml \ -l javascript \ -o /generated + --additional-properties useES6=false # Use a subset of the generated files -mv generated/docs ../ -mv generated/src ../ +mv generated/src ../sdk # Cleanup if [[ -f "openapi.yaml" ]]; then diff --git a/packages/sdk/src/index.js b/packages/sdk/src/index.js new file mode 100644 index 0000000000..c8948484a9 --- /dev/null +++ b/packages/sdk/src/index.js @@ -0,0 +1,51 @@ +import * as BudibaseApi from "../sdk" + +let ApiClient = new BudibaseApi.ApiClient() + +// Default to current host +ApiClient.basePath = "/api/public/v1" + +/** + * Configures the Budibase Public API SDK + * @param apiKey the user's API key + * @param host the Budibase server host + */ +export const configure = ({ apiKey, host }) => { + ApiClient.authentications["ApiKeyAuth"].apiKey = apiKey + ApiClient.basePath = `${host || ""}/api/public/v1` +} + +/** + * Promisifies a generated API SDK and turns it into a more traditional async + * function. + * @param apiName the name of the generated API SDK to promisify + */ +const promisify = apiName => { + // Construct an instance of the generated API + let api = new BudibaseApi[apiName](ApiClient) + + // Patch each API endpoint and promisify it + let fns = Object.getOwnPropertyNames(Object.getPrototypeOf(api)) + fns = fns.filter(x => x !== "constructor") + fns.forEach(fn => { + const generated = api[fn].bind(api) + api[fn] = async (...params) => { + return new Promise((resolve, reject) => { + generated(...params, (error, data) => { + if (error) { + reject(error) + } else { + resolve(data) + } + }) + }) + } + }) + return api +} + +export const ApplicationsApi = promisify("ApplicationsApi") +export const QueriesApi = new BudibaseApi.QueriesApi(ApiClient) +export const RowsApi = promisify("RowsApi") +export const TablesApi = promisify("TablesApi") +export const UsersApi = promisify("UsersApi") diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock index 4e8d6d718f..757430d6b7 100644 --- a/packages/sdk/yarn.lock +++ b/packages/sdk/yarn.lock @@ -85,6 +85,13 @@ estree-walker "^2.0.1" magic-string "^0.25.7" +"@rollup/plugin-json@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" + integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== + dependencies: + "@rollup/pluginutils" "^3.0.8" + "@rollup/plugin-node-resolve@^11.2.1": version "11.2.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" @@ -97,7 +104,7 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== From b6b7cf813ba7084462a63c4b34b38f974fc2c977 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Sep 2022 15:19:42 +0100 Subject: [PATCH 03/15] Promisify queries API --- packages/sdk/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/index.js b/packages/sdk/src/index.js index c8948484a9..e56ef051f7 100644 --- a/packages/sdk/src/index.js +++ b/packages/sdk/src/index.js @@ -45,7 +45,7 @@ const promisify = apiName => { } export const ApplicationsApi = promisify("ApplicationsApi") -export const QueriesApi = new BudibaseApi.QueriesApi(ApiClient) +export const QueriesApi = promisify("QueriesApi") export const RowsApi = promisify("RowsApi") export const TablesApi = promisify("TablesApi") export const UsersApi = promisify("UsersApi") From dc564f92e3c9d51563c653f2db7d4e22a8f27d36 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Sep 2022 15:38:09 +0100 Subject: [PATCH 04/15] Use promises when generating public API SDK rather than promisifying after --- packages/sdk/scripts/config.json | 3 +++ packages/sdk/scripts/generate-sdk.sh | 5 ++-- packages/sdk/src/index.js | 39 ++++------------------------ 3 files changed, 11 insertions(+), 36 deletions(-) create mode 100644 packages/sdk/scripts/config.json diff --git a/packages/sdk/scripts/config.json b/packages/sdk/scripts/config.json new file mode 100644 index 0000000000..a6a3e1acb8 --- /dev/null +++ b/packages/sdk/scripts/config.json @@ -0,0 +1,3 @@ +{ + "usePromises": true +} \ No newline at end of file diff --git a/packages/sdk/scripts/generate-sdk.sh b/packages/sdk/scripts/generate-sdk.sh index 88fbde906a..82cb3f1d36 100755 --- a/packages/sdk/scripts/generate-sdk.sh +++ b/packages/sdk/scripts/generate-sdk.sh @@ -17,12 +17,13 @@ cp ../../server/specs/openapi.yaml ./ docker run --rm \ -v ${PWD}/openapi.yaml:/openapi.yml \ -v ${PWD}/generated:/generated \ + -v ${PWD}/config.json:/config.json \ -u $(id -u):$(id -g) \ swaggerapi/swagger-codegen-cli-v3 generate \ -i /openapi.yml \ -l javascript \ - -o /generated - --additional-properties useES6=false + -o /generated \ + -c /config.json # Use a subset of the generated files mv generated/src ../sdk diff --git a/packages/sdk/src/index.js b/packages/sdk/src/index.js index e56ef051f7..23b3f9507e 100644 --- a/packages/sdk/src/index.js +++ b/packages/sdk/src/index.js @@ -15,37 +15,8 @@ export const configure = ({ apiKey, host }) => { ApiClient.basePath = `${host || ""}/api/public/v1` } -/** - * Promisifies a generated API SDK and turns it into a more traditional async - * function. - * @param apiName the name of the generated API SDK to promisify - */ -const promisify = apiName => { - // Construct an instance of the generated API - let api = new BudibaseApi[apiName](ApiClient) - - // Patch each API endpoint and promisify it - let fns = Object.getOwnPropertyNames(Object.getPrototypeOf(api)) - fns = fns.filter(x => x !== "constructor") - fns.forEach(fn => { - const generated = api[fn].bind(api) - api[fn] = async (...params) => { - return new Promise((resolve, reject) => { - generated(...params, (error, data) => { - if (error) { - reject(error) - } else { - resolve(data) - } - }) - }) - } - }) - return api -} - -export const ApplicationsApi = promisify("ApplicationsApi") -export const QueriesApi = promisify("QueriesApi") -export const RowsApi = promisify("RowsApi") -export const TablesApi = promisify("TablesApi") -export const UsersApi = promisify("UsersApi") +export const ApplicationsApi = new BudibaseApi.ApplicationsApi(ApiClient) +export const QueriesApi = new BudibaseApi.QueriesApi(ApiClient) +export const RowsApi = new BudibaseApi.RowsApi(ApiClient) +export const TablesApi = new BudibaseApi.TablesApi(ApiClient) +export const UsersApi = new BudibaseApi.UsersApi(ApiClient) From 586f97d74fe38fbf6a5181f3c0aa52b2809ddb48 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Sep 2022 15:42:36 +0100 Subject: [PATCH 05/15] Move rollup plugin to dev dependency --- packages/client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/package.json b/packages/client/package.json index dad087808b..c50817dc39 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -35,7 +35,6 @@ "downloadjs": "1.4.7", "leaflet": "^1.7.1", "regexparam": "^1.3.0", - "rollup-plugin-polyfill-node": "^0.8.0", "sanitize-html": "^2.7.0", "screenfull": "^6.0.1", "shortid": "^2.2.15", @@ -52,6 +51,7 @@ "postcss": "^8.2.10", "rollup": "^2.44.0", "rollup-plugin-json": "^4.0.0", + "rollup-plugin-polyfill-node": "^0.8.0", "rollup-plugin-postcss": "^4.0.0", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-svg": "^2.0.0", From fadb1e498e13a7b8c1eba56c1643a80069b7bded Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 20 Sep 2022 11:24:54 +0100 Subject: [PATCH 06/15] Add operationIds to public API --- packages/server/specs/openapi.json | 22 + packages/server/specs/openapi.yaml | 22 + .../src/api/routes/public/applications.ts | 5 + .../server/src/api/routes/public/queries.ts | 2 + packages/server/src/api/routes/public/rows.ts | 5 + .../server/src/api/routes/public/tables.ts | 5 + .../server/src/api/routes/public/users.ts | 5 + packages/server/src/definitions/openapi.ts | 930 +++++++++--------- 8 files changed, 549 insertions(+), 447 deletions(-) diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index f8539b9f7f..37c636590b 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -1792,6 +1792,7 @@ "paths": { "/applications": { "post": { + "operationId": "createApplication", "summary": "Create an application", "tags": [ "applications" @@ -1832,6 +1833,7 @@ }, "/applications/{appId}": { "put": { + "operationId": "updateApplication", "summary": "Update an application", "tags": [ "applications" @@ -1870,6 +1872,7 @@ } }, "delete": { + "operationId": "deleteApplication", "summary": "Delete an application", "tags": [ "applications" @@ -1898,6 +1901,7 @@ } }, "get": { + "operationId": "getApplicationById", "summary": "Retrieve an application", "tags": [ "applications" @@ -1928,6 +1932,7 @@ }, "/applications/search": { "post": { + "operationId": "searchApplications", "summary": "Search for applications", "description": "Based on application properties (currently only name) search for applications.", "tags": [ @@ -1964,6 +1969,7 @@ }, "/queries/{queryId}": { "post": { + "operationId": "executeQuery", "summary": "Execute a query", "description": "Queries which have been created within a Budibase app can be executed using this,", "tags": [ @@ -2011,6 +2017,7 @@ }, "/queries/search": { "post": { + "operationId": "searchQueries", "summary": "Search for queries", "description": "Based on query properties (currently only name) search for queries.", "tags": [ @@ -2052,6 +2059,7 @@ }, "/tables/{tableId}/rows": { "post": { + "operationId": "createRow", "summary": "Create a row", "description": "Creates a row within the specified table.", "tags": [ @@ -2101,6 +2109,7 @@ }, "/tables/{tableId}/rows/{rowId}": { "put": { + "operationId": "updateRow", "summary": "Update a row", "description": "Updates a row within the specified table.", "tags": [ @@ -2151,6 +2160,7 @@ } }, "delete": { + "operationId": "deleteRow", "summary": "Delete a row", "description": "Deletes a row within the specified table.", "tags": [ @@ -2186,6 +2196,7 @@ } }, "get": { + "operationId": "getRowById", "summary": "Retrieve a row", "description": "This gets a single row, it will be enriched with the full related rows, rather than the squashed \"primaryDisplay\" format returned by the search endpoint.", "tags": [ @@ -2223,6 +2234,7 @@ }, "/tables/{tableId}/rows/search": { "post": { + "operationId": "searchRows", "summary": "Search for rows", "tags": [ "rows" @@ -2266,6 +2278,7 @@ }, "/tables": { "post": { + "operationId": "createTable", "summary": "Create a table", "description": "Create a table, this could be internal or external.", "tags": [ @@ -2311,6 +2324,7 @@ }, "/tables/{tableId}": { "put": { + "operationId": "updateTable", "summary": "Update a table", "description": "Update a table, this could be internal or external.", "tags": [ @@ -2357,6 +2371,7 @@ } }, "delete": { + "operationId": "deleteTable", "summary": "Delete a table", "description": "Delete a table, this could be internal or external.", "tags": [ @@ -2389,6 +2404,7 @@ } }, "get": { + "operationId": "getTableById", "summary": "Retrieve a table", "description": "Lookup a table, this could be internal or external.", "tags": [ @@ -2423,6 +2439,7 @@ }, "/tables/search": { "post": { + "operationId": "searchTables", "summary": "Search for tables", "description": "Based on table properties (currently only name) search for tables. This could be an internal or an external table.", "tags": [ @@ -2464,6 +2481,7 @@ }, "/users": { "post": { + "operationId": "createUser", "summary": "Create a user", "tags": [ "users" @@ -2499,6 +2517,7 @@ }, "/users/{userId}": { "put": { + "operationId": "updateUser", "summary": "Update a user", "tags": [ "users" @@ -2537,6 +2556,7 @@ } }, "delete": { + "operationId": "deleteUser", "summary": "Delete a user", "tags": [ "users" @@ -2565,6 +2585,7 @@ } }, "get": { + "operationId": "getUserById", "summary": "Retrieve a user", "tags": [ "users" @@ -2595,6 +2616,7 @@ }, "/users/search": { "post": { + "operationId": "searchUsers", "summary": "Search for users", "description": "Based on user properties (currently only name) search for users.", "tags": [ diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index 3cd29791af..46a6e387e3 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -1370,6 +1370,7 @@ security: paths: /applications: post: + operationId: createApplication summary: Create an application tags: - applications @@ -1393,6 +1394,7 @@ paths: $ref: "#/components/examples/application" "/applications/{appId}": put: + operationId: updateApplication summary: Update an application tags: - applications @@ -1415,6 +1417,7 @@ paths: application: $ref: "#/components/examples/application" delete: + operationId: deleteApplication summary: Delete an application tags: - applications @@ -1431,6 +1434,7 @@ paths: application: $ref: "#/components/examples/application" get: + operationId: getApplicationById summary: Retrieve an application tags: - applications @@ -1448,6 +1452,7 @@ paths: $ref: "#/components/examples/application" /applications/search: post: + operationId: searchApplications summary: Search for applications description: Based on application properties (currently only name) search for applications. @@ -1472,6 +1477,7 @@ paths: $ref: "#/components/examples/applications" "/queries/{queryId}": post: + operationId: executeQuery summary: Execute a query description: Queries which have been created within a Budibase app can be executed using this, @@ -1500,6 +1506,7 @@ paths: $ref: "#/components/examples/sqlResponse" /queries/search: post: + operationId: searchQueries summary: Search for queries description: Based on query properties (currently only name) search for queries. tags: @@ -1524,6 +1531,7 @@ paths: $ref: "#/components/examples/queries" "/tables/{tableId}/rows": post: + operationId: createRow summary: Create a row description: Creates a row within the specified table. tags: @@ -1554,6 +1562,7 @@ paths: $ref: "#/components/examples/row" "/tables/{tableId}/rows/{rowId}": put: + operationId: updateRow summary: Update a row description: Updates a row within the specified table. tags: @@ -1583,6 +1592,7 @@ paths: row: $ref: "#/components/examples/row" delete: + operationId: deleteRow summary: Delete a row description: Deletes a row within the specified table. tags: @@ -1603,6 +1613,7 @@ paths: row: $ref: "#/components/examples/row" get: + operationId: getRowById summary: Retrieve a row description: This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the @@ -1625,6 +1636,7 @@ paths: $ref: "#/components/examples/enrichedRow" "/tables/{tableId}/rows/search": post: + operationId: searchRows summary: Search for rows tags: - rows @@ -1650,6 +1662,7 @@ paths: $ref: "#/components/examples/rows" /tables: post: + operationId: createTable summary: Create a table description: Create a table, this could be internal or external. tags: @@ -1677,6 +1690,7 @@ paths: $ref: "#/components/examples/table" "/tables/{tableId}": put: + operationId: updateTable summary: Update a table description: Update a table, this could be internal or external. tags: @@ -1703,6 +1717,7 @@ paths: table: $ref: "#/components/examples/table" delete: + operationId: deleteTable summary: Delete a table description: Delete a table, this could be internal or external. tags: @@ -1721,6 +1736,7 @@ paths: table: $ref: "#/components/examples/table" get: + operationId: getTableById summary: Retrieve a table description: Lookup a table, this could be internal or external. tags: @@ -1740,6 +1756,7 @@ paths: $ref: "#/components/examples/table" /tables/search: post: + operationId: searchTables summary: Search for tables description: Based on table properties (currently only name) search for tables. This could be an internal or an external table. @@ -1765,6 +1782,7 @@ paths: $ref: "#/components/examples/tables" /users: post: + operationId: createUser summary: Create a user tags: - users @@ -1786,6 +1804,7 @@ paths: $ref: "#/components/examples/user" "/users/{userId}": put: + operationId: updateUser summary: Update a user tags: - users @@ -1808,6 +1827,7 @@ paths: user: $ref: "#/components/examples/user" delete: + operationId: deleteUser summary: Delete a user tags: - users @@ -1824,6 +1844,7 @@ paths: user: $ref: "#/components/examples/user" get: + operationId: getUserById summary: Retrieve a user tags: - users @@ -1841,6 +1862,7 @@ paths: $ref: "#/components/examples/user" /users/search: post: + operationId: searchUsers summary: Search for users description: Based on user properties (currently only name) search for users. tags: diff --git a/packages/server/src/api/routes/public/applications.ts b/packages/server/src/api/routes/public/applications.ts index 05f56da7b0..c407156caf 100644 --- a/packages/server/src/api/routes/public/applications.ts +++ b/packages/server/src/api/routes/public/applications.ts @@ -9,6 +9,7 @@ const read = [], * @openapi * /applications: * post: + * operationId: createApplication * summary: Create an application * tags: * - applications @@ -41,6 +42,7 @@ write.push( * @openapi * /applications/{appId}: * put: + * operationId: updateApplication * summary: Update an application * tags: * - applications @@ -73,6 +75,7 @@ write.push( * @openapi * /applications/{appId}: * delete: + * operationId: deleteApplication * summary: Delete an application * tags: * - applications @@ -95,6 +98,7 @@ write.push(new Endpoint("delete", "/applications/:appId", controller.destroy)) * @openapi * /applications/{appId}: * get: + * operationId: getApplicationById * summary: Retrieve an application * tags: * - applications @@ -117,6 +121,7 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read)) * @openapi * /applications/search: * post: + * operationId: searchApplications * summary: Search for applications * description: Based on application properties (currently only name) search for applications. * tags: diff --git a/packages/server/src/api/routes/public/queries.ts b/packages/server/src/api/routes/public/queries.ts index 9e5d73714e..b325c40a52 100644 --- a/packages/server/src/api/routes/public/queries.ts +++ b/packages/server/src/api/routes/public/queries.ts @@ -9,6 +9,7 @@ const read = [], * @openapi * /queries/{queryId}: * post: + * operationId: executeQuery * summary: Execute a query * description: Queries which have been created within a Budibase app can be executed using this, * tags: @@ -42,6 +43,7 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute)) * @openapi * /queries/search: * post: + * operationId: searchQueries * summary: Search for queries * description: Based on query properties (currently only name) search for queries. * tags: diff --git a/packages/server/src/api/routes/public/rows.ts b/packages/server/src/api/routes/public/rows.ts index 80da073e3e..78dfbba6fd 100644 --- a/packages/server/src/api/routes/public/rows.ts +++ b/packages/server/src/api/routes/public/rows.ts @@ -9,6 +9,7 @@ const read = [], * @openapi * /tables/{tableId}/rows: * post: + * operationId: createRow * summary: Create a row * description: Creates a row within the specified table. * tags: @@ -43,6 +44,7 @@ write.push(new Endpoint("post", "/tables/:tableId/rows", controller.create)) * @openapi * /tables/{tableId}/rows/{rowId}: * put: + * operationId: updateRow * summary: Update a row * description: Updates a row within the specified table. * tags: @@ -79,6 +81,7 @@ write.push( * @openapi * /tables/{tableId}/rows/{rowId}: * delete: + * operationId: deleteRow * summary: Delete a row * description: Deletes a row within the specified table. * tags: @@ -106,6 +109,7 @@ write.push( * @openapi * /tables/{tableId}/rows/{rowId}: * get: + * operationId: getRowById * summary: Retrieve a row * description: This gets a single row, it will be enriched with the full related rows, rather than * the squashed "primaryDisplay" format returned by the search endpoint. @@ -132,6 +136,7 @@ read.push(new Endpoint("get", "/tables/:tableId/rows/:rowId", controller.read)) * @openapi * /tables/{tableId}/rows/search: * post: + * operationId: searchRows * summary: Search for rows * tags: * - rows diff --git a/packages/server/src/api/routes/public/tables.ts b/packages/server/src/api/routes/public/tables.ts index 7e8ce29ae3..cc6408681e 100644 --- a/packages/server/src/api/routes/public/tables.ts +++ b/packages/server/src/api/routes/public/tables.ts @@ -9,6 +9,7 @@ const read = [], * @openapi * /tables: * post: + * operationId: createTable * summary: Create a table * description: Create a table, this could be internal or external. * tags: @@ -45,6 +46,7 @@ write.push( * @openapi * /tables/{tableId}: * put: + * operationId: updateTable * summary: Update a table * description: Update a table, this could be internal or external. * tags: @@ -81,6 +83,7 @@ write.push( * @openapi * /tables/{tableId}: * delete: + * operationId: deleteTable * summary: Delete a table * description: Delete a table, this could be internal or external. * tags: @@ -105,6 +108,7 @@ write.push(new Endpoint("delete", "/tables/:tableId", controller.destroy)) * @openapi * /tables/{tableId}: * get: + * operationId: getTableById * summary: Retrieve a table * description: Lookup a table, this could be internal or external. * tags: @@ -129,6 +133,7 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read)) * @openapi * /tables/search: * post: + * operationId: searchTables * summary: Search for tables * description: Based on table properties (currently only name) search for tables. This could be * an internal or an external table. diff --git a/packages/server/src/api/routes/public/users.ts b/packages/server/src/api/routes/public/users.ts index 06e17fba42..2be31b43d7 100644 --- a/packages/server/src/api/routes/public/users.ts +++ b/packages/server/src/api/routes/public/users.ts @@ -9,6 +9,7 @@ const read = [], * @openapi * /users: * post: + * operationId: createUser * summary: Create a user * tags: * - users @@ -35,6 +36,7 @@ write.push(new Endpoint("post", "/users", controller.create)) * @openapi * /users/{userId}: * put: + * operationId: updateUser * summary: Update a user * tags: * - users @@ -63,6 +65,7 @@ write.push(new Endpoint("put", "/users/:userId", controller.update)) * @openapi * /users/{userId}: * delete: + * operationId: deleteUser * summary: Delete a user * tags: * - users @@ -85,6 +88,7 @@ write.push(new Endpoint("delete", "/users/:userId", controller.destroy)) * @openapi * /users/{userId}: * get: + * operationId: getUserById * summary: Retrieve a user * tags: * - users @@ -107,6 +111,7 @@ read.push(new Endpoint("get", "/users/:userId", controller.read)) * @openapi * /users/search: * post: + * operationId: searchUsers * summary: Search for users * description: Based on user properties (currently only name) search for users. * tags: diff --git a/packages/server/src/definitions/openapi.ts b/packages/server/src/definitions/openapi.ts index a4bd0c1e3e..166ff9570e 100644 --- a/packages/server/src/definitions/openapi.ts +++ b/packages/server/src/definitions/openapi.ts @@ -5,491 +5,67 @@ export interface paths { "/applications": { - post: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created application. */ - 200: { - content: { - "application/json": components["schemas"]["applicationOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["application"]; - }; - }; - }; + post: operations["createApplication"]; }; "/applications/{appId}": { - get: { - parameters: { - path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; - }; - }; - responses: { - /** Returns the retrieved application. */ - 200: { - content: { - "application/json": components["schemas"]["applicationOutput"]; - }; - }; - }; - }; - put: { - parameters: { - path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; - }; - }; - responses: { - /** Returns the updated application. */ - 200: { - content: { - "application/json": components["schemas"]["applicationOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["application"]; - }; - }; - }; - delete: { - parameters: { - path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; - }; - }; - responses: { - /** Returns the deleted application. */ - 200: { - content: { - "application/json": components["schemas"]["applicationOutput"]; - }; - }; - }; - }; + get: operations["getApplicationById"]; + put: operations["updateApplication"]; + delete: operations["deleteApplication"]; }; "/applications/search": { /** Based on application properties (currently only name) search for applications. */ - post: { - responses: { - /** Returns the applications that were found based on the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["applicationSearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; + post: operations["searchApplications"]; }; "/queries/{queryId}": { /** Queries which have been created within a Budibase app can be executed using this, */ - post: { - parameters: { - path: { - /** The ID of the query which this request is targeting. */ - queryId: components["parameters"]["queryId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the result of the query execution. */ - 200: { - content: { - "application/json": components["schemas"]["executeQueryOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["executeQuery"]; - }; - }; - }; + post: operations["executeQuery"]; }; "/queries/search": { /** Based on query properties (currently only name) search for queries. */ - post: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the queries found based on the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["querySearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; + post: operations["searchQueries"]; }; "/tables/{tableId}/rows": { /** Creates a row within the specified table. */ - post: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created row, including the ID which has been generated for it. This can be found in the Budibase portal, viewed under the developer information. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["row"]; - }; - }; - }; + post: operations["createRow"]; }; "/tables/{tableId}/rows/{rowId}": { /** This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the search endpoint. */ - get: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the retrieved row. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - }; + get: operations["getRowById"]; /** Updates a row within the specified table. */ - put: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created row, including the ID which has been generated for it. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["row"]; - }; - }; - }; + put: operations["updateRow"]; /** Deletes a row within the specified table. */ - delete: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the deleted row, including the ID which has been generated for it. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - }; + delete: operations["deleteRow"]; }; "/tables/{tableId}/rows/search": { - post: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** The response will contain an array of rows that match the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["searchOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["rowSearch"]; - }; - }; - }; + post: operations["searchRows"]; }; "/tables": { /** Create a table, this could be internal or external. */ - post: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["table"]; - }; - }; - }; + post: operations["createTable"]; }; "/tables/{tableId}": { /** Lookup a table, this could be internal or external. */ - get: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the retrieved table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - }; + get: operations["getTableById"]; /** Update a table, this could be internal or external. */ - put: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the updated table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["table"]; - }; - }; - }; + put: operations["updateTable"]; /** Delete a table, this could be internal or external. */ - delete: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the deleted table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - }; + delete: operations["deleteTable"]; }; "/tables/search": { /** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */ - post: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the found tables, based on the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["tableSearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; + post: operations["searchTables"]; }; "/users": { - post: { - responses: { - /** Returns the created user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["user"]; - }; - }; - }; + post: operations["createUser"]; }; "/users/{userId}": { - get: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the retrieved user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - }; - put: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the updated user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["user"]; - }; - }; - }; - delete: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the deleted user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - }; + get: operations["getUserById"]; + put: operations["updateUser"]; + delete: operations["deleteUser"]; }; "/users/search": { /** Based on user properties (currently only name) search for users. */ - post: { - responses: { - /** Returns the found users based on search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["userSearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; + post: operations["searchUsers"]; }; } @@ -1127,6 +703,466 @@ export interface components { }; } -export interface operations {} +export interface operations { + createApplication: { + parameters: { + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the created application. */ + 200: { + content: { + "application/json": components["schemas"]["applicationOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["application"]; + }; + }; + }; + getApplicationById: { + parameters: { + path: { + /** The ID of the app which this request is targeting. */ + appId: components["parameters"]["appIdUrl"]; + }; + }; + responses: { + /** Returns the retrieved application. */ + 200: { + content: { + "application/json": components["schemas"]["applicationOutput"]; + }; + }; + }; + }; + updateApplication: { + parameters: { + path: { + /** The ID of the app which this request is targeting. */ + appId: components["parameters"]["appIdUrl"]; + }; + }; + responses: { + /** Returns the updated application. */ + 200: { + content: { + "application/json": components["schemas"]["applicationOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["application"]; + }; + }; + }; + deleteApplication: { + parameters: { + path: { + /** The ID of the app which this request is targeting. */ + appId: components["parameters"]["appIdUrl"]; + }; + }; + responses: { + /** Returns the deleted application. */ + 200: { + content: { + "application/json": components["schemas"]["applicationOutput"]; + }; + }; + }; + }; + /** Based on application properties (currently only name) search for applications. */ + searchApplications: { + responses: { + /** Returns the applications that were found based on the search parameters. */ + 200: { + content: { + "application/json": components["schemas"]["applicationSearch"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["nameSearch"]; + }; + }; + }; + /** Queries which have been created within a Budibase app can be executed using this, */ + executeQuery: { + parameters: { + path: { + /** The ID of the query which this request is targeting. */ + queryId: components["parameters"]["queryId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the result of the query execution. */ + 200: { + content: { + "application/json": components["schemas"]["executeQueryOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["executeQuery"]; + }; + }; + }; + /** Based on query properties (currently only name) search for queries. */ + searchQueries: { + parameters: { + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the queries found based on the search parameters. */ + 200: { + content: { + "application/json": components["schemas"]["querySearch"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["nameSearch"]; + }; + }; + }; + /** Creates a row within the specified table. */ + createRow: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the created row, including the ID which has been generated for it. This can be found in the Budibase portal, viewed under the developer information. */ + 200: { + content: { + "application/json": components["schemas"]["rowOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["row"]; + }; + }; + }; + /** This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the search endpoint. */ + getRowById: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + /** The ID of the row which this request is targeting. */ + rowId: components["parameters"]["rowId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the retrieved row. */ + 200: { + content: { + "application/json": components["schemas"]["rowOutput"]; + }; + }; + }; + }; + /** Updates a row within the specified table. */ + updateRow: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + /** The ID of the row which this request is targeting. */ + rowId: components["parameters"]["rowId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the created row, including the ID which has been generated for it. */ + 200: { + content: { + "application/json": components["schemas"]["rowOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["row"]; + }; + }; + }; + /** Deletes a row within the specified table. */ + deleteRow: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + /** The ID of the row which this request is targeting. */ + rowId: components["parameters"]["rowId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the deleted row, including the ID which has been generated for it. */ + 200: { + content: { + "application/json": components["schemas"]["rowOutput"]; + }; + }; + }; + }; + searchRows: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** The response will contain an array of rows that match the search parameters. */ + 200: { + content: { + "application/json": components["schemas"]["searchOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["rowSearch"]; + }; + }; + }; + /** Create a table, this could be internal or external. */ + createTable: { + parameters: { + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */ + 200: { + content: { + "application/json": components["schemas"]["tableOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["table"]; + }; + }; + }; + /** Lookup a table, this could be internal or external. */ + getTableById: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the retrieved table. */ + 200: { + content: { + "application/json": components["schemas"]["tableOutput"]; + }; + }; + }; + }; + /** Update a table, this could be internal or external. */ + updateTable: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the updated table. */ + 200: { + content: { + "application/json": components["schemas"]["tableOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["table"]; + }; + }; + }; + /** Delete a table, this could be internal or external. */ + deleteTable: { + parameters: { + path: { + /** The ID of the table which this request is targeting. */ + tableId: components["parameters"]["tableId"]; + }; + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the deleted table. */ + 200: { + content: { + "application/json": components["schemas"]["tableOutput"]; + }; + }; + }; + }; + /** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */ + searchTables: { + parameters: { + header: { + /** The ID of the app which this request is targeting. */ + "x-budibase-app-id": components["parameters"]["appId"]; + }; + }; + responses: { + /** Returns the found tables, based on the search parameters. */ + 200: { + content: { + "application/json": components["schemas"]["tableSearch"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["nameSearch"]; + }; + }; + }; + createUser: { + responses: { + /** Returns the created user. */ + 200: { + content: { + "application/json": components["schemas"]["userOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["user"]; + }; + }; + }; + getUserById: { + parameters: { + path: { + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; + }; + }; + responses: { + /** Returns the retrieved user. */ + 200: { + content: { + "application/json": components["schemas"]["userOutput"]; + }; + }; + }; + }; + updateUser: { + parameters: { + path: { + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; + }; + }; + responses: { + /** Returns the updated user. */ + 200: { + content: { + "application/json": components["schemas"]["userOutput"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["user"]; + }; + }; + }; + deleteUser: { + parameters: { + path: { + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; + }; + }; + responses: { + /** Returns the deleted user. */ + 200: { + content: { + "application/json": components["schemas"]["userOutput"]; + }; + }; + }; + }; + /** Based on user properties (currently only name) search for users. */ + searchUsers: { + responses: { + /** Returns the found users based on search parameters. */ + 200: { + content: { + "application/json": components["schemas"]["userSearch"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["nameSearch"]; + }; + }; + }; +} export interface external {} From 9a8ba68cba9f10f9cc4ee8baa8bfe5295bb3c243 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 20 Sep 2022 11:25:11 +0100 Subject: [PATCH 07/15] Update sdk version --- packages/sdk/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 65b57dacf3..1127be4958 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "1.3.15-alpha.7", + "version": "1.3.19-alpha.6", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", From 25078b6bb8d67996bfd95199cccc3d811390d1d0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 09:08:52 +0100 Subject: [PATCH 08/15] Add unique srcript for generating SDK to avoid unnecessarily building it --- package.json | 1 + packages/sdk/package.json | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d9b78368ba..579e86802e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "bootstrap": "lerna bootstrap && lerna link && ./scripts/link-dependencies.sh", "build": "lerna run build", "build:dev": "lerna run prebuild && tsc --build --watch --preserveWatchOutput", + "build:sdk": "lerna run build:sdk", "deps:circular": "madge packages/server/dist/index.js packages/worker/src/index.ts packages/backend-core/dist/src/index.js packages/cli/src/index.js --circular", "release": "lerna publish ${RELEASE_VERSION_TYPE:-patch} --yes --force-publish && yarn release:pro", "release:develop": "lerna publish prerelease --yes --force-publish --dist-tag develop --exact && yarn release:pro:develop", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 1127be4958..517ec36f5b 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "1.3.19-alpha.6", + "version": "1.4.3-alpha.0", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", @@ -8,8 +8,7 @@ "type": "module", "scripts": { "generate": "cd scripts && bash generate-sdk.sh", - "build": "yarn run generate && rollup -c", - "dev:builder": "yarn run build" + "build:sdk": "yarn run generate && rollup -c" }, "dependencies": { "superagent": "^5.3.0" From afcd40a9e566198e0db74d44dfc6b0ecaba56a24 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 09:09:12 +0100 Subject: [PATCH 09/15] Build SDK as part of release workflows which publish to NPM --- .github/workflows/release-develop.yml | 3 ++- .github/workflows/release.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 57e65c734e..21c74851e1 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -46,7 +46,8 @@ jobs: - run: yarn - run: yarn bootstrap - run: yarn lint - - run: yarn build + - run: yarn build + - run: yarn build:sdk - run: yarn test - name: Configure AWS Credentials diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 961082e1ef..de288dd7db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,6 +56,7 @@ jobs: - run: yarn bootstrap - run: yarn lint - run: yarn build + - run: yarn build:sdk - run: yarn test - name: Configure AWS Credentials From e2982e1454fa9d33a86f716e8d6e3765bb0ce1e2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 09:49:33 +0100 Subject: [PATCH 10/15] Add helper util for authenticating the public API SDK in component plugins --- packages/client/src/sdk.js | 2 ++ packages/client/src/utils/api.js | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 packages/client/src/utils/api.js diff --git a/packages/client/src/sdk.js b/packages/client/src/sdk.js index aa778388f6..1afeea0055 100644 --- a/packages/client/src/sdk.js +++ b/packages/client/src/sdk.js @@ -17,6 +17,7 @@ import { getAction } from "utils/getAction" import Provider from "components/context/Provider.svelte" import { ActionTypes } from "./constants" import { fetchDatasourceSchema } from "./utils/schema.js" +import { getAPIKey } from "./utils/api.js" export default { API, @@ -36,4 +37,5 @@ export default { fetchDatasourceSchema, Provider, ActionTypes, + getAPIKey, } diff --git a/packages/client/src/utils/api.js b/packages/client/src/utils/api.js new file mode 100644 index 0000000000..4e6025873d --- /dev/null +++ b/packages/client/src/utils/api.js @@ -0,0 +1,6 @@ +import { API } from "api" + +export const getAPIKey = async () => { + const { apiKey } = await API.fetchDeveloperInfo() + return apiKey +} From 9f4e8c9fd309e7f079d90d7f86729d0ed459032f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 09:49:40 +0100 Subject: [PATCH 11/15] Bump version --- packages/sdk/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 517ec36f5b..4e0695f145 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "1.4.3-alpha.0", + "version": "1.4.3-alpha.2", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", From 8ae7b97d9c8483513f50d58af226bf08c07cb364 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 09:53:24 +0100 Subject: [PATCH 12/15] Ignore generated SDK files from linting --- .eslintignore | 3 ++- .prettierignore | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 54824be5c7..579bd55947 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,5 @@ packages/server/client packages/builder/.routify packages/builder/cypress/support/queryLevelTransformerFunction.js packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js -packages/builder/cypress/reports \ No newline at end of file +packages/builder/cypress/reports +packages/sdk/sdk \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index ad36a86b99..3a381d255e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,4 +8,5 @@ packages/server/client packages/server/src/definitions/openapi.ts packages/builder/.routify packages/builder/cypress/support/queryLevelTransformerFunction.js -packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js \ No newline at end of file +packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js +packages/sdk/sdk \ No newline at end of file From 3b4ca9e5b37482761791694b30b2b4138ab12001 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 19:11:47 +0100 Subject: [PATCH 13/15] Update public API operation IDs to be shorter --- packages/server/specs/openapi.json | 44 +- packages/server/specs/openapi.yaml | 44 +- .../src/api/controllers/plugin/index.ts | 2 +- .../src/api/routes/public/applications.ts | 10 +- .../server/src/api/routes/public/queries.ts | 4 +- packages/server/src/api/routes/public/rows.ts | 10 +- .../server/src/api/routes/public/tables.ts | 10 +- .../server/src/api/routes/public/users.ts | 10 +- packages/server/src/definitions/openapi.ts | 443 ++---------------- 9 files changed, 114 insertions(+), 463 deletions(-) diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index 37c636590b..09657d3f02 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -1792,7 +1792,7 @@ "paths": { "/applications": { "post": { - "operationId": "createApplication", + "operationId": "create", "summary": "Create an application", "tags": [ "applications" @@ -1833,7 +1833,7 @@ }, "/applications/{appId}": { "put": { - "operationId": "updateApplication", + "operationId": "update", "summary": "Update an application", "tags": [ "applications" @@ -1872,7 +1872,7 @@ } }, "delete": { - "operationId": "deleteApplication", + "operationId": "delete", "summary": "Delete an application", "tags": [ "applications" @@ -1901,7 +1901,7 @@ } }, "get": { - "operationId": "getApplicationById", + "operationId": "getById", "summary": "Retrieve an application", "tags": [ "applications" @@ -1932,7 +1932,7 @@ }, "/applications/search": { "post": { - "operationId": "searchApplications", + "operationId": "search", "summary": "Search for applications", "description": "Based on application properties (currently only name) search for applications.", "tags": [ @@ -1969,7 +1969,7 @@ }, "/queries/{queryId}": { "post": { - "operationId": "executeQuery", + "operationId": "execute", "summary": "Execute a query", "description": "Queries which have been created within a Budibase app can be executed using this,", "tags": [ @@ -2017,7 +2017,7 @@ }, "/queries/search": { "post": { - "operationId": "searchQueries", + "operationId": "search", "summary": "Search for queries", "description": "Based on query properties (currently only name) search for queries.", "tags": [ @@ -2059,7 +2059,7 @@ }, "/tables/{tableId}/rows": { "post": { - "operationId": "createRow", + "operationId": "create", "summary": "Create a row", "description": "Creates a row within the specified table.", "tags": [ @@ -2109,7 +2109,7 @@ }, "/tables/{tableId}/rows/{rowId}": { "put": { - "operationId": "updateRow", + "operationId": "update", "summary": "Update a row", "description": "Updates a row within the specified table.", "tags": [ @@ -2160,7 +2160,7 @@ } }, "delete": { - "operationId": "deleteRow", + "operationId": "delete", "summary": "Delete a row", "description": "Deletes a row within the specified table.", "tags": [ @@ -2196,7 +2196,7 @@ } }, "get": { - "operationId": "getRowById", + "operationId": "getById", "summary": "Retrieve a row", "description": "This gets a single row, it will be enriched with the full related rows, rather than the squashed \"primaryDisplay\" format returned by the search endpoint.", "tags": [ @@ -2234,7 +2234,7 @@ }, "/tables/{tableId}/rows/search": { "post": { - "operationId": "searchRows", + "operationId": "search", "summary": "Search for rows", "tags": [ "rows" @@ -2278,7 +2278,7 @@ }, "/tables": { "post": { - "operationId": "createTable", + "operationId": "create", "summary": "Create a table", "description": "Create a table, this could be internal or external.", "tags": [ @@ -2324,7 +2324,7 @@ }, "/tables/{tableId}": { "put": { - "operationId": "updateTable", + "operationId": "update", "summary": "Update a table", "description": "Update a table, this could be internal or external.", "tags": [ @@ -2371,7 +2371,7 @@ } }, "delete": { - "operationId": "deleteTable", + "operationId": "delete", "summary": "Delete a table", "description": "Delete a table, this could be internal or external.", "tags": [ @@ -2404,7 +2404,7 @@ } }, "get": { - "operationId": "getTableById", + "operationId": "getById", "summary": "Retrieve a table", "description": "Lookup a table, this could be internal or external.", "tags": [ @@ -2439,7 +2439,7 @@ }, "/tables/search": { "post": { - "operationId": "searchTables", + "operationId": "search", "summary": "Search for tables", "description": "Based on table properties (currently only name) search for tables. This could be an internal or an external table.", "tags": [ @@ -2481,7 +2481,7 @@ }, "/users": { "post": { - "operationId": "createUser", + "operationId": "create", "summary": "Create a user", "tags": [ "users" @@ -2517,7 +2517,7 @@ }, "/users/{userId}": { "put": { - "operationId": "updateUser", + "operationId": "update", "summary": "Update a user", "tags": [ "users" @@ -2556,7 +2556,7 @@ } }, "delete": { - "operationId": "deleteUser", + "operationId": "delete", "summary": "Delete a user", "tags": [ "users" @@ -2585,7 +2585,7 @@ } }, "get": { - "operationId": "getUserById", + "operationId": "getById", "summary": "Retrieve a user", "tags": [ "users" @@ -2616,7 +2616,7 @@ }, "/users/search": { "post": { - "operationId": "searchUsers", + "operationId": "search", "summary": "Search for users", "description": "Based on user properties (currently only name) search for users.", "tags": [ diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index 46a6e387e3..64a3df1f48 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -1370,7 +1370,7 @@ security: paths: /applications: post: - operationId: createApplication + operationId: create summary: Create an application tags: - applications @@ -1394,7 +1394,7 @@ paths: $ref: "#/components/examples/application" "/applications/{appId}": put: - operationId: updateApplication + operationId: update summary: Update an application tags: - applications @@ -1417,7 +1417,7 @@ paths: application: $ref: "#/components/examples/application" delete: - operationId: deleteApplication + operationId: delete summary: Delete an application tags: - applications @@ -1434,7 +1434,7 @@ paths: application: $ref: "#/components/examples/application" get: - operationId: getApplicationById + operationId: getById summary: Retrieve an application tags: - applications @@ -1452,7 +1452,7 @@ paths: $ref: "#/components/examples/application" /applications/search: post: - operationId: searchApplications + operationId: search summary: Search for applications description: Based on application properties (currently only name) search for applications. @@ -1477,7 +1477,7 @@ paths: $ref: "#/components/examples/applications" "/queries/{queryId}": post: - operationId: executeQuery + operationId: execute summary: Execute a query description: Queries which have been created within a Budibase app can be executed using this, @@ -1506,7 +1506,7 @@ paths: $ref: "#/components/examples/sqlResponse" /queries/search: post: - operationId: searchQueries + operationId: search summary: Search for queries description: Based on query properties (currently only name) search for queries. tags: @@ -1531,7 +1531,7 @@ paths: $ref: "#/components/examples/queries" "/tables/{tableId}/rows": post: - operationId: createRow + operationId: create summary: Create a row description: Creates a row within the specified table. tags: @@ -1562,7 +1562,7 @@ paths: $ref: "#/components/examples/row" "/tables/{tableId}/rows/{rowId}": put: - operationId: updateRow + operationId: update summary: Update a row description: Updates a row within the specified table. tags: @@ -1592,7 +1592,7 @@ paths: row: $ref: "#/components/examples/row" delete: - operationId: deleteRow + operationId: delete summary: Delete a row description: Deletes a row within the specified table. tags: @@ -1613,7 +1613,7 @@ paths: row: $ref: "#/components/examples/row" get: - operationId: getRowById + operationId: getById summary: Retrieve a row description: This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the @@ -1636,7 +1636,7 @@ paths: $ref: "#/components/examples/enrichedRow" "/tables/{tableId}/rows/search": post: - operationId: searchRows + operationId: search summary: Search for rows tags: - rows @@ -1662,7 +1662,7 @@ paths: $ref: "#/components/examples/rows" /tables: post: - operationId: createTable + operationId: create summary: Create a table description: Create a table, this could be internal or external. tags: @@ -1690,7 +1690,7 @@ paths: $ref: "#/components/examples/table" "/tables/{tableId}": put: - operationId: updateTable + operationId: update summary: Update a table description: Update a table, this could be internal or external. tags: @@ -1717,7 +1717,7 @@ paths: table: $ref: "#/components/examples/table" delete: - operationId: deleteTable + operationId: delete summary: Delete a table description: Delete a table, this could be internal or external. tags: @@ -1736,7 +1736,7 @@ paths: table: $ref: "#/components/examples/table" get: - operationId: getTableById + operationId: getById summary: Retrieve a table description: Lookup a table, this could be internal or external. tags: @@ -1756,7 +1756,7 @@ paths: $ref: "#/components/examples/table" /tables/search: post: - operationId: searchTables + operationId: search summary: Search for tables description: Based on table properties (currently only name) search for tables. This could be an internal or an external table. @@ -1782,7 +1782,7 @@ paths: $ref: "#/components/examples/tables" /users: post: - operationId: createUser + operationId: create summary: Create a user tags: - users @@ -1804,7 +1804,7 @@ paths: $ref: "#/components/examples/user" "/users/{userId}": put: - operationId: updateUser + operationId: update summary: Update a user tags: - users @@ -1827,7 +1827,7 @@ paths: user: $ref: "#/components/examples/user" delete: - operationId: deleteUser + operationId: delete summary: Delete a user tags: - users @@ -1844,7 +1844,7 @@ paths: user: $ref: "#/components/examples/user" get: - operationId: getUserById + operationId: getById summary: Retrieve a user tags: - users @@ -1862,7 +1862,7 @@ paths: $ref: "#/components/examples/user" /users/search: post: - operationId: searchUsers + operationId: search summary: Search for users description: Based on user properties (currently only name) search for users. tags: diff --git a/packages/server/src/api/controllers/plugin/index.ts b/packages/server/src/api/controllers/plugin/index.ts index 868d2689fd..7d1b1291ab 100644 --- a/packages/server/src/api/controllers/plugin/index.ts +++ b/packages/server/src/api/controllers/plugin/index.ts @@ -129,6 +129,6 @@ export async function processUploadedPlugin( } const doc = await plugins.storePlugin(metadata, directory, source) - ClientAppSocket.emit("plugins-update", { name: doc.name, hash: doc.hash }) + ClientAppSocket.emit("plugin-update", { name: doc.name, hash: doc.hash }) return doc } diff --git a/packages/server/src/api/routes/public/applications.ts b/packages/server/src/api/routes/public/applications.ts index c407156caf..b8dad05507 100644 --- a/packages/server/src/api/routes/public/applications.ts +++ b/packages/server/src/api/routes/public/applications.ts @@ -9,7 +9,7 @@ const read = [], * @openapi * /applications: * post: - * operationId: createApplication + * operationId: create * summary: Create an application * tags: * - applications @@ -42,7 +42,7 @@ write.push( * @openapi * /applications/{appId}: * put: - * operationId: updateApplication + * operationId: update * summary: Update an application * tags: * - applications @@ -75,7 +75,7 @@ write.push( * @openapi * /applications/{appId}: * delete: - * operationId: deleteApplication + * operationId: delete * summary: Delete an application * tags: * - applications @@ -98,7 +98,7 @@ write.push(new Endpoint("delete", "/applications/:appId", controller.destroy)) * @openapi * /applications/{appId}: * get: - * operationId: getApplicationById + * operationId: getById * summary: Retrieve an application * tags: * - applications @@ -121,7 +121,7 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read)) * @openapi * /applications/search: * post: - * operationId: searchApplications + * operationId: search * summary: Search for applications * description: Based on application properties (currently only name) search for applications. * tags: diff --git a/packages/server/src/api/routes/public/queries.ts b/packages/server/src/api/routes/public/queries.ts index b325c40a52..dc18fb91ac 100644 --- a/packages/server/src/api/routes/public/queries.ts +++ b/packages/server/src/api/routes/public/queries.ts @@ -9,7 +9,7 @@ const read = [], * @openapi * /queries/{queryId}: * post: - * operationId: executeQuery + * operationId: execute * summary: Execute a query * description: Queries which have been created within a Budibase app can be executed using this, * tags: @@ -43,7 +43,7 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute)) * @openapi * /queries/search: * post: - * operationId: searchQueries + * operationId: search * summary: Search for queries * description: Based on query properties (currently only name) search for queries. * tags: diff --git a/packages/server/src/api/routes/public/rows.ts b/packages/server/src/api/routes/public/rows.ts index 78dfbba6fd..16364a196d 100644 --- a/packages/server/src/api/routes/public/rows.ts +++ b/packages/server/src/api/routes/public/rows.ts @@ -9,7 +9,7 @@ const read = [], * @openapi * /tables/{tableId}/rows: * post: - * operationId: createRow + * operationId: create * summary: Create a row * description: Creates a row within the specified table. * tags: @@ -44,7 +44,7 @@ write.push(new Endpoint("post", "/tables/:tableId/rows", controller.create)) * @openapi * /tables/{tableId}/rows/{rowId}: * put: - * operationId: updateRow + * operationId: update * summary: Update a row * description: Updates a row within the specified table. * tags: @@ -81,7 +81,7 @@ write.push( * @openapi * /tables/{tableId}/rows/{rowId}: * delete: - * operationId: deleteRow + * operationId: delete * summary: Delete a row * description: Deletes a row within the specified table. * tags: @@ -109,7 +109,7 @@ write.push( * @openapi * /tables/{tableId}/rows/{rowId}: * get: - * operationId: getRowById + * operationId: getById * summary: Retrieve a row * description: This gets a single row, it will be enriched with the full related rows, rather than * the squashed "primaryDisplay" format returned by the search endpoint. @@ -136,7 +136,7 @@ read.push(new Endpoint("get", "/tables/:tableId/rows/:rowId", controller.read)) * @openapi * /tables/{tableId}/rows/search: * post: - * operationId: searchRows + * operationId: search * summary: Search for rows * tags: * - rows diff --git a/packages/server/src/api/routes/public/tables.ts b/packages/server/src/api/routes/public/tables.ts index cc6408681e..a40c8ab83c 100644 --- a/packages/server/src/api/routes/public/tables.ts +++ b/packages/server/src/api/routes/public/tables.ts @@ -9,7 +9,7 @@ const read = [], * @openapi * /tables: * post: - * operationId: createTable + * operationId: create * summary: Create a table * description: Create a table, this could be internal or external. * tags: @@ -46,7 +46,7 @@ write.push( * @openapi * /tables/{tableId}: * put: - * operationId: updateTable + * operationId: update * summary: Update a table * description: Update a table, this could be internal or external. * tags: @@ -83,7 +83,7 @@ write.push( * @openapi * /tables/{tableId}: * delete: - * operationId: deleteTable + * operationId: delete * summary: Delete a table * description: Delete a table, this could be internal or external. * tags: @@ -108,7 +108,7 @@ write.push(new Endpoint("delete", "/tables/:tableId", controller.destroy)) * @openapi * /tables/{tableId}: * get: - * operationId: getTableById + * operationId: getById * summary: Retrieve a table * description: Lookup a table, this could be internal or external. * tags: @@ -133,7 +133,7 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read)) * @openapi * /tables/search: * post: - * operationId: searchTables + * operationId: search * summary: Search for tables * description: Based on table properties (currently only name) search for tables. This could be * an internal or an external table. diff --git a/packages/server/src/api/routes/public/users.ts b/packages/server/src/api/routes/public/users.ts index 2be31b43d7..ee23ff7f7f 100644 --- a/packages/server/src/api/routes/public/users.ts +++ b/packages/server/src/api/routes/public/users.ts @@ -9,7 +9,7 @@ const read = [], * @openapi * /users: * post: - * operationId: createUser + * operationId: create * summary: Create a user * tags: * - users @@ -36,7 +36,7 @@ write.push(new Endpoint("post", "/users", controller.create)) * @openapi * /users/{userId}: * put: - * operationId: updateUser + * operationId: update * summary: Update a user * tags: * - users @@ -65,7 +65,7 @@ write.push(new Endpoint("put", "/users/:userId", controller.update)) * @openapi * /users/{userId}: * delete: - * operationId: deleteUser + * operationId: delete * summary: Delete a user * tags: * - users @@ -88,7 +88,7 @@ write.push(new Endpoint("delete", "/users/:userId", controller.destroy)) * @openapi * /users/{userId}: * get: - * operationId: getUserById + * operationId: getById * summary: Retrieve a user * tags: * - users @@ -111,7 +111,7 @@ read.push(new Endpoint("get", "/users/:userId", controller.read)) * @openapi * /users/search: * post: - * operationId: searchUsers + * operationId: search * summary: Search for users * description: Based on user properties (currently only name) search for users. * tags: diff --git a/packages/server/src/definitions/openapi.ts b/packages/server/src/definitions/openapi.ts index 166ff9570e..9644bebc19 100644 --- a/packages/server/src/definitions/openapi.ts +++ b/packages/server/src/definitions/openapi.ts @@ -5,67 +5,67 @@ export interface paths { "/applications": { - post: operations["createApplication"]; + post: operations["create"]; }; "/applications/{appId}": { - get: operations["getApplicationById"]; - put: operations["updateApplication"]; - delete: operations["deleteApplication"]; + get: operations["getById"]; + put: operations["update"]; + delete: operations["delete"]; }; "/applications/search": { /** Based on application properties (currently only name) search for applications. */ - post: operations["searchApplications"]; + post: operations["search"]; }; "/queries/{queryId}": { /** Queries which have been created within a Budibase app can be executed using this, */ - post: operations["executeQuery"]; + post: operations["execute"]; }; "/queries/search": { /** Based on query properties (currently only name) search for queries. */ - post: operations["searchQueries"]; + post: operations["search"]; }; "/tables/{tableId}/rows": { /** Creates a row within the specified table. */ - post: operations["createRow"]; + post: operations["create"]; }; "/tables/{tableId}/rows/{rowId}": { /** This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the search endpoint. */ - get: operations["getRowById"]; + get: operations["getById"]; /** Updates a row within the specified table. */ - put: operations["updateRow"]; + put: operations["update"]; /** Deletes a row within the specified table. */ - delete: operations["deleteRow"]; + delete: operations["delete"]; }; "/tables/{tableId}/rows/search": { - post: operations["searchRows"]; + post: operations["search"]; }; "/tables": { /** Create a table, this could be internal or external. */ - post: operations["createTable"]; + post: operations["create"]; }; "/tables/{tableId}": { /** Lookup a table, this could be internal or external. */ - get: operations["getTableById"]; + get: operations["getById"]; /** Update a table, this could be internal or external. */ - put: operations["updateTable"]; + put: operations["update"]; /** Delete a table, this could be internal or external. */ - delete: operations["deleteTable"]; + delete: operations["delete"]; }; "/tables/search": { /** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */ - post: operations["searchTables"]; + post: operations["search"]; }; "/users": { - post: operations["createUser"]; + post: operations["create"]; }; "/users/{userId}": { - get: operations["getUserById"]; - put: operations["updateUser"]; - delete: operations["deleteUser"]; + get: operations["getById"]; + put: operations["update"]; + delete: operations["delete"]; }; "/users/search": { /** Based on user properties (currently only name) search for users. */ - post: operations["searchUsers"]; + post: operations["search"]; }; } @@ -704,87 +704,81 @@ export interface components { } export interface operations { - createApplication: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; + create: { responses: { - /** Returns the created application. */ + /** Returns the created user. */ 200: { content: { - "application/json": components["schemas"]["applicationOutput"]; + "application/json": components["schemas"]["userOutput"]; }; }; }; requestBody: { content: { - "application/json": components["schemas"]["application"]; + "application/json": components["schemas"]["user"]; }; }; }; - getApplicationById: { + getById: { parameters: { path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; }; }; responses: { - /** Returns the retrieved application. */ + /** Returns the retrieved user. */ 200: { content: { - "application/json": components["schemas"]["applicationOutput"]; + "application/json": components["schemas"]["userOutput"]; }; }; }; }; - updateApplication: { + update: { parameters: { path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; }; }; responses: { - /** Returns the updated application. */ + /** Returns the updated user. */ 200: { content: { - "application/json": components["schemas"]["applicationOutput"]; + "application/json": components["schemas"]["userOutput"]; }; }; }; requestBody: { content: { - "application/json": components["schemas"]["application"]; + "application/json": components["schemas"]["user"]; }; }; }; - deleteApplication: { + delete: { parameters: { path: { - /** The ID of the app which this request is targeting. */ - appId: components["parameters"]["appIdUrl"]; + /** The ID of the user which this request is targeting. */ + userId: components["parameters"]["userId"]; }; }; responses: { - /** Returns the deleted application. */ + /** Returns the deleted user. */ 200: { content: { - "application/json": components["schemas"]["applicationOutput"]; + "application/json": components["schemas"]["userOutput"]; }; }; }; }; - /** Based on application properties (currently only name) search for applications. */ - searchApplications: { + /** Based on user properties (currently only name) search for users. */ + search: { responses: { - /** Returns the applications that were found based on the search parameters. */ + /** Returns the found users based on search parameters. */ 200: { content: { - "application/json": components["schemas"]["applicationSearch"]; + "application/json": components["schemas"]["userSearch"]; }; }; }; @@ -795,7 +789,7 @@ export interface operations { }; }; /** Queries which have been created within a Budibase app can be executed using this, */ - executeQuery: { + execute: { parameters: { path: { /** The ID of the query which this request is targeting. */ @@ -820,349 +814,6 @@ export interface operations { }; }; }; - /** Based on query properties (currently only name) search for queries. */ - searchQueries: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the queries found based on the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["querySearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; - /** Creates a row within the specified table. */ - createRow: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created row, including the ID which has been generated for it. This can be found in the Budibase portal, viewed under the developer information. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["row"]; - }; - }; - }; - /** This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the search endpoint. */ - getRowById: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the retrieved row. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - }; - /** Updates a row within the specified table. */ - updateRow: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created row, including the ID which has been generated for it. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["row"]; - }; - }; - }; - /** Deletes a row within the specified table. */ - deleteRow: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - /** The ID of the row which this request is targeting. */ - rowId: components["parameters"]["rowId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the deleted row, including the ID which has been generated for it. */ - 200: { - content: { - "application/json": components["schemas"]["rowOutput"]; - }; - }; - }; - }; - searchRows: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** The response will contain an array of rows that match the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["searchOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["rowSearch"]; - }; - }; - }; - /** Create a table, this could be internal or external. */ - createTable: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["table"]; - }; - }; - }; - /** Lookup a table, this could be internal or external. */ - getTableById: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the retrieved table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - }; - /** Update a table, this could be internal or external. */ - updateTable: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the updated table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["table"]; - }; - }; - }; - /** Delete a table, this could be internal or external. */ - deleteTable: { - parameters: { - path: { - /** The ID of the table which this request is targeting. */ - tableId: components["parameters"]["tableId"]; - }; - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the deleted table. */ - 200: { - content: { - "application/json": components["schemas"]["tableOutput"]; - }; - }; - }; - }; - /** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */ - searchTables: { - parameters: { - header: { - /** The ID of the app which this request is targeting. */ - "x-budibase-app-id": components["parameters"]["appId"]; - }; - }; - responses: { - /** Returns the found tables, based on the search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["tableSearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; - createUser: { - responses: { - /** Returns the created user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["user"]; - }; - }; - }; - getUserById: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the retrieved user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - }; - updateUser: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the updated user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["user"]; - }; - }; - }; - deleteUser: { - parameters: { - path: { - /** The ID of the user which this request is targeting. */ - userId: components["parameters"]["userId"]; - }; - }; - responses: { - /** Returns the deleted user. */ - 200: { - content: { - "application/json": components["schemas"]["userOutput"]; - }; - }; - }; - }; - /** Based on user properties (currently only name) search for users. */ - searchUsers: { - responses: { - /** Returns the found users based on search parameters. */ - 200: { - content: { - "application/json": components["schemas"]["userSearch"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["nameSearch"]; - }; - }; - }; } export interface external {} From 1ec90ae770b075c1e902b3d16b7838d449e98e47 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 21 Sep 2022 19:12:25 +0100 Subject: [PATCH 14/15] Export SDK as a class to allow multiple instances --- packages/sdk/src/index.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/sdk/src/index.js b/packages/sdk/src/index.js index 23b3f9507e..4569907702 100644 --- a/packages/sdk/src/index.js +++ b/packages/sdk/src/index.js @@ -1,22 +1,23 @@ import * as BudibaseApi from "../sdk" -let ApiClient = new BudibaseApi.ApiClient() +export default class SDK { + applications = new BudibaseApi.ApplicationsApi() + queries = new BudibaseApi.QueriesApi() + rows = new BudibaseApi.RowsApi() + tables = new BudibaseApi.TablesApi() + users = new BudibaseApi.UsersApi() -// Default to current host -ApiClient.basePath = "/api/public/v1" + constructor({ apiKey, host }) { + let ApiClient = new BudibaseApi.ApiClient() -/** - * Configures the Budibase Public API SDK - * @param apiKey the user's API key - * @param host the Budibase server host - */ -export const configure = ({ apiKey, host }) => { - ApiClient.authentications["ApiKeyAuth"].apiKey = apiKey - ApiClient.basePath = `${host || ""}/api/public/v1` + // Default to current host + ApiClient.basePath = `${host || ""}/api/public/v1` + ApiClient.authentications["ApiKeyAuth"].apiKey = apiKey + + this.applications = new BudibaseApi.ApplicationsApi(ApiClient) + this.queries = new BudibaseApi.QueriesApi(ApiClient) + this.rows = new BudibaseApi.RowsApi(ApiClient) + this.tables = new BudibaseApi.TablesApi(ApiClient) + this.users = new BudibaseApi.UsersApi(ApiClient) + } } - -export const ApplicationsApi = new BudibaseApi.ApplicationsApi(ApiClient) -export const QueriesApi = new BudibaseApi.QueriesApi(ApiClient) -export const RowsApi = new BudibaseApi.RowsApi(ApiClient) -export const TablesApi = new BudibaseApi.TablesApi(ApiClient) -export const UsersApi = new BudibaseApi.UsersApi(ApiClient) From 02156387c7f559e359bb33c4260ef75f3f555d14 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 26 Sep 2022 14:18:31 +0100 Subject: [PATCH 15/15] Update delete endpoints to be called destroy --- packages/sdk/yarn.lock | 9 +-------- packages/server/specs/openapi.json | 8 ++++---- packages/server/specs/openapi.yaml | 8 ++++---- packages/server/src/api/routes/public/applications.ts | 2 +- packages/server/src/api/routes/public/rows.ts | 2 +- packages/server/src/api/routes/public/tables.ts | 2 +- packages/server/src/api/routes/public/users.ts | 2 +- packages/server/src/definitions/openapi.ts | 10 +++++----- 8 files changed, 18 insertions(+), 25 deletions(-) diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock index 757430d6b7..4e8d6d718f 100644 --- a/packages/sdk/yarn.lock +++ b/packages/sdk/yarn.lock @@ -85,13 +85,6 @@ estree-walker "^2.0.1" magic-string "^0.25.7" -"@rollup/plugin-json@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" - integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== - dependencies: - "@rollup/pluginutils" "^3.0.8" - "@rollup/plugin-node-resolve@^11.2.1": version "11.2.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" @@ -104,7 +97,7 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index 09657d3f02..ce410823ec 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -1872,7 +1872,7 @@ } }, "delete": { - "operationId": "delete", + "operationId": "destroy", "summary": "Delete an application", "tags": [ "applications" @@ -2160,7 +2160,7 @@ } }, "delete": { - "operationId": "delete", + "operationId": "destroy", "summary": "Delete a row", "description": "Deletes a row within the specified table.", "tags": [ @@ -2371,7 +2371,7 @@ } }, "delete": { - "operationId": "delete", + "operationId": "destroy", "summary": "Delete a table", "description": "Delete a table, this could be internal or external.", "tags": [ @@ -2556,7 +2556,7 @@ } }, "delete": { - "operationId": "delete", + "operationId": "destroy", "summary": "Delete a user", "tags": [ "users" diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index 64a3df1f48..ed13ac01f4 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -1417,7 +1417,7 @@ paths: application: $ref: "#/components/examples/application" delete: - operationId: delete + operationId: destroy summary: Delete an application tags: - applications @@ -1592,7 +1592,7 @@ paths: row: $ref: "#/components/examples/row" delete: - operationId: delete + operationId: destroy summary: Delete a row description: Deletes a row within the specified table. tags: @@ -1717,7 +1717,7 @@ paths: table: $ref: "#/components/examples/table" delete: - operationId: delete + operationId: destroy summary: Delete a table description: Delete a table, this could be internal or external. tags: @@ -1827,7 +1827,7 @@ paths: user: $ref: "#/components/examples/user" delete: - operationId: delete + operationId: destroy summary: Delete a user tags: - users diff --git a/packages/server/src/api/routes/public/applications.ts b/packages/server/src/api/routes/public/applications.ts index b8dad05507..93d86d2aed 100644 --- a/packages/server/src/api/routes/public/applications.ts +++ b/packages/server/src/api/routes/public/applications.ts @@ -75,7 +75,7 @@ write.push( * @openapi * /applications/{appId}: * delete: - * operationId: delete + * operationId: destroy * summary: Delete an application * tags: * - applications diff --git a/packages/server/src/api/routes/public/rows.ts b/packages/server/src/api/routes/public/rows.ts index 16364a196d..9109ae76b8 100644 --- a/packages/server/src/api/routes/public/rows.ts +++ b/packages/server/src/api/routes/public/rows.ts @@ -81,7 +81,7 @@ write.push( * @openapi * /tables/{tableId}/rows/{rowId}: * delete: - * operationId: delete + * operationId: destroy * summary: Delete a row * description: Deletes a row within the specified table. * tags: diff --git a/packages/server/src/api/routes/public/tables.ts b/packages/server/src/api/routes/public/tables.ts index a40c8ab83c..74cd8ca3cf 100644 --- a/packages/server/src/api/routes/public/tables.ts +++ b/packages/server/src/api/routes/public/tables.ts @@ -83,7 +83,7 @@ write.push( * @openapi * /tables/{tableId}: * delete: - * operationId: delete + * operationId: destroy * summary: Delete a table * description: Delete a table, this could be internal or external. * tags: diff --git a/packages/server/src/api/routes/public/users.ts b/packages/server/src/api/routes/public/users.ts index ee23ff7f7f..67b73f6cbe 100644 --- a/packages/server/src/api/routes/public/users.ts +++ b/packages/server/src/api/routes/public/users.ts @@ -65,7 +65,7 @@ write.push(new Endpoint("put", "/users/:userId", controller.update)) * @openapi * /users/{userId}: * delete: - * operationId: delete + * operationId: destroy * summary: Delete a user * tags: * - users diff --git a/packages/server/src/definitions/openapi.ts b/packages/server/src/definitions/openapi.ts index 9644bebc19..bb0ffb6771 100644 --- a/packages/server/src/definitions/openapi.ts +++ b/packages/server/src/definitions/openapi.ts @@ -10,7 +10,7 @@ export interface paths { "/applications/{appId}": { get: operations["getById"]; put: operations["update"]; - delete: operations["delete"]; + delete: operations["destroy"]; }; "/applications/search": { /** Based on application properties (currently only name) search for applications. */ @@ -34,7 +34,7 @@ export interface paths { /** Updates a row within the specified table. */ put: operations["update"]; /** Deletes a row within the specified table. */ - delete: operations["delete"]; + delete: operations["destroy"]; }; "/tables/{tableId}/rows/search": { post: operations["search"]; @@ -49,7 +49,7 @@ export interface paths { /** Update a table, this could be internal or external. */ put: operations["update"]; /** Delete a table, this could be internal or external. */ - delete: operations["delete"]; + delete: operations["destroy"]; }; "/tables/search": { /** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */ @@ -61,7 +61,7 @@ export interface paths { "/users/{userId}": { get: operations["getById"]; put: operations["update"]; - delete: operations["delete"]; + delete: operations["destroy"]; }; "/users/search": { /** Based on user properties (currently only name) search for users. */ @@ -756,7 +756,7 @@ export interface operations { }; }; }; - delete: { + destroy: { parameters: { path: { /** The ID of the user which this request is targeting. */