@satorijs/satori
Advanced tools
Comparing version 3.5.3 to 3.6.0-alpha.0
{ | ||
"name": "@satorijs/satori", | ||
"description": "Core components of Satorijs", | ||
"version": "3.5.3", | ||
"version": "3.6.0-alpha.0", | ||
"type": "module", | ||
@@ -38,18 +38,6 @@ "main": "lib/index.cjs", | ||
], | ||
"devDependencies": { | ||
"@types/parseurl": "^1.3.3" | ||
}, | ||
"dependencies": { | ||
"@satorijs/core": "3.5.3", | ||
"@types/ws": "^8.5.10", | ||
"file-type": "^16.5.4", | ||
"http-proxy-agent": "^7.0.0", | ||
"https-proxy-agent": "^7.0.2", | ||
"koa": "^2.14.2", | ||
"koa-bodyparser": "^4.4.1", | ||
"parseurl": "^1.3.3", | ||
"path-to-regexp": "^6.2.1", | ||
"socks-proxy-agent": "^8.0.2", | ||
"ws": "^8.14.2" | ||
"@satorijs/core": "3.6.0-alpha.0", | ||
"cosmokit": "^1.5.2" | ||
} | ||
} |
@@ -1,55 +0,2 @@ | ||
import { Quester } from '@satorijs/core' | ||
import { base64ToArrayBuffer } from 'cosmokit' | ||
import { ClientRequestArgs } from 'http' | ||
import { WebSocket } from 'ws' | ||
import { basename } from 'path' | ||
import { promises as fs } from 'fs' | ||
import { fileURLToPath } from 'url' | ||
import FileType from 'file-type' | ||
import { HttpProxyAgent } from 'http-proxy-agent' | ||
import { HttpsProxyAgent } from 'https-proxy-agent' | ||
import { SocksProxyAgent } from 'socks-proxy-agent' | ||
export * from '@satorijs/core' | ||
export * from 'cosmokit' | ||
const oldFile = Quester.prototype.file | ||
Quester.prototype.file = async function file(this: Quester, url: string) { | ||
// for backward compatibility | ||
if (url.startsWith('base64://')) { | ||
const data = base64ToArrayBuffer(url.slice(9)) | ||
const result = await FileType.fromBuffer(data) | ||
const filename = 'file' + (result ? '.' + result.ext : '') | ||
return { mime: result?.mime, filename, data } | ||
} | ||
if (url.startsWith('file://')) { | ||
const data = await fs.readFile(fileURLToPath(url)) | ||
const result = await FileType.fromBuffer(data) | ||
return { mime: result?.mime, filename: basename(url), data } | ||
} | ||
return oldFile.call(this, url) | ||
} | ||
Quester.prototype.ws = function ws(this: Quester, url: string, options: ClientRequestArgs = {}) { | ||
return new WebSocket(this.resolve(url), { | ||
agent: this.agent(this.config.proxyAgent), | ||
handshakeTimeout: this.config.timeout, | ||
...options, | ||
headers: { | ||
...this.config.headers, | ||
...options.headers, | ||
}, | ||
}) | ||
} | ||
const _prepare = Quester.prototype.prepare | ||
Quester.prototype.prepare = function prepare(this: Quester) { | ||
const options = _prepare.call(this) | ||
options.httpAgent = this.agent(this.config.proxyAgent) | ||
options.httpsAgent = this.agent(this.config.proxyAgent) | ||
return options | ||
} | ||
Quester.defineAgent(['http'], HttpProxyAgent) | ||
Quester.defineAgent(['https'], HttpsProxyAgent) | ||
Quester.defineAgent(['socks', 'socks4', 'socks4a', 'socks5', 'socks5h'], SocksProxyAgent) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
0
0
0
2589
33
1
+ Addedcosmokit@^1.5.2
+ Added@satorijs/core@3.6.0-alpha.0(transitive)
+ Addedundios@0.1.100.3.3(transitive)
+ Addedundios-file@0.1.3(transitive)
- Removed@types/ws@^8.5.10
- Removedfile-type@^16.5.4
- Removedhttp-proxy-agent@^7.0.0
- Removedhttps-proxy-agent@^7.0.2
- Removedkoa@^2.14.2
- Removedkoa-bodyparser@^4.4.1
- Removedparseurl@^1.3.3
- Removedpath-to-regexp@^6.2.1
- Removedsocks-proxy-agent@^8.0.2
- Removedws@^8.14.2
- Removed@hapi/bourne@3.0.0(transitive)
- Removed@satorijs/core@3.5.3(transitive)
- Removed@types/node@22.13.5(transitive)
- Removed@types/ws@8.5.14(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedagent-base@7.1.3(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaxios@1.8.1(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcache-content-type@1.0.1(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedco@4.6.0(transitive)
- Removedco-body@6.2.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookies@0.9.1(transitive)
- Removedcopy-to@2.0.1(transitive)
- Removedcordis-axios@4.1.0(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddeep-equal@1.0.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddepd@1.1.22.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedes-set-tostringtag@2.1.0(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedform-data@4.0.2(transitive)
- Removedfresh@0.5.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.3.0(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-assert@1.5.0(transitive)
- Removedhttp-errors@1.8.12.0.0(transitive)
- Removedhttp-proxy-agent@7.0.2(transitive)
- Removedhttps-proxy-agent@7.0.6(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinflation@2.1.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedip-address@9.0.5(transitive)
- Removedis-generator-function@1.1.0(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedjsbn@1.1.0(transitive)
- Removedkeygrip@1.1.0(transitive)
- Removedkoa@2.16.0(transitive)
- Removedkoa-bodyparser@4.4.1(transitive)
- Removedkoa-compose@4.2.0(transitive)
- Removedkoa-convert@2.0.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedonly@0.0.2(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@6.3.0(transitive)
- Removedproxy-from-env@1.1.0(transitive)
- Removedqs@6.14.0(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.4(transitive)
- Removedsocks-proxy-agent@8.0.5(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedstatuses@1.5.02.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtsscmp@1.0.6(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedundici-types@6.20.0(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedvary@1.1.2(transitive)
- Removedylru@1.4.0(transitive)
Updated@satorijs/core@3.6.0-alpha.0