Migrating to express 5

This commit is contained in:
SamTV12345 2024-10-01 21:10:03 +02:00
parent 2aba044dfe
commit 6b6f9e535f
8 changed files with 203 additions and 175 deletions

View file

@ -165,11 +165,11 @@ importers:
specifier: ^0.24.0 specifier: ^0.24.0
version: 0.24.0 version: 0.24.0
express: express:
specifier: 4.21.0 specifier: ^5.0.0
version: 4.21.0 version: 5.0.0
express-rate-limit: express-rate-limit:
specifier: ^7.4.0 specifier: ^7.4.0
version: 7.4.0(express@4.21.0) version: 7.4.0(express@5.0.0)
fast-deep-equal: fast-deep-equal:
specifier: ^3.1.3 specifier: ^3.1.3
version: 3.1.3 version: 3.1.3
@ -259,7 +259,7 @@ importers:
version: 10.1.0 version: 10.1.0
swagger-ui-express: swagger-ui-express:
specifier: ^5.0.1 specifier: ^5.0.1
version: 5.0.1(express@4.21.0) version: 5.0.1(express@5.0.0)
tinycon: tinycon:
specifier: 0.6.8 specifier: 0.6.8
version: 0.6.8 version: 0.6.8
@ -286,8 +286,8 @@ importers:
specifier: ^3.2.24 specifier: ^3.2.24
version: 3.2.24 version: 3.2.24
'@types/express': '@types/express':
specifier: ^4.17.21 specifier: ^5.0.0
version: 4.17.21 version: 5.0.0
'@types/formidable': '@types/formidable':
specifier: ^3.4.5 specifier: ^3.4.5
version: 3.4.5 version: 3.4.5
@ -1646,11 +1646,11 @@ packages:
'@types/estree@1.0.6': '@types/estree@1.0.6':
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
'@types/express-serve-static-core@4.19.6': '@types/express-serve-static-core@5.0.0':
resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} resolution: {integrity: sha512-AbXMTZGt40T+KON9/Fdxx0B2WK5hsgxcfXJLr5bFpZ7b4JCex2WyQPTEKdXqfHiY5nKKBScZ7yCoO6Pvgxfvnw==}
'@types/express@4.17.21': '@types/express@5.0.0':
resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} resolution: {integrity: sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==}
'@types/formidable@3.4.5': '@types/formidable@3.4.5':
resolution: {integrity: sha512-s7YPsNVfnsng5L8sKnG/Gbb2tiwwJTY1conOkJzTMRvJAlLFW1nEua+ADsJQu8N1c0oTHx9+d5nqg10WuT9gHQ==} resolution: {integrity: sha512-s7YPsNVfnsng5L8sKnG/Gbb2tiwwJTY1conOkJzTMRvJAlLFW1nEua+ADsJQu8N1c0oTHx9+d5nqg10WuT9gHQ==}
@ -2050,6 +2050,10 @@ packages:
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
accepts@2.0.0:
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
engines: {node: '>= 0.6'}
acorn-jsx@5.3.2: acorn-jsx@5.3.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies: peerDependencies:
@ -2112,8 +2116,8 @@ packages:
resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
array-flatten@1.1.1: array-flatten@3.0.0:
resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} resolution: {integrity: sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==}
array-includes@3.1.8: array-includes@3.1.8:
resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==}
@ -2190,9 +2194,9 @@ packages:
birpc@0.2.17: birpc@0.2.17:
resolution: {integrity: sha512-+hkTxhot+dWsLpp3gia5AkVHIsKlZybNT5gIYiDlNzJrmYPcTM9k5/w2uaj3IPpd7LlEYpmCj4Jj1nC41VhDFg==} resolution: {integrity: sha512-+hkTxhot+dWsLpp3gia5AkVHIsKlZybNT5gIYiDlNzJrmYPcTM9k5/w2uaj3IPpd7LlEYpmCj4Jj1nC41VhDFg==}
body-parser@1.20.3: body-parser@2.0.1:
resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==} resolution: {integrity: sha512-PagxbjvuPH6tv0f/kdVbFGcb79D236SLcDTs6DrQ7GizJ88S1UWP4nMXFEo/I4fdhGRGabvFfFjVGm3M7U8JwA==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} engines: {node: '>= 0.10'}
brace-expansion@1.1.11: brace-expansion@1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
@ -2331,6 +2335,10 @@ packages:
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
content-disposition@1.0.0:
resolution: {integrity: sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==}
engines: {node: '>= 0.6'}
content-type@1.0.5: content-type@1.0.5:
resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
@ -2345,6 +2353,10 @@ packages:
cookie-signature@1.0.6: cookie-signature@1.0.6:
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
cookie-signature@1.2.1:
resolution: {integrity: sha512-78KWk9T26NhzXtuL26cIJ8/qNHANyJ/ZYrmEXFzUmhZdjpBv+DlWlOANRTGBt48YcyslsLrj0bMLFTmXvLRCOw==}
engines: {node: '>=6.6.0'}
cookie@0.4.1: cookie@0.4.1:
resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
@ -2433,6 +2445,14 @@ packages:
supports-color: supports-color:
optional: true optional: true
debug@3.1.0:
resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
debug@3.2.7: debug@3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies: peerDependencies:
@ -2450,6 +2470,15 @@ packages:
supports-color: supports-color:
optional: true optional: true
debug@4.3.6:
resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
debug@4.3.7: debug@4.3.7:
resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
@ -2847,9 +2876,9 @@ packages:
peerDependencies: peerDependencies:
express: 4 || 5 || ^5.0.0-beta.1 express: 4 || 5 || ^5.0.0-beta.1
express@4.21.0: express@5.0.0:
resolution: {integrity: sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==} resolution: {integrity: sha512-V4UkHQc+B7ldh1YC84HCXHwf60M4BOMvp9rkvTUWCK5apqDC1Esnbid4wm6nFyVuDy8XMfETsJw5lsIGBWyo0A==}
engines: {node: '>= 0.10.0'} engines: {node: '>= 18'}
extend@3.0.2: extend@3.0.2:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
@ -2895,8 +2924,8 @@ packages:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'} engines: {node: '>=8'}
finalhandler@1.3.1: finalhandler@2.0.0:
resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==} resolution: {integrity: sha512-MX6Zo2adDViYh+GcxxB1dpO43eypOGUOL12rLCOTMQv/DfIbpSJUy4oQIIZhVZkH9e+bZWKMon0XHFEju16tkQ==}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
find-root@1.1.0: find-root@1.1.0:
@ -2958,6 +2987,10 @@ packages:
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
fresh@2.0.0:
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
engines: {node: '>= 0.8'}
fs-extra@10.1.0: fs-extra@10.1.0:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'} engines: {node: '>=12'}
@ -3198,6 +3231,10 @@ packages:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
iconv-lite@0.5.2:
resolution: {integrity: sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==}
engines: {node: '>=0.10.0'}
iconv-lite@0.6.3: iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -3320,6 +3357,9 @@ packages:
is-promise@1.0.1: is-promise@1.0.1:
resolution: {integrity: sha512-mjWH5XxnhMA8cFnDchr6qRP9S/kLntKuEfIYku+PaN1CnS8v+OG9O/BKpRCVRJvpIkgAZm0Pf5Is3iSSOILlcg==} resolution: {integrity: sha512-mjWH5XxnhMA8cFnDchr6qRP9S/kLntKuEfIYku+PaN1CnS8v+OG9O/BKpRCVRJvpIkgAZm0Pf5Is3iSSOILlcg==}
is-promise@4.0.0:
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
is-regex@1.1.4: is-regex@1.1.4:
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
@ -3580,8 +3620,13 @@ packages:
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
merge-descriptors@1.0.3: media-typer@1.1.0:
resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==}
engines: {node: '>= 0.8'}
merge-descriptors@2.0.0:
resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==}
engines: {node: '>=18'}
merge2@1.4.1: merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
@ -3614,14 +3659,17 @@ packages:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
mime-db@1.53.0:
resolution: {integrity: sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==}
engines: {node: '>= 0.6'}
mime-types@2.1.35: mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
mime@1.6.0: mime-types@3.0.0:
resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} resolution: {integrity: sha512-XqoSHeCGjVClAmoGFG3lVFqQFRIrTVw2OH3axRqAcfaw+gHWIfnASS92AV+Rl/mk0MupgZTRHQOjxY6YVnzK5w==}
engines: {node: '>=4'} engines: {node: '>= 0.6'}
hasBin: true
mime@2.6.0: mime@2.6.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
@ -3714,6 +3762,10 @@ packages:
resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
negotiator@1.0.0:
resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
engines: {node: '>= 0.6'}
netmask@2.0.2: netmask@2.0.2:
resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==}
engines: {node: '>= 0.4.0'} engines: {node: '>= 0.4.0'}
@ -3868,9 +3920,6 @@ packages:
path-parse@1.0.7: path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
path-to-regexp@0.1.10:
resolution: {integrity: sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==}
path-to-regexp@6.2.2: path-to-regexp@6.2.2:
resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==}
@ -3985,6 +4034,10 @@ packages:
resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
raw-body@3.0.0:
resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==}
engines: {node: '>= 0.8'}
react-dom@18.3.1: react-dom@18.3.1:
resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}
peerDependencies: peerDependencies:
@ -4121,6 +4174,10 @@ packages:
engines: {node: '>=18.0.0', npm: '>=8.0.0'} engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true hasBin: true
router@2.0.0:
resolution: {integrity: sha512-dIM5zVoG8xhC6rnSN8uoAgFARwTE7BQs8YwHEvK0VCmfxQXMaOuA1uiR1IPwsW7JyK5iTt7Od/TC9StasS2NPQ==}
engines: {node: '>= 0.10'}
rrweb-cssom@0.7.1: rrweb-cssom@0.7.1:
resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==} resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==}
@ -4224,16 +4281,16 @@ packages:
engines: {node: '>=10'} engines: {node: '>=10'}
hasBin: true hasBin: true
send@0.19.0: send@1.1.0:
resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} resolution: {integrity: sha512-v67WcEouB5GxbTWL/4NeToqcZiAWEq90N888fczVArY8A79J0L4FD7vj5hm3eUMua5EpoQ59wa/oovY6TLvRUA==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 18'}
serialize-javascript@6.0.2: serialize-javascript@6.0.2:
resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}
serve-static@1.16.2: serve-static@2.1.0:
resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} resolution: {integrity: sha512-A3We5UfEjG8Z7VkDv6uItWw6HY2bBSBJT1KtVESn6EOoOr2jAxNhxWCLY3jDE2WcuHXByWju74ck3ZgLwL8xmA==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 18'}
set-cookie-parser@2.7.0: set-cookie-parser@2.7.0:
resolution: {integrity: sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==} resolution: {integrity: sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==}
@ -4540,6 +4597,10 @@ packages:
resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
type-is@2.0.0:
resolution: {integrity: sha512-gd0sGezQYCbWSbkZr75mln4YBidWUN60+devscpLF5mtRDUpiaTvKpBNrdaCvel1NdR2k6vclXybU5fBd2i+nw==}
engines: {node: '>= 0.6'}
typed-array-buffer@1.0.2: typed-array-buffer@1.0.2:
resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
@ -5967,7 +6028,7 @@ snapshots:
'@types/cookies@0.9.0': '@types/cookies@0.9.0':
dependencies: dependencies:
'@types/connect': 3.4.38 '@types/connect': 3.4.38
'@types/express': 4.17.21 '@types/express': 5.0.0
'@types/keygrip': 1.0.6 '@types/keygrip': 1.0.6
'@types/node': 22.7.4 '@types/node': 22.7.4
@ -5983,17 +6044,17 @@ snapshots:
'@types/estree@1.0.6': {} '@types/estree@1.0.6': {}
'@types/express-serve-static-core@4.19.6': '@types/express-serve-static-core@5.0.0':
dependencies: dependencies:
'@types/node': 22.7.4 '@types/node': 22.7.4
'@types/qs': 6.9.15 '@types/qs': 6.9.15
'@types/range-parser': 1.2.7 '@types/range-parser': 1.2.7
'@types/send': 0.17.4 '@types/send': 0.17.4
'@types/express@4.17.21': '@types/express@5.0.0':
dependencies: dependencies:
'@types/body-parser': 1.19.5 '@types/body-parser': 1.19.5
'@types/express-serve-static-core': 4.19.6 '@types/express-serve-static-core': 5.0.0
'@types/qs': 6.9.15 '@types/qs': 6.9.15
'@types/serve-static': 1.15.7 '@types/serve-static': 1.15.7
@ -6140,7 +6201,7 @@ snapshots:
'@types/swagger-ui-express@4.1.6': '@types/swagger-ui-express@4.1.6':
dependencies: dependencies:
'@types/express': 4.17.21 '@types/express': 5.0.0
'@types/serve-static': 1.15.7 '@types/serve-static': 1.15.7
'@types/tar@6.1.13': '@types/tar@6.1.13':
@ -6484,6 +6545,11 @@ snapshots:
mime-types: 2.1.35 mime-types: 2.1.35
negotiator: 0.6.3 negotiator: 0.6.3
accepts@2.0.0:
dependencies:
mime-types: 3.0.0
negotiator: 1.0.0
acorn-jsx@5.3.2(acorn@8.12.0): acorn-jsx@5.3.2(acorn@8.12.0):
dependencies: dependencies:
acorn: 8.12.0 acorn: 8.12.0
@ -6560,7 +6626,7 @@ snapshots:
call-bind: 1.0.7 call-bind: 1.0.7
is-array-buffer: 3.0.4 is-array-buffer: 3.0.4
array-flatten@1.1.1: {} array-flatten@3.0.0: {}
array-includes@3.1.8: array-includes@3.1.8:
dependencies: dependencies:
@ -6647,18 +6713,17 @@ snapshots:
birpc@0.2.17: {} birpc@0.2.17: {}
body-parser@1.20.3: body-parser@2.0.1:
dependencies: dependencies:
bytes: 3.1.2 bytes: 3.1.2
content-type: 1.0.5 content-type: 1.0.5
debug: 2.6.9 debug: 3.1.0
depd: 2.0.0
destroy: 1.2.0 destroy: 1.2.0
http-errors: 2.0.0 http-errors: 2.0.0
iconv-lite: 0.4.24 iconv-lite: 0.5.2
on-finished: 2.4.1 on-finished: 2.4.1
qs: 6.13.0 qs: 6.13.0
raw-body: 2.5.2 raw-body: 3.0.0
type-is: 1.6.18 type-is: 1.6.18
unpipe: 1.0.0 unpipe: 1.0.0
transitivePeerDependencies: transitivePeerDependencies:
@ -6808,6 +6873,10 @@ snapshots:
dependencies: dependencies:
safe-buffer: 5.2.1 safe-buffer: 5.2.1
content-disposition@1.0.0:
dependencies:
safe-buffer: 5.2.1
content-type@1.0.5: {} content-type@1.0.5: {}
convert-source-map@2.0.0: {} convert-source-map@2.0.0: {}
@ -6819,6 +6888,8 @@ snapshots:
cookie-signature@1.0.6: {} cookie-signature@1.0.6: {}
cookie-signature@1.2.1: {}
cookie@0.4.1: {} cookie@0.4.1: {}
cookie@0.4.2: {} cookie@0.4.2: {}
@ -6899,6 +6970,10 @@ snapshots:
dependencies: dependencies:
ms: 2.0.0 ms: 2.0.0
debug@3.1.0:
dependencies:
ms: 2.0.0
debug@3.2.7: debug@3.2.7:
dependencies: dependencies:
ms: 2.1.3 ms: 2.1.3
@ -6909,6 +6984,10 @@ snapshots:
optionalDependencies: optionalDependencies:
supports-color: 8.1.1 supports-color: 8.1.1
debug@4.3.6:
dependencies:
ms: 2.1.2
debug@4.3.7: debug@4.3.7:
dependencies: dependencies:
ms: 2.1.3 ms: 2.1.3
@ -7467,41 +7546,42 @@ snapshots:
- supports-color - supports-color
- utf-8-validate - utf-8-validate
express-rate-limit@7.4.0(express@4.21.0): express-rate-limit@7.4.0(express@5.0.0):
dependencies: dependencies:
express: 4.21.0 express: 5.0.0
express@4.21.0: express@5.0.0:
dependencies: dependencies:
accepts: 1.3.8 accepts: 2.0.0
array-flatten: 1.1.1 body-parser: 2.0.1
body-parser: 1.20.3 content-disposition: 1.0.0
content-disposition: 0.5.4
content-type: 1.0.5 content-type: 1.0.5
cookie: 0.6.0 cookie: 0.6.0
cookie-signature: 1.0.6 cookie-signature: 1.2.1
debug: 2.6.9 debug: 4.3.6
depd: 2.0.0 depd: 2.0.0
encodeurl: 2.0.0 encodeurl: 2.0.0
escape-html: 1.0.3 escape-html: 1.0.3
etag: 1.8.1 etag: 1.8.1
finalhandler: 1.3.1 finalhandler: 2.0.0
fresh: 0.5.2 fresh: 2.0.0
http-errors: 2.0.0 http-errors: 2.0.0
merge-descriptors: 1.0.3 merge-descriptors: 2.0.0
methods: 1.1.2 methods: 1.1.2
mime-types: 3.0.0
on-finished: 2.4.1 on-finished: 2.4.1
once: 1.4.0
parseurl: 1.3.3 parseurl: 1.3.3
path-to-regexp: 0.1.10
proxy-addr: 2.0.7 proxy-addr: 2.0.7
qs: 6.13.0 qs: 6.13.0
range-parser: 1.2.1 range-parser: 1.2.1
router: 2.0.0
safe-buffer: 5.2.1 safe-buffer: 5.2.1
send: 0.19.0 send: 1.1.0
serve-static: 1.16.2 serve-static: 2.1.0
setprototypeof: 1.2.0 setprototypeof: 1.2.0
statuses: 2.0.1 statuses: 2.0.1
type-is: 1.6.18 type-is: 2.0.0
utils-merge: 1.0.1 utils-merge: 1.0.1
vary: 1.1.2 vary: 1.1.2
transitivePeerDependencies: transitivePeerDependencies:
@ -7552,10 +7632,10 @@ snapshots:
dependencies: dependencies:
to-regex-range: 5.0.1 to-regex-range: 5.0.1
finalhandler@1.3.1: finalhandler@2.0.0:
dependencies: dependencies:
debug: 2.6.9 debug: 2.6.9
encodeurl: 2.0.0 encodeurl: 1.0.2
escape-html: 1.0.3 escape-html: 1.0.3
on-finished: 2.4.1 on-finished: 2.4.1
parseurl: 1.3.3 parseurl: 1.3.3
@ -7619,6 +7699,8 @@ snapshots:
fresh@0.5.2: {} fresh@0.5.2: {}
fresh@2.0.0: {}
fs-extra@10.1.0: fs-extra@10.1.0:
dependencies: dependencies:
graceful-fs: 4.2.11 graceful-fs: 4.2.11
@ -7943,6 +8025,10 @@ snapshots:
dependencies: dependencies:
safer-buffer: 2.1.2 safer-buffer: 2.1.2
iconv-lite@0.5.2:
dependencies:
safer-buffer: 2.1.2
iconv-lite@0.6.3: iconv-lite@0.6.3:
dependencies: dependencies:
safer-buffer: 2.1.2 safer-buffer: 2.1.2
@ -8048,6 +8134,8 @@ snapshots:
is-promise@1.0.1: {} is-promise@1.0.1: {}
is-promise@4.0.0: {}
is-regex@1.1.4: is-regex@1.1.4:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.7
@ -8362,7 +8450,9 @@ snapshots:
media-typer@0.3.0: {} media-typer@0.3.0: {}
merge-descriptors@1.0.3: {} media-typer@1.1.0: {}
merge-descriptors@2.0.0: {}
merge2@1.4.1: {} merge2@1.4.1: {}
@ -8392,11 +8482,15 @@ snapshots:
mime-db@1.52.0: {} mime-db@1.52.0: {}
mime-db@1.53.0: {}
mime-types@2.1.35: mime-types@2.1.35:
dependencies: dependencies:
mime-db: 1.52.0 mime-db: 1.52.0
mime@1.6.0: {} mime-types@3.0.0:
dependencies:
mime-db: 1.53.0
mime@2.6.0: {} mime@2.6.0: {}
@ -8480,6 +8574,8 @@ snapshots:
negotiator@0.6.3: {} negotiator@0.6.3: {}
negotiator@1.0.0: {}
netmask@2.0.2: {} netmask@2.0.2: {}
nise@6.1.1: nise@6.1.1:
@ -8671,8 +8767,6 @@ snapshots:
path-parse@1.0.7: {} path-parse@1.0.7: {}
path-to-regexp@0.1.10: {}
path-to-regexp@6.2.2: {} path-to-regexp@6.2.2: {}
path-to-regexp@8.1.0: {} path-to-regexp@8.1.0: {}
@ -8770,6 +8864,13 @@ snapshots:
iconv-lite: 0.4.24 iconv-lite: 0.4.24
unpipe: 1.0.0 unpipe: 1.0.0
raw-body@3.0.0:
dependencies:
bytes: 3.1.2
http-errors: 2.0.0
iconv-lite: 0.6.3
unpipe: 1.0.0
react-dom@18.3.1(react@18.3.1): react-dom@18.3.1(react@18.3.1):
dependencies: dependencies:
loose-envify: 1.4.0 loose-envify: 1.4.0
@ -8918,6 +9019,16 @@ snapshots:
'@rollup/rollup-win32-x64-msvc': 4.21.0 '@rollup/rollup-win32-x64-msvc': 4.21.0
fsevents: 2.3.3 fsevents: 2.3.3
router@2.0.0:
dependencies:
array-flatten: 3.0.0
is-promise: 4.0.0
methods: 1.1.2
parseurl: 1.3.3
path-to-regexp: 8.1.0
setprototypeof: 1.2.0
utils-merge: 1.0.1
rrweb-cssom@0.7.1: {} rrweb-cssom@0.7.1: {}
run-parallel@1.2.0: run-parallel@1.2.0:
@ -8998,17 +9109,16 @@ snapshots:
semver@7.6.3: {} semver@7.6.3: {}
send@0.19.0: send@1.1.0:
dependencies: dependencies:
debug: 2.6.9 debug: 4.3.7
depd: 2.0.0
destroy: 1.2.0 destroy: 1.2.0
encodeurl: 1.0.2 encodeurl: 2.0.0
escape-html: 1.0.3 escape-html: 1.0.3
etag: 1.8.1 etag: 1.8.1
fresh: 0.5.2 fresh: 0.5.2
http-errors: 2.0.0 http-errors: 2.0.0
mime: 1.6.0 mime-types: 2.1.35
ms: 2.1.3 ms: 2.1.3
on-finished: 2.4.1 on-finished: 2.4.1
range-parser: 1.2.1 range-parser: 1.2.1
@ -9020,12 +9130,12 @@ snapshots:
dependencies: dependencies:
randombytes: 2.1.0 randombytes: 2.1.0
serve-static@1.16.2: serve-static@2.1.0:
dependencies: dependencies:
encodeurl: 2.0.0 encodeurl: 2.0.0
escape-html: 1.0.3 escape-html: 1.0.3
parseurl: 1.3.3 parseurl: 1.3.3
send: 0.19.0 send: 1.1.0
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9284,9 +9394,9 @@ snapshots:
swagger-ui-dist@5.17.14: {} swagger-ui-dist@5.17.14: {}
swagger-ui-express@5.0.1(express@4.21.0): swagger-ui-express@5.0.1(express@5.0.0):
dependencies: dependencies:
express: 4.21.0 express: 5.0.0
swagger-ui-dist: 5.17.14 swagger-ui-dist: 5.17.14
symbol-tree@3.2.4: {} symbol-tree@3.2.4: {}
@ -9381,6 +9491,12 @@ snapshots:
media-typer: 0.3.0 media-typer: 0.3.0
mime-types: 2.1.35 mime-types: 2.1.35
type-is@2.0.0:
dependencies:
content-type: 1.0.5
media-typer: 1.1.0
mime-types: 3.0.0
typed-array-buffer@1.0.2: typed-array-buffer@1.0.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.7

View file

@ -96,12 +96,6 @@
"socketio": "ep_etherpad-lite/node/handler/PadMessageHandler" "socketio": "ep_etherpad-lite/node/handler/PadMessageHandler"
} }
}, },
{
"name": "tests",
"hooks": {
"expressPreSession": "ep_etherpad-lite/node/hooks/express/tests"
}
},
{ {
"name": "admin", "name": "admin",
"hooks": { "hooks": {

View file

@ -22,7 +22,7 @@ exports.expressCreateServer = (hookName: string, args: ArgsExpressType, cb: Func
console.error('admin template not found, skipping admin interface. You need to rebuild it in /admin with pnpm run build-copy') console.error('admin template not found, skipping admin interface. You need to rebuild it in /admin with pnpm run build-copy')
return cb(); return cb();
} }
args.app.get('/admin/*', (req: any, res: any) => { args.app.get('/admin/:filename', (req: any, res: any) => {
// parse URL // parse URL
const parsedUrl = url.parse(req.url); const parsedUrl = url.parse(req.url);
// extract URL path // extract URL path

View file

@ -25,8 +25,8 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
}); });
// handle export requests // handle export requests
args.app.use('/p/:pad/:rev?/export/:type', limiter); args.app.use('/p/:pad/:rev{.:ext}/export/:type', limiter);
args.app.get('/p/:pad/:rev?/export/:type', (req:any, res:any, next:Function) => { args.app.get('/p/:pad/:rev{.:ext}/export/:type', (req:any, res:any, next:Function) => {
(async () => { (async () => {
const types = ['pdf', 'doc', 'txt', 'html', 'odt', 'etherpad']; const types = ['pdf', 'doc', 'txt', 'html', 'odt', 'etherpad'];
// send a 404 if we don't support this filetype // send a 404 if we don't support this filetype

View file

@ -6,6 +6,7 @@ import {PartType} from "../../types/PartType";
const fs = require('fs').promises; const fs = require('fs').promises;
import {minify} from '../../utils/Minify'; import {minify} from '../../utils/Minify';
import path from 'node:path'; import path from 'node:path';
import {ArgsExpressType} from "../../types/ArgsExpressType";
const plugins = require('../../../static/js/pluginfw/plugin_defs'); const plugins = require('../../../static/js/pluginfw/plugin_defs');
const settings = require('../../utils/Settings'); const settings = require('../../utils/Settings');
@ -30,16 +31,16 @@ const getTar = async () => {
return tar; return tar;
}; };
exports.expressPreSession = async (hookName:string, {app}:any) => { exports.expressPreSession = async (hookName:string, {app}:ArgsExpressType) => {
// Minify will serve static files compressed (minify enabled). It also has // Minify will serve static files compressed (minify enabled). It also has
// file-specific hacks for ace/require-kernel/etc. // file-specific hacks for ace/require-kernel/etc.
app.all('/static/:filename(*)', minify); app.all('/static/*filename', minify);
// serve plugin definitions // serve plugin definitions
// not very static, but served here so that client can do // not very static, but served here so that client can do
// require("pluginfw/static/js/plugin-definitions.js"); // require("pluginfw/static/js/plugin-definitions.js");
app.get('/pluginfw/plugin-definitions.json', (req: any, res:any, next:Function) => { app.get('/pluginfw/plugin-definitions.json', (_req, res) => {
const clientParts = plugins.parts.filter((part: PartType) => part.client_hooks != null); const clientParts = plugins.parts.filter((part: PartType) => part.client_hooks != null);
const clientPlugins:MapArrayType<string> = {}; const clientPlugins:MapArrayType<string> = {};
for (const name of new Set(clientParts.map((part: PartType) => part.plugin))) { for (const name of new Set(clientParts.map((part: PartType) => part.plugin))) {

View file

@ -1,83 +0,0 @@
'use strict';
import {Dirent} from "node:fs";
import {PluginDef} from "../../types/PartType";
const path = require('path');
const fsp = require('fs').promises;
const plugins = require('../../../static/js/pluginfw/plugin_defs');
const sanitizePathname = require('../../utils/sanitizePathname');
const settings = require('../../utils/Settings');
// Returns all *.js files under specDir (recursively) as relative paths to specDir, using '/'
// instead of path.sep to separate pathname components.
const findSpecs = async (specDir: string) => {
let dirents: Dirent[];
try {
dirents = await fsp.readdir(specDir, {withFileTypes: true});
} catch (err:any) {
if (['ENOENT', 'ENOTDIR'].includes(err.code)) return [];
throw err;
}
const specs: string[] = [];
await Promise.all(dirents.map(async (dirent) => {
if (dirent.isDirectory()) {
const subdirSpecs = await findSpecs(path.join(specDir, dirent.name));
specs.push(...subdirSpecs.map((spec) => `${dirent.name}/${spec}`));
return;
}
if (!dirent.name.endsWith('.js')) return;
specs.push(dirent.name);
}));
return specs;
};
exports.expressPreSession = async (hookName:string, {app}:any) => {
app.get('/tests/frontend/frontendTestSpecs.json', (req:any, res:any, next:Function) => {
(async () => {
const modules:string[] = [];
await Promise.all(Object.entries(plugins.plugins).map(async ([plugin, def]) => {
let {package: {path: pluginPath}} = def as PluginDef;
if (!pluginPath.endsWith(path.sep)) pluginPath += path.sep;
const specDir = `${plugin === 'ep_etherpad-lite' ? '' : 'static/'}tests/frontend/specs`;
for (const spec of await findSpecs(path.join(pluginPath, specDir))) {
if (plugin === 'ep_etherpad-lite' && !settings.enableAdminUITests &&
spec.startsWith('admin')) continue;
modules.push(`${plugin}/${specDir}/${spec.replace(/\.js$/, '')}`);
}
}));
// Sort plugin tests before core tests.
modules.sort((a, b) => {
a = String(a);
b = String(b);
const aCore = a.startsWith('ep_etherpad-lite/');
const bCore = b.startsWith('ep_etherpad-lite/');
if (aCore === bCore) return a.localeCompare(b);
return aCore ? 1 : -1;
});
console.debug('Sent browser the following test spec modules:', modules);
res.json(modules);
})().catch((err) => next(err || new Error(err)));
});
const rootTestFolder = path.join(settings.root, 'src/tests/frontend/');
app.get('/tests/frontend/index.html', (req:any, res:any) => {
res.redirect(['./', ...req.url.split('?').slice(1)].join('?'));
});
// The regexp /[\d\D]{0,}/ is equivalent to the regexp /.*/. The Express route path used here
// uses the more verbose /[\d\D]{0,}/ pattern instead of /.*/ because path-to-regexp v0.1.7 (the
// version used with Express v4.x) interprets '.' and '*' differently than regexp.
app.get('/tests/frontend/:file([\\d\\D]{0,})', (req:any, res:any, next:Function) => {
(async () => {
let file = sanitizePathname(req.params.file);
if (['', '.', './'].includes(file)) file = 'index.html';
res.sendFile(path.join(rootTestFolder, file));
})().catch((err) => next(err || new Error(err)));
});
app.get('/tests/frontend', (req:any, res:any) => {
res.redirect(['./frontend/', ...req.url.split('?').slice(1)].join('?'));
});
};

View file

@ -146,7 +146,7 @@ const compatPaths = {
* @param res the Express response * @param res the Express response
*/ */
const _minify = async (req:any, res:any) => { const _minify = async (req:any, res:any) => {
let filename = req.params.filename; let filename = req.params.filename.join('/');
try { try {
filename = sanitizePathname(filename); filename = sanitizePathname(filename);
} catch (err) { } catch (err) {

View file

@ -38,7 +38,7 @@
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"esbuild": "^0.24.0", "esbuild": "^0.24.0",
"express": "4.21.0", "express": "^5.0.0",
"express-rate-limit": "^7.4.0", "express-rate-limit": "^7.4.0",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"find-root": "1.1.0", "find-root": "1.1.0",
@ -84,7 +84,7 @@
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.47.2", "@playwright/test": "^1.47.2",
"@types/async": "^3.2.24", "@types/async": "^3.2.24",
"@types/express": "^4.17.21", "@types/express": "^5.0.0",
"@types/formidable": "^3.4.5", "@types/formidable": "^3.4.5",
"@types/http-errors": "^2.0.4", "@types/http-errors": "^2.0.4",
"@types/jquery": "^3.5.31", "@types/jquery": "^3.5.31",