browsermob-proxy-api-client 1.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/BMPError.d.ts +15 -0
- package/dist/BMPError.js +29 -0
- package/dist/BMPError.js.map +1 -0
- package/dist/httpRequest.d.ts +18 -0
- package/dist/httpRequest.js +57 -0
- package/dist/httpRequest.js.map +1 -0
- package/dist/index.d.ts +5 -13
- package/dist/index.js +83 -71
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [3.0.0](https://github.com/raul72/browsermob-proxy-api-client/compare/2.0.0...3.0.0) (2025-03-06)
|
|
4
|
+
|
|
5
|
+
- Throw error when API responds with non-ok response code ([#151](https://github.com/raul72/browsermob-proxy-api-client/pull/151))
|
|
6
|
+
|
|
7
|
+
## [2.0.0](https://github.com/raul72/browsermob-proxy-api-client/compare/1.0.2...2.0.0) (2024-02-02)
|
|
8
|
+
|
|
9
|
+
- Drop node 16 support ([#107](https://github.com/raul72/browsermob-proxy-api-client/pull/107))
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Refer to [REST API] section of BrowserMob Proxy documentation for detailed infor
|
|
|
8
8
|
[](https://bundlephobia.com/package/browsermob-proxy-api-client@latest)
|
|
9
9
|
[](https://npm-stat.com/charts.html?package=browsermob-proxy-api-client)
|
|
10
10
|
[](https://snyk.io/test/npm/browsermob-proxy-api-client)
|
|
11
|
-
[](https://coveralls.io/r/raul72/browsermob-proxy-api-client)
|
|
12
12
|
|
|
13
13
|
## Installing
|
|
14
14
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClientRequest, IncomingMessage } from 'http';
|
|
2
|
+
import { OutgoingHttpHeaders } from 'http2';
|
|
3
|
+
import { HttpRequestResponse } from './httpRequest';
|
|
4
|
+
interface BMPErrorRequest extends Pick<ClientRequest, 'host' | 'protocol' | 'method' | 'path'> {
|
|
5
|
+
headers: OutgoingHttpHeaders;
|
|
6
|
+
}
|
|
7
|
+
interface BMPErrorResponse extends Pick<IncomingMessage, 'complete' | 'headers' | 'rawHeaders' | 'method' | 'url' | 'statusCode' | 'statusMessage'> {
|
|
8
|
+
}
|
|
9
|
+
export default class BMPError extends Error {
|
|
10
|
+
req: BMPErrorRequest;
|
|
11
|
+
res: BMPErrorResponse;
|
|
12
|
+
data: string;
|
|
13
|
+
constructor(message: string, { req, res, data }: HttpRequestResponse);
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/dist/BMPError.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class BMPError extends Error {
|
|
4
|
+
req;
|
|
5
|
+
res;
|
|
6
|
+
data;
|
|
7
|
+
constructor(message, { req, res, data }) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.req = {
|
|
10
|
+
host: req.host,
|
|
11
|
+
protocol: req.protocol,
|
|
12
|
+
method: req.method,
|
|
13
|
+
path: req.path,
|
|
14
|
+
headers: req.getHeaders(),
|
|
15
|
+
};
|
|
16
|
+
this.res = {
|
|
17
|
+
complete: res.complete,
|
|
18
|
+
headers: res.headers,
|
|
19
|
+
rawHeaders: res.rawHeaders,
|
|
20
|
+
method: res.method,
|
|
21
|
+
url: res.url,
|
|
22
|
+
statusCode: res.statusCode,
|
|
23
|
+
statusMessage: res.statusMessage,
|
|
24
|
+
};
|
|
25
|
+
this.data = data;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = BMPError;
|
|
29
|
+
//# sourceMappingURL=BMPError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BMPError.js","sourceRoot":"","sources":["../BMPError.ts"],"names":[],"mappings":";;AAaA,MAAqB,QAAS,SAAQ,KAAK;IAClC,GAAG,CAAkB;IAErB,GAAG,CAAmB;IAEtB,IAAI,CAAC;IAEZ,YAAmB,OAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAuB;QACzE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,GAAG,GAAG;YACT,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;SAC1B,CAAC;QAEF,IAAI,CAAC,GAAG,GAAG;YACT,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,aAAa,EAAE,GAAG,CAAC,aAAa;SACjC,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AA9BD,2BA8BC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClientRequest, IncomingMessage, RequestOptions } from 'http';
|
|
2
|
+
export declare enum Method {
|
|
3
|
+
GET = "GET",
|
|
4
|
+
POST = "POST",
|
|
5
|
+
PUT = "PUT",
|
|
6
|
+
DELETE = "DELETE"
|
|
7
|
+
}
|
|
8
|
+
export interface HttpRequestResponse {
|
|
9
|
+
req: ClientRequest;
|
|
10
|
+
res: IncomingMessage;
|
|
11
|
+
data: string;
|
|
12
|
+
}
|
|
13
|
+
export default class HttpRequest {
|
|
14
|
+
protected defaultOptions: RequestOptions;
|
|
15
|
+
protected overwriteOptions: RequestOptions;
|
|
16
|
+
protected httpRequest(options: RequestOptions, payload?: string): Promise<HttpRequestResponse>;
|
|
17
|
+
protected httpRequestWithArgs(path?: string, method?: Method, args?: Record<string, string | number | boolean>): Promise<HttpRequestResponse>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Method = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("http"));
|
|
8
|
+
var Method;
|
|
9
|
+
(function (Method) {
|
|
10
|
+
Method["GET"] = "GET";
|
|
11
|
+
Method["POST"] = "POST";
|
|
12
|
+
Method["PUT"] = "PUT";
|
|
13
|
+
Method["DELETE"] = "DELETE";
|
|
14
|
+
})(Method || (exports.Method = Method = {}));
|
|
15
|
+
class HttpRequest {
|
|
16
|
+
defaultOptions = {};
|
|
17
|
+
overwriteOptions = {};
|
|
18
|
+
async httpRequest(options, payload = '') {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
const req = http_1.default.request({
|
|
21
|
+
...this.defaultOptions,
|
|
22
|
+
...options,
|
|
23
|
+
...this.overwriteOptions,
|
|
24
|
+
}, res => {
|
|
25
|
+
const data = [];
|
|
26
|
+
res.on('data', chunk => data.push(chunk));
|
|
27
|
+
res.on('end', () => {
|
|
28
|
+
resolve({
|
|
29
|
+
req,
|
|
30
|
+
res,
|
|
31
|
+
data: data.join(''),
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
req.on('error', error => reject(error));
|
|
36
|
+
if (payload) {
|
|
37
|
+
req.write(payload);
|
|
38
|
+
}
|
|
39
|
+
req.end();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async httpRequestWithArgs(path = '/', method = Method.GET, args = {}) {
|
|
43
|
+
const headers = {};
|
|
44
|
+
const params = new URLSearchParams();
|
|
45
|
+
if ([Method.POST, Method.PUT].includes(method) && Object.entries(args).length) {
|
|
46
|
+
headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
47
|
+
Object.entries(args).forEach(arg => params.set(arg[0], String(arg[1])));
|
|
48
|
+
}
|
|
49
|
+
return this.httpRequest({
|
|
50
|
+
path,
|
|
51
|
+
method,
|
|
52
|
+
headers,
|
|
53
|
+
}, params.toString());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = HttpRequest;
|
|
57
|
+
//# sourceMappingURL=httpRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpRequest.js","sourceRoot":"","sources":["../httpRequest.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA4E;AAE5E,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,2BAAiB,CAAA;AACnB,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AAQD,MAAqB,WAAW;IACpB,cAAc,GAAmB,EAAE,CAAC;IAEpC,gBAAgB,GAAmB,EAAE,CAAC;IAEtC,KAAK,CAAC,WAAW,CACzB,OAAuB,EACvB,OAAO,GAAG,EAAE;QAEZ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CACtB;gBACE,GAAG,IAAI,CAAC,cAAc;gBACtB,GAAG,OAAO;gBACV,GAAG,IAAI,CAAC,gBAAgB;aACzB,EACD,GAAG,CAAC,EAAE;gBACJ,MAAM,IAAI,GAAa,EAAE,CAAC;gBAC1B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC1C,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;oBACjB,OAAO,CAAC;wBACN,GAA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="node" />
|
|
2
1
|
import { RequestOptions } from 'http';
|
|
3
2
|
import { Har } from 'har-format';
|
|
3
|
+
import BMPError from './BMPError';
|
|
4
|
+
import HttpRequest, { HttpRequestResponse } from './httpRequest';
|
|
4
5
|
import { BandwidthLimitsResponse, BlacklistItem, NewHarPageArgs, ProxyList, SetBandwidthLimitArgs, SetBlacklistArgs, SetRetryCountArgs, SetRewriteArgs, SetTimeoutsArgs, SetWhitelistArgs, StartHarArgs, StartProxyArgs, WaitArgs } from './typings/proxy';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
POST = "POST",
|
|
8
|
-
PUT = "PUT",
|
|
9
|
-
DELETE = "DELETE"
|
|
10
|
-
}
|
|
11
|
-
export { BandwidthLimitsResponse, BlacklistItem, NewHarPageArgs, ProxyList, SetBandwidthLimitArgs, SetBlacklistArgs, SetRetryCountArgs, SetRewriteArgs, SetTimeoutsArgs, SetWhitelistArgs, StartHarArgs, StartProxyArgs, WaitArgs, };
|
|
12
|
-
export default class BrowserMobProxyAPIClient {
|
|
13
|
-
readonly host: string;
|
|
14
|
-
readonly port: number;
|
|
6
|
+
export { BandwidthLimitsResponse, BlacklistItem, BMPError, NewHarPageArgs, ProxyList, SetBandwidthLimitArgs, SetBlacklistArgs, SetRetryCountArgs, SetRewriteArgs, SetTimeoutsArgs, SetWhitelistArgs, StartHarArgs, StartProxyArgs, WaitArgs, };
|
|
7
|
+
export default class BrowserMobProxyAPIClient extends HttpRequest {
|
|
15
8
|
constructor(host?: string, port?: number);
|
|
16
|
-
protected httpRequest(options: RequestOptions, payload?: string): Promise<
|
|
17
|
-
protected httpRequestWithArgs(path?: string, method?: Method, args?: Record<string, string | number | boolean>): Promise<string>;
|
|
9
|
+
protected httpRequest(options: RequestOptions, payload?: string): Promise<HttpRequestResponse>;
|
|
18
10
|
/***
|
|
19
11
|
* Get a list of ports attached to ProxyServer instances managed by ProxyManager
|
|
20
12
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,143 +1,154 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Method["PUT"] = "PUT";
|
|
12
|
-
Method["DELETE"] = "DELETE";
|
|
13
|
-
})(Method || (Method = {}));
|
|
14
|
-
class BrowserMobProxyAPIClient {
|
|
39
|
+
exports.BMPError = void 0;
|
|
40
|
+
const BMPError_1 = __importDefault(require("./BMPError"));
|
|
41
|
+
exports.BMPError = BMPError_1.default;
|
|
42
|
+
const httpRequest_1 = __importStar(require("./httpRequest"));
|
|
43
|
+
class BrowserMobProxyAPIClient extends httpRequest_1.default {
|
|
15
44
|
constructor(host = 'localhost', port = 8080) {
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
res.on('data', chunk => data.push(chunk));
|
|
28
|
-
res.on('end', () => {
|
|
29
|
-
resolve(data.join(''));
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
req.on('error', error => reject(error));
|
|
33
|
-
if (payload) {
|
|
34
|
-
req.write(payload);
|
|
35
|
-
}
|
|
36
|
-
req.end();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
httpRequestWithArgs(path = '/', method = Method.GET, args = {}) {
|
|
40
|
-
const headers = {};
|
|
41
|
-
const params = new URLSearchParams();
|
|
42
|
-
if ([Method.POST, Method.PUT].includes(method) && Object.entries(args).length) {
|
|
43
|
-
headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
44
|
-
Object.entries(args).forEach(arg => params.set(arg[0], String(arg[1])));
|
|
45
|
+
super();
|
|
46
|
+
this.defaultOptions = {
|
|
47
|
+
host,
|
|
48
|
+
port,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async httpRequest(options, payload = '') {
|
|
52
|
+
const ret = await super.httpRequest(options, payload);
|
|
53
|
+
const statusCode = ret.res.statusCode || 0;
|
|
54
|
+
if (statusCode < 200 || statusCode >= 400) {
|
|
55
|
+
throw new BMPError_1.default(`Invalid API response code ${ret.res.statusCode}${options.path ? ` on ${options.path}` : ''}`, ret);
|
|
45
56
|
}
|
|
46
|
-
return
|
|
47
|
-
path,
|
|
48
|
-
method,
|
|
49
|
-
headers,
|
|
50
|
-
}, params.toString());
|
|
57
|
+
return ret;
|
|
51
58
|
}
|
|
52
59
|
/***
|
|
53
60
|
* Get a list of ports attached to ProxyServer instances managed by ProxyManager
|
|
54
61
|
*/
|
|
55
62
|
async getProxyList() {
|
|
56
|
-
|
|
63
|
+
const res = await this.httpRequestWithArgs('/proxy', httpRequest_1.Method.GET);
|
|
64
|
+
return JSON.parse(res.data);
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
67
|
* Creates a new proxy to run requests off of
|
|
60
68
|
*/
|
|
61
69
|
async start(args = {}) {
|
|
62
|
-
const res = await this.httpRequestWithArgs('/proxy', Method.POST, { ...args });
|
|
63
|
-
const { port } = JSON.parse(res);
|
|
70
|
+
const res = await this.httpRequestWithArgs('/proxy', httpRequest_1.Method.POST, { ...args });
|
|
71
|
+
const { port } = JSON.parse(res.data);
|
|
64
72
|
return port || null;
|
|
65
73
|
}
|
|
66
74
|
/**
|
|
67
75
|
* Shuts down the proxy and closes the port.
|
|
68
76
|
*/
|
|
69
77
|
async stop(port) {
|
|
70
|
-
await this.httpRequestWithArgs(`/proxy/${port}`, Method.DELETE);
|
|
78
|
+
await this.httpRequestWithArgs(`/proxy/${port}`, httpRequest_1.Method.DELETE);
|
|
71
79
|
}
|
|
72
80
|
/**
|
|
73
81
|
* Creates a new HAR attached to the proxy
|
|
74
82
|
* returns the HAR content if there was a previous HAR
|
|
75
83
|
*/
|
|
76
84
|
async startHar(port, args = {}) {
|
|
77
|
-
const res = await this.httpRequestWithArgs(`/proxy/${port}/har`, Method.PUT, { ...args });
|
|
78
|
-
return res ? JSON.parse(res) : undefined;
|
|
85
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/har`, httpRequest_1.Method.PUT, { ...args });
|
|
86
|
+
return res.data ? JSON.parse(res.data) : undefined;
|
|
79
87
|
}
|
|
80
88
|
/**
|
|
81
89
|
* Starts a new page on the existing HAR
|
|
82
90
|
*/
|
|
83
91
|
async newHarPage(port, args = {}) {
|
|
84
|
-
await this.httpRequestWithArgs(`/proxy/${port}/har/pageRef`, Method.PUT, { ...args });
|
|
92
|
+
await this.httpRequestWithArgs(`/proxy/${port}/har/pageRef`, httpRequest_1.Method.PUT, { ...args });
|
|
85
93
|
}
|
|
86
94
|
/**
|
|
87
95
|
* Returns the JSON/HAR content representing all the HTTP traffic passed through the proxy
|
|
88
96
|
* provided you have already created the HAR with this.startHar
|
|
89
97
|
*/
|
|
90
98
|
async getHar(port) {
|
|
91
|
-
const res = await this.httpRequestWithArgs(`/proxy/${port}/har`, Method.GET);
|
|
92
|
-
return res ? JSON.parse(res) : undefined;
|
|
99
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/har`, httpRequest_1.Method.GET);
|
|
100
|
+
return res.data ? JSON.parse(res.data) : undefined;
|
|
93
101
|
}
|
|
94
102
|
/**
|
|
95
103
|
* Get whitelisted items
|
|
96
104
|
*/
|
|
97
105
|
async getWhitelist(port) {
|
|
98
|
-
|
|
106
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/whitelist`, httpRequest_1.Method.GET);
|
|
107
|
+
return JSON.parse(res.data);
|
|
99
108
|
}
|
|
100
109
|
/**
|
|
101
110
|
* Sets a list of URL patterns to whitelist
|
|
102
111
|
*/
|
|
103
112
|
async setWhitelist(port, args) {
|
|
104
|
-
await this.httpRequestWithArgs(`/proxy/${port}/whitelist`, Method.PUT, { ...args });
|
|
113
|
+
await this.httpRequestWithArgs(`/proxy/${port}/whitelist`, httpRequest_1.Method.PUT, { ...args });
|
|
105
114
|
}
|
|
106
115
|
/**
|
|
107
116
|
* Clears all URL patterns from the whitelist
|
|
108
117
|
*/
|
|
109
118
|
async clearWhitelist(port) {
|
|
110
|
-
await this.httpRequestWithArgs(`/proxy/${port}/whitelist`, Method.DELETE);
|
|
119
|
+
await this.httpRequestWithArgs(`/proxy/${port}/whitelist`, httpRequest_1.Method.DELETE);
|
|
111
120
|
}
|
|
112
121
|
/**
|
|
113
122
|
* Get blacklisted items
|
|
114
123
|
*/
|
|
115
124
|
async getBlacklist(port) {
|
|
116
|
-
|
|
125
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/blacklist`, httpRequest_1.Method.GET);
|
|
126
|
+
return JSON.parse(res.data);
|
|
117
127
|
}
|
|
118
128
|
/**
|
|
119
129
|
* Set a URL to blacklist
|
|
120
130
|
*/
|
|
121
131
|
async setBlacklist(port, args) {
|
|
122
|
-
await this.httpRequestWithArgs(`/proxy/${port}/blacklist`, Method.PUT, { ...args });
|
|
132
|
+
await this.httpRequestWithArgs(`/proxy/${port}/blacklist`, httpRequest_1.Method.PUT, { ...args });
|
|
123
133
|
}
|
|
124
134
|
/**
|
|
125
135
|
* Clears all URL patterns from the blacklist
|
|
126
136
|
*/
|
|
127
137
|
async clearBlacklist(port) {
|
|
128
|
-
await this.httpRequestWithArgs(`/proxy/${port}/blacklist`, Method.DELETE);
|
|
138
|
+
await this.httpRequestWithArgs(`/proxy/${port}/blacklist`, httpRequest_1.Method.DELETE);
|
|
129
139
|
}
|
|
130
140
|
/**
|
|
131
141
|
* Limit the bandwidth through the proxy
|
|
132
142
|
*/
|
|
133
143
|
async setBandwidthLimit(port, args = {}) {
|
|
134
|
-
await this.httpRequestWithArgs(`/proxy/${port}/limit`, Method.PUT, { ...args });
|
|
144
|
+
await this.httpRequestWithArgs(`/proxy/${port}/limit`, httpRequest_1.Method.PUT, { ...args });
|
|
135
145
|
}
|
|
136
146
|
/**
|
|
137
147
|
* Displays the amount of data remaining to be uploaded/downloaded until the limit is reached
|
|
138
148
|
*/
|
|
139
149
|
async getBandwidthLimit(port) {
|
|
140
|
-
|
|
150
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/limit`, httpRequest_1.Method.GET);
|
|
151
|
+
return JSON.parse(res.data);
|
|
141
152
|
}
|
|
142
153
|
/**
|
|
143
154
|
* Set and override HTTP Request headers
|
|
@@ -146,7 +157,7 @@ class BrowserMobProxyAPIClient {
|
|
|
146
157
|
async setRequestHeaders(port, headers) {
|
|
147
158
|
await this.httpRequest({
|
|
148
159
|
path: `/proxy/${port}/headers`,
|
|
149
|
-
method: Method.POST,
|
|
160
|
+
method: httpRequest_1.Method.POST,
|
|
150
161
|
headers: {
|
|
151
162
|
'Content-Type': 'text/plain',
|
|
152
163
|
},
|
|
@@ -159,7 +170,7 @@ class BrowserMobProxyAPIClient {
|
|
|
159
170
|
async setHosts(port, hosts) {
|
|
160
171
|
await this.httpRequest({
|
|
161
172
|
path: `/proxy/${port}/hosts`,
|
|
162
|
-
method: Method.POST,
|
|
173
|
+
method: httpRequest_1.Method.POST,
|
|
163
174
|
headers: {
|
|
164
175
|
'Content-Type': 'text/plain',
|
|
165
176
|
},
|
|
@@ -171,7 +182,7 @@ class BrowserMobProxyAPIClient {
|
|
|
171
182
|
async setBasicAuth(port, domain, username, password) {
|
|
172
183
|
await this.httpRequest({
|
|
173
184
|
path: `/proxy/${port}/auth/basic/${domain}`,
|
|
174
|
-
method: Method.POST,
|
|
185
|
+
method: httpRequest_1.Method.POST,
|
|
175
186
|
headers: {
|
|
176
187
|
'Content-Type': 'text/plain',
|
|
177
188
|
},
|
|
@@ -181,7 +192,8 @@ class BrowserMobProxyAPIClient {
|
|
|
181
192
|
* Wait till all request are being made
|
|
182
193
|
*/
|
|
183
194
|
async wait(port, args) {
|
|
184
|
-
|
|
195
|
+
const res = await this.httpRequestWithArgs(`/proxy/${port}/wait`, httpRequest_1.Method.PUT, { ...args });
|
|
196
|
+
return res.data;
|
|
185
197
|
}
|
|
186
198
|
/**
|
|
187
199
|
* Handles different proxy timeouts
|
|
@@ -189,7 +201,7 @@ class BrowserMobProxyAPIClient {
|
|
|
189
201
|
async setTimeouts(port, timeouts) {
|
|
190
202
|
await this.httpRequest({
|
|
191
203
|
path: `/proxy/${port}/timeout`,
|
|
192
|
-
method: Method.PUT,
|
|
204
|
+
method: httpRequest_1.Method.PUT,
|
|
193
205
|
headers: {
|
|
194
206
|
'Content-Type': 'text/plain',
|
|
195
207
|
},
|
|
@@ -199,25 +211,25 @@ class BrowserMobProxyAPIClient {
|
|
|
199
211
|
* Redirecting URLs
|
|
200
212
|
*/
|
|
201
213
|
async setRewrite(port, args) {
|
|
202
|
-
await this.httpRequestWithArgs(`/proxy/${port}/rewrite`, Method.PUT, { ...args });
|
|
214
|
+
await this.httpRequestWithArgs(`/proxy/${port}/rewrite`, httpRequest_1.Method.PUT, { ...args });
|
|
203
215
|
}
|
|
204
216
|
/**
|
|
205
217
|
* Removes all URL redirection rules currently in effect
|
|
206
218
|
*/
|
|
207
219
|
async clearRewrites(port) {
|
|
208
|
-
await this.httpRequestWithArgs(`/proxy/${port}/rewrite`, Method.DELETE);
|
|
220
|
+
await this.httpRequestWithArgs(`/proxy/${port}/rewrite`, httpRequest_1.Method.DELETE);
|
|
209
221
|
}
|
|
210
222
|
/**
|
|
211
223
|
* Set retry count
|
|
212
224
|
*/
|
|
213
225
|
async setRetryCount(port, args) {
|
|
214
|
-
await this.httpRequestWithArgs(`/proxy/${port}/retry`, Method.PUT, { ...args });
|
|
226
|
+
await this.httpRequestWithArgs(`/proxy/${port}/retry`, httpRequest_1.Method.PUT, { ...args });
|
|
215
227
|
}
|
|
216
228
|
/**
|
|
217
229
|
* Empties the DNS cache
|
|
218
230
|
*/
|
|
219
231
|
async clearDNSCache(port) {
|
|
220
|
-
await this.httpRequestWithArgs(`/proxy/${port}/dns/cache`, Method.DELETE);
|
|
232
|
+
await this.httpRequestWithArgs(`/proxy/${port}/dns/cache`, httpRequest_1.Method.DELETE);
|
|
221
233
|
}
|
|
222
234
|
/**
|
|
223
235
|
* Set request interceptor
|
|
@@ -227,7 +239,7 @@ class BrowserMobProxyAPIClient {
|
|
|
227
239
|
async setRequestInterceptor(port, interceptor) {
|
|
228
240
|
await this.httpRequest({
|
|
229
241
|
path: `/proxy/${port}/filter/request`,
|
|
230
|
-
method: Method.POST,
|
|
242
|
+
method: httpRequest_1.Method.POST,
|
|
231
243
|
headers: {
|
|
232
244
|
'Content-Type': 'text/plain',
|
|
233
245
|
},
|
|
@@ -241,7 +253,7 @@ class BrowserMobProxyAPIClient {
|
|
|
241
253
|
async setResponseInterceptor(port, interceptor) {
|
|
242
254
|
await this.httpRequest({
|
|
243
255
|
path: `/proxy/${port}/filter/response`,
|
|
244
|
-
method: Method.POST,
|
|
256
|
+
method: httpRequest_1.Method.POST,
|
|
245
257
|
headers: {
|
|
246
258
|
'Content-Type': 'text/plain',
|
|
247
259
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,0DAAkC;AAsBhC,mBAtBK,kBAAQ,CAsBL;AArBV,6DAAyE;AAmCzE,MAAqB,wBAAyB,SAAQ,qBAAW;IAC/D,YAAY,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,IAAI;QACzC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG;YACpB,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,WAAW,CACzB,OAAuB,EACvB,OAAO,GAAG,EAAE;QAEZ,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAEtD,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC;QAE3C,IAAI,UAAU,GAAG,GAAG,IAAI,UAAU,IAAI,GAAG,E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
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "jest"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=18"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://github.com/raul72/browsermob-proxy-api-client/",
|
|
15
15
|
"repository": {
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@jest/globals": "^29.3.1",
|
|
24
|
-
"@microsoft/eslint-formatter-sarif": "
|
|
25
|
-
"@tsconfig/
|
|
26
|
-
"@types/node": "^
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
28
|
-
"@typescript-eslint/parser": "
|
|
24
|
+
"@microsoft/eslint-formatter-sarif": "3.1.0",
|
|
25
|
+
"@tsconfig/node18": "^18",
|
|
26
|
+
"@types/node": "^18",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
28
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
29
29
|
"eslint": "^8.29.0",
|
|
30
|
-
"eslint-config-airbnb-typescript": "^
|
|
30
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
31
31
|
"eslint-plugin-import": "^2.26.0",
|
|
32
32
|
"jest": "^29.3.1",
|
|
33
33
|
"ts-jest": "^29.0.3",
|
|
34
34
|
"ts-node": "^10.9.1",
|
|
35
|
-
"typescript": "^
|
|
35
|
+
"typescript": "^5.0.0"
|
|
36
36
|
},
|
|
37
|
-
"version": "
|
|
37
|
+
"version": "3.0.0"
|
|
38
38
|
}
|