Fixed POST method and package scripts

This commit is contained in:
minicx 2023-08-21 00:00:05 +03:00
parent 9584cbc7cd
commit 8cd436f4ba
4 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "flaresolverr.js",
"version": "0.1.0",
"version": "0.1.1",
"description": "Api for bypassing cloudflare via dockered FlareSolverr",
"files": [
"dist",
@ -31,12 +31,10 @@
"cloudflare bypass"
],
"scripts": {
"build:mjs": "rm -rf dist/mjs && tsc -p tsconfig.json",
"build:cjs": "rm -rf dist/cjs && tsc -p tsconfig-cjs.json",
"build": "rollup -c",
"lint": "eslint --fix .",
"format": "prettier --write src/** rollup.config.mjs",
"prepublishOnly": "npm run lint && npm run build"
"prepublishOnly": "npm run format && npm run lint && npm run build"
},
"engines": {
"node": ">=16"

View File

@ -19,7 +19,7 @@ const rollupConfig = {
entryFileNames: '[name].cjs',
},
],
external: [ 'node:http' ],
external: ['node:http'],
plugins: [
clean('dist'),
eslint({

View File

@ -208,7 +208,7 @@ export class FlareSolverr {
*/
async post(options: IRequestPostOptions): Promise<IRequestAnswer> {
return await this._makeRequest({
cmd: 'request.get',
cmd: 'request.post',
...options,
proxy:
options.proxy === undefined

View File

@ -22,6 +22,7 @@ type TAPIMethodList = [
'sessions.create',
'sessions.destroy',
'request.get',
'request.post',
];
/**