@convex-dev/cli
Advanced tools
Comparing version 0.0.36 to 0.0.42
{ | ||
"@babel/runtime@7.16.5": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", | ||
"@types/deep-equal@1.0.1": "sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg==", | ||
"@types/node@16.11.14": "sha512-mK6BKLpL0bG6v2CxHbm0ed6RcZrAtTHBTd/ZpnlVPVa3HkumsqLE4BC4u6TQ8D7pnrRbOU0am6epuALs+Ncnzw==", | ||
"ansi-styles@3.2.1": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", | ||
"@types/node@16.11.17": "sha512-C1vTZME8cFo8uxY2ui41xcynEotVkczIVI5AjLmy5pkpBv/FtG+jhtOlfcPysI8VRVwoOMv6NJm44LGnoMSWkw==", | ||
"ansi-styles@4.3.0": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", | ||
"anymatch@3.1.2": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", | ||
"available-typed-arrays@1.0.5": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", | ||
"axios-case-converter@0.9.0_axios@0.24.0": "sha512-G6tOanR1cdIrBtRyiPvR+xXyWCCZacSw8LtT8bmImvpye+XiyoOlLluz0N61IfetznNQ9BeMi5yA0rIyYDr8mQ==", | ||
"axios-retry@3.2.4": "sha512-Co3UXiv4npi6lM963mfnuH90/YFLKWWDmoBYfxkHT5xtkSSWNqK9zdG3fw5/CP/dsoKB5aMMJCsgab+tp1OxLQ==", | ||
"axios@0.21.4": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", | ||
"axios@0.24.0": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", | ||
"binary-extensions@2.2.0": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", | ||
"braces@3.0.2": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", | ||
"call-bind@1.0.2": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", | ||
"chalk@2.4.2": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", | ||
"camel-case@4.1.2": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", | ||
"capital-case@1.0.4": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", | ||
"chalk@4.1.2": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", | ||
"chokidar@3.5.2": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", | ||
"color-convert@1.9.3": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", | ||
"color-name@1.1.3": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", | ||
"color-convert@2.0.1": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", | ||
"color-name@1.1.4": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", | ||
"commander@8.1.0": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", | ||
@@ -21,2 +24,3 @@ "deep-equal@2.0.5": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", | ||
"define-properties@1.1.3": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", | ||
"dot-case@3.0.4": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", | ||
"envfile@6.17.0": "sha512-RnhtVw3auDZeeh5VtaNrbE7s6Kq8BoRtGIzcbMpMsJ+wIpRgs5jiDG4gQjW+vfws5QPlizE57/fUU0Tj6Nrs8A==", | ||
@@ -26,4 +30,21 @@ "es-abstract@1.19.1": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", | ||
"es-to-primitive@1.2.1": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", | ||
"esbuild@0.12.29": "sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==", | ||
"escape-string-regexp@1.0.5": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", | ||
"esbuild-android-arm64@0.14.8": "sha512-tAEoSHnPBSH0cCAFa/aYs3LPsoTY4SwsP6wDKi4PaelbQYNJjqNpAeweyJ8l98g1D6ZkLyqsHbkYj+209sezkA==", | ||
"esbuild-darwin-64@0.14.8": "sha512-t7p7WzTb+ybiD/irkMt5j/NzB+jY+8yPTsrXk5zCOH1O7DdthRnAUJ7pJPwImdL7jAGRbLtYRxUPgCHs/0qUPw==", | ||
"esbuild-darwin-arm64@0.14.8": "sha512-5FeaT2zMUajKnBwUMSsjZev5iA38YHrDmXhkOCwZQIFUvhqojinqCrvv/X7dyxb1987bcY9KGwJ+EwDwd922HQ==", | ||
"esbuild-freebsd-64@0.14.8": "sha512-pGHBLSf7ynfyDZXUtbq/GsA2VIwQlWXrUj1AMcE0id47mRdEUM8/1ZuqMGZx63hRnNgtK9zNJ8OIu2c7qq76Qw==", | ||
"esbuild-freebsd-arm64@0.14.8": "sha512-g4GgAnrx6Gh1BjKJjJWgPnOR4tW2FcAx9wFvyUjRsIjB35gT+aAFR+P/zStu5OG9LnbS8Pvjd4wS68QIXk+2dA==", | ||
"esbuild-linux-32@0.14.8": "sha512-wPfQJadF5vTzriw/B8Ide74PeAJlZW7czNx3NIUHkHlXb+En1SeIqNzl6jG9DuJUl57xD9Ucl9YJFEkFeX8eLg==", | ||
"esbuild-linux-64@0.14.8": "sha512-+RNuLk9RhRDL2kG+KTEYl5cIgF6AGLkRnKKWEu9DpCZaickONEqrKyQSVn410Hj105DLdW6qvIXQQHPycJhExg==", | ||
"esbuild-linux-arm64@0.14.8": "sha512-BtWoKNYul9UoxUvQUSdSrvSmJyFL1sGnNPTSqWCg1wMe4kmc8UY2yVsXSSkKO8N2jtHxlgFyz/XhvNBzEwGVcw==", | ||
"esbuild-linux-arm@0.14.8": "sha512-HIct38SvUAIJbiTwV/PVQroimQo96TGtzRDAEZxTorB4vsAj1r8bd0keXExPU4RH7G0zIqC4loQQpWYL+nH4Vg==", | ||
"esbuild-linux-mips64le@0.14.8": "sha512-0DxnCl9XTvaQtsX6Qa+Phr5i9b04INwwSv2RbQ2UWRLoQ/037iaFzbmuhgrcmaGOcRwPkCa+4Qo5EgI01MUgsQ==", | ||
"esbuild-linux-ppc64le@0.14.8": "sha512-Uzr/OMj97Q0qoWLXCvXCKUY/z1SNI4iSZEuYylM5Nd71HGStL32XWq/MReJ0PYMvUMKKJicKSKw2jWM1uBQ84Q==", | ||
"esbuild-linux-s390x@0.14.8": "sha512-vURka7aCA5DrRoOqOn6pXYwFlDSoQ4qnqam8AC0Ikn6tibutuhgar6M3Ek2DCuz9yqd396mngdYr5A8x2TPkww==", | ||
"esbuild-netbsd-64@0.14.8": "sha512-tjyDak2/pp0VUAhBW6/ueuReMd5qLHNlisXl5pq0Xn0z+kH9urA/t1igm0JassWbdMz123td5ZEQWoD9KbtOAw==", | ||
"esbuild-openbsd-64@0.14.8": "sha512-zAKKV15fIyAuDDga5rQv0lW2ufBWj/OCjqjDBb3dJf5SfoAi/DMIHuzmkKQeDQ+oxt9Rp1D7ZOlOBVflutFTqQ==", | ||
"esbuild-sunos-64@0.14.8": "sha512-xV41Wa8imziM/2dbWZjLKQbIETRgo5dE0oc/uPsgaecJhsrdA0VkGa/V432LJSUYv967xHDQdoRRl5tr80+NnQ==", | ||
"esbuild-windows-32@0.14.8": "sha512-AxpdeLKQSyCZo7MzdOyV4OgEbEJcjnrS/2niAjbHESbjuS5P1DN/5vZoJ/JSWDVa/40OkBuHBhAXMx1HK3UDsg==", | ||
"esbuild-windows-64@0.14.8": "sha512-/3pllNoy8mrz/E1rYalwiwwhzJBrYQhEapwAteHZbFVhGzYuB8F80e8x5eA8dhFHxDiZh1VzK+hREwwSt8UTQA==", | ||
"esbuild-windows-arm64@0.14.8": "sha512-lTm5naoNgaUvzIiax3XYIEebqwr3bIIEEtqUhzQ2UQ+JMBmvhr02w3sJIJqF3axTX6TgWrC1OtM7DYNvFG+aXA==", | ||
"esbuild@0.14.8": "sha512-stMsCBmxwaMpeK8GC/49L/cRGIwsHwoEN7Twk5zDTHlm/63c0KXFKzDC8iM2Mi3fyCKwS002TAH6IlAvqR6t3g==", | ||
"fill-range@7.0.1": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", | ||
@@ -38,6 +59,7 @@ "follow-redirects@1.14.6": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", | ||
"has-bigints@1.0.1": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", | ||
"has-flag@3.0.0": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", | ||
"has-flag@4.0.0": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", | ||
"has-symbols@1.0.2": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", | ||
"has-tostringtag@1.0.0": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", | ||
"has@1.0.3": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", | ||
"header-case@2.0.4": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", | ||
"internal-slot@1.0.3": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", | ||
@@ -69,4 +91,6 @@ "is-arguments@1.1.1": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", | ||
"isarray@2.0.5": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", | ||
"lower-case@2.0.2": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", | ||
"no-case@3.0.4": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", | ||
"normalize-path@3.0.0": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", | ||
"object-inspect@1.11.1": "sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA==", | ||
"object-inspect@1.12.0": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", | ||
"object-is@1.1.5": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", | ||
@@ -76,2 +100,3 @@ "object-keys@1.1.1": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", | ||
"open@8.4.0": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", | ||
"pascal-case@3.1.2": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", | ||
"picomatch@2.3.0": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", | ||
@@ -82,8 +107,11 @@ "readdirp@3.6.0": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", | ||
"side-channel@1.0.4": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", | ||
"snake-case@3.0.4": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", | ||
"string.prototype.trimend@1.0.4": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", | ||
"string.prototype.trimstart@1.0.4": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", | ||
"supports-color@5.5.0": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", | ||
"supports-color@7.2.0": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", | ||
"to-regex-range@5.0.1": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", | ||
"tslib@2.3.1": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", | ||
"typescript@4.5.4": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", | ||
"unbox-primitive@1.0.1": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", | ||
"upper-case-first@2.0.2": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", | ||
"which-boxed-primitive@1.0.2": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", | ||
@@ -90,0 +118,0 @@ "which-collection@1.0.1": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", |
{ | ||
"name": "@convex-dev/cli", | ||
"description": "Command-line interface for Convex Cloud backend.", | ||
"version": "0.0.36", | ||
"version": "0.0.42", | ||
"author": "Convex, Inc. <team@convex.dev>", | ||
@@ -12,12 +12,13 @@ "homepage": "https://convex.dev", | ||
"dependencies": { | ||
"esbuild": "^0.12.25", | ||
"axios-retry": "~3.2.4" | ||
"axios-case-converter": "~0.9.0", | ||
"axios-retry": "~3.2.4", | ||
"esbuild": "~0.14.8" | ||
}, | ||
"devDependencies": { | ||
"@convex-dev/bundler": "0.0.36", | ||
"@convex-dev/common": "0.0.36", | ||
"@convex-dev/bundler": "0.0.42", | ||
"@convex-dev/common": "0.0.42", | ||
"@types/deep-equal": "1.0.1", | ||
"@types/node": "^16.11.7", | ||
"axios": "0.21.4", | ||
"chalk": "^2.4.2", | ||
"axios": "~0.24.0", | ||
"chalk": "4", | ||
"chokidar": "3.5.2", | ||
@@ -24,0 +25,0 @@ "commander": "8.1.0", |
@@ -10,3 +10,7 @@ import chalk from "chalk"; | ||
import axiosRetry from "axios-retry"; | ||
import applyCaseMiddleware from "axios-case-converter"; | ||
export const provisionHost = | ||
process.env.CONVEX_PROVISION_HOST || "https://provision.convex.dev"; | ||
/** Type representing Convex index spec. */ | ||
@@ -20,2 +24,3 @@ export interface Index { | ||
export interface InstanceConfig { | ||
instanceName: string; | ||
origin: string; | ||
@@ -53,2 +58,5 @@ functions: string; | ||
} | ||
if (obj.instanceName && typeof obj.instanceName !== "string") { | ||
throw new ParseError("Expected instance name to be a string"); | ||
} | ||
if (typeof obj.functions !== "string") { | ||
@@ -62,3 +70,8 @@ throw new ParseError("Expected functions to be a string"); | ||
} | ||
return { origin: obj.origin, functions: obj.functions, indexes: obj.indexes }; | ||
return { | ||
origin: obj.origin, | ||
instanceName: obj.instanceName, | ||
functions: obj.functions, | ||
indexes: obj.indexes, | ||
}; | ||
} | ||
@@ -78,7 +91,7 @@ | ||
} catch (err) { | ||
if (err instanceof ParseError) { | ||
console.log(chalk.red('Error: Parsing "convex.json" failed')); | ||
console.log(chalk.gray(err.toString())); | ||
if (err instanceof ParseError || err instanceof SyntaxError) { | ||
console.error(chalk.red('Error: Parsing "convex.json" failed')); | ||
console.error(chalk.gray(err.toString())); | ||
} else { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -88,7 +101,7 @@ 'Error: Unable to read instance config file "convex.json" in current directory' | ||
); | ||
console.log( | ||
console.error( | ||
"Are you running this command from the root directory of a Convex app?" | ||
); | ||
if (err instanceof Error) { | ||
console.log(chalk.gray(err.message)); | ||
console.error(chalk.gray(err.message)); | ||
} | ||
@@ -102,5 +115,5 @@ } | ||
} catch (err) { | ||
console.log(chalk.red("Error: Unable to bundle convex modules")); | ||
console.error(chalk.red("Error: Unable to bundle convex modules")); | ||
if (err instanceof Error) { | ||
console.log(chalk.gray(err.message)); | ||
console.error(chalk.gray(err.message)); | ||
} | ||
@@ -125,3 +138,3 @@ process.exit(1); | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -131,11 +144,11 @@ `Error: Unable to open env file ".env.local" in current directory.` | ||
); | ||
console.log( | ||
console.error( | ||
"Are you running this command from the root directory of a Convex app?" | ||
); | ||
console.log( | ||
console.error( | ||
`If so, have you included your admin key as CONVEX_ADMIN_KEY environment variable in ".env.local"?` | ||
); | ||
console.log(""); | ||
console.log(" CONVEX_ADMIN_KEY=<your instance's admin key>"); | ||
console.log(""); | ||
console.error(""); | ||
console.error(" CONVEX_ADMIN_KEY=<your instance's admin key>"); | ||
console.error(""); | ||
process.exit(1); | ||
@@ -145,4 +158,4 @@ } | ||
const adminKey = envFile["CONVEX_ADMIN_KEY"]; | ||
if (!adminKey) { | ||
console.log( | ||
if (!adminKey || adminKey == "undefined") { | ||
console.error( | ||
chalk.red( | ||
@@ -152,8 +165,8 @@ `Error: We couldn't find the CONVEX_ADMIN_KEY environment variable in ".env.local".` | ||
); | ||
console.log( | ||
console.error( | ||
"Include your instance's admin key as the CONVEX_ADMIN_KEY environment variable." | ||
); | ||
console.log(""); | ||
console.log(" CONVEX_ADMIN_KEY=<your instance's admin key>"); | ||
console.log(""); | ||
console.error(""); | ||
console.error(" CONVEX_ADMIN_KEY=<your instance's admin key>"); | ||
console.error(""); | ||
process.exit(1); | ||
@@ -226,3 +239,3 @@ } | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -234,3 +247,3 @@ 'Error: Unable to open file "README.md" for writing in "' + | ||
); | ||
console.log( | ||
console.error( | ||
"Are you running this command from the root directory of a Convex app?" | ||
@@ -243,3 +256,3 @@ ); | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red('Error: Unable to write "README.md" in "' + functionsDir + '"') | ||
@@ -259,3 +272,3 @@ ); | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -265,3 +278,3 @@ 'Error: Unable to open instance config file "convex.json" for writing in current directory' | ||
); | ||
console.log( | ||
console.error( | ||
"Are you running this command from the root directory of a Convex app?" | ||
@@ -278,3 +291,3 @@ ); | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -297,3 +310,3 @@ 'Error: Unable to write instance config file "convex.json" in current directory' | ||
} catch (err) { | ||
console.log("README.md not written."); | ||
console.error("README.md not written."); | ||
} | ||
@@ -303,2 +316,6 @@ } | ||
export async function writeAdminKey(adminKey: string) { | ||
if (!adminKey) { | ||
console.error(chalk.red(`Error: unexpected - admin key is missing`)); | ||
process.exit(1); | ||
} | ||
let envLocalFile: fs.FileHandle; | ||
@@ -308,6 +325,6 @@ try { | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red('Error: Unable to open file ".env.local" in current directory') | ||
); | ||
console.log( | ||
console.error( | ||
"Are you running this command from the root directory of a Convex app?" | ||
@@ -320,3 +337,3 @@ ); | ||
} catch (err) { | ||
console.log( | ||
console.error( | ||
chalk.red('Error: Unable to write file ".env.local" in current directory') | ||
@@ -343,2 +360,3 @@ ); | ||
}); | ||
adminKey = process.env.CONVEX_ADMIN_KEY || adminKey; | ||
return client | ||
@@ -353,7 +371,9 @@ .post(`${origin}/api/${version}/get_config`, { version, adminKey }) | ||
.catch(function (err) { | ||
console.log( | ||
console.error( | ||
chalk.red("Error: Unable to pull instance config from", origin) | ||
); | ||
console.log(chalk.gray(err.message)); | ||
console.log(chalk.gray(err.response.data)); | ||
console.error(chalk.gray(err.message)); | ||
if (err.response) { | ||
console.error(chalk.gray(err.response.data)); | ||
} | ||
process.exit(1); | ||
@@ -382,8 +402,10 @@ }); | ||
): Promise<void> { | ||
adminKey = process.env.CONVEX_ADMIN_KEY || adminKey; | ||
const config = configJSON(instanceConfig, modules, adminKey); | ||
const origin = instanceConfig.origin; | ||
return axios | ||
.post(`${instanceConfig.origin}/api/${version}/push_config`, config) | ||
.post(`${origin}/api/${version}/push_config`, config) | ||
.then(function (res) {}) | ||
.catch(function (err) { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -394,4 +416,6 @@ "Error: Unable to push instance config to", | ||
); | ||
console.log(chalk.gray(err.message)); | ||
console.log(chalk.gray(err.response.data)); | ||
console.error(chalk.gray(err.message)); | ||
if (err.response) { | ||
console.error(chalk.gray(err.response.data)); | ||
} | ||
process.exit(1); | ||
@@ -512,3 +536,8 @@ }); | ||
betaKey?: string | ||
): Promise<{ instanceOrigin: string; adminKey: string }> { | ||
): Promise<{ | ||
instanceName: string; | ||
instanceOrigin: string; | ||
adminKey: string; | ||
redemptionsRemaining: number; | ||
}> { | ||
let provisioningArgs: ProvisionArgs = { | ||
@@ -519,6 +548,5 @@ version, | ||
}; | ||
const provisionHost = | ||
process.env.CONVEX_PROVISION_HOST || "https://provision.convex.dev"; | ||
const provisionUrl = `${provisionHost}/api/${version}/provision`; | ||
return axios | ||
const client = applyCaseMiddleware(axios.create()); | ||
return client | ||
.post(provisionUrl, provisioningArgs) | ||
@@ -528,3 +556,3 @@ .then(function (res) { | ||
if (res.data.error === "NEED_BETA_KEY") { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -534,9 +562,9 @@ "Error: a beta key is required to provision a convex backend." | ||
); | ||
console.log( | ||
console.error( | ||
chalk.gray( | ||
"Pass it with --betaKey; if you don't have one, sign up at https://convex.dev" | ||
"Pass it with --beta-key; if you don't have one, sign up at https://convex.dev" | ||
) | ||
); | ||
} else if (res.data.error === "KEY_EXHAUSTED") { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -546,7 +574,7 @@ "Error: this beta key has already been used the maximum number of times." | ||
); | ||
console.log( | ||
console.error( | ||
chalk.gray("Contact support@convex.dev to request a new key") | ||
); | ||
} else if (res.data.error === "EMAIL_NOT_ASSOCIATED_WITH_KEY") { | ||
console.log( | ||
console.error( | ||
chalk.red( | ||
@@ -556,10 +584,12 @@ "Error: the email provided is not associated with the given beta key." | ||
); | ||
console.log( | ||
console.error( | ||
chalk.gray("Contact support@convex.dev if this message is in error") | ||
); | ||
} else { | ||
console.log( | ||
chalk.red("Random error during provisioning: " + res.data.error) | ||
console.error( | ||
chalk.red( | ||
"Unknown error during provisioning: " + JSON.stringify(res.data) | ||
) | ||
); | ||
console.log( | ||
console.error( | ||
chalk.gray("Contact support@convex.dev if issue persists") | ||
@@ -570,12 +600,23 @@ ); | ||
} else { | ||
const instanceOrigin = | ||
process.env.CONVEX_INSTANCE_ORIGIN || res.data.url; | ||
const adminKey = process.env.CONVEX_ADMIN_KEY || res.data.admin_key; | ||
return { instanceOrigin: instanceOrigin, adminKey: adminKey }; | ||
const instanceOrigin = res.data.url; | ||
const instanceName = res.data.instanceName; | ||
const adminKey = res.data.adminKey; | ||
const redemptionsRemaining = res.data.redemptionsRemaining; | ||
if (!adminKey || !instanceOrigin || !redemptionsRemaining) { | ||
console.error( | ||
chalk.red( | ||
"Unknown error during provisioning: " + JSON.stringify(res.data) | ||
) | ||
); | ||
process.exit(1); | ||
} | ||
return { instanceName, instanceOrigin, adminKey, redemptionsRemaining }; | ||
} | ||
}) | ||
.catch(function (err) { | ||
console.log(chalk.red("Error: Unable to provision instance")); | ||
console.log(chalk.gray(err.message)); | ||
console.log(chalk.gray(err.response.data)); | ||
console.error(chalk.red("Error: Unable to provision instance")); | ||
console.error(chalk.gray(err.message)); | ||
if (err.response) { | ||
console.error(chalk.gray(err.response.data)); | ||
} | ||
process.exit(1); | ||
@@ -598,9 +639,11 @@ }); | ||
.catch(function (err) { | ||
console.log( | ||
console.error( | ||
chalk.red("Error: Unable to login to dashboard at ", instanceOrigin) | ||
); | ||
console.log(chalk.gray(err.message)); | ||
console.log(chalk.gray(err.response.data)); | ||
console.error(chalk.gray(err.message)); | ||
if (err.response) { | ||
console.error(chalk.gray(err.response.data)); | ||
} | ||
process.exit(1); | ||
}); | ||
} |
@@ -6,2 +6,3 @@ #!/usr/bin/env node | ||
import { dashboard } from "./dashboard"; | ||
import { deactivate } from "./deactivate"; | ||
@@ -12,6 +13,4 @@ const program = new Command(); | ||
program.addCommand(dashboard); | ||
program.addCommand(deactivate); | ||
program | ||
.parseAsync(process.argv) | ||
.catch(console.error) | ||
.finally(() => process.exit()); | ||
program.parseAsync(process.argv); |
@@ -14,3 +14,3 @@ import { Command } from "commander"; | ||
.option( | ||
"--betaKey <key>", | ||
"--beta-key <key>", | ||
"Your Convex beta key that grants you access to the closed beta" | ||
@@ -20,4 +20,4 @@ ) | ||
if (fs.existsSync("convex.json")) { | ||
console.log(chalk.red('File "convex.json" already exists.')); | ||
console.log( | ||
console.error(chalk.red('File "convex.json" already exists.')); | ||
console.error( | ||
"Remove this file to create a new project or use `convex push` to apply changes." | ||
@@ -28,4 +28,4 @@ ); | ||
if (fs.existsSync(".env.local")) { | ||
console.log(chalk.red('File ".env.local" already exists.')); | ||
console.log("Remove this file to create a new project."); | ||
console.error(chalk.red('File ".env.local" already exists.')); | ||
console.error("Remove this file to create a new project."); | ||
process.exit(1); | ||
@@ -52,3 +52,6 @@ } | ||
const { instanceOrigin, adminKey } = await provision(email, betaKey); | ||
const { instanceOrigin, adminKey, redemptionsRemaining } = await provision( | ||
email, | ||
betaKey | ||
); | ||
// Clear spinner. | ||
@@ -63,3 +66,3 @@ clearInterval(spinner); | ||
if (modules.length > 0) { | ||
console.log(chalk.red("Error: Unexpected modules in new project")); | ||
console.error(chalk.red("Error: Unexpected modules in new project")); | ||
process.exit(1); | ||
@@ -69,3 +72,7 @@ } | ||
await writeConfig(instanceConfig); | ||
console.log(chalk.green("Done!")); | ||
console.log( | ||
chalk.green( | ||
`Done! Beta key now has ${redemptionsRemaining} redemptions remaining` | ||
) | ||
); | ||
@@ -72,0 +79,0 @@ console.log( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
423876
11379
23
3
+ Addedaxios-case-converter@~0.9.0
+ Added@esbuild/linux-loong64@0.14.54(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.28.1(transitive)
+ Addedaxios-case-converter@0.9.0(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedcapital-case@1.0.4(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddot-case@3.0.4(transitive)
+ Addedesbuild@0.14.54(transitive)
+ Addedesbuild-android-64@0.14.54(transitive)
+ Addedesbuild-android-arm64@0.14.54(transitive)
+ Addedesbuild-darwin-64@0.14.54(transitive)
+ Addedesbuild-darwin-arm64@0.14.54(transitive)
+ Addedesbuild-freebsd-64@0.14.54(transitive)
+ Addedesbuild-freebsd-arm64@0.14.54(transitive)
+ Addedesbuild-linux-32@0.14.54(transitive)
+ Addedesbuild-linux-64@0.14.54(transitive)
+ Addedesbuild-linux-arm@0.14.54(transitive)
+ Addedesbuild-linux-arm64@0.14.54(transitive)
+ Addedesbuild-linux-mips64le@0.14.54(transitive)
+ Addedesbuild-linux-ppc64le@0.14.54(transitive)
+ Addedesbuild-linux-riscv64@0.14.54(transitive)
+ Addedesbuild-linux-s390x@0.14.54(transitive)
+ Addedesbuild-netbsd-64@0.14.54(transitive)
+ Addedesbuild-openbsd-64@0.14.54(transitive)
+ Addedesbuild-sunos-64@0.14.54(transitive)
+ Addedesbuild-windows-32@0.14.54(transitive)
+ Addedesbuild-windows-64@0.14.54(transitive)
+ Addedesbuild-windows-arm64@0.14.54(transitive)
+ Addedfollow-redirects@1.15.6(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedheader-case@2.0.4(transitive)
+ Addedlower-case@2.0.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedno-case@3.0.4(transitive)
+ Addedpascal-case@3.1.2(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedsnake-case@3.0.4(transitive)
+ Addedtslib@2.6.2(transitive)
+ Addedupper-case-first@2.0.2(transitive)
- Removedesbuild@0.12.29(transitive)
Updatedesbuild@~0.14.8