Fix PDF Upload edge case (#18533)

we were using an older version of `file-type` which has limited support
for PDF as it's a complex spec
Updated to latest version which includes support for plugins and added
`@file-type/pdf` which has extensive spec compliant detection approach

fixes TWENTY-SERVER-FAN
This commit is contained in:
neo773
2026-03-12 16:04:24 +05:30
committed by GitHub
parent 38664249cf
commit b21fb4aa6f
7 changed files with 153 additions and 180 deletions
+39 -1
View File
@@ -5873,6 +5873,17 @@ __metadata:
languageName: node
linkType: hard
"@file-type/pdf@npm:^0.2.0":
version: 0.2.0
resolution: "@file-type/pdf@npm:0.2.0"
dependencies:
"@borewit/text-codec": "npm:^0.2.1"
read-next-line: "npm:^0.5.0"
sax: "npm:^1.4.1"
checksum: 10c0/9f2f446a04ca2fff4f5a02aeb6065d72f4fc95b6bce5efc6a8ec77530c5b36192f9aa718b65e00398921cf5a0d505cda5e9208d3ac81aad63f7d60a535212a89
languageName: node
linkType: hard
"@floating-ui/core@npm:^1.6.0":
version: 1.6.7
resolution: "@floating-ui/core@npm:1.6.7"
@@ -36527,6 +36538,18 @@ __metadata:
languageName: node
linkType: hard
"file-type@npm:^21.3.1":
version: 21.3.1
resolution: "file-type@npm:21.3.1"
dependencies:
"@tokenizer/inflate": "npm:^0.4.1"
strtok3: "npm:^10.3.4"
token-types: "npm:^6.1.1"
uint8array-extras: "npm:^1.4.0"
checksum: 10c0/66a8eda781c803c6fc372464abba88cee564cfe30f029716f06909da1564bc51d0a4e8d34654b881dc751cdb0513338b3c0747e06a608cee0dd5c5499b018d47
languageName: node
linkType: hard
"filelist@npm:^1.0.4":
version: 1.0.4
resolution: "filelist@npm:1.0.4"
@@ -51234,6 +51257,13 @@ __metadata:
languageName: node
linkType: hard
"read-next-line@npm:^0.5.0":
version: 0.5.0
resolution: "read-next-line@npm:0.5.0"
checksum: 10c0/a658dd647a655767a81d237474dac2cce6f15fff14e8963a41980bafb30c11298e27d6210a06031ecef62a28edf703cc2e3fce8d28ec411bb309ea71403c6992
languageName: node
linkType: hard
"read-only-stream@npm:^2.0.0":
version: 2.0.0
resolution: "read-only-stream@npm:2.0.0"
@@ -52880,6 +52910,13 @@ __metadata:
languageName: node
linkType: hard
"sax@npm:^1.4.1":
version: 1.5.0
resolution: "sax@npm:1.5.0"
checksum: 10c0/bc3b60a7bfecd40b18256596e96b32df2488339ae1e00a77f842b568f0831228a16c3bd357ec500241ec0b9dc7a475a1286427795c4a8c50bb8e8878f3435dd8
languageName: node
linkType: hard
"saxes@npm:^6.0.0":
version: 6.0.0
resolution: "saxes@npm:6.0.0"
@@ -56594,6 +56631,7 @@ __metadata:
"@envelop/on-resolve": "npm:4.1.0"
"@esbuild-plugins/node-modules-polyfill": "npm:^0.2.2"
"@faker-js/faker": "npm:^9.8.0"
"@file-type/pdf": "npm:^0.2.0"
"@graphql-tools/schema": "npm:10.0.4"
"@graphql-tools/utils": "npm:9.2.1"
"@graphql-yoga/nestjs": "patch:@graphql-yoga/nestjs@2.1.0#./patches/@graphql-yoga+nestjs+2.1.0.patch"
@@ -56700,7 +56738,7 @@ __metadata:
dotenv: "npm:16.4.5"
express: "npm:4.22.1"
express-session: "npm:^1.18.2"
file-type: "npm:16.5.4"
file-type: "npm:^21.3.1"
fuse.js: "npm:^7.1.0"
gaxios: "npm:5.1.3"
google-auth-library: "npm:8.9.0"