Skip to content

Commit d364e49

Browse files
authored
v1.3.3 (#51)
* chore: add log for file reading error * cleanup: remove curl generator error, now shifted this to UI in requestly/requestly#2184 * chore: bump version + update requestly-core version + resolve vulnerable dependency * chore: build assets * fix: typescript config * fix: lib proxy exports * [ENGG-2339] chore: update requestly-core
1 parent e2faff7 commit d364e49

File tree

14 files changed

+134
-136
lines changed

14 files changed

+134
-136
lines changed

dist/components/proxy-middleware/middlewares/logger_middleware.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
"use strict";
2-
var __importDefault = (this && this.__importDefault) || function (mod) {
3-
return (mod && mod.__esModule) ? mod : { "default": mod };
4-
};
52
Object.defineProperty(exports, "__esModule", { value: true });
6-
const lodash_1 = require("lodash");
7-
const httpsnippet_1 = __importDefault(require("httpsnippet"));
3+
// import { cloneDeep } from "lodash";
4+
// import HTTPSnippet from "httpsnippet";
85
const utils_1 = require("../rule_action_processor/utils");
96
const harObectCreator_1 = require("../helpers/harObectCreator");
10-
const url = require("url");
7+
// const url = require("url");
118
class LoggerMiddleware {
129
constructor(is_active, loggerService) {
1310
this.generate_curl_from_har = (requestHarObject) => {
1411
if (!requestHarObject) {
1512
return "";
1613
}
1714
let requestCurl = "";
18-
try {
19-
const harObject = (0, lodash_1.cloneDeep)(requestHarObject);
20-
requestCurl = new httpsnippet_1.default(harObject).convert("shell", "curl", {
21-
indent: " ",
22-
});
23-
}
24-
catch (err) {
25-
console.error(`LoggerMiddleware.generate_curl_from_har Error: ${err}`);
26-
}
15+
// try {
16+
// const harObject = cloneDeep(requestHarObject);
17+
// requestCurl = new HTTPSnippet(harObject).convert("shell", "curl", {
18+
// indent: " ",
19+
// });
20+
// } catch (err) {
21+
// console.error(`LoggerMiddleware.generate_curl_from_har Error: ${err}`);
22+
// }
2723
return requestCurl;
2824
};
2925
this.send_network_log = (ctx, action_result_objs = [], requestState = "") => {

dist/components/proxy-middleware/rule_action_processor/processors/modify_response_processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const modify_response_using_local = (action, ctx) => {
8383
modify_response(ctx, data, action.statusCode);
8484
}
8585
catch (err) {
86-
console.log("Some Error while reading file");
86+
console.log("Error reading file", err);
8787
}
8888
};
8989
const modify_response_using_code = (action, ctx) => __awaiter(void 0, void 0, void 0, function* () {

package-lock.json

Lines changed: 84 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"name": "@requestly/requestly-proxy",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "Proxy that gives superpowers to all the Requestly clients",
55
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"type": "commonjs",
68
"scripts": {
79
"test": "echo \"Error: no test specified\" && exit 1",
810
"dev": "nodemon src/test.ts",
@@ -13,11 +15,17 @@
1315
"type": "git",
1416
"url": "git+https://github.com/requestly/rq-proxy.git"
1517
},
18+
"exports": {
19+
".": {
20+
"require": "./dist/index.js",
21+
"types": "./dist/index.d.ts"
22+
}
23+
},
1624
"author": "",
1725
"license": "ISC",
1826
"dependencies": {
19-
"@requestly/requestly-core": "^1.0.4",
20-
"@sentry/browser": "^6.19.7",
27+
"@requestly/requestly-core": "^1.1.0",
28+
"@sentry/browser": "^8.33.1",
2129
"async": "^3.2.5",
2230
"axios": "^1.7.2",
2331
"capture-console-logs": "^1.0.1",
@@ -40,7 +48,7 @@
4048
"ajv": "^8.13.0",
4149
"nodemon": "^3.1.0",
4250
"type-fest": "^2.12.2",
43-
"typescript": "^4.6.3"
51+
"typescript": "^5.6.3"
4452
},
4553
"files": [
4654
"dist"

src/components/proxy-middleware/helpers/proxy_ctx_helper.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
// TODO: Removing this for now
2-
// import {
3-
// extractUrlComponent,
4-
// getQueryParamsMap,
5-
// } from "../../../../../../../common/components/utils/utils";
6-
// const CONSTANTS = require("../../../../../../../common/constants");
7-
81
import {
92
CONSTANTS as GLOBAL_CONSTANTS,
103
} from "@requestly/requestly-core"

src/components/proxy-middleware/middlewares/logger_middleware.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { cloneDeep } from "lodash";
2-
import HTTPSnippet from "httpsnippet";
1+
// import { cloneDeep } from "lodash";
2+
// import HTTPSnippet from "httpsnippet";
33
import { get_success_actions_from_action_results } from "../rule_action_processor/utils";
44
import { createHar } from "../helpers/harObectCreator";
5-
const url = require("url");
5+
// const url = require("url");
66

77
class LoggerMiddleware {
88
constructor(is_active, loggerService) {
@@ -15,14 +15,14 @@ class LoggerMiddleware {
1515
return "";
1616
}
1717
let requestCurl = "";
18-
try {
19-
const harObject = cloneDeep(requestHarObject);
20-
requestCurl = new HTTPSnippet(harObject).convert("shell", "curl", {
21-
indent: " ",
22-
});
23-
} catch (err) {
24-
console.error(`LoggerMiddleware.generate_curl_from_har Error: ${err}`);
25-
}
18+
// try {
19+
// const harObject = cloneDeep(requestHarObject);
20+
// requestCurl = new HTTPSnippet(harObject).convert("shell", "curl", {
21+
// indent: " ",
22+
// });
23+
// } catch (err) {
24+
// console.error(`LoggerMiddleware.generate_curl_from_har Error: ${err}`);
25+
// }
2626
return requestCurl;
2727
};
2828

src/components/proxy-middleware/rule_action_processor/processors/modify_response_processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const modify_response_using_local = (action, ctx) => {
9292
data = fs.readFileSync(action.response, "utf-8");
9393
modify_response(ctx, data, action.statusCode);
9494
} catch (err) {
95-
console.log("Some Error while reading file");
95+
console.log("Error reading file", err)
9696
}
9797
};
9898

src/components/ssl-proxying/ssl-proxying-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// import BaseConfigFetcher from "renderer/lib/fetcher/base";
33
// TODO: @sahil fix this by adding type.d.ts file
44
//@ts-ignore
5-
import { RULE_PROCESSOR } from "@requestly/requestly-core";
5+
// import { RULE_PROCESSOR } from "@requestly/requestly-core";
66

77

88
// TODO: @sahil to add this

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import RQProxy from "./rq-proxy";
22
import RQProxyProvider from "./rq-proxy-provider";
33

4-
54
export {
65
RQProxy,
76
RQProxyProvider,

src/lib/proxy/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
"use strict";
1+
import DefaultExport, {Proxy, PROXY_HANDLER_TYPE, gunzip, wildcard} from "./lib/proxy"
22

3-
module.exports = require("./lib/proxy");
3+
export default DefaultExport;
4+
5+
export {Proxy, PROXY_HANDLER_TYPE, gunzip, wildcard}

0 commit comments

Comments
 (0)