Merge pull request #106 from appwrite/feat-api-keys

feat: api keys
This commit is contained in:
Torsten Dittmann authored and GitHub committed 2022-11-03 15:55:26 +01:00
commit d4f20ca370
15 files changed
+225 -575

No files matched your search

+14 -497
View File
@@ -9,8 +9,8 @@
"version": "0.0.1",
"dependencies": {
"@aw-labs/appwrite-console": "^10.0.0",
"@aw-labs/icons": "0.0.0-66",
"@aw-labs/ui": "0.0.0-66",
"@aw-labs/icons": "0.0.0-68",
"@aw-labs/ui": "0.0.0-68",
"@popperjs/core": "^2.11.6",
"echarts": "^5.4.0",
"prismjs": "^1.29.0",
@@ -80,14 +80,14 @@
}
},
"node_modules/@aw-labs/icons": {
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-66.tgz",
"integrity": "sha512-3r6pxixYZ6Bn9QTUbFk8XYwds+CHz1baRkOVsQ5HoFz6XgvzTWn3/+pvZZ56Ht2Ek//wr4wwI30pdCXaX4QIsA=="
"version": "0.0.0-68",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-68.tgz",
"integrity": "sha512-sLaaDCjVUysdfatBtis/p8ggphEi1GlhJHnYAzERBJ9iX6lyvT61UXDADOk27GxL8h9fJJ+J1Q8BEF0QfTHooQ=="
},
"node_modules/@aw-labs/ui": {
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-66.tgz",
"integrity": "sha512-5qFISwKzOyZq7Ix5FG/BhVKEcIMXd2/Y8Ioba+ejTQ8B9hzj6FlwxUw7hLT49ZDhU+kxpjJQV51hRpbHGvmEag==",
"version": "0.0.0-68",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-68.tgz",
"integrity": "sha512-1MdyKxo/8tETxp5CKCI56IhadAUxGBTT6bGxr/IfMORWQkDdGLF+y2xwjLq8md+tEBxQv7akkXu1jCzpl6Wf/Q==",
"dependencies": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
@@ -721,38 +721,6 @@
"dev": true,
"peer": true
},
"node_modules/@esbuild/android-arm": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.10.tgz",
"integrity": "sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz",
"integrity": "sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg==",
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@eslint/eslintrc": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@@ -2899,54 +2867,6 @@
"esbuild-windows-arm64": "0.15.10"
}
},
"node_modules/esbuild-android-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz",
"integrity": "sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-android-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz",
"integrity": "sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz",
"integrity": "sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz",
@@ -2963,262 +2883,6 @@
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz",
"integrity": "sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz",
"integrity": "sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-32": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz",
"integrity": "sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz",
"integrity": "sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz",
"integrity": "sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz",
"integrity": "sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-mips64le": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz",
"integrity": "sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-ppc64le": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz",
"integrity": "sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-riscv64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz",
"integrity": "sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-s390x": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz",
"integrity": "sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-netbsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz",
"integrity": "sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-openbsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz",
"integrity": "sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-sunos-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz",
"integrity": "sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-32": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz",
"integrity": "sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz",
"integrity": "sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz",
"integrity": "sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
@@ -7791,14 +7455,14 @@
}
},
"@aw-labs/icons": {
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-66.tgz",
"integrity": "sha512-3r6pxixYZ6Bn9QTUbFk8XYwds+CHz1baRkOVsQ5HoFz6XgvzTWn3/+pvZZ56Ht2Ek//wr4wwI30pdCXaX4QIsA=="
"version": "0.0.0-68",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-68.tgz",
"integrity": "sha512-sLaaDCjVUysdfatBtis/p8ggphEi1GlhJHnYAzERBJ9iX6lyvT61UXDADOk27GxL8h9fJJ+J1Q8BEF0QfTHooQ=="
},
"@aw-labs/ui": {
"version": "0.0.0-66",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-66.tgz",
"integrity": "sha512-5qFISwKzOyZq7Ix5FG/BhVKEcIMXd2/Y8Ioba+ejTQ8B9hzj6FlwxUw7hLT49ZDhU+kxpjJQV51hRpbHGvmEag==",
"version": "0.0.0-68",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-68.tgz",
"integrity": "sha512-1MdyKxo/8tETxp5CKCI56IhadAUxGBTT6bGxr/IfMORWQkDdGLF+y2xwjLq8md+tEBxQv7akkXu1jCzpl6Wf/Q==",
"requires": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
@@ -8291,20 +7955,6 @@
"dev": true,
"peer": true
},
"@esbuild/android-arm": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.10.tgz",
"integrity": "sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg==",
"dev": true,
"optional": true
},
"@esbuild/linux-loong64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz",
"integrity": "sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg==",
"dev": true,
"optional": true
},
"@eslint/eslintrc": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@@ -9991,27 +9641,6 @@
"esbuild-windows-arm64": "0.15.10"
}
},
"esbuild-android-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz",
"integrity": "sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA==",
"dev": true,
"optional": true
},
"esbuild-android-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz",
"integrity": "sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg==",
"dev": true,
"optional": true
},
"esbuild-darwin-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz",
"integrity": "sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA==",
"dev": true,
"optional": true
},
"esbuild-darwin-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz",
@@ -10019,118 +9648,6 @@
"dev": true,
"optional": true
},
"esbuild-freebsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz",
"integrity": "sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w==",
"dev": true,
"optional": true
},
"esbuild-freebsd-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz",
"integrity": "sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg==",
"dev": true,
"optional": true
},
"esbuild-linux-32": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz",
"integrity": "sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w==",
"dev": true,
"optional": true
},
"esbuild-linux-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz",
"integrity": "sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA==",
"dev": true,
"optional": true
},
"esbuild-linux-arm": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz",
"integrity": "sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A==",
"dev": true,
"optional": true
},
"esbuild-linux-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz",
"integrity": "sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A==",
"dev": true,
"optional": true
},
"esbuild-linux-mips64le": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz",
"integrity": "sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q==",
"dev": true,
"optional": true
},
"esbuild-linux-ppc64le": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz",
"integrity": "sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ==",
"dev": true,
"optional": true
},
"esbuild-linux-riscv64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz",
"integrity": "sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q==",
"dev": true,
"optional": true
},
"esbuild-linux-s390x": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz",
"integrity": "sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA==",
"dev": true,
"optional": true
},
"esbuild-netbsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz",
"integrity": "sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw==",
"dev": true,
"optional": true
},
"esbuild-openbsd-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz",
"integrity": "sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ==",
"dev": true,
"optional": true
},
"esbuild-sunos-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz",
"integrity": "sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg==",
"dev": true,
"optional": true
},
"esbuild-windows-32": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz",
"integrity": "sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg==",
"dev": true,
"optional": true
},
"esbuild-windows-64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz",
"integrity": "sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA==",
"dev": true,
"optional": true
},
"esbuild-windows-arm64": {
"version": "0.15.10",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz",
"integrity": "sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw==",
"dev": true,
"optional": true
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+2 -2
View File
@@ -20,8 +20,8 @@
},
"dependencies": {
"@aw-labs/appwrite-console": "^10.0.0",
"@aw-labs/icons": "0.0.0-66",
"@aw-labs/ui": "0.0.0-66",
"@aw-labs/icons": "0.0.0-68",
"@aw-labs/ui": "0.0.0-68",
"@popperjs/core": "^2.11.6",
"echarts": "^5.4.0",
"prismjs": "^1.29.0",
+9 -1
View File
@@ -1,13 +1,21 @@
<script lang="ts">
export let withIndentation = false;
</script>
<li class="collapsible-item">
<details class="collapsible-wrapper">
<summary class="collapsible-button">
<slot name="beforetitle" />
<span class="text"><slot name="title" /></span>
<span class="collapsible-button-optional"><slot name="subtitle" /></span>
<div class="icon">
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</summary>
<div class="collapsible-content">
<div
class="collapsible-content"
class:u-margin-block-start-8={withIndentation}
class:u-padding-inline-32={withIndentation}>
<slot />
</div>
</details>
+5 -1
View File
@@ -33,7 +33,11 @@ export enum Dependencies {
WEBHOOKS = 'dependency:webhooks'
}
export const scopes = [
export const scopes: {
scope: string;
description: string;
category: string;
}[] = [
{
scope: 'users.read',
description: "Access to read your project's users",
-1
View File
@@ -26,7 +26,6 @@ const setProviders = (project: Models.Project): Provider[] => {
switch (n.name.toLowerCase()) {
case 'amazon':
console.log(n);
docs = 'https://developer.amazon.com/apps-and-games/services-and-apis';
break;
case 'apple':
@@ -15,11 +15,9 @@
import { Dependencies } from '$lib/constants';
async function onFinish() {
console.log(2);
await invalidate(Dependencies.FUNCTIONS);
}
async function create() {
console.log(1);
try {
const response = await sdkForProject.functions.create(
$createFunction.id ?? 'unique()',
@@ -12,7 +12,6 @@
$: projectId = $page.params.project;
$: path = `/console/project-${projectId}/overview`;
$: console.log($stats.get(projectId));
let period: UsagePeriods = '30d';
let showPeriodBandwidth = false;
let showPeriodRequests = false;
@@ -10,16 +10,21 @@
TableRowLink
} from '$lib/elements/table';
import { toLocaleDateTime } from '$lib/helpers/date';
import { wizard } from '$lib/stores/wizard';
import type { PageData } from './$types';
import Create from './create.svelte';
import Wizard from './wizard.svelte';
export let data: PageData;
let show = false;
function create() {
wizard.start(Wizard);
}
</script>
<div class="common-section u-flex u-gap-12">
<Heading tag="h3" size="7">API Keys</Heading>
<span class="u-margin-inline-start-auto">
<Button on:click={() => (show = true)}>
<Button on:click={create}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create API Key</span>
</Button>
@@ -32,7 +37,7 @@
<TableCellHead>Name</TableCellHead>
<TableCellHead>last accessed</TableCellHead>
<TableCellHead>expiration date</TableCellHead>
<TableCellHead>clients</TableCellHead>
<TableCellHead>scopes</TableCellHead>
</TableHeader>
<TableBody>
{#each data.keys.keys as key}
@@ -44,15 +49,17 @@
{key.accessedAt ? toLocaleDateTime(key.accessedAt) : 'never'}
</TableCellText>
<TableCellText title="Expiration Date">
{toLocaleDateTime(key.$updatedAt)}
{key.expire ? toLocaleDateTime(key.expire) : 'never'}
</TableCellText>
<TableCellText title="Expiration Date">
{key.scopes.length} Scopes
</TableCellText>
<TableCellText title="Clients" />
</TableRowLink>
{/each}
</TableBody>
</Table>
{:else}
<Empty isButton single on:click={() => (show = true)}>
<Empty isButton single on:click={create}>
<div class="u-text-center">
<p class="text u-line-height-1-5">Create your first API Key to get started</p>
<p class="text u-line-height-1-5">Need a hand? Check out our documentation.</p>
@@ -63,5 +70,3 @@
</div>
</Empty>
{/if}
<Create bind:show />
@@ -18,7 +18,7 @@
let name: string = null;
let secret: string = null;
let expire: string = null;
let scopes: string[] = [];
let scopes: string[] = null;
onMount(() => {
name ??= $key.name;
@@ -135,16 +135,20 @@
practice to allow only the permissions you need to meet your project goals.
</p>
<svelte:fragment slot="aside">
<Scopes bind:scopes />
{#if scopes !== null}
<Scopes bind:scopes />
{/if}
</svelte:fragment>
<svelte:fragment slot="actions">
<Button
submit
disabled={!(
difference(scopes, $key.scopes).length !== 0 ||
difference($key.scopes, scopes).length !== 0
)}>Update</Button>
disabled={scopes &&
$key?.scopes &&
!(
difference(scopes, $key.scopes).length !== 0 ||
difference($key.scopes, scopes).length !== 0
)}>Update</Button>
</svelte:fragment>
</CardGrid>
</Form>
@@ -1,42 +0,0 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { InputText, Button, FormList } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { project } from '../../.../../store';
import Scopes from './scopes.svelte';
export let show = false;
let name: string;
let scopes: string[] = [];
async function create() {
try {
await sdkForConsole.projects.createKey($project.$id, name, scopes);
name = null;
scopes = [];
invalidate(Dependencies.KEYS);
show = false;
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
}
}
</script>
<Modal bind:show on:submit={create} size="big">
<svelte:fragment slot="header">Create API Key</svelte:fragment>
<FormList>
<InputText id="name" label="Name" bind:value={name} autofocus required />
<Scopes bind:scopes />
</FormList>
<svelte:fragment slot="footer">
<Button submit>Register</Button>
<Button secondary on:click={() => (show = false)}>Cancel</Button>
</svelte:fragment>
</Modal>
@@ -7,6 +7,14 @@
export let scopes: string[];
enum Category {
Authentication = 'Authentication',
Database = 'Database',
Functions = 'Functions',
Storage = 'Storage',
Other = 'Other'
}
let mounted = false;
onMount(() => {
@@ -28,6 +36,29 @@
}
}
function categoryState(category: string, s: string[]): boolean | null {
const scopesByCategory = allScopes.filter((n) => n.category === category);
const filtered = scopesByCategory.filter((n) => s.includes(n.scope));
if (filtered.length === 0) {
return false;
} else if (filtered.length === scopesByCategory.length) {
return true;
} else {
return null;
}
}
function onCategoryChange(
event: Event & { currentTarget: EventTarget & HTMLInputElement },
category: Category
) {
allScopes.forEach((s) => {
if (s.category === category) {
activeScopes[s.scope] = event.currentTarget.checked;
}
});
}
const activeScopes = allScopes.reduce((prev, next) => {
prev[next.scope] = false;
@@ -54,19 +85,35 @@
<Button text on:click={selectAll}>Select all</Button>
</div>
<Collapsible>
{#each ['Authentication', 'Database', 'Functions', 'Storage', 'Other'] as category}
<CollapsibleItem>
<svelte:fragment slot="title">{category}</svelte:fragment>
<FormList>
{#each allScopes.filter((s) => s.category === category) as scope}
<InputChoice
id={scope.scope}
label={scope.scope}
bind:value={activeScopes[scope.scope]}>
{scope.description}
</InputChoice>
{/each}
</FormList>
{#each [Category.Authentication, Category.Database, Category.Functions, Category.Storage, Category.Other] as category}
{@const checked = categoryState(category, scopes)}
<CollapsibleItem withIndentation>
<svelte:fragment slot="beforetitle">
<input
type="checkbox"
{checked}
indeterminate={checked === null ? true : false}
on:change={(e) => onCategoryChange(e, category)} />
</svelte:fragment>
<svelte:fragment slot="title">
{category}
</svelte:fragment>
<svelte:fragment slot="subtitle">
({allScopes.filter((n) => n.category === category && scopes.includes(n.scope))
.length} Scopes)
</svelte:fragment>
<div class="form">
<FormList>
{#each allScopes.filter((s) => s.category === category) as scope}
<InputChoice
id={scope.scope}
label={scope.scope}
bind:value={activeScopes[scope.scope]}>
{scope.description}
</InputChoice>
{/each}
</FormList>
</div>
</CollapsibleItem>
{/each}
</Collapsible>
@@ -0,0 +1,50 @@
<script lang="ts">
import { Wizard } from '$lib/layout';
import { beforeNavigate, goto } from '$app/navigation';
import { wizard } from '$lib/stores/wizard';
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
import Step1 from './wizard/step1.svelte';
import Step2 from './wizard/step2.svelte';
import { key } from './wizard/store';
import { sdkForConsole } from '$lib/stores/sdk';
import { page } from '$app/stores';
import { addNotification } from '$lib/stores/notifications';
import { onDestroy } from 'svelte';
async function onFinish() {
try {
const { $id } = await sdkForConsole.projects.createKey(
$page.params.project,
$key.name,
$key.scopes,
$key.expire ?? undefined
);
goto(`/console/project-${$page.params.project}/overview/keys/${$id}`);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
}
}
onDestroy(() => {
key.reset();
});
beforeNavigate(() => {
wizard.hide();
});
const stepsComponents: WizardStepsType = new Map();
stepsComponents.set(1, {
label: 'Details',
component: Step1
});
stepsComponents.set(2, {
label: 'Scopes',
component: Step2
});
</script>
<Wizard title="Create an API Key" steps={stepsComponents} on:finish={onFinish} />
@@ -0,0 +1,19 @@
<script lang="ts">
import { FormList, InputText, InputDateTime } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
import { key } from './store';
</script>
<WizardStep>
<svelte:fragment slot="title">Create an API Key</svelte:fragment>
<svelte:fragment slot="subtitle">Let's create an API Key.</svelte:fragment>
<FormList>
<InputText
id="name"
label="Name"
placeholder="API Key Name"
required
bind:value={$key.name} />
<InputDateTime id="expire" label="Expiration Date" bind:value={$key.expire} />
</FormList>
</WizardStep>
@@ -0,0 +1,17 @@
<script lang="ts">
import { FormList } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
import Scopes from '../scopes.svelte';
import { key } from './store';
</script>
<WizardStep>
<svelte:fragment slot="title">Add Scopes</svelte:fragment>
<svelte:fragment slot="subtitle">
Choose which permission scopes to grant your application. It is best practice to allow only
the permissions you need to meet your project goals.
</svelte:fragment>
<FormList>
<Scopes bind:scopes={$key.scopes} />
</FormList>
</WizardStep>
@@ -0,0 +1,25 @@
import { writable } from 'svelte/store';
import type { Models } from '@aw-labs/appwrite-console';
function createKeyStore() {
const { subscribe, update, set } = writable<Partial<Models.Key>>({
name: null,
expire: null,
scopes: []
});
return {
subscribe,
update,
set,
reset() {
set({
name: null,
expire: null,
scopes: []
});
}
};
}
export const key = createKeyStore();