Commit f4c422c6 authored by nanahira's avatar nanahira

bump an add http things

parent 6ed2bf93
...@@ -9,15 +9,18 @@ ...@@ -9,15 +9,18 @@
"version": "1.0.1", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"cordis-decorators": "^1.0.7", "cordis-decorators": "^1.0.8",
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^28.1.6", "@types/jest": "^28.1.6",
"@types/koa": "^2.13.5",
"@types/koa__router": "^8.0.11",
"@types/lodash": "^4.14.182", "@types/lodash": "^4.14.182",
"@types/node": "^18.0.6", "@types/node": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0", "@typescript-eslint/parser": "^4.33.0",
"cordis": "^2.0.6",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
...@@ -1184,7 +1187,6 @@ ...@@ -1184,7 +1187,6 @@
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==",
"peer": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -1234,7 +1236,6 @@ ...@@ -1234,7 +1236,6 @@
"version": "1.19.2", "version": "1.19.2",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
"peer": true,
"dependencies": { "dependencies": {
"@types/connect": "*", "@types/connect": "*",
"@types/node": "*" "@types/node": "*"
...@@ -1244,7 +1245,6 @@ ...@@ -1244,7 +1245,6 @@
"version": "3.4.35", "version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
"peer": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -1252,14 +1252,12 @@ ...@@ -1252,14 +1252,12 @@
"node_modules/@types/content-disposition": { "node_modules/@types/content-disposition": {
"version": "0.5.5", "version": "0.5.5",
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz", "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz",
"integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==", "integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA=="
"peer": true
}, },
"node_modules/@types/cookies": { "node_modules/@types/cookies": {
"version": "0.7.7", "version": "0.7.7",
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz", "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz",
"integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==", "integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==",
"peer": true,
"dependencies": { "dependencies": {
"@types/connect": "*", "@types/connect": "*",
"@types/express": "*", "@types/express": "*",
...@@ -1271,7 +1269,6 @@ ...@@ -1271,7 +1269,6 @@
"version": "4.17.13", "version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
"peer": true,
"dependencies": { "dependencies": {
"@types/body-parser": "*", "@types/body-parser": "*",
"@types/express-serve-static-core": "^4.17.18", "@types/express-serve-static-core": "^4.17.18",
...@@ -1283,7 +1280,6 @@ ...@@ -1283,7 +1280,6 @@
"version": "4.17.29", "version": "4.17.29",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz",
"integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==",
"peer": true,
"dependencies": { "dependencies": {
"@types/node": "*", "@types/node": "*",
"@types/qs": "*", "@types/qs": "*",
...@@ -1302,14 +1298,12 @@ ...@@ -1302,14 +1298,12 @@
"node_modules/@types/http-assert": { "node_modules/@types/http-assert": {
"version": "1.5.3", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz", "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
"integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==", "integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA=="
"peer": true
}, },
"node_modules/@types/http-errors": { "node_modules/@types/http-errors": {
"version": "1.8.2", "version": "1.8.2",
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz",
"integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==", "integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w=="
"peer": true
}, },
"node_modules/@types/istanbul-lib-coverage": { "node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.4", "version": "2.0.4",
...@@ -1354,14 +1348,12 @@ ...@@ -1354,14 +1348,12 @@
"node_modules/@types/keygrip": { "node_modules/@types/keygrip": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz",
"integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==", "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw=="
"peer": true
}, },
"node_modules/@types/koa": { "node_modules/@types/koa": {
"version": "2.13.5", "version": "2.13.5",
"resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.5.tgz", "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.5.tgz",
"integrity": "sha512-HSUOdzKz3by4fnqagwthW/1w/yJspTgppyyalPVbgZf8jQWvdIXcVW5h2DGtw4zYntOaeRGx49r1hxoPWrD4aA==", "integrity": "sha512-HSUOdzKz3by4fnqagwthW/1w/yJspTgppyyalPVbgZf8jQWvdIXcVW5h2DGtw4zYntOaeRGx49r1hxoPWrD4aA==",
"peer": true,
"dependencies": { "dependencies": {
"@types/accepts": "*", "@types/accepts": "*",
"@types/content-disposition": "*", "@types/content-disposition": "*",
...@@ -1377,7 +1369,6 @@ ...@@ -1377,7 +1369,6 @@
"version": "8.0.11", "version": "8.0.11",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.11.tgz", "resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.11.tgz",
"integrity": "sha512-WXgKWpBsbS14kzmzD9LeFapOIa678h7zvUHxDwXwSx4ETKXhXLVUAToX6jZ/U7EihM7qwyD9W/BZvB0MRu7MTQ==", "integrity": "sha512-WXgKWpBsbS14kzmzD9LeFapOIa678h7zvUHxDwXwSx4ETKXhXLVUAToX6jZ/U7EihM7qwyD9W/BZvB0MRu7MTQ==",
"peer": true,
"dependencies": { "dependencies": {
"@types/koa": "*" "@types/koa": "*"
} }
...@@ -1386,7 +1377,6 @@ ...@@ -1386,7 +1377,6 @@
"version": "3.2.5", "version": "3.2.5",
"resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz",
"integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==",
"peer": true,
"dependencies": { "dependencies": {
"@types/koa": "*" "@types/koa": "*"
} }
...@@ -1400,8 +1390,7 @@ ...@@ -1400,8 +1390,7 @@
"node_modules/@types/mime": { "node_modules/@types/mime": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
"peer": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.0.6", "version": "18.0.6",
...@@ -1417,20 +1406,17 @@ ...@@ -1417,20 +1406,17 @@
"node_modules/@types/qs": { "node_modules/@types/qs": {
"version": "6.9.7", "version": "6.9.7",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
"peer": true
}, },
"node_modules/@types/range-parser": { "node_modules/@types/range-parser": {
"version": "1.2.4", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
"peer": true
}, },
"node_modules/@types/serve-static": { "node_modules/@types/serve-static": {
"version": "1.13.10", "version": "1.13.10",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
"peer": true,
"dependencies": { "dependencies": {
"@types/mime": "^1", "@types/mime": "^1",
"@types/node": "*" "@types/node": "*"
...@@ -2254,15 +2240,14 @@ ...@@ -2254,15 +2240,14 @@
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz", "resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz",
"integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==", "integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==",
"peer": true,
"dependencies": { "dependencies": {
"cosmokit": "^1.2.1" "cosmokit": "^1.2.1"
} }
}, },
"node_modules/cordis-decorators": { "node_modules/cordis-decorators": {
"version": "1.0.7", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/cordis-decorators/-/cordis-decorators-1.0.7.tgz", "resolved": "https://registry.npmjs.org/cordis-decorators/-/cordis-decorators-1.0.8.tgz",
"integrity": "sha512-8EWWWhMbNNLajrKlQN7qr6gtMRU56bXott3Ee0Bve0yumvx/a/1m7sMxh+isZR76SvOEB60eCVxPn3uNYV0ycQ==", "integrity": "sha512-VeNNr+1PlUKet3zZajK22tcuPJ56GY7dXfaHahH3XaxblDSr/nIoDbOzhaZYJZbjDs21EjgPWYzFWLv3zajYRQ==",
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mustache": "^4.2.0", "mustache": "^4.2.0",
...@@ -2285,8 +2270,7 @@ ...@@ -2285,8 +2270,7 @@
"node_modules/cosmokit": { "node_modules/cosmokit": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.2.1.tgz", "resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.2.1.tgz",
"integrity": "sha512-BTn7vRr31WUwX7Tq8Q/r+Qz+LPKTE3vA0d7xzVaYNes2NPvGPmIWiljYP0m/PIrdpqLLtdHpY1zGNr+OwDhA7A==", "integrity": "sha512-BTn7vRr31WUwX7Tq8Q/r+Qz+LPKTE3vA0d7xzVaYNes2NPvGPmIWiljYP0m/PIrdpqLLtdHpY1zGNr+OwDhA7A=="
"peer": true
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.3",
...@@ -7154,7 +7138,6 @@ ...@@ -7154,7 +7138,6 @@
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==",
"peer": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -7204,7 +7187,6 @@ ...@@ -7204,7 +7187,6 @@
"version": "1.19.2", "version": "1.19.2",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
"peer": true,
"requires": { "requires": {
"@types/connect": "*", "@types/connect": "*",
"@types/node": "*" "@types/node": "*"
...@@ -7214,7 +7196,6 @@ ...@@ -7214,7 +7196,6 @@
"version": "3.4.35", "version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
"peer": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
...@@ -7222,14 +7203,12 @@ ...@@ -7222,14 +7203,12 @@
"@types/content-disposition": { "@types/content-disposition": {
"version": "0.5.5", "version": "0.5.5",
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz", "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz",
"integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==", "integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA=="
"peer": true
}, },
"@types/cookies": { "@types/cookies": {
"version": "0.7.7", "version": "0.7.7",
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz", "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz",
"integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==", "integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==",
"peer": true,
"requires": { "requires": {
"@types/connect": "*", "@types/connect": "*",
"@types/express": "*", "@types/express": "*",
...@@ -7241,7 +7220,6 @@ ...@@ -7241,7 +7220,6 @@
"version": "4.17.13", "version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
"peer": true,
"requires": { "requires": {
"@types/body-parser": "*", "@types/body-parser": "*",
"@types/express-serve-static-core": "^4.17.18", "@types/express-serve-static-core": "^4.17.18",
...@@ -7253,7 +7231,6 @@ ...@@ -7253,7 +7231,6 @@
"version": "4.17.29", "version": "4.17.29",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz",
"integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==",
"peer": true,
"requires": { "requires": {
"@types/node": "*", "@types/node": "*",
"@types/qs": "*", "@types/qs": "*",
...@@ -7272,14 +7249,12 @@ ...@@ -7272,14 +7249,12 @@
"@types/http-assert": { "@types/http-assert": {
"version": "1.5.3", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz", "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
"integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==", "integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA=="
"peer": true
}, },
"@types/http-errors": { "@types/http-errors": {
"version": "1.8.2", "version": "1.8.2",
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz",
"integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==", "integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w=="
"peer": true
}, },
"@types/istanbul-lib-coverage": { "@types/istanbul-lib-coverage": {
"version": "2.0.4", "version": "2.0.4",
...@@ -7324,14 +7299,12 @@ ...@@ -7324,14 +7299,12 @@
"@types/keygrip": { "@types/keygrip": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz",
"integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==", "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw=="
"peer": true
}, },
"@types/koa": { "@types/koa": {
"version": "2.13.5", "version": "2.13.5",
"resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.5.tgz", "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.5.tgz",
"integrity": "sha512-HSUOdzKz3by4fnqagwthW/1w/yJspTgppyyalPVbgZf8jQWvdIXcVW5h2DGtw4zYntOaeRGx49r1hxoPWrD4aA==", "integrity": "sha512-HSUOdzKz3by4fnqagwthW/1w/yJspTgppyyalPVbgZf8jQWvdIXcVW5h2DGtw4zYntOaeRGx49r1hxoPWrD4aA==",
"peer": true,
"requires": { "requires": {
"@types/accepts": "*", "@types/accepts": "*",
"@types/content-disposition": "*", "@types/content-disposition": "*",
...@@ -7347,7 +7320,6 @@ ...@@ -7347,7 +7320,6 @@
"version": "8.0.11", "version": "8.0.11",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.11.tgz", "resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.11.tgz",
"integrity": "sha512-WXgKWpBsbS14kzmzD9LeFapOIa678h7zvUHxDwXwSx4ETKXhXLVUAToX6jZ/U7EihM7qwyD9W/BZvB0MRu7MTQ==", "integrity": "sha512-WXgKWpBsbS14kzmzD9LeFapOIa678h7zvUHxDwXwSx4ETKXhXLVUAToX6jZ/U7EihM7qwyD9W/BZvB0MRu7MTQ==",
"peer": true,
"requires": { "requires": {
"@types/koa": "*" "@types/koa": "*"
} }
...@@ -7356,7 +7328,6 @@ ...@@ -7356,7 +7328,6 @@
"version": "3.2.5", "version": "3.2.5",
"resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz",
"integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==",
"peer": true,
"requires": { "requires": {
"@types/koa": "*" "@types/koa": "*"
} }
...@@ -7370,8 +7341,7 @@ ...@@ -7370,8 +7341,7 @@
"@types/mime": { "@types/mime": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
"peer": true
}, },
"@types/node": { "@types/node": {
"version": "18.0.6", "version": "18.0.6",
...@@ -7387,20 +7357,17 @@ ...@@ -7387,20 +7357,17 @@
"@types/qs": { "@types/qs": {
"version": "6.9.7", "version": "6.9.7",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
"peer": true
}, },
"@types/range-parser": { "@types/range-parser": {
"version": "1.2.4", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
"peer": true
}, },
"@types/serve-static": { "@types/serve-static": {
"version": "1.13.10", "version": "1.13.10",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
"peer": true,
"requires": { "requires": {
"@types/mime": "^1", "@types/mime": "^1",
"@types/node": "*" "@types/node": "*"
...@@ -7991,15 +7958,14 @@ ...@@ -7991,15 +7958,14 @@
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz", "resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz",
"integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==", "integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==",
"peer": true,
"requires": { "requires": {
"cosmokit": "^1.2.1" "cosmokit": "^1.2.1"
} }
}, },
"cordis-decorators": { "cordis-decorators": {
"version": "1.0.7", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/cordis-decorators/-/cordis-decorators-1.0.7.tgz", "resolved": "https://registry.npmjs.org/cordis-decorators/-/cordis-decorators-1.0.8.tgz",
"integrity": "sha512-8EWWWhMbNNLajrKlQN7qr6gtMRU56bXott3Ee0Bve0yumvx/a/1m7sMxh+isZR76SvOEB60eCVxPn3uNYV0ycQ==", "integrity": "sha512-VeNNr+1PlUKet3zZajK22tcuPJ56GY7dXfaHahH3XaxblDSr/nIoDbOzhaZYJZbjDs21EjgPWYzFWLv3zajYRQ==",
"requires": { "requires": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mustache": "^4.2.0", "mustache": "^4.2.0",
...@@ -8018,8 +7984,7 @@ ...@@ -8018,8 +7984,7 @@
"cosmokit": { "cosmokit": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.2.1.tgz", "resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.2.1.tgz",
"integrity": "sha512-BTn7vRr31WUwX7Tq8Q/r+Qz+LPKTE3vA0d7xzVaYNes2NPvGPmIWiljYP0m/PIrdpqLLtdHpY1zGNr+OwDhA7A==", "integrity": "sha512-BTn7vRr31WUwX7Tq8Q/r+Qz+LPKTE3vA0d7xzVaYNes2NPvGPmIWiljYP0m/PIrdpqLLtdHpY1zGNr+OwDhA7A=="
"peer": true
}, },
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.3",
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"@types/node": "^18.0.6", "@types/node": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0", "@typescript-eslint/parser": "^4.33.0",
"cordis": "^2.0.6",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
...@@ -57,7 +58,9 @@ ...@@ -57,7 +58,9 @@
"@satorijs/satori": "^1.0.3" "@satorijs/satori": "^1.0.3"
}, },
"dependencies": { "dependencies": {
"cordis-decorators": "^1.0.7", "cordis-decorators": "^1.0.8",
"lodash": "^4.17.21" "lodash": "^4.17.21",
"@types/koa": "^2.13.5",
"@types/koa__router": "^8.0.11"
} }
} }
import { defaultRegistrarS } from './registrar'; import { defaultRegistrarS } from '../registrar';
export const { export const {
OnAnywhere, OnAnywhere,
......
import { defaultRegistrarS } from '../registrar';
import {
DefaultContext,
DefaultState,
ParameterizedContext,
Next as KoaNext,
} from 'koa';
import { RouterParamContext } from '@koa/router';
export type KoaContext = ParameterizedContext<
DefaultState,
DefaultContext & RouterParamContext<DefaultState, DefaultContext>,
any
>;
const RouterMethod = defaultRegistrarS.decorateMethod(
'route',
(
ctx,
fun: (ctx: KoaContext, Next: KoaNext) => Promise<any>,
method:
| 'get'
| 'post'
| 'put'
| 'delete'
| 'patch'
| 'options'
| 'head'
| 'all',
path: string,
) => {
const _path = path.startsWith('/') ? path : `/${path}`;
return ctx.router[method](_path, (koaCtx, next) => fun(koaCtx, next));
},
);
export const Get = (path: string) => RouterMethod('get', path);
export const Post = (path: string) => RouterMethod('post', path);
export const Put = (path: string) => RouterMethod('put', path);
export const Delete = (path: string) => RouterMethod('delete', path);
export const Patch = (path: string) => RouterMethod('patch', path);
export const Options = (path: string) => RouterMethod('options', path);
export const Head = (path: string) => RouterMethod('head', path);
export const All = (path: string) => RouterMethod('all', path);
export * from './common';
export * from './http';
...@@ -3,24 +3,37 @@ import { Registrar } from 'cordis-decorators'; ...@@ -3,24 +3,37 @@ import { Registrar } from 'cordis-decorators';
import { selectContext, Selection } from './utility/select-context'; import { selectContext, Selection } from './utility/select-context';
export class SatoriRegistrar<Ctx extends Context> extends Registrar<Ctx> { export class SatoriRegistrar<Ctx extends Context> extends Registrar<Ctx> {
methodDecorators() {
return {
...super.methodDecorators(),
};
}
selectorDecorators() { selectorDecorators() {
return { return {
OnAnywhere: () => this.decorateTransformer((ctx, r) => ctx.any()), OnAnywhere: this.decorateTransformer((ctx) => ctx.any()),
OnNowhere: () => this.decorateTransformer((ctx, r) => ctx.never()), OnNowhere: this.decorateTransformer((ctx) => ctx.never()),
OnUser: (...values: string[]) => OnUser: this.decorateTransformer((ctx, ...values: string[]) =>
this.decorateTransformer((ctx, r) => ctx.user(...r(values))), ctx.user(...values),
OnSelf: (...values: string[]) => ),
this.decorateTransformer((ctx, r) => ctx.self(...r(values))), OnSelf: this.decorateTransformer((ctx, ...values: string[]) =>
OnGuild: (...values: string[]) => ctx.self(...values),
this.decorateTransformer((ctx, r) => ctx.guild(...r(values))), ),
OnChannel: (...values: string[]) => OnGuild: this.decorateTransformer((ctx, ...values: string[]) =>
this.decorateTransformer((ctx, r) => ctx.channel(...r(values))), ctx.guild(...values),
OnPlatform: (...values: string[]) => ),
this.decorateTransformer((ctx, r) => ctx.platform(...r(values))), OnChannel: this.decorateTransformer((ctx, ...values: string[]) =>
OnPrivate: (...values: string[]) => ctx.channel(...values),
this.decorateTransformer((ctx, r) => ctx.private(...r(values))), ),
OnSelection: (selection: Selection) => OnPlatform: this.decorateTransformer((ctx, ...values: string[]) =>
this.decorateTransformer((ctx, r) => selectContext(ctx, r(selection))), ctx.platform(...values),
),
OnPrivate: this.decorateTransformer((ctx, ...values: string[]) =>
ctx.private(...values),
),
OnSelection: this.decorateTransformer((ctx, selection: Selection) =>
selectContext(ctx, selection),
),
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment