From ff63cea108d32c0bd818585ebc7583bfd4c8c19e Mon Sep 17 00:00:00 2001 From: Martin Sefcik Date: Mon, 30 Oct 2023 18:03:32 +0100 Subject: [PATCH 01/26] fix (#759): fixed axios versions inconsistency --- package-lock.json | 140 ++++++++++++++++---------------- packages/bruno-app/package.json | 2 +- packages/bruno-js/package.json | 2 +- 3 files changed, 74 insertions(+), 70 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79f3de50f..7e030331b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5546,13 +5546,6 @@ "version": "1.12.0", "license": "MIT" }, - "node_modules/axios": { - "version": "0.26.1", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.8" - } - }, "node_modules/babel-jest": { "version": "29.3.1", "dev": true, @@ -13580,6 +13573,7 @@ }, "node_modules/react-is": { "version": "18.2.0", + "dev": true, "license": "MIT" }, "node_modules/react-redux": { @@ -16448,7 +16442,7 @@ "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", "@usebruno/schema": "0.6.0", - "axios": "^0.26.0", + "axios": "^1.5.1", "classnames": "^2.3.1", "codemirror": "^5.65.2", "codemirror-graphql": "^1.2.5", @@ -16512,6 +16506,16 @@ "version": "2.0.1", "license": "Python-2.0" }, + "packages/bruno-app/node_modules/axios": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "packages/bruno-app/node_modules/entities": { "version": "3.0.1", "license": "BSD-2-Clause", @@ -16865,7 +16869,7 @@ "@usebruno/query": "0.1.0", "ajv": "^8.12.0", "atob": "^2.1.2", - "axios": "^0.26.0", + "axios": "^1.5.1", "btoa": "^1.2.1", "chai": "^4.3.7", "chai-string": "^1.5.0", @@ -16896,6 +16900,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "packages/bruno-js/node_modules/axios": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "packages/bruno-js/node_modules/json-schema-traverse": { "version": "1.0.0", "license": "MIT" @@ -20241,8 +20255,7 @@ } }, "@tabler/icons": { - "version": "1.119.0", - "requires": {} + "version": "1.119.0" }, "@tauri-apps/cli": { "version": "1.2.2", @@ -20511,7 +20524,7 @@ "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", "@usebruno/schema": "0.6.0", - "axios": "^0.26.0", + "axios": "^1.5.1", "babel-loader": "^8.2.3", "classnames": "^2.3.1", "codemirror": "^5.65.2", @@ -20567,6 +20580,16 @@ "argparse": { "version": "2.0.1" }, + "axios": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "entities": { "version": "3.0.1" }, @@ -20685,7 +20708,7 @@ "@usebruno/query": "0.1.0", "ajv": "^8.12.0", "atob": "^2.1.2", - "axios": "^0.26.0", + "axios": "^1.5.1", "btoa": "^1.2.1", "chai": "^4.3.7", "chai-string": "^1.5.0", @@ -20708,6 +20731,16 @@ "uri-js": "^4.2.2" } }, + "axios": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "json-schema-traverse": { "version": "1.0.0" }, @@ -20746,8 +20779,7 @@ } }, "@usebruno/schema": { - "version": "file:packages/bruno-schema", - "requires": {} + "version": "file:packages/bruno-schema" }, "@usebruno/testbench": { "version": "file:packages/bruno-testbench", @@ -20891,8 +20923,7 @@ }, "@webpack-cli/configtest": { "version": "1.2.0", - "dev": true, - "requires": {} + "dev": true }, "@webpack-cli/info": { "version": "1.5.0", @@ -20903,8 +20934,7 @@ }, "@webpack-cli/serve": { "version": "1.7.0", - "dev": true, - "requires": {} + "dev": true }, "@xtuc/ieee754": { "version": "1.2.0", @@ -20981,8 +21011,7 @@ }, "ajv-keywords": { "version": "3.5.2", - "dev": true, - "requires": {} + "dev": true }, "amdefine": { "version": "0.0.8" @@ -21247,12 +21276,6 @@ "aws4": { "version": "1.12.0" }, - "axios": { - "version": "0.26.1", - "requires": { - "follow-redirects": "^1.14.8" - } - }, "babel-jest": { "version": "29.3.1", "dev": true, @@ -21876,8 +21899,7 @@ "chai-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", - "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", - "requires": {} + "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==" }, "chalk": { "version": "4.1.2", @@ -22272,8 +22294,7 @@ }, "css-declaration-sorter": { "version": "6.3.1", - "dev": true, - "requires": {} + "dev": true }, "css-loader": { "version": "6.7.3", @@ -22392,8 +22413,7 @@ }, "cssnano-utils": { "version": "3.1.0", - "dev": true, - "requires": {} + "dev": true }, "csso": { "version": "4.2.0", @@ -23553,8 +23573,7 @@ } }, "goober": { - "version": "2.1.11", - "requires": {} + "version": "2.1.11" }, "got": { "version": "9.6.0", @@ -23917,8 +23936,7 @@ }, "icss-utils": { "version": "5.1.0", - "dev": true, - "requires": {} + "dev": true }, "idb": { "version": "7.1.1" @@ -24520,8 +24538,7 @@ }, "jest-pnp-resolver": { "version": "1.2.3", - "dev": true, - "requires": {} + "dev": true }, "jest-regex-util": { "version": "29.2.0", @@ -25110,8 +25127,7 @@ "version": "1.4.1" }, "meros": { - "version": "1.2.1", - "requires": {} + "version": "1.2.1" }, "methods": { "version": "1.1.2" @@ -25871,23 +25887,19 @@ }, "postcss-discard-comments": { "version": "5.1.2", - "dev": true, - "requires": {} + "dev": true }, "postcss-discard-duplicates": { "version": "5.1.0", - "dev": true, - "requires": {} + "dev": true }, "postcss-discard-empty": { "version": "5.1.1", - "dev": true, - "requires": {} + "dev": true }, "postcss-discard-overridden": { "version": "5.1.0", - "dev": true, - "requires": {} + "dev": true }, "postcss-js": { "version": "3.0.3", @@ -25969,8 +25981,7 @@ }, "postcss-modules-extract-imports": { "version": "3.0.0", - "dev": true, - "requires": {} + "dev": true }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -26003,8 +26014,7 @@ }, "postcss-normalize-charset": { "version": "5.1.0", - "dev": true, - "requires": {} + "dev": true }, "postcss-normalize-display-values": { "version": "5.1.0", @@ -26399,11 +26409,11 @@ } }, "react-inspector": { - "version": "6.0.2", - "requires": {} + "version": "6.0.2" }, "react-is": { - "version": "18.2.0" + "version": "18.2.0", + "dev": true }, "react-redux": { "version": "7.2.9", @@ -26550,8 +26560,7 @@ } }, "redux-thunk": { - "version": "2.4.2", - "requires": {} + "version": "2.4.2" }, "regenerate": { "version": "1.4.2", @@ -26783,8 +26792,7 @@ }, "rollup-plugin-peer-deps-external": { "version": "2.2.4", - "dev": true, - "requires": {} + "dev": true }, "rollup-plugin-postcss": { "version": "4.0.2", @@ -27278,8 +27286,7 @@ }, "style-loader": { "version": "3.3.1", - "dev": true, - "requires": {} + "dev": true }, "styled-components": { "version": "5.3.6", @@ -27308,8 +27315,7 @@ } }, "styled-jsx": { - "version": "5.0.7", - "requires": {} + "version": "5.0.7" }, "stylehacks": { "version": "5.1.1", @@ -27902,8 +27908,7 @@ } }, "use-sync-external-store": { - "version": "1.2.0", - "requires": {} + "version": "1.2.0" }, "utf8-byte-length": { "version": "1.0.4", @@ -28064,8 +28069,7 @@ }, "acorn-import-assertions": { "version": "1.8.0", - "dev": true, - "requires": {} + "dev": true }, "schema-utils": { "version": "3.1.1", diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index c3f82569f..532902cd2 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -20,7 +20,7 @@ "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", "@usebruno/schema": "0.6.0", - "axios": "^0.26.0", + "axios": "^1.5.1", "classnames": "^2.3.1", "codemirror": "^5.65.2", "codemirror-graphql": "^1.2.5", diff --git a/packages/bruno-js/package.json b/packages/bruno-js/package.json index d8161c9ec..274e1ae04 100644 --- a/packages/bruno-js/package.json +++ b/packages/bruno-js/package.json @@ -17,7 +17,7 @@ "@usebruno/query": "0.1.0", "ajv": "^8.12.0", "atob": "^2.1.2", - "axios": "^0.26.0", + "axios": "^1.5.1", "btoa": "^1.2.1", "chai": "^4.3.7", "chai-string": "^1.5.0", From 741718ede61bb45f8e4783ac57489500bbea7980 Mon Sep 17 00:00:00 2001 From: szto Date: Fri, 3 Nov 2023 00:37:08 +0900 Subject: [PATCH 02/26] feat: korean transation --- docs/readme/readme_kr.md | 121 +++++++++++++++++++++++++++++++++++++++ readme.md | 2 +- 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 docs/readme/readme_kr.md diff --git a/docs/readme/readme_kr.md b/docs/readme/readme_kr.md new file mode 100644 index 000000000..070fd0866 --- /dev/null +++ b/docs/readme/readme_kr.md @@ -0,0 +1,121 @@ +
+ + +### Bruno - API 탐색 및 테스트를 위한 오픈소스 IDE. + +[![GitHub version](https://badge.fury.io/gh/usebruno%2Fbruno.svg)](https://badge.fury.io/gh/usebruno%bruno) +[![CI](https://github.com/usebruno/bruno/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/usebruno/bruno/workflows/unit-tests.yml) +[![Commit Activity](https://img.shields.io/github/commit-activity/m/usebruno/bruno)](https://github.com/usebruno/bruno/pulse) +[![X](https://img.shields.io/twitter/follow/use_bruno?style=social&logo=x)](https://twitter.com/use_bruno) +[![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com) +[![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads) + +Bruno는 새롭고 혁신적인 API 클라이언트로, Postman과 유사한 툴들을 혁신하는 것을 목표로 합니다. + +Bruno는 사용자의 컬렉션을 파일 시스템의 폴더에 직접 저장합니다. 일반 텍스트 마크업 언어인 Bru를 사용해 API 요청에 대한 정보를 저장합니다. + +Git 또는 원하는 버전 관리 도구를 사용하여 API 컬렉션을 연동할 수 있습니다. + +브루는 오프라인 전용입니다. 브루노에 클라우드 동기화 기능을 추가할 계획은 없습니다. 저희는 사용자의 데이터 프라이버시를 소중히 여기며, 데이터는 사용자의 기기에 남아 있어야 한다고 믿습니다. 장기 비전 읽기 [링크](https://github.com/usebruno/bruno/discussions/269) + +📢 Watch our recent talk at India FOSS 3.0 Conference [here](https://www.youtube.com/watch?v=7bSMFpbcPiY) + +![bruno](/assets/images/landing-2.png)

+ +### 설치 + +Bruno 는 여기에서 다운로드 받을 수 있습니다.[링크](https://www.usebruno.com/downloads) (맥, 윈도우, 리눅스) + +Homebrew, Chocolatey, Snap, Apt 같은 패키지 관리자를 통해서도 Bruno를 설치할 수 있습니다. + +```sh +# On Mac via Homebrew +brew install bruno + +# On Windows via Chocolatey +choco install bruno + +# On Linux via Snap +snap install bruno + +# On Linux via Apt +sudo mkdir -p /etc/apt/keyrings +sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/bruno.gpg --keyserver keyserver.ubuntu.com --recv-keys 9FA6017ECABE0266 + +echo "deb [signed-by=/etc/apt/keyrings/bruno.gpg] http://debian.usebruno.com/ bruno stable" | sudo tee /etc/apt/sources.list.d/bruno.list + +sudo apt update +sudo apt install bruno +``` + +### 여러 플랫폼에서 실행하세요. 🖥️ + +![bruno](assets/images/run-anywhere.png)

+ +### Git과 연동하세요. 👩‍💻🧑‍💻 + +또는 원하는 버전 관리 시스템을 선택하세요. + +![bruno](assets/images/version-control.png)

+ +### 중요 링크 📌 + +- [Our Long Term Vision](https://github.com/usebruno/bruno/discussions/269) +- [Roadmap](https://github.com/usebruno/bruno/discussions/384) +- [Documentation](https://docs.usebruno.com) +- [Website](https://www.usebruno.com) +- [Pricing](https://www.usebruno.com/pricing) +- [Download](https://www.usebruno.com/downloads) + +### 쇼케이스 🎥 + +- [Testimonials](https://github.com/usebruno/bruno/discussions/343) +- [Knowledge Hub](https://github.com/usebruno/bruno/discussions/386) +- [Scriptmania](https://github.com/usebruno/bruno/discussions/385) + +### 지원 ❤️ + +프로젝트가 마음에 들면 ⭐ 버튼을 눌러 주세요. + +### 후기 공유 📣 + +Bruno가 여러분과 여러분의 팀에 도움이 되었다면, 잊지 말고 공유해 주세요. [Github discussion 공유 링크](https://github.com/usebruno/bruno/discussions/343) + +### 새 패키지 관리자에게 게시 + +더 많은 정보를 확인하시려명 링크를 클릭해 주세요.[배포 가이드](publishing.md) + +### 컨트리뷰트 👩‍💻🧑‍💻 + +컨트리뷰트에 관심이 있으시면 링크를 참고해 주세요. [컨트리뷰트 가이드](contributing.md) + +코드를 통해 기여할 수 없더라도 사용 사례를 해결하기 위해 구현이 필요한 버그나 기능 요청을 주저하지 마시고 제출해 주세요. + +### Authors + +
+ + + +
+ +### Stay in touch 🌐 + +[𝕏 (Twitter)](https://twitter.com/use_bruno)
+[Website](https://www.usebruno.com)
+[Discord](https://discord.com/invite/KgcZUncpjq)
+[LinkedIn](https://www.linkedin.com/company/usebruno) + +### Trademark + +**Name** + +`Bruno` is a trademark held by [Anoop M D](https://www.helloanoop.com/) + +**Logo** + +The logo is sourced from [OpenMoji](https://openmoji.org/library/emoji-1F436/). License: CC [BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) + +### License 📄 + +[MIT](license.md) diff --git a/readme.md b/readme.md index 96a9d7c88..51bd7db9c 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ [![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com) [![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads) -**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) +**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) | [한국어](docs/readme/readme_kr.md) Bruno is a new and innovative API client, aimed at revolutionizing the status quo represented by Postman and similar tools out there. From 5be12543e55be32bbb8861a903324d3ea68270ec Mon Sep 17 00:00:00 2001 From: Its-treason <39559178+Its-treason@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:13:24 +0100 Subject: [PATCH 03/26] fix: Fix Content-Security-Policy config --- packages/bruno-electron/src/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index 602517b5b..a65dc28c6 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -14,16 +14,18 @@ const { loadWindowState, saveBounds, saveMaximized } = require('./utils/window') const lastOpenedCollections = new LastOpenedCollections(); +// Reference: https://content-security-policy.com/ const contentSecurityPolicy = [ - isDev ? "default-src 'self' 'unsafe-inline' 'unsafe-eval'" : "default-src 'self'", - "connect-src 'self' https://api.github.com/repos/usebruno/bruno", - "font-src 'self' https://fonts.gstatic.com", + "default-src 'self'", + "script-src * 'unsafe-inline' 'unsafe-eval'", + "connect-src 'self' api.github.com", + "font-src 'self' https:", "form-action 'none'", - "img-src 'self' blob: data:", - "style-src 'self' https://fonts.googleapis.com" + "img-src 'self' blob: data: https:", + "style-src 'self' 'unsafe-inline' https:" ]; -setContentSecurityPolicy(contentSecurityPolicy.join(';')); +setContentSecurityPolicy(contentSecurityPolicy.join(';') + ';'); const menu = Menu.buildFromTemplate(menuTemplate); Menu.setApplicationMenu(menu); From ce91812ce5f6087aba4c22132d8496a35273280a Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Wed, 8 Nov 2023 01:36:37 +0530 Subject: [PATCH 04/26] feat(#338): curl parser based in curlconverter --- package-lock.json | 467 ++++++++++++++---- packages/bruno-app/package.json | 6 +- .../bruno-app/src/utils/common/codemirror.js | 1 - packages/bruno-app/src/utils/common/index.js | 12 + .../bruno-app/src/utils/common/index.spec.js | 35 +- .../bruno-app/src/utils/curl/curl-to-json.js | 169 +++++++ .../src/utils/curl/curl-to-json.spec.js | 62 +++ packages/bruno-app/src/utils/curl/index.js | 79 +-- .../bruno-app/src/utils/curl/parse-curl.js | 238 +++++++++ 9 files changed, 942 insertions(+), 127 deletions(-) create mode 100644 packages/bruno-app/src/utils/curl/curl-to-json.js create mode 100644 packages/bruno-app/src/utils/curl/curl-to-json.spec.js create mode 100644 packages/bruno-app/src/utils/curl/parse-curl.js diff --git a/package-lock.json b/package-lock.json index b814d03e3..a1e845084 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6241,11 +6241,13 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "license": "MIT", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7320,12 +7322,27 @@ "dev": true, "license": "MIT" }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-properties": { - "version": "1.1.4", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -8673,8 +8690,12 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "license": "MIT" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/generic-names": { "version": "4.0.0", @@ -8715,12 +8736,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "license": "MIT", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8949,6 +8972,17 @@ "csstype": "^3.0.10" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/got": { "version": "9.6.0", "dev": true, @@ -9165,9 +9199,7 @@ }, "node_modules/has-property-descriptors": { "version": "1.0.0", - "dev": true, "license": "MIT", - "optional": true, "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -9175,6 +9207,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "license": "MIT", @@ -9213,6 +9256,17 @@ "node": ">=0.10.0" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "dev": true, @@ -11931,8 +11985,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "license": "MIT", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -12218,14 +12273,6 @@ "xml2js": "^0.4.5" } }, - "node_modules/parse-curl": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/parse-curl/-/parse-curl-0.2.6.tgz", - "integrity": "sha512-ENhXeIxG4A6wFvYSU87b0o3Tp6U+Wup069GYhXCn0ZP/E7evfvomTSM/MeEOs3QTyuye+u2r7fFRj6nX0q9kQA==", - "dependencies": { - "shellwords": "^0.1.0" - } - }, "node_modules/parse-headers": { "version": "2.0.5", "dev": true, @@ -13724,7 +13771,6 @@ }, "node_modules/react-is": { "version": "18.2.0", - "dev": true, "license": "MIT" }, "node_modules/react-redux": { @@ -14611,6 +14657,20 @@ "dev": true, "license": "ISC" }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-value": { "version": "4.1.0", "funding": [ @@ -14665,11 +14725,6 @@ "node": ">=8" } }, - "node_modules/shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" - }, "node_modules/side-channel": { "version": "1.0.4", "license": "MIT", @@ -14915,6 +14970,14 @@ "node": ">=10.0.0" } }, + "node_modules/strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/string_decoder": { "version": "1.1.1", "license": "MIT", @@ -16035,6 +16098,15 @@ "punycode": "^2.1.0" } }, + "node_modules/url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -16055,6 +16127,25 @@ "node": ">=4" } }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "node_modules/url/node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/use-sync-external-store": { "version": "1.2.0", "license": "MIT", @@ -16578,7 +16669,8 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "engines": { "node": ">=12" } @@ -16635,6 +16727,7 @@ "classnames": "^2.3.1", "codemirror": "^5.65.2", "codemirror-graphql": "^1.2.5", + "cookie": "^0.6.0", "escape-html": "^1.0.3", "file-dialog": "^0.0.8", "file-saver": "^2.0.5", @@ -16647,17 +16740,18 @@ "httpsnippet": "^3.0.1", "idb": "^7.0.0", "immer": "^9.0.15", + "jsesc": "^3.0.2", "know-your-http-well": "^0.5.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", "mousetrap": "^1.6.5", "nanoid": "3.3.4", "next": "12.3.3", - "parse-curl": "^0.2.6", "path": "^0.12.7", "platform": "^1.3.6", "posthog-node": "^2.1.0", "qs": "^6.11.0", + "query-string": "^7.0.1", "react": "18.2.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", @@ -16670,7 +16764,9 @@ "sass": "^1.46.0", "styled-components": "^5.3.3", "tailwindcss": "^2.2.19", + "url": "^0.11.3", "xml-formatter": "^3.5.0", + "yargs-parser": "^21.1.1", "yup": "^0.32.11" }, "devDependencies": { @@ -16706,6 +16802,22 @@ "proxy-from-env": "^1.1.0" } }, + "packages/bruno-app/node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "packages/bruno-app/node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "engines": { + "node": ">=0.10" + } + }, "packages/bruno-app/node_modules/entities": { "version": "3.0.1", "license": "BSD-2-Clause", @@ -16716,6 +16828,25 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "packages/bruno-app/node_modules/filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/bruno-app/node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "packages/bruno-app/node_modules/markdown-it": { "version": "13.0.2", "license": "MIT", @@ -16730,6 +16861,31 @@ "markdown-it": "bin/markdown-it.js" } }, + "packages/bruno-app/node_modules/query-string": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", + "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "dependencies": { + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/bruno-app/node_modules/split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "engines": { + "node": ">=6" + } + }, "packages/bruno-cli": { "name": "@usebruno/cli", "version": "1.0.0", @@ -16824,7 +16980,7 @@ }, "packages/bruno-electron": { "name": "bruno", - "version": "v1.0.1", + "version": "v1.1.0", "dependencies": { "@aws-sdk/credential-providers": "^3.425.0", "@usebruno/js": "0.9.1", @@ -20482,7 +20638,8 @@ } }, "@tabler/icons": { - "version": "1.119.0" + "version": "1.119.0", + "requires": {} }, "@tauri-apps/cli": { "version": "1.2.2", @@ -20756,6 +20913,7 @@ "classnames": "^2.3.1", "codemirror": "^5.65.2", "codemirror-graphql": "^1.2.5", + "cookie": "^0.6.0", "cross-env": "^7.0.3", "css-loader": "^6.5.1", "escape-html": "^1.0.3", @@ -20773,6 +20931,7 @@ "httpsnippet": "^3.0.1", "idb": "^7.0.0", "immer": "^9.0.15", + "jsesc": "^3.0.2", "know-your-http-well": "^0.5.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", @@ -20780,12 +20939,12 @@ "mousetrap": "^1.6.5", "nanoid": "3.3.4", "next": "12.3.3", - "parse-curl": "^0.2.6", "path": "^0.12.7", "platform": "^1.3.6", "posthog-node": "^2.1.0", "prettier": "^2.7.1", "qs": "^6.11.0", + "query-string": "^7.0.1", "react": "18.2.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", @@ -20799,9 +20958,11 @@ "style-loader": "^3.3.1", "styled-components": "^5.3.3", "tailwindcss": "^2.2.19", + "url": "^0.11.3", "webpack": "^5.64.4", "webpack-cli": "^4.9.1", "xml-formatter": "^3.5.0", + "yargs-parser": "*", "yup": "^0.32.11" }, "dependencies": { @@ -20818,9 +20979,29 @@ "proxy-from-env": "^1.1.0" } }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + }, + "decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" + }, "entities": { "version": "3.0.1" }, + "filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==" + }, + "jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==" + }, "markdown-it": { "version": "13.0.2", "requires": { @@ -20830,6 +21011,22 @@ "mdurl": "^1.0.1", "uc.micro": "^1.0.5" } + }, + "query-string": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", + "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "requires": { + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + } + }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" } } }, @@ -21008,7 +21205,8 @@ } }, "@usebruno/schema": { - "version": "file:packages/bruno-schema" + "version": "file:packages/bruno-schema", + "requires": {} }, "@usebruno/testbench": { "version": "file:packages/bruno-testbench", @@ -21152,7 +21350,8 @@ }, "@webpack-cli/configtest": { "version": "1.2.0", - "dev": true + "dev": true, + "requires": {} }, "@webpack-cli/info": { "version": "1.5.0", @@ -21163,7 +21362,8 @@ }, "@webpack-cli/serve": { "version": "1.7.0", - "dev": true + "dev": true, + "requires": {} }, "@xtuc/ieee754": { "version": "1.2.0", @@ -21239,7 +21439,8 @@ }, "ajv-keywords": { "version": "3.5.2", - "dev": true + "dev": true, + "requires": {} }, "amdefine": { "version": "0.0.8" @@ -22064,10 +22265,13 @@ } }, "call-bind": { - "version": "1.0.2", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" } }, "callsites": { @@ -22130,7 +22334,8 @@ "chai-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", - "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==" + "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", + "requires": {} }, "chalk": { "version": "4.1.2", @@ -22525,7 +22730,8 @@ }, "css-declaration-sorter": { "version": "6.3.1", - "dev": true + "dev": true, + "requires": {} }, "css-loader": { "version": "6.7.3", @@ -22644,7 +22850,8 @@ }, "cssnano-utils": { "version": "3.1.0", - "dev": true + "dev": true, + "requires": {} }, "csso": { "version": "4.2.0", @@ -22724,11 +22931,24 @@ "version": "1.1.3", "dev": true }, + "define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, "define-properties": { - "version": "1.1.4", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "optional": true, "requires": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } @@ -23621,7 +23841,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "generic-names": { "version": "4.0.0", @@ -23647,11 +23869,14 @@ "version": "2.0.0" }, "get-intrinsic": { - "version": "1.1.3", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-own-enumerable-property-symbols": { @@ -23797,7 +24022,16 @@ } }, "goober": { - "version": "2.1.11" + "version": "2.1.11", + "requires": {} + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } }, "got": { "version": "9.6.0", @@ -23943,12 +24177,15 @@ }, "has-property-descriptors": { "version": "1.0.0", - "dev": true, - "optional": true, "requires": { "get-intrinsic": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { "version": "1.0.3" }, @@ -23970,6 +24207,14 @@ } } }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "dev": true @@ -24159,7 +24404,8 @@ }, "icss-utils": { "version": "5.1.0", - "dev": true + "dev": true, + "requires": {} }, "idb": { "version": "7.1.1" @@ -24759,7 +25005,8 @@ }, "jest-pnp-resolver": { "version": "1.2.3", - "dev": true + "dev": true, + "requires": {} }, "jest-regex-util": { "version": "29.2.0", @@ -25344,7 +25591,8 @@ "version": "1.4.1" }, "meros": { - "version": "1.2.1" + "version": "1.2.1", + "requires": {} }, "methods": { "version": "1.1.2" @@ -25673,7 +25921,9 @@ "version": "2.2.0" }, "object-inspect": { - "version": "1.12.3" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" }, "object-keys": { "version": "1.1.1", @@ -25846,14 +26096,6 @@ "xml2js": "^0.4.5" } }, - "parse-curl": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/parse-curl/-/parse-curl-0.2.6.tgz", - "integrity": "sha512-ENhXeIxG4A6wFvYSU87b0o3Tp6U+Wup069GYhXCn0ZP/E7evfvomTSM/MeEOs3QTyuye+u2r7fFRj6nX0q9kQA==", - "requires": { - "shellwords": "^0.1.0" - } - }, "parse-headers": { "version": "2.0.5", "dev": true @@ -26121,19 +26363,23 @@ }, "postcss-discard-comments": { "version": "5.1.2", - "dev": true + "dev": true, + "requires": {} }, "postcss-discard-duplicates": { "version": "5.1.0", - "dev": true + "dev": true, + "requires": {} }, "postcss-discard-empty": { "version": "5.1.1", - "dev": true + "dev": true, + "requires": {} }, "postcss-discard-overridden": { "version": "5.1.0", - "dev": true + "dev": true, + "requires": {} }, "postcss-js": { "version": "3.0.3", @@ -26215,7 +26461,8 @@ }, "postcss-modules-extract-imports": { "version": "3.0.0", - "dev": true + "dev": true, + "requires": {} }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -26248,7 +26495,8 @@ }, "postcss-normalize-charset": { "version": "5.1.0", - "dev": true + "dev": true, + "requires": {} }, "postcss-normalize-display-values": { "version": "5.1.0", @@ -26724,11 +26972,11 @@ } }, "react-inspector": { - "version": "6.0.2" + "version": "6.0.2", + "requires": {} }, "react-is": { - "version": "18.2.0", - "dev": true + "version": "18.2.0" }, "react-redux": { "version": "7.2.9", @@ -26875,7 +27123,8 @@ } }, "redux-thunk": { - "version": "2.4.2" + "version": "2.4.2", + "requires": {} }, "regenerate": { "version": "1.4.2", @@ -27112,7 +27361,8 @@ }, "rollup-plugin-peer-deps-external": { "version": "2.2.4", - "dev": true + "dev": true, + "requires": {} }, "rollup-plugin-postcss": { "version": "4.0.2", @@ -27333,6 +27583,17 @@ "version": "2.0.0", "dev": true }, + "set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "requires": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, "set-value": { "version": "4.1.0", "requires": { @@ -27364,11 +27625,6 @@ "version": "3.0.0", "dev": true }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" - }, "side-channel": { "version": "1.0.4", "requires": { @@ -27545,6 +27801,11 @@ "streamsearch": { "version": "1.1.0" }, + "strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==" + }, "string_decoder": { "version": "1.1.1", "requires": { @@ -27625,7 +27886,8 @@ }, "style-loader": { "version": "3.3.1", - "dev": true + "dev": true, + "requires": {} }, "styled-components": { "version": "5.3.6", @@ -27654,7 +27916,8 @@ } }, "styled-jsx": { - "version": "5.0.7" + "version": "5.0.7", + "requires": {} }, "stylehacks": { "version": "5.1.1", @@ -28243,6 +28506,30 @@ "punycode": "^2.1.0" } }, + "url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "requires": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "requires": { + "side-channel": "^1.0.4" + } + } + } + }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -28260,7 +28547,8 @@ } }, "use-sync-external-store": { - "version": "1.2.0" + "version": "1.2.0", + "requires": {} }, "utf8-byte-length": { "version": "1.0.4", @@ -28421,7 +28709,8 @@ }, "acorn-import-assertions": { "version": "1.8.0", - "dev": true + "dev": true, + "requires": {} }, "schema-utils": { "version": "3.1.1", @@ -28590,7 +28879,9 @@ } }, "yargs-parser": { - "version": "21.1.1" + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" }, "yauzl": { "version": "2.10.0", diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index c2bdc494c..d5ba0b1aa 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -24,6 +24,7 @@ "classnames": "^2.3.1", "codemirror": "^5.65.2", "codemirror-graphql": "^1.2.5", + "cookie": "^0.6.0", "escape-html": "^1.0.3", "file-dialog": "^0.0.8", "file-saver": "^2.0.5", @@ -36,17 +37,18 @@ "httpsnippet": "^3.0.1", "idb": "^7.0.0", "immer": "^9.0.15", + "jsesc": "^3.0.2", "know-your-http-well": "^0.5.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", "mousetrap": "^1.6.5", "nanoid": "3.3.4", "next": "12.3.3", - "parse-curl": "^0.2.6", "path": "^0.12.7", "platform": "^1.3.6", "posthog-node": "^2.1.0", "qs": "^6.11.0", + "query-string": "^7.0.1", "react": "18.2.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", @@ -59,7 +61,9 @@ "sass": "^1.46.0", "styled-components": "^5.3.3", "tailwindcss": "^2.2.19", + "url": "^0.11.3", "xml-formatter": "^3.5.0", + "yargs-parser": "^21.1.1", "yup": "^0.32.11" }, "devDependencies": { diff --git a/packages/bruno-app/src/utils/common/codemirror.js b/packages/bruno-app/src/utils/common/codemirror.js index 6074dbdcf..4be4dc473 100644 --- a/packages/bruno-app/src/utils/common/codemirror.js +++ b/packages/bruno-app/src/utils/common/codemirror.js @@ -1,5 +1,4 @@ import get from 'lodash/get'; -import isString from 'lodash/isString'; let CodeMirror; const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; diff --git a/packages/bruno-app/src/utils/common/index.js b/packages/bruno-app/src/utils/common/index.js index 992ec233e..be6982436 100644 --- a/packages/bruno-app/src/utils/common/index.js +++ b/packages/bruno-app/src/utils/common/index.js @@ -94,3 +94,15 @@ export const getContentType = (headers) => { return ''; }; + +export const startsWith = (str, search) => { + if (!str || !str.length || typeof str !== 'string') { + return false; + } + + if (!search || !search.length || typeof search !== 'string') { + return false; + } + + return str.substr(0, search.length) === search; +}; diff --git a/packages/bruno-app/src/utils/common/index.spec.js b/packages/bruno-app/src/utils/common/index.spec.js index 6d52ed1aa..3484fac9c 100644 --- a/packages/bruno-app/src/utils/common/index.spec.js +++ b/packages/bruno-app/src/utils/common/index.spec.js @@ -1,6 +1,6 @@ const { describe, it, expect } = require('@jest/globals'); -import { normalizeFileName } from './index'; +import { normalizeFileName, startsWith } from './index'; describe('common utils', () => { describe('normalizeFileName', () => { @@ -16,4 +16,37 @@ describe('common utils', () => { expect(normalizeFileName('foo\\bar\\')).toBe('foo-bar-'); }); }); + + describe('startsWith', () => { + it('should return false if str is not a string', () => { + expect(startsWith(null, 'foo')).toBe(false); + expect(startsWith(undefined, 'foo')).toBe(false); + expect(startsWith(123, 'foo')).toBe(false); + expect(startsWith({}, 'foo')).toBe(false); + expect(startsWith([], 'foo')).toBe(false); + }); + + it('should return false if search is not a string', () => { + expect(startsWith('foo', null)).toBe(false); + expect(startsWith('foo', undefined)).toBe(false); + expect(startsWith('foo', 123)).toBe(false); + expect(startsWith('foo', {})).toBe(false); + expect(startsWith('foo', [])).toBe(false); + }); + + it('should return false if str does not start with search', () => { + expect(startsWith('foo', 'bar')).toBe(false); + expect(startsWith('foo', 'baz')).toBe(false); + expect(startsWith('foo', 'bar')).toBe(false); + expect(startsWith('foo', 'baz')).toBe(false); + expect(startsWith('foo', 'bar')).toBe(false); + expect(startsWith('foo', 'baz')).toBe(false); + }); + + it('should return true if str starts with search', () => { + expect(startsWith('foo', 'f')).toBe(true); + expect(startsWith('foo', 'fo')).toBe(true); + expect(startsWith('foo', 'foo')).toBe(true); + }); + }); }); diff --git a/packages/bruno-app/src/utils/curl/curl-to-json.js b/packages/bruno-app/src/utils/curl/curl-to-json.js new file mode 100644 index 000000000..8313e0a79 --- /dev/null +++ b/packages/bruno-app/src/utils/curl/curl-to-json.js @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2014-2016 Nick Carneiro + * https://github.com/curlconverter/curlconverter + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import parseCurlCommand from './parse-curl'; +import * as querystring from 'query-string'; +import * as jsesc from 'jsesc'; + +function getContentType(headers = {}) { + const contentType = Object.keys(headers).find((key) => key.toLowerCase() === 'content-type'); + + return contentType ? headers[contentType] : null; +} + +function repr(value, isKey) { + return isKey ? "'" + jsesc(value, { quotes: 'single' }) + "'" : value; +} + +function getQueries(request) { + const queries = {}; + for (const paramName in request.query) { + const rawValue = request.query[paramName]; + let paramValue; + if (Array.isArray(rawValue)) { + paramValue = rawValue.map(repr); + } else { + paramValue = repr(rawValue); + } + queries[repr(paramName)] = paramValue; + } + + return queries; +} + +function getDataString(request) { + if (typeof request.data === 'number') { + request.data = request.data.toString(); + } + + const contentType = getContentType(request.headers); + + if (contentType && contentType.includes('application/json')) { + return { data: request.data.toString() }; + } + + const parsedQueryString = querystring.parse(request.data, { sort: false }); + const keyCount = Object.keys(parsedQueryString).length; + const singleKeyOnly = keyCount === 1 && !parsedQueryString[Object.keys(parsedQueryString)[0]]; + const singularData = request.isDataBinary || singleKeyOnly; + if (singularData) { + const data = {}; + data[repr(request.data)] = ''; + return { data: data }; + } else { + return getMultipleDataString(request, parsedQueryString); + } +} + +function getMultipleDataString(request, parsedQueryString) { + const data = {}; + + for (const key in parsedQueryString) { + const value = parsedQueryString[key]; + if (Array.isArray(value)) { + data[repr(key)] = value; + } else { + data[repr(key)] = repr(value); + } + } + + return { data: data }; +} + +function getFilesString(request) { + const data = {}; + + data.files = {}; + data.data = {}; + + for (const multipartKey in request.multipartUploads) { + const multipartValue = request.multipartUploads[multipartKey]; + if (multipartValue.startsWith('@')) { + const fileName = multipartValue.slice(1); + data.files[repr(multipartKey)] = repr(fileName); + } else { + data.data[repr(multipartKey)] = repr(multipartValue); + } + } + + if (Object.keys(data.files).length === 0) { + delete data.files; + } + + if (Object.keys(data.data).length === 0) { + delete data.data; + } + + return data; +} + +const curlToJson = (curlCommand) => { + const request = parseCurlCommand(curlCommand); + + const requestJson = {}; + + // curl automatically prepends 'http' if the scheme is missing, but python fails and returns an error + // we tack it on here to mimic curl + if (!request.url.match(/https?:/)) { + request.url = 'http://' + request.url; + } + if (!request.urlWithoutQuery.match(/https?:/)) { + request.urlWithoutQuery = 'http://' + request.urlWithoutQuery; + } + + requestJson.url = request.urlWithoutQuery.replace(/\/$/, ''); + requestJson.raw_url = request.url; + requestJson.method = request.method; + + if (request.cookies) { + const cookies = {}; + for (const cookieName in request.cookies) { + cookies[repr(cookieName)] = repr(request.cookies[cookieName]); + } + + requestJson.cookies = cookies; + } + + if (request.headers) { + const headers = {}; + for (const headerName in request.headers) { + headers[repr(headerName)] = repr(request.headers[headerName]); + } + + requestJson.headers = headers; + } + + if (request.query) { + requestJson.queries = getQueries(request); + } + + if (typeof request.data === 'string' || typeof request.data === 'number') { + Object.assign(requestJson, getDataString(request)); + } else if (request.multipartUploads) { + Object.assign(requestJson, getFilesString(request)); + } + + if (request.insecure) { + requestJson.insecure = false; + } + + if (request.auth) { + const splitAuth = request.auth.split(':'); + const user = splitAuth[0] || ''; + const password = splitAuth[1] || ''; + + requestJson.auth = { + user: repr(user), + password: repr(password) + }; + } + + return Object.keys(requestJson).length ? requestJson : {}; +}; + +export default curlToJson; diff --git a/packages/bruno-app/src/utils/curl/curl-to-json.spec.js b/packages/bruno-app/src/utils/curl/curl-to-json.spec.js new file mode 100644 index 000000000..bf7d836df --- /dev/null +++ b/packages/bruno-app/src/utils/curl/curl-to-json.spec.js @@ -0,0 +1,62 @@ +const { describe, it, expect } = require('@jest/globals'); + +import curlToJson from './curl-to-json'; + +describe('curlToJson', () => { + it('should return a parse a simple curl command', () => { + const curlCommand = 'curl https://www.usebruno.com'; + const result = curlToJson(curlCommand); + + expect(result).toEqual({ + url: 'https://www.usebruno.com', + raw_url: 'https://www.usebruno.com', + method: 'get' + }); + }); + + it('should return a parse a curl command with headers', () => { + const curlCommand = `curl https://www.usebruno.com + -H 'Accept: application/json, text/plain, */*' + -H 'Accept-Language: en-US,en;q=0.9,hi;q=0.8' + `; + + const result = curlToJson(curlCommand); + + expect(result).toEqual({ + url: 'https://www.usebruno.com', + raw_url: 'https://www.usebruno.com', + method: 'get', + headers: { + Accept: 'application/json, text/plain, */*', + 'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8' + } + }); + }); + + it('should return a parse a curl with a post body', () => { + const curlCommand = `curl 'https://www.usebruno.com' + -H 'Accept: application/json, text/plain, */*' + -H 'Accept-Language: en-US,en;q=0.9,hi;q=0.8' + -H 'Content-Type: application/json;charset=utf-8' + -H 'Origin: https://www.usebruno.com' + -H 'Referer: https://www.usebruno.com/' + --data-raw '{"email":"test@usebruno.com","password":"test"}' + `; + + const result = curlToJson(curlCommand); + + expect(result).toEqual({ + url: '%27https://www.usebruno.com%27', + raw_url: "'https://www.usebruno.com'", + method: 'post', + headers: { + Accept: 'application/json, text/plain, */*', + 'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8', + 'Content-Type': 'application/json;charset=utf-8', + Origin: 'https://www.usebruno.com', + Referer: 'https://www.usebruno.com/' + }, + data: '{"email":"test@usebruno.com","password":"test"}' + }); + }); +}); diff --git a/packages/bruno-app/src/utils/curl/index.js b/packages/bruno-app/src/utils/curl/index.js index 30080e467..ecaf582c7 100644 --- a/packages/bruno-app/src/utils/curl/index.js +++ b/packages/bruno-app/src/utils/curl/index.js @@ -1,18 +1,29 @@ -import * as parse from 'parse-curl'; -import { BrunoError } from 'utils/common/error'; -import { parseQueryParams } from 'utils/url'; +import { forOwn } from 'lodash'; +import { safeStringifyJSON } from 'utils/common'; +import curlToJson from './curl-to-json'; -export const getRequestFromCurlCommand = (command) => { +export const getRequestFromCurlCommand = (curlCommand) => { const parseFormData = (parsedBody) => { - parseQueryParams(parsedBody); - }; - try { - const request = parse(command); - const parsedHeader = request?.header; - const headers = - parsedHeader && Object.keys(parsedHeader).map((key) => ({ name: key, value: parsedHeader[key], enabled: true })); + const formData = []; + forOwn(parsedBody, (value, key) => { + formData.push({ name: key, value, enabled: true }); + }); - const contentType = headers?.find((h) => h.name.toLowerCase() === 'content-type'); + return formData; + }; + + try { + if (!curlCommand || typeof curlCommand !== 'string' || curlCommand.length === 0) { + return null; + } + + const request = curlToJson(curlCommand); + const parsedHeaders = request?.headers; + const headers = + parsedHeaders && + Object.keys(parsedHeaders).map((key) => ({ name: key, value: parsedHeaders[key], enabled: true })); + + const contentType = headers?.find((h) => h.name.toLowerCase() === 'content-type')?.value; const body = { mode: 'none', json: null, @@ -22,30 +33,25 @@ export const getRequestFromCurlCommand = (command) => { multipartForm: null, formUrlEncoded: null }; - const parsedBody = request?.body; - if (parsedBody && contentType) { - switch (contentType.value.toLowerCase()) { - case 'application/json': - body.mode = 'json'; - body.json = parsedBody; - break; - case 'text/xml': - body.mode = 'xml'; - body.xml = parsedBody; - break; - case 'application/x-www-form-urlencoded': - body.mode = 'formUrlEncoded'; - body.formUrlEncoded = parseFormData(parsedBody); - break; - case 'multipart/form-data': - body.mode = 'multipartForm'; - body.multipartForm = parsedBody; - break; - case 'text/plain': - default: - body.mode = 'text'; - body.text = parsedBody; - break; + const parsedBody = request.data; + if (parsedBody && contentType && typeof contentType === 'string') { + if (contentType.includes('application/json')) { + body.mode = 'json'; + body.json = safeStringifyJSON(parsedBody); + } else if (contentType.includes('text/xml')) { + body.mode = 'xml'; + body.xml = parsedBody; + } else if (contentType.includes('application/x-www-form-urlencoded')) { + body.mode = 'formUrlEncoded'; + console.log(parsedBody); + console.log(parseFormData(parsedBody)); + body.formUrlEncoded = parseFormData(parsedBody); + } else if (contentType.includes('multipart/form-data')) { + body.mode = 'multipartForm'; + body.multipartForm = parsedBody; + } else if (contentType.includes('text/plain')) { + body.mode = 'text'; + body.text = parsedBody; } } return { @@ -55,6 +61,7 @@ export const getRequestFromCurlCommand = (command) => { headers: headers }; } catch (error) { + console.error(error); return null; } }; diff --git a/packages/bruno-app/src/utils/curl/parse-curl.js b/packages/bruno-app/src/utils/curl/parse-curl.js new file mode 100644 index 000000000..b7f6572f7 --- /dev/null +++ b/packages/bruno-app/src/utils/curl/parse-curl.js @@ -0,0 +1,238 @@ +/** + * Copyright (c) 2014-2016 Nick Carneiro + * https://github.com/curlconverter/curlconverter + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import * as cookie from 'cookie'; +import * as URL from 'url'; +import * as querystring from 'query-string'; +import yargs from 'yargs-parser'; + +const parseCurlCommand = (curlCommand) => { + // Remove newlines (and from continuations) + curlCommand = curlCommand.replace(/\\\r|\\\n/g, ''); + + // Remove extra whitespace + curlCommand = curlCommand.replace(/\s+/g, ' '); + + // yargs parses -XPOST as separate arguments. just prescreen for it. + curlCommand = curlCommand.replace(/ -XPOST/, ' -X POST'); + curlCommand = curlCommand.replace(/ -XGET/, ' -X GET'); + curlCommand = curlCommand.replace(/ -XPUT/, ' -X PUT'); + curlCommand = curlCommand.replace(/ -XPATCH/, ' -X PATCH'); + curlCommand = curlCommand.replace(/ -XDELETE/, ' -X DELETE'); + curlCommand = curlCommand.replace(/ -XOPTIONS/, ' -X OPTIONS'); + // Safari adds `-Xnull` if is unable to determine the request type, it can be ignored + curlCommand = curlCommand.replace(/ -Xnull/, ' '); + curlCommand = curlCommand.trim(); + + const parsedArguments = yargs(curlCommand, { + boolean: ['I', 'head', 'compressed', 'L', 'k', 'silent', 's'], + alias: { + H: 'header', + A: 'user-agent' + } + }); + + let cookieString; + let cookies; + let url = parsedArguments._[1] || ''; + + // remove surrounding quotes if present + if (url && url.length) { + url = url.replace(/^['"]|['"]$/g, ''); + } + + // if url argument wasn't where we expected it, try to find it in the other arguments + if (!url) { + for (const argName in parsedArguments) { + if (typeof parsedArguments[argName] === 'string') { + if (parsedArguments[argName].indexOf('http') === 0 || parsedArguments[argName].indexOf('www.') === 0) { + url = parsedArguments[argName]; + } + } + } + } + + let headers; + + if (parsedArguments.header) { + if (!headers) { + headers = {}; + } + if (!Array.isArray(parsedArguments.header)) { + parsedArguments.header = [parsedArguments.header]; + } + parsedArguments.header.forEach((header) => { + if (header.indexOf('Cookie') !== -1) { + cookieString = header; + } else { + const components = header.split(/:(.*)/); + if (components[1]) { + headers[components[0]] = components[1].trim(); + } + } + }); + } + + if (parsedArguments['user-agent']) { + if (!headers) { + headers = {}; + } + headers['User-Agent'] = parsedArguments['user-agent']; + } + + if (parsedArguments.b) { + cookieString = parsedArguments.b; + } + if (parsedArguments.cookie) { + cookieString = parsedArguments.cookie; + } + let multipartUploads; + if (parsedArguments.F) { + multipartUploads = {}; + if (!Array.isArray(parsedArguments.F)) { + parsedArguments.F = [parsedArguments.F]; + } + parsedArguments.F.forEach((multipartArgument) => { + // input looks like key=value. value could be json or a file path prepended with an @ + const splitArguments = multipartArgument.split('=', 2); + const key = splitArguments[0]; + const value = splitArguments[1]; + multipartUploads[key] = value; + }); + } + if (cookieString) { + const cookieParseOptions = { + decode: function (s) { + return s; + } + }; + // separate out cookie headers into separate data structure + // note: cookie is case insensitive + cookies = cookie.parse(cookieString.replace(/^Cookie: /gi, ''), cookieParseOptions); + } + let method; + if (parsedArguments.X === 'POST') { + method = 'post'; + } else if (parsedArguments.X === 'PUT' || parsedArguments.T) { + method = 'put'; + } else if (parsedArguments.X === 'PATCH') { + method = 'patch'; + } else if (parsedArguments.X === 'DELETE') { + method = 'delete'; + } else if (parsedArguments.X === 'OPTIONS') { + method = 'options'; + } else if ( + (parsedArguments.d || + parsedArguments.data || + parsedArguments['data-ascii'] || + parsedArguments['data-binary'] || + parsedArguments['data-raw'] || + parsedArguments.F || + parsedArguments.form) && + !(parsedArguments.G || parsedArguments.get) + ) { + method = 'post'; + } else if (parsedArguments.I || parsedArguments.head) { + method = 'head'; + } else { + method = 'get'; + } + + const compressed = !!parsedArguments.compressed; + const urlObject = URL.parse(url || ''); + + // if GET request with data, convert data to query string + // NB: the -G flag does not change the http verb. It just moves the data into the url. + if (parsedArguments.G || parsedArguments.get) { + urlObject.query = urlObject.query ? urlObject.query : ''; + const option = 'd' in parsedArguments ? 'd' : 'data' in parsedArguments ? 'data' : null; + if (option) { + let urlQueryString = ''; + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + urlQueryString += '&'; + } + + if (typeof parsedArguments[option] === 'object') { + urlQueryString += parsedArguments[option].join('&'); + } else { + urlQueryString += parsedArguments[option]; + } + urlObject.query += urlQueryString; + url += urlQueryString; + delete parsedArguments[option]; + } + } + if (urlObject.query && urlObject.query.endsWith('&')) { + urlObject.query = urlObject.query.slice(0, -1); + } + const query = querystring.parse(urlObject.query, { sort: false }); + for (const param in query) { + if (query[param] === null) { + query[param] = ''; + } + } + + urlObject.search = null; // Clean out the search/query portion. + const request = { + url: url, + urlWithoutQuery: URL.format(urlObject) + }; + if (compressed) { + request.compressed = true; + } + + if (Object.keys(query).length > 0) { + request.query = query; + } + if (headers) { + request.headers = headers; + } + request.method = method; + + if (cookies) { + request.cookies = cookies; + request.cookieString = cookieString.replace('Cookie: ', ''); + } + if (multipartUploads) { + request.multipartUploads = multipartUploads; + } + if (parsedArguments.data) { + request.data = parsedArguments.data; + } else if (parsedArguments['data-binary']) { + request.data = parsedArguments['data-binary']; + request.isDataBinary = true; + } else if (parsedArguments.d) { + request.data = parsedArguments.d; + } else if (parsedArguments['data-ascii']) { + request.data = parsedArguments['data-ascii']; + } else if (parsedArguments['data-raw']) { + request.data = parsedArguments['data-raw']; + request.isDataRaw = true; + } + + if (parsedArguments.u) { + request.auth = parsedArguments.u; + } + if (parsedArguments.user) { + request.auth = parsedArguments.user; + } + if (Array.isArray(request.data)) { + request.dataArray = request.data; + request.data = request.data.join('&'); + } + + if (parsedArguments.k || parsedArguments.insecure) { + request.insecure = true; + } + return request; +}; + +export default parseCurlCommand; From 50d8577298760b28e1f866164970ed85ae1a4aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAnior=20Sbrissa?= Date: Wed, 8 Nov 2023 14:23:19 -0300 Subject: [PATCH 05/26] docs: add readme pt br translation --- docs/readme/readme_pt_br.md | 121 ++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/readme/readme_pt_br.md diff --git a/docs/readme/readme_pt_br.md b/docs/readme/readme_pt_br.md new file mode 100644 index 000000000..edc47d5e0 --- /dev/null +++ b/docs/readme/readme_pt_br.md @@ -0,0 +1,121 @@ +
+ + +### Bruno - IDE de código aberto para explorar e testar APIs. + +[![GitHub version](https://badge.fury.io/gh/usebruno%2Fbruno.svg)](https://badge.fury.io/gh/usebruno%bruno) +[![CI](https://github.com/usebruno/bruno/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/usebruno/bruno/workflows/unit-tests.yml) +[![Commit Activity](https://img.shields.io/github/commit-activity/m/usebruno/bruno)](https://github.com/usebruno/bruno/pulse) +[![X](https://img.shields.io/twitter/follow/use_bruno?style=social&logo=x)](https://twitter.com/use_bruno) +[![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com) +[![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads) + +Bruno é um novo e inovador cliente de API, com o objetivo de revolucionar o status quo representado por ferramentas como o Postman e outras semelhantes. + +Bruno armazena suas coleções diretamente em uma pasta no seu sistema de arquivos. Utilizamos uma linguagem de marcação de texto simples, chamada Bru, para salvar informações sobre requisições de API. + +Você pode usar o Git ou qualquer sistema de controle de versão de sua escolha para colaborar em suas coleções de API. + +Bruno é totalmente offline. Não há planos de adicionar sincronização em nuvem ao Bruno, nunca. Valorizamos a privacidade de seus dados e acreditamos que eles devem permanecer em seu dispositivo. Saiba mais sobre nossa visão a longo prazo [aqui](https://github.com/usebruno/bruno/discussions/269). + +📢 Assista à nossa palestra recente na India FOSS 3.0 Conference [aqui](https://www.youtube.com/watch?v=7bSMFpbcPiY). + +![bruno](../../assets/images/landing-2.png)

+ +### Instalação + +Bruno está disponível para download como binário [em nosso site](https://www.usebruno.com/downloads) para Mac, Windows e Linux. + +Você também pode instalar o Bruno via gerenciadores de pacotes como Homebrew, Chocolatey, Snap e Apt. + +```sh +# Mac via Homebrew +brew install bruno + +# Windows via Chocolatey +choco install bruno + +# Linux via Snap +snap install bruno + +# Linux via Apt +sudo mkdir -p /etc/apt/keyrings +sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/bruno.gpg --keyserver keyserver.ubuntu.com --recv-keys 9FA6017ECABE0266 + +echo "deb [signed-by=/etc/apt/keyrings/bruno.gpg] http://debian.usebruno.com/ bruno stable" | sudo tee /etc/apt/sources.list.d/bruno.list + +sudo apt update +sudo apt install bruno +``` + +### Execute em várias plataformas 🖥️ + +![bruno](../../assets/images/run-anywhere.png)

+ +### Colaboração via Git 👩‍💻🧑‍💻 + +Ou qualquer sistema de controle de versão de sua escolha. + +![bruno](../../assets/images/version-control.png)

+ +### Links Importantes 📌 + +- [Nossa Visão de Longo Prazo](https://github.com/usebruno/bruno/discussions/269) +- [Roadmap](https://github.com/usebruno/bruno/discussions/384) +- [Documentação](https://docs.usebruno.com) +- [Website](https://www.usebruno.com) +- [Preços](https://www.usebruno.com/pricing) +- [Download](https://www.usebruno.com/downloads) + +### Showcase 🎥 + +- [Depoimentos](https://github.com/usebruno/bruno/discussions/343) +- [Hub de Conhecimento](https://github.com/usebruno/bruno/discussions/386) +- [Scriptmania](https://github.com/usebruno/bruno/discussions/385) + +### Apoie ❤️ + +Au-au! Se você gosta do projeto, clique no botão ⭐!! + +### Compartilhe sua experiência 📣 + +Se o Bruno ajudou no seu trabalho e/ou no trabalho de sua equipe, por favor, não se esqueça de compartilhar seu [depoimento em nossas discussões no GitHub](https://github.com/usebruno/bruno/discussions/343). + +### Publicando em Novos Gerenciadores de Pacotes + +Por favor, verifique [aqui](../publishing/publishing_pt_br.md) mais informações. + +### Colabore 👩‍💻🧑‍💻 + +Fico feliz que você queira melhorar o Bruno. Por favor, confira o [guia de colaboração](../contributing/contributing_pt_br.md). + +Mesmo que você não possa contribuir codificando, não deixe de relatar problemas e solicitar recursos que precisam ser implementados para atender ao contexto de seu dia a dia. + +### Authors + +
+ + + +
+ +### Mantenha Contato 🌐 + +[𝕏 (Twitter)](https://twitter.com/use_bruno)
+[Website](https://www.usebruno.com)
+[Discord](https://discord.com/invite/KgcZUncpjq)
+[LinkedIn](https://www.linkedin.com/company/usebruno) + +### Trademark + +**Nome** + +`Bruno` é uma marca registrada de [Anoop M D](https://www.helloanoop.com/). + +**Logo** + +A logo é original do [OpenMoji](https://openmoji.org/library/emoji-1F436/). Licença: CC [BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). + +### Licença 📄 + +[MIT](license.md) From 159f39dd18637bb697f9dee949537f4007073785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAnior=20Sbrissa?= Date: Wed, 8 Nov 2023 17:22:26 -0300 Subject: [PATCH 06/26] docs: add contributing pt br translation --- docs/contributing/contributing_pt_br.md | 87 +++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 docs/contributing/contributing_pt_br.md diff --git a/docs/contributing/contributing_pt_br.md b/docs/contributing/contributing_pt_br.md new file mode 100644 index 000000000..46d20f181 --- /dev/null +++ b/docs/contributing/contributing_pt_br.md @@ -0,0 +1,87 @@ +## Vamos tornar o Bruno melhor, juntos!! + +Estamos felizes que você queira ajudar a melhorar o Bruno. Abaixo estão as diretrizes e orientações para começar a executar o Bruno no seu computador. + +### Stack de Tecnologias + +O Bruno é construído usando Next.js e React. Também usamos o Electron para disponibilizar uma versão para desktop (que suporta coleções locais). + +Bibliotecas que utilizamos: + +Libraries we use + +- CSS - Tailwind +- Editor de Código - Codemirror +- Gerenciador de Estado - Redux +- Ícones - Tabler Icons +- Formulários - formik +- Validador de Schema - Yup +- Cliente de Requisições - axios +- Monitor de Arquivos - chokidar + +### Dependências + +Você precisará do [Node v18.x (ou da versão LTS mais recente)](https://nodejs.org/en/) e do npm na versão 8.x. Nós utilizamos npm workspaces no projeto. + +## Desenvolvimento + +Bruno está sendo desenvolvido como um aplicativo de desktop. Você precisa carregar o aplicativo executando o aplicativo Next.js em um terminal e, em seguida, executar o aplicativo Electron em outro terminal. + +### Dependências + +- NodeJS v18 + +### Desenvolvimento Local + +```bash +# use nodejs 18 version +nvm use + +# install deps +npm i --legacy-peer-deps + +# build graphql docs +npm run build:graphql-docs + +# build bruno query +npm run build:bruno-query + +# run next app (terminal 1) +npm run dev:web + +# run electron app (terminal 2) +npm run dev:electron +``` + +### Troubleshooting + +Você pode se deparar com o erro `Unsupported platform` ao executar o comando `npm install`. Para corrigir isso, você precisará excluir a pasta `node_modules` e o arquivo `package-lock.json` e, em seguida, executar o comando `npm install` novamente. Isso deve instalar todos os pacotes necessários para executar o aplicativo. + +```shell +# delete node_modules in sub-directories +find ./ -type d -name "node_modules" -print0 | while read -d $'\0' dir; do + rm -rf "$dir" +done + +# delete package-lock in sub-directories +find . -type f -name "package-lock.json" -delete +``` + +### Testando + +```bash +# bruno-schema +npm test --workspace=packages/bruno-schema + +# bruno-lang +npm test --workspace=packages/bruno-lang +``` + +### Envio de Pull Request + +- Por favor, mantenha os PRs pequenos e focados em uma única coisa. +- Siga o formato de criação de branches. + - feature/[nome da funcionalidade]: Esta branch deve conter alterações para uma funcionalidade específica. + - Exemplo: feature/dark-mode + - bugfix/[nome do bug]: Esta branch deve conter apenas correções para um bug específico. + - Exemplo: bugfix/bug-1 From 35a4d46dc51031f5c250279f5a4cc6be786e2668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAnior=20Sbrissa?= Date: Wed, 8 Nov 2023 17:35:49 -0300 Subject: [PATCH 07/26] docs: add publishing pt br translation --- docs/publishing/publishing_pt_br.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/publishing/publishing_pt_br.md diff --git a/docs/publishing/publishing_pt_br.md b/docs/publishing/publishing_pt_br.md new file mode 100644 index 000000000..13d414a40 --- /dev/null +++ b/docs/publishing/publishing_pt_br.md @@ -0,0 +1,5 @@ +### Publicando Bruno em um novo gerenciador de pacotes + +Embora nosso código seja de código aberto e esteja disponível para todos usarem, pedimos gentilmente que entre em contato conosco antes de considerar a publicação em novos gerenciadores de pacotes. Como o criador da ferramenta, mantenho a marca registrada `Bruno` para este projeto e gostaria de gerenciar sua distribuição. Se deseja ver o Bruno em um novo gerenciador de pacotes, por favor, crie uma solicitação através de uma issue no GitHub. + +Embora a maioria de nossas funcionalidades seja gratuita e de código aberto (o que abrange API's REST e GraphQL), buscamos alcançar um equilíbrio harmonioso entre os princípios de código aberto e sustentabilidade. - https://github.com/usebruno/bruno/discussions/269 From 86553464cc6bf2a39a234eaaa695c5c2de698e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=B6nefeldt?= Date: Wed, 8 Nov 2023 22:19:09 +0100 Subject: [PATCH 08/26] https://github.com/usebruno/bruno/discussions/865: Added ahint to the stackoverflow tag to teh readme --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 96a9d7c88..d6c4db467 100644 --- a/readme.md +++ b/readme.md @@ -65,6 +65,7 @@ Or any version control system of your choice - [Our Long Term Vision](https://github.com/usebruno/bruno/discussions/269) - [Roadmap](https://github.com/usebruno/bruno/discussions/384) - [Documentation](https://docs.usebruno.com) +- [stackoverflow](https://stackoverflow.com/questions/tagged/bruno) - [Website](https://www.usebruno.com) - [Pricing](https://www.usebruno.com/pricing) - [Download](https://www.usebruno.com/downloads) From 07a9d4645f6b18a6b13717296b032c0c1f967299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAnior=20Sbrissa?= Date: Wed, 8 Nov 2023 21:57:43 -0300 Subject: [PATCH 09/26] docs: review pt br translation and add reference links --- contributing.md | 2 +- docs/contributing/contributing_pt_br.md | 4 +--- docs/publishing/publishing_pt_br.md | 2 +- publishing.md | 2 ++ readme.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contributing.md b/contributing.md index 0d6efdffa..5c0b8bb2f 100644 --- a/contributing.md +++ b/contributing.md @@ -1,4 +1,4 @@ -**English** | [Українська](docs/contributing/contributing_ua.md) | [Русский](docs/contributing/contributing_ru.md) | [Türkçe](docs/contributing/contributing_tr.md) | [Deutsch](docs/contributing/contributing_de.md) | [Français](docs/contributing/contributing_fr.md) +**English** | [Українська](docs/contributing/contributing_ua.md) | [Русский](docs/contributing/contributing_ru.md) | [Türkçe](docs/contributing/contributing_tr.md) | [Deutsch](docs/contributing/contributing_de.md) | [Français](docs/contributing/contributing_fr.md) | [Português (BR)](docs/contributing/contributing_pt_br.md) ## Let's make bruno better, together !! diff --git a/docs/contributing/contributing_pt_br.md b/docs/contributing/contributing_pt_br.md index 46d20f181..7f7baabb3 100644 --- a/docs/contributing/contributing_pt_br.md +++ b/docs/contributing/contributing_pt_br.md @@ -8,8 +8,6 @@ O Bruno é construído usando Next.js e React. Também usamos o Electron para di Bibliotecas que utilizamos: -Libraries we use - - CSS - Tailwind - Editor de Código - Codemirror - Gerenciador de Estado - Redux @@ -25,7 +23,7 @@ Você precisará do [Node v18.x (ou da versão LTS mais recente)](https://nodejs ## Desenvolvimento -Bruno está sendo desenvolvido como um aplicativo de desktop. Você precisa carregar o aplicativo executando o aplicativo Next.js em um terminal e, em seguida, executar o aplicativo Electron em outro terminal. +Bruno está sendo desenvolvido como um aplicativo de desktop. Você precisa carregar o programa executando o aplicativo Next.js em um terminal e, em seguida, executar o aplicativo Electron em outro terminal. ### Dependências diff --git a/docs/publishing/publishing_pt_br.md b/docs/publishing/publishing_pt_br.md index 13d414a40..b3d580ee0 100644 --- a/docs/publishing/publishing_pt_br.md +++ b/docs/publishing/publishing_pt_br.md @@ -1,5 +1,5 @@ ### Publicando Bruno em um novo gerenciador de pacotes -Embora nosso código seja de código aberto e esteja disponível para todos usarem, pedimos gentilmente que entre em contato conosco antes de considerar a publicação em novos gerenciadores de pacotes. Como o criador da ferramenta, mantenho a marca registrada `Bruno` para este projeto e gostaria de gerenciar sua distribuição. Se deseja ver o Bruno em um novo gerenciador de pacotes, por favor, crie uma solicitação através de uma issue no GitHub. +Embora nosso código seja de código aberto e esteja disponível para todos usarem, pedimos gentilmente que entre em contato conosco antes de considerar a publicação em novos gerenciadores de pacotes. Como o criador da ferramenta, mantenho a marca registrada `Bruno` para este projeto e gostaria de gerenciar sua distribuição. Se deseja ver o Bruno em um novo gerenciador de pacotes, por favor, solicite através de uma issue no GitHub. Embora a maioria de nossas funcionalidades seja gratuita e de código aberto (o que abrange API's REST e GraphQL), buscamos alcançar um equilíbrio harmonioso entre os princípios de código aberto e sustentabilidade. - https://github.com/usebruno/bruno/discussions/269 diff --git a/publishing.md b/publishing.md index 430baa94e..0d23e1f36 100644 --- a/publishing.md +++ b/publishing.md @@ -1,3 +1,5 @@ +**English** | [Português (BR)](docs/publishing/publishing_pt_br.md) + ### Publishing Bruno to a new package manager While our code is open source and available for everyone to use, we kindly request that you reach out to us before considering publication on new package managers. As the creator of Bruno, I hold the trademark `Bruno` for this project and would like to manage its distribution. If you'd like to see Bruno on a new package manager, please raise a GitHub issue. diff --git a/readme.md b/readme.md index 96a9d7c88..0e3a13bd7 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ [![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com) [![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads) -**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) +**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) | [Português (BR)](docs/readme/readme_pt_br.md) Bruno is a new and innovative API client, aimed at revolutionizing the status quo represented by Postman and similar tools out there. From aab591cb126e8bdaabab3216149da1e9d7eae664 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Thu, 9 Nov 2023 13:20:07 +0530 Subject: [PATCH 10/26] feat(#338): switch to curl mode if a curl cmd is pasted in new request modal --- .../Sidebar/NewRequest/StyledWrapper.js | 4 +++ .../components/Sidebar/NewRequest/index.js | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/NewRequest/StyledWrapper.js b/packages/bruno-app/src/components/Sidebar/NewRequest/StyledWrapper.js index 72d1d8a90..9845bd2ef 100644 --- a/packages/bruno-app/src/components/Sidebar/NewRequest/StyledWrapper.js +++ b/packages/bruno-app/src/components/Sidebar/NewRequest/StyledWrapper.js @@ -35,6 +35,10 @@ const StyledWrapper = styled.div` } } } + + textarea.curl-command { + min-height: 150px; + } `; export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js index 43d91430b..377e6bb72 100644 --- a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js +++ b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js @@ -1,4 +1,4 @@ -import React, { useRef, useEffect } from 'react'; +import React, { useRef, useEffect, useCallback } from 'react'; import { useFormik } from 'formik'; import * as Yup from 'yup'; import toast from 'react-hot-toast'; @@ -115,6 +115,25 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => { const onSubmit = () => formik.handleSubmit(); + const handlePaste = useCallback( + (event) => { + const clipboardData = event.clipboardData || window.clipboardData; + const pastedData = clipboardData.getData('Text'); + + // Check if pasted data looks like a cURL command + const curlCommandRegex = /^\s*curl\s/i; + if (curlCommandRegex.test(pastedData)) { + // Switch to the 'from-curl' request type + formik.setFieldValue('requestType', 'from-curl'); + formik.setFieldValue('curlCommand', pastedData); + + // Prevent the default paste behavior to avoid pasting into the textarea + event.preventDefault(); + } + }, + [formik] + ); + return ( @@ -174,7 +193,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => { Name { spellCheck="false" onChange={formik.handleChange} value={formik.values.requestUrl || ''} + onPaste={handlePaste} /> @@ -232,8 +252,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => { From a0196a01b3b04041befc41d277b7e65710b66b8b Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Thu, 9 Nov 2023 13:39:24 +0530 Subject: [PATCH 11/26] chore: bumped release version --- packages/bruno-app/src/components/Sidebar/index.js | 2 +- packages/bruno-electron/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/index.js b/packages/bruno-app/src/components/Sidebar/index.js index 0e6153f9d..670d28d23 100644 --- a/packages/bruno-app/src/components/Sidebar/index.js +++ b/packages/bruno-app/src/components/Sidebar/index.js @@ -105,7 +105,7 @@ const Sidebar = () => { Star -
v1.1.0
+
v1.1.1
diff --git a/packages/bruno-electron/package.json b/packages/bruno-electron/package.json index 57dff832f..d0c562a70 100644 --- a/packages/bruno-electron/package.json +++ b/packages/bruno-electron/package.json @@ -1,5 +1,5 @@ { - "version": "v1.1.0", + "version": "v1.1.1", "name": "bruno", "description": "Opensource API Client for Exploring and Testing APIs", "homepage": "https://www.usebruno.com", From 3e137ac6b4fe59b1b85f6a85a55b226a9e879c02 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Thu, 9 Nov 2023 13:47:33 +0530 Subject: [PATCH 12/26] fix: fixed failing test --- packages/bruno-app/src/utils/curl/curl-to-json.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/utils/curl/curl-to-json.spec.js b/packages/bruno-app/src/utils/curl/curl-to-json.spec.js index bf7d836df..c8f7d1c03 100644 --- a/packages/bruno-app/src/utils/curl/curl-to-json.spec.js +++ b/packages/bruno-app/src/utils/curl/curl-to-json.spec.js @@ -46,8 +46,8 @@ describe('curlToJson', () => { const result = curlToJson(curlCommand); expect(result).toEqual({ - url: '%27https://www.usebruno.com%27', - raw_url: "'https://www.usebruno.com'", + url: 'https://www.usebruno.com', + raw_url: 'https://www.usebruno.com', method: 'post', headers: { Accept: 'application/json, text/plain, */*', From ba761098be216e802399e8888974377fbe6bbe4b Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Thu, 9 Nov 2023 16:12:33 +0530 Subject: [PATCH 13/26] chore(#827): bumped bruno cli version to 1.1.0 --- packages/bruno-cli/changelog.md | 4 ++++ packages/bruno-cli/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bruno-cli/changelog.md b/packages/bruno-cli/changelog.md index adfa14c1a..1d6729309 100644 --- a/packages/bruno-cli/changelog.md +++ b/packages/bruno-cli/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 1.1.0 + +- Upgraded axios to 1.5.1 + ## 1.0.0 - Announcing Stable Release diff --git a/packages/bruno-cli/package.json b/packages/bruno-cli/package.json index 88c6eb91d..d2aa710f4 100644 --- a/packages/bruno-cli/package.json +++ b/packages/bruno-cli/package.json @@ -1,6 +1,6 @@ { "name": "@usebruno/cli", - "version": "1.0.0", + "version": "1.1.0", "license": "MIT", "main": "src/index.js", "bin": { From 043b80171ef088959f041433c9783abcd192b738 Mon Sep 17 00:00:00 2001 From: Adarsh Lilha Date: Fri, 10 Nov 2023 03:27:17 +0530 Subject: [PATCH 14/26] fix headers in code generator --- .../GenerateCodeItem/CodeView/index.js | 3 ++- .../bruno-app/src/utils/codegenerator/har.js | 26 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js index 64c229ae4..18734b288 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js @@ -9,10 +9,11 @@ const CodeView = ({ language, item }) => { const { storedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const { target, client, language: lang } = language; + const headers = item.draft ? get(item, 'draft.request.headers') : get(item, 'request.headers'); let snippet = ''; try { - snippet = new HTTPSnippet(buildHarRequest(item.request)).convert(target, client); + snippet = new HTTPSnippet(buildHarRequest({ request: item.request, headers })).convert(target, client); } catch (e) { console.error(e); snippet = 'Error generating code snippet'; diff --git a/packages/bruno-app/src/utils/codegenerator/har.js b/packages/bruno-app/src/utils/codegenerator/har.js index b48fbc3c7..e0e2b2a6c 100644 --- a/packages/bruno-app/src/utils/codegenerator/har.js +++ b/packages/bruno-app/src/utils/codegenerator/har.js @@ -9,25 +9,17 @@ const createContentType = (mode) => { case 'multipartForm': return 'multipart/form-data'; default: - return 'application/json'; + return ''; } }; -const createHeaders = (headers, mode) => { - const contentType = createContentType(mode); - const headersArray = headers +const createHeaders = (headers) => { + return headers .filter((header) => header.enabled) - .map((header) => { - return { - name: header.name, - value: header.value - }; - }); - const headerNames = headersArray.map((header) => header.name); - if (!headerNames.includes('Content-Type')) { - return [...headersArray, { name: 'Content-Type', value: contentType }]; - } - return headersArray; + .map((header) => ({ + name: header.name, + value: header.value + })); }; const createQuery = (queryParams = []) => { @@ -56,13 +48,13 @@ const createPostData = (body) => { } }; -export const buildHarRequest = (request) => { +export const buildHarRequest = ({ request, headers }) => { return { method: request.method, url: request.url, httpVersion: 'HTTP/1.1', cookies: [], - headers: createHeaders(request.headers, request.body.mode), + headers: createHeaders(headers), queryString: createQuery(request.params), postData: createPostData(request.body), headersSize: 0, From e1a74d0652ecb6b5828683f318f180ecebfb6ff1 Mon Sep 17 00:00:00 2001 From: Mirko Golze Date: Fri, 10 Nov 2023 21:20:30 +0100 Subject: [PATCH 15/26] #937, #921 improve evaluation of proxy configuration, allow empty proxy port --- .../CollectionSettings/ProxySettings/index.js | 14 ++++----- .../Preferences/ProxySettings/index.js | 10 +++---- .../src/runner/run-single-request.js | 7 +++-- .../bruno-electron/src/ipc/network/index.js | 30 +++++-------------- 4 files changed, 21 insertions(+), 40 deletions(-) diff --git a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js index 2ed25b1e5..c8ccb103e 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js @@ -11,22 +11,20 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => { protocol: Yup.string().oneOf(['http', 'https', 'socks4', 'socks5']), hostname: Yup.string() .when('enabled', { - is: true, + is: 'true', then: (hostname) => hostname.required('Specify the hostname for your proxy.'), otherwise: (hostname) => hostname.nullable() }) .max(1024), port: Yup.number() - .when('enabled', { - is: true, - then: (port) => port.required('Specify port between 1 and 65535').typeError('Specify port between 1 and 65535'), - otherwise: (port) => port.nullable().transform((_, val) => (val ? Number(val) : null)) - }) .min(1) - .max(65535), + .max(65535) + .typeError('Specify port between 1 and 65535') + .nullable() + .transform((_, val) => (val ? Number(val) : null)), auth: Yup.object() .when('enabled', { - is: true, + is: 'true', then: Yup.object({ enabled: Yup.boolean(), username: Yup.string() diff --git a/packages/bruno-app/src/components/Preferences/ProxySettings/index.js b/packages/bruno-app/src/components/Preferences/ProxySettings/index.js index 6b3fb7877..788f79270 100644 --- a/packages/bruno-app/src/components/Preferences/ProxySettings/index.js +++ b/packages/bruno-app/src/components/Preferences/ProxySettings/index.js @@ -22,13 +22,11 @@ const ProxySettings = ({ close }) => { }) .max(1024), port: Yup.number() - .when('enabled', { - is: true, - then: (port) => port.required('Specify port between 1 and 65535').typeError('Specify port between 1 and 65535'), - otherwise: (port) => port.nullable().transform((_, val) => (val ? Number(val) : null)) - }) .min(1) - .max(65535), + .max(65535) + .typeError('Specify port between 1 and 65535') + .nullable() + .transform((_, val) => (val ? Number(val) : null)), auth: Yup.object() .when('enabled', { is: true, diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js index e047969f6..32122f744 100644 --- a/packages/bruno-cli/src/runner/run-single-request.js +++ b/packages/bruno-cli/src/runner/run-single-request.js @@ -3,7 +3,7 @@ const qs = require('qs'); const chalk = require('chalk'); const decomment = require('decomment'); const fs = require('fs'); -const { forOwn, each, extend, get, compact } = require('lodash'); +const { forOwn, isUndefined, isNull, each, extend, get, compact } = require('lodash'); const FormData = require('form-data'); const prepareRequest = require('./prepare-request'); const interpolateVars = require('./interpolate-vars'); @@ -136,14 +136,15 @@ const runSingleRequest = async function ( const proxyAuthEnabled = get(brunoConfig, 'proxy.auth.enabled', false); const socksEnabled = proxyProtocol.includes('socks'); + let uriPort = isUndefined(proxyPort) || isNull(proxyPort) ? '' : `:${proxyPort}`; let proxyUri; if (proxyAuthEnabled) { const proxyAuthUsername = interpolateString(get(brunoConfig, 'proxy.auth.username'), interpolationOptions); const proxyAuthPassword = interpolateString(get(brunoConfig, 'proxy.auth.password'), interpolationOptions); - proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`; + proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}${uriPort}`; } else { - proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`; + proxyUri = `${proxyProtocol}://${proxyHostname}${uriPort}`; } if (socksEnabled) { diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 7e4b7ee2a..9419d4554 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -6,11 +6,10 @@ const axios = require('axios'); const path = require('path'); const decomment = require('decomment'); const Mustache = require('mustache'); -const FormData = require('form-data'); const contentDispositionParser = require('content-disposition'); const mime = require('mime-types'); const { ipcMain } = require('electron'); -const { forOwn, extend, each, get, compact } = require('lodash'); +const { isEmpty, isUndefined, isNull, each, get, compact } = require('lodash'); const { VarsRuntime, AssertRuntime, ScriptRuntime, TestRuntime } = require('@usebruno/js'); const prepareRequest = require('./prepare-request'); const prepareGqlIntrospectionRequest = require('./prepare-gql-introspection-request'); @@ -72,22 +71,6 @@ const getEnvVars = (environment = {}) => { }; }; -const getSize = (data) => { - if (!data) { - return 0; - } - - if (typeof data === 'string') { - return Buffer.byteLength(data, 'utf8'); - } - - if (typeof data === 'object') { - return Buffer.byteLength(safeStringifyJSON(data), 'utf8'); - } - - return 0; -}; - const configureRequest = async ( collectionUid, request, @@ -143,7 +126,7 @@ const configureRequest = async ( // proxy configuration let proxyConfig = get(brunoConfig, 'proxy', {}); - let proxyEnabled = get(proxyConfig, 'enabled', false); + let proxyEnabled = isEmpty(proxyConfig) ? 'global' : get(proxyConfig, 'enabled', false); if (proxyEnabled === 'global') { proxyConfig = preferencesUtil.getGlobalProxyConfig(); proxyEnabled = get(proxyConfig, 'enabled', false); @@ -156,14 +139,15 @@ const configureRequest = async ( const proxyAuthEnabled = get(proxyConfig, 'auth.enabled', false); const socksEnabled = proxyProtocol.includes('socks'); + let uriPort = isUndefined(proxyPort) || isNull(proxyPort) ? '' : `:${proxyPort}`; let proxyUri; if (proxyAuthEnabled) { const proxyAuthUsername = interpolateString(get(proxyConfig, 'auth.username'), interpolationOptions); const proxyAuthPassword = interpolateString(get(proxyConfig, 'auth.password'), interpolationOptions); - proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`; + proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}${uriPort}`; } else { - proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`; + proxyUri = `${proxyProtocol}://${proxyHostname}${uriPort}`; } if (socksEnabled) { @@ -203,10 +187,10 @@ const configureRequest = async ( const parseDataFromResponse = (response) => { const dataBuffer = Buffer.from(response.data); // Parse the charset from content type: https://stackoverflow.com/a/33192813 - const charset = /charset=([^()<>@,;:\"/[\]?.=\s]*)/i.exec(response.headers['Content-Type'] || ''); + const charset = /charset=([^()<>@,;:"/[\]?.=\s]*)/i.exec(response.headers['Content-Type'] || ''); // Overwrite the original data for backwards compatability let data = dataBuffer.toString(charset || 'utf-8'); - // Try to parse response to JSON, this can quitly fail + // Try to parse response to JSON, this can quietly fail try { data = JSON.parse(response.data); } catch {} From a0b2f80508686a278689ddec271d896df4d5e6f8 Mon Sep 17 00:00:00 2001 From: MrLuje Date: Sat, 11 Nov 2023 14:59:57 +0000 Subject: [PATCH 16/26] fix(openapi-import): spec security should be optional --- .../bruno-app/src/utils/importers/openapi-collection.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/bruno-app/src/utils/importers/openapi-collection.js b/packages/bruno-app/src/utils/importers/openapi-collection.js index 20a915bd4..d317fdfe4 100644 --- a/packages/bruno-app/src/utils/importers/openapi-collection.js +++ b/packages/bruno-app/src/utils/importers/openapi-collection.js @@ -267,12 +267,7 @@ const getDefaultUrl = (serverObject) => { }; const getSecurity = (apiSpec) => { - let supportedSchemes = apiSpec.security || []; - if (supportedSchemes.length === 0) { - return { - supported: [] - }; - } + let defaultSchemes = apiSpec.security || []; let securitySchemes = get(apiSpec, 'components.securitySchemes', {}); if (Object.keys(securitySchemes) === 0) { @@ -282,7 +277,7 @@ const getSecurity = (apiSpec) => { } return { - supported: supportedSchemes.map((scheme) => { + supported: defaultSchemes.map((scheme) => { var schemeName = Object.keys(scheme)[0]; return securitySchemes[schemeName]; }), From a5ce7e9c9ccb2c7a208e8d6c6207193b8a61ac21 Mon Sep 17 00:00:00 2001 From: Mirko Golze Date: Sun, 12 Nov 2023 21:41:25 +0100 Subject: [PATCH 17/26] #937, #921 improve evaluation of proxy configuration, allow empty proxy port --- packages/bruno-electron/src/ipc/network/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 9419d4554..d6afbe6f5 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -9,7 +9,7 @@ const Mustache = require('mustache'); const contentDispositionParser = require('content-disposition'); const mime = require('mime-types'); const { ipcMain } = require('electron'); -const { isEmpty, isUndefined, isNull, each, get, compact } = require('lodash'); +const { isUndefined, isNull, each, get, compact } = require('lodash'); const { VarsRuntime, AssertRuntime, ScriptRuntime, TestRuntime } = require('@usebruno/js'); const prepareRequest = require('./prepare-request'); const prepareGqlIntrospectionRequest = require('./prepare-gql-introspection-request'); @@ -126,7 +126,7 @@ const configureRequest = async ( // proxy configuration let proxyConfig = get(brunoConfig, 'proxy', {}); - let proxyEnabled = isEmpty(proxyConfig) ? 'global' : get(proxyConfig, 'enabled', false); + let proxyEnabled = get(proxyConfig, 'enabled', 'global'); if (proxyEnabled === 'global') { proxyConfig = preferencesUtil.getGlobalProxyConfig(); proxyEnabled = get(proxyConfig, 'enabled', false); From 500e3853a598fdcda47823428d08e68f5324551d Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Tue, 14 Nov 2023 16:33:27 +0100 Subject: [PATCH 18/26] Improve error message when an empty var is set Fixes #962 --- packages/bruno-js/src/bru.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bruno-js/src/bru.js b/packages/bruno-js/src/bru.js index 078aacc78..884b05a50 100644 --- a/packages/bruno-js/src/bru.js +++ b/packages/bruno-js/src/bru.js @@ -58,7 +58,7 @@ class Bru { setVar(key, value) { if (!key) { - throw new Error('Key is required'); + throw new Error('A variable with an empty name has been created but name is required.'); } if (envVariableNameRegex.test(key) === false) { From f39d9858776c1ae1cef90f07c4500fcd47e7374b Mon Sep 17 00:00:00 2001 From: Art051 <91856576+Art051@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:28:35 +0000 Subject: [PATCH 19/26] Problem: Issue relates to OpenAPI specs which have self referencing components, resulting in infinite loops being made within resolveRefs. Solution: Added basic use of Set to store already-traversed items within the OpenAPI spec. Linked to personal use having import problems as well as this issue raised: https://github.com/usebruno/bruno/issues/939#issue-1986513743 Tested against the API Spec mentioned in the issue both as JSON and YAML. --- .../src/utils/importers/openapi-collection.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/bruno-app/src/utils/importers/openapi-collection.js b/packages/bruno-app/src/utils/importers/openapi-collection.js index d317fdfe4..febe7d61d 100644 --- a/packages/bruno-app/src/utils/importers/openapi-collection.js +++ b/packages/bruno-app/src/utils/importers/openapi-collection.js @@ -187,18 +187,24 @@ const transformOpenapiRequestItem = (request) => { return brunoRequestItem; }; -const resolveRefs = (spec, components = spec.components) => { +const resolveRefs = (spec, components = spec.components, visitedItems = new Set()) => { if (!spec || typeof spec !== 'object') { return spec; } if (Array.isArray(spec)) { - return spec.map((item) => resolveRefs(item, components)); + return spec.map((item) => resolveRefs(item, components, visitedItems)); } if ('$ref' in spec) { const refPath = spec.$ref; + if (visitedItems.has(refPath)) { + return spec; + } else { + visitedItems.add(refPath); + } + if (refPath.startsWith('#/components/')) { // Local reference within components const refKeys = refPath.replace('#/components/', '').split('/'); @@ -213,7 +219,7 @@ const resolveRefs = (spec, components = spec.components) => { } } - return resolveRefs(ref, components); + return resolveRefs(ref, components, visitedItems); } else { // Handle external references (not implemented here) // You would need to fetch the external reference and resolve it. @@ -223,7 +229,7 @@ const resolveRefs = (spec, components = spec.components) => { // Recursively resolve references in nested objects for (const prop in spec) { - spec[prop] = resolveRefs(spec[prop], components); + spec[prop] = resolveRefs(spec[prop], components, visitedItems); } return spec; From d3c854a9da224fa992a152e4c2e2ba309685da48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=B6nefeldt?= <1157580+Andreas-Schoenefeldt@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:22:05 +0100 Subject: [PATCH 20/26] Update readme.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérémy Benoist --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index d6c4db467..6485845e5 100644 --- a/readme.md +++ b/readme.md @@ -65,7 +65,7 @@ Or any version control system of your choice - [Our Long Term Vision](https://github.com/usebruno/bruno/discussions/269) - [Roadmap](https://github.com/usebruno/bruno/discussions/384) - [Documentation](https://docs.usebruno.com) -- [stackoverflow](https://stackoverflow.com/questions/tagged/bruno) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/bruno) - [Website](https://www.usebruno.com) - [Pricing](https://www.usebruno.com/pricing) - [Download](https://www.usebruno.com/downloads) From fff687000267b8dc3e79398d59e27ac560fc539e Mon Sep 17 00:00:00 2001 From: Bennieboj <4215739+bennieboj@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:42:53 +0100 Subject: [PATCH 21/26] fix #961 by using trim --- .../bruno-app/src/components/RequestPane/QueryUrl/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js index 0a45f1a7d..f07bd5452 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js @@ -34,7 +34,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { requestUrlChanged({ itemUid: item.uid, collectionUid: collection.uid, - url: value + url: value.trim() }) ); }; @@ -80,7 +80,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { }} > Date: Thu, 16 Nov 2023 13:43:01 -0500 Subject: [PATCH 22/26] feat(#970): Add PDF Preview Any PDF response can be now be previewed. There is no UI fancy UI interface for it for simplicity. This makes it look very similar to Postman. --- package-lock.json | 877 +++++++++++++++++- packages/bruno-app/package.json | 2 + .../QueryResult/QueryResultPreview/index.js | 23 + .../ResponsePane/QueryResult/StyledWrapper.js | 13 + .../ResponsePane/QueryResult/index.js | 2 + 5 files changed, 904 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index a1e845084..0f1c2a4c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3491,6 +3491,74 @@ "node": ">=10" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "optional": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + }, "node_modules/@n1ru4l/push-pull-async-iterable-iterator": { "version": "3.2.0", "license": "MIT", @@ -5068,6 +5136,12 @@ "dev": true, "license": "MIT" }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, "node_modules/about-window": { "version": "1.15.2", "license": "MIT" @@ -5111,7 +5185,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "debug": "4" @@ -5351,10 +5425,43 @@ "version": "1.0.0", "license": "MIT" }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "optional": true + }, "node_modules/arcsecond": { "version": "5.0.0", "license": "MIT" }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/arg": { "version": "5.0.2", "license": "MIT" @@ -6326,6 +6433,21 @@ } ] }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/caseless": { "version": "0.12.0", "license": "Apache-2.0" @@ -6412,6 +6534,15 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true, + "engines": { + "node": ">=10" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "dev": true, @@ -6558,6 +6689,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/clsx": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/co": { "version": "4.6.0", "dev": true, @@ -6629,6 +6768,15 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colord": { "version": "2.9.3", "dev": true, @@ -6834,6 +6982,12 @@ "typedarray-to-buffer": "^3.1.5" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true + }, "node_modules/content-disposition": { "version": "0.5.4", "license": "MIT", @@ -7383,6 +7537,12 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, "node_modules/depd": { "version": "2.0.0", "license": "MIT", @@ -7398,6 +7558,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "dev": true, @@ -8674,6 +8843,36 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "license": "ISC" @@ -8697,6 +8896,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/generic-names": { "version": "4.0.0", "dev": true, @@ -9228,6 +9447,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, "node_modules/has-yarn": { "version": "2.1.0", "dev": true, @@ -9475,7 +9700,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -11303,9 +11528,17 @@ "node": ">=12" } }, + "node_modules/make-cancellable-promise": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.3.2.tgz", + "integrity": "sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww==", + "funding": { + "url": "https://github.com/wojtekmaj/make-cancellable-promise?sponsor=1" + } + }, "node_modules/make-dir": { "version": "3.1.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -11322,6 +11555,14 @@ "dev": true, "license": "ISC" }, + "node_modules/make-event-props": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/make-event-props/-/make-event-props-1.6.2.tgz", + "integrity": "sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==", + "funding": { + "url": "https://github.com/wojtekmaj/make-event-props?sponsor=1" + } + }, "node_modules/makeerror": { "version": "1.0.12", "dev": true, @@ -11409,6 +11650,22 @@ "version": "1.0.1", "license": "MIT" }, + "node_modules/merge-refs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.2.tgz", + "integrity": "sha512-RwcT7GsQR3KbuLw1rRuodq4Nt547BKEBkliZ0qqsrpyNne9bGTFtsFIsIpx82huWhcl3kOlOlH4H0xkPk/DqVw==", + "funding": { + "url": "https://github.com/wojtekmaj/merge-refs?sponsor=1" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/merge-stream": { "version": "2.0.0", "dev": true, @@ -11586,6 +11843,46 @@ "dev": true, "license": "MIT" }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + }, "node_modules/mkdirp": { "version": "0.5.6", "license": "MIT", @@ -11691,6 +11988,12 @@ "version": "0.0.8", "license": "ISC" }, + "node_modules/nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "optional": true + }, "node_modules/nanoclone": { "version": "0.2.1", "license": "MIT" @@ -11874,6 +12177,21 @@ "node": ">= 16.0.0" } }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "dev": true, @@ -11940,6 +12258,18 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "optional": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/nth-check": { "version": "2.1.1", "dev": true, @@ -12371,6 +12701,15 @@ "node": ">=8" } }, + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "1.1.1", "license": "MIT", @@ -12388,6 +12727,18 @@ "through": "~2.3" } }, + "node_modules/pdfjs-dist": { + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" + } + }, "node_modules/pend": { "version": "1.2.0", "dev": true, @@ -13773,6 +14124,34 @@ "version": "18.2.0", "license": "MIT" }, + "node_modules/react-pdf": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.5.1.tgz", + "integrity": "sha512-NVno97L3wfX3RLGB3C+QtroOiQrgCKPHLMFKMSQaRqDlH3gkq2CB2NyXJ+IDQNLrT/gSMPPgtZQL8cOUySc/3w==", + "dependencies": { + "clsx": "^2.0.0", + "make-cancellable-promise": "^1.3.1", + "make-event-props": "^1.6.0", + "merge-refs": "^1.2.1", + "pdfjs-dist": "3.11.174", + "prop-types": "^15.6.2", + "tiny-invariant": "^1.0.0", + "tiny-warning": "^1.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/react-pdf?sponsor=1" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-redux": { "version": "7.2.9", "license": "MIT", @@ -14526,7 +14905,7 @@ }, "node_modules/semver": { "version": "6.3.0", - "dev": true, + "devOptional": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -14654,7 +15033,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/set-function-length": { @@ -14741,6 +15120,61 @@ "version": "3.0.7", "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-get/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/simple-get/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "license": "MIT", @@ -15450,6 +15884,41 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "optional": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + }, "node_modules/temp-file": { "version": "3.4.0", "dev": true, @@ -15635,6 +16104,11 @@ "dev": true, "license": "MIT" }, + "node_modules/tiny-invariant": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", + "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + }, "node_modules/tiny-warning": { "version": "1.0.3", "license": "MIT" @@ -16507,6 +16981,15 @@ "dev": true, "license": "ISC" }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/widest-line": { "version": "3.1.0", "dev": true, @@ -16748,6 +17231,7 @@ "nanoid": "3.3.4", "next": "12.3.3", "path": "^0.12.7", + "pdfjs-dist": "^3.11.174", "platform": "^1.3.6", "posthog-node": "^2.1.0", "qs": "^6.11.0", @@ -16759,6 +17243,7 @@ "react-github-btn": "^1.4.0", "react-hot-toast": "^2.4.0", "react-inspector": "^6.0.2", + "react-pdf": "^7.5.1", "react-redux": "^7.2.6", "react-tooltip": "^5.5.2", "sass": "^1.46.0", @@ -16888,7 +17373,7 @@ }, "packages/bruno-cli": { "name": "@usebruno/cli", - "version": "1.0.0", + "version": "1.1.0", "license": "MIT", "dependencies": { "@usebruno/js": "0.9.1", @@ -16980,7 +17465,7 @@ }, "packages/bruno-electron": { "name": "bruno", - "version": "v1.1.0", + "version": "v1.1.1", "dependencies": { "@aws-sdk/credential-providers": "^3.425.0", "@usebruno/js": "0.9.1", @@ -19784,6 +20269,58 @@ } } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "optional": true, + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "optional": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, "@n1ru4l/push-pull-async-iterable-iterator": { "version": "3.2.0" }, @@ -20940,6 +21477,7 @@ "nanoid": "3.3.4", "next": "12.3.3", "path": "^0.12.7", + "pdfjs-dist": "3.11.174", "platform": "^1.3.6", "posthog-node": "^2.1.0", "prettier": "^2.7.1", @@ -20952,6 +21490,7 @@ "react-github-btn": "^1.4.0", "react-hot-toast": "^2.4.0", "react-inspector": "^6.0.2", + "react-pdf": "^7.5.1", "react-redux": "^7.2.6", "react-tooltip": "^5.5.2", "sass": "^1.46.0", @@ -20962,7 +21501,7 @@ "webpack": "^5.64.4", "webpack-cli": "^4.9.1", "xml-formatter": "^3.5.0", - "yargs-parser": "*", + "yargs-parser": "^21.1.1", "yup": "^0.32.11" }, "dependencies": { @@ -21377,6 +21916,12 @@ "version": "5.1.1", "dev": true }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, "about-window": { "version": "1.15.2" }, @@ -21403,7 +21948,7 @@ }, "agent-base": { "version": "6.0.2", - "dev": true, + "devOptional": true, "requires": { "debug": "4" } @@ -21563,9 +22108,38 @@ "append-field": { "version": "1.0.0" }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "optional": true + }, "arcsecond": { "version": "5.0.0" }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "arg": { "version": "5.0.2" }, @@ -22316,6 +22890,17 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz", "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==" }, + "canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "optional": true, + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + } + }, "caseless": { "version": "0.12.0" }, @@ -22367,6 +22952,12 @@ "readdirp": "~3.6.0" } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true + }, "chrome-trace-event": { "version": "1.0.3", "dev": true @@ -22444,6 +23035,11 @@ "mimic-response": "^1.0.0" } }, + "clsx": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==" + }, "co": { "version": "4.6.0", "dev": true @@ -22488,6 +23084,12 @@ "simple-swizzle": "^0.2.2" } }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true + }, "colord": { "version": "2.9.3", "dev": true @@ -22634,6 +23236,12 @@ } } }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true + }, "content-disposition": { "version": "0.5.4", "requires": { @@ -22971,12 +23579,24 @@ "delayed-stream": { "version": "1.0.0" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, "depd": { "version": "2.0.0" }, "destroy": { "version": "1.2.0" }, + "detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "optional": true + }, "detect-newline": { "version": "3.1.0", "dev": true @@ -23833,6 +24453,32 @@ "universalify": "^2.0.0" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, "fs.realpath": { "version": "1.0.0" }, @@ -23845,6 +24491,23 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "optional": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "generic-names": { "version": "4.0.0", "dev": true, @@ -24189,6 +24852,12 @@ "has-symbols": { "version": "1.0.3" }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, "has-yarn": { "version": "2.1.0", "dev": true @@ -24348,7 +25017,7 @@ }, "https-proxy-agent": { "version": "5.0.1", - "dev": true, + "devOptional": true, "requires": { "agent-base": "6", "debug": "4" @@ -25513,9 +26182,14 @@ "@jridgewell/sourcemap-codec": "^1.4.13" } }, + "make-cancellable-promise": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.3.2.tgz", + "integrity": "sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww==" + }, "make-dir": { "version": "3.1.0", - "dev": true, + "devOptional": true, "requires": { "semver": "^6.0.0" } @@ -25524,6 +26198,11 @@ "version": "1.3.6", "dev": true }, + "make-event-props": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/make-event-props/-/make-event-props-1.6.2.tgz", + "integrity": "sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==" + }, "makeerror": { "version": "1.0.12", "dev": true, @@ -25583,6 +26262,12 @@ "merge-descriptors": { "version": "1.0.1" }, + "merge-refs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.2.tgz", + "integrity": "sha512-RwcT7GsQR3KbuLw1rRuodq4Nt547BKEBkliZ0qqsrpyNne9bGTFtsFIsIpx82huWhcl3kOlOlH4H0xkPk/DqVw==", + "requires": {} + }, "merge-stream": { "version": "2.0.0", "dev": true @@ -25681,6 +26366,39 @@ "version": "1.2.0", "dev": true }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "optional": true + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, "mkdirp": { "version": "0.5.6", "requires": { @@ -25747,6 +26465,12 @@ "mute-stream": { "version": "0.0.8" }, + "nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "optional": true + }, "nanoclone": { "version": "0.2.1" }, @@ -25854,6 +26578,15 @@ "tv4": "^1.3.0" } }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "requires": { + "abbrev": "1" + } + }, "normalize-package-data": { "version": "2.5.0", "dev": true, @@ -25897,6 +26630,18 @@ "path-key": "^3.0.0" } }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "optional": true, + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "nth-check": { "version": "2.1.1", "dev": true, @@ -26161,6 +26906,12 @@ "path-type": { "version": "4.0.0" }, + "path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "optional": true + }, "pathval": { "version": "1.1.1" }, @@ -26170,6 +26921,15 @@ "through": "~2.3" } }, + "pdfjs-dist": { + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", + "requires": { + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" + } + }, "pend": { "version": "1.2.0", "dev": true @@ -26978,6 +27738,21 @@ "react-is": { "version": "18.2.0" }, + "react-pdf": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.5.1.tgz", + "integrity": "sha512-NVno97L3wfX3RLGB3C+QtroOiQrgCKPHLMFKMSQaRqDlH3gkq2CB2NyXJ+IDQNLrT/gSMPPgtZQL8cOUySc/3w==", + "requires": { + "clsx": "^2.0.0", + "make-cancellable-promise": "^1.3.1", + "make-event-props": "^1.6.0", + "merge-refs": "^1.2.1", + "pdfjs-dist": "3.11.174", + "prop-types": "^15.6.2", + "tiny-invariant": "^1.0.0", + "tiny-warning": "^1.0.0" + } + }, "react-redux": { "version": "7.2.9", "requires": { @@ -27488,7 +28263,7 @@ }, "semver": { "version": "6.3.0", - "dev": true + "devOptional": true }, "semver-compare": { "version": "1.0.0", @@ -27581,7 +28356,7 @@ }, "set-blocking": { "version": "2.0.0", - "dev": true + "devOptional": true }, "set-function-length": { "version": "1.1.1", @@ -27636,6 +28411,40 @@ "signal-exit": { "version": "3.0.7" }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "optional": true + }, + "simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "optional": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + }, + "dependencies": { + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true + } + } + }, "simple-swizzle": { "version": "0.2.2", "requires": { @@ -28115,6 +28924,34 @@ "version": "2.2.1", "dev": true }, + "tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "optional": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, "temp-file": { "version": "3.4.0", "dev": true, @@ -28236,6 +29073,11 @@ "version": "1.7.1", "dev": true }, + "tiny-invariant": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", + "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + }, "tiny-warning": { "version": "1.0.3" }, @@ -28777,6 +29619,15 @@ "version": "1.0.0", "dev": true }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "widest-line": { "version": "3.1.0", "dev": true, diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index d5ba0b1aa..94e1db53b 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -45,6 +45,7 @@ "nanoid": "3.3.4", "next": "12.3.3", "path": "^0.12.7", + "pdfjs-dist": "^3.11.174", "platform": "^1.3.6", "posthog-node": "^2.1.0", "qs": "^6.11.0", @@ -56,6 +57,7 @@ "react-github-btn": "^1.4.0", "react-hot-toast": "^2.4.0", "react-inspector": "^6.0.2", + "react-pdf": "^7.5.1", "react-redux": "^7.2.6", "react-tooltip": "^5.5.2", "sass": "^1.46.0", diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js index 5ed21ee97..157cfa0a3 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js @@ -2,6 +2,11 @@ import CodeEditor from 'components/CodeEditor/index'; import { get } from 'lodash'; import { useDispatch, useSelector } from 'react-redux'; import { sendRequest } from 'providers/ReduxStore/slices/collections/actions'; +import { Document, Page } from "react-pdf"; +import { useState } from "react"; +import 'pdfjs-dist/build/pdf.worker'; +import 'react-pdf/dist/esm/Page/AnnotationLayer.css'; +import 'react-pdf/dist/esm/Page/TextLayer.css'; const QueryResultPreview = ({ previewTab, @@ -19,6 +24,10 @@ const QueryResultPreview = ({ const preferences = useSelector((state) => state.app.preferences); const dispatch = useDispatch(); + const [numPages, setNumPages] = useState(null); + function onDocumentLoadSuccess({ numPages }) { + setNumPages(numPages); + } // Fail safe, so we don't render anything with an invalid tab if (!allowedPreviewModes.includes(previewTab)) { return null; @@ -45,6 +54,20 @@ const QueryResultPreview = ({ case 'preview-image': { return ; } + case 'preview-pdf': { + return( +
+ + {Array.from(new Array(numPages), (el, index) => ( + + ))} + +
+ ); + } default: case 'raw': { return ( diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js index 07f51b8bd..9b797a638 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js @@ -18,6 +18,19 @@ const StyledWrapper = styled.div` width: 100%; } + .react-pdf__Page { + margin-top: 10px; + background-color:transparent !important; + } + .react-pdf__Page__textContent { + border: 1px solid darkgrey; + box-shadow: 5px 5px 5px 1px #ccc; + border-radius: 0px; + margin: 0 auto; + } + .react-pdf__Page__canvas { + margin: 0 auto; + } div[role='tablist'] { .active { color: ${(props) => props.theme.colors.text.yellow}; diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js index b5508ba1b..f49c2491b 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js @@ -49,6 +49,8 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven allowedPreviewModes.unshift('preview-web'); } else if (mode.includes('image')) { allowedPreviewModes.unshift('preview-image'); + } else if (contentType.includes("pdf")) { + allowedPreviewModes.unshift('preview-pdf'); } return allowedPreviewModes; From 52baa69b70e0e1caf53f2ee5b656d552752eb92d Mon Sep 17 00:00:00 2001 From: n00o Date: Thu, 16 Nov 2023 18:55:43 -0500 Subject: [PATCH 23/26] Fix formatting Pass prettier tests --- .../QueryResult/QueryResultPreview/index.js | 21 ++++++++----------- .../ResponsePane/QueryResult/StyledWrapper.js | 2 +- .../ResponsePane/QueryResult/index.js | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js index 157cfa0a3..af11ebc23 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultPreview/index.js @@ -2,8 +2,8 @@ import CodeEditor from 'components/CodeEditor/index'; import { get } from 'lodash'; import { useDispatch, useSelector } from 'react-redux'; import { sendRequest } from 'providers/ReduxStore/slices/collections/actions'; -import { Document, Page } from "react-pdf"; -import { useState } from "react"; +import { Document, Page } from 'react-pdf'; +import { useState } from 'react'; import 'pdfjs-dist/build/pdf.worker'; import 'react-pdf/dist/esm/Page/AnnotationLayer.css'; import 'react-pdf/dist/esm/Page/TextLayer.css'; @@ -55,16 +55,13 @@ const QueryResultPreview = ({ return ; } case 'preview-pdf': { - return( -
- - {Array.from(new Array(numPages), (el, index) => ( - - ))} - + return ( +
+ + {Array.from(new Array(numPages), (el, index) => ( + + ))} +
); } diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js index 9b797a638..64ab32f7e 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/StyledWrapper.js @@ -20,7 +20,7 @@ const StyledWrapper = styled.div` .react-pdf__Page { margin-top: 10px; - background-color:transparent !important; + background-color: transparent !important; } .react-pdf__Page__textContent { border: 1px solid darkgrey; diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js index f49c2491b..a8f13505c 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js @@ -49,7 +49,7 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven allowedPreviewModes.unshift('preview-web'); } else if (mode.includes('image')) { allowedPreviewModes.unshift('preview-image'); - } else if (contentType.includes("pdf")) { + } else if (contentType.includes('pdf')) { allowedPreviewModes.unshift('preview-pdf'); } From e96da632b2d6b1a1f8d310e0b09961fdba508069 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Sat, 18 Nov 2023 08:29:18 +0530 Subject: [PATCH 24/26] chore: version bump @usebruno/js @usebruno/cli --- packages/bruno-cli/package.json | 4 ++-- packages/bruno-js/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bruno-cli/package.json b/packages/bruno-cli/package.json index d2aa710f4..37ea480a8 100644 --- a/packages/bruno-cli/package.json +++ b/packages/bruno-cli/package.json @@ -1,6 +1,6 @@ { "name": "@usebruno/cli", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "main": "src/index.js", "bin": { @@ -24,7 +24,7 @@ "package.json" ], "dependencies": { - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "axios": "^1.5.1", "chai": "^4.3.7", diff --git a/packages/bruno-js/package.json b/packages/bruno-js/package.json index 1152beec5..d751c0328 100644 --- a/packages/bruno-js/package.json +++ b/packages/bruno-js/package.json @@ -1,6 +1,6 @@ { "name": "@usebruno/js", - "version": "0.9.1", + "version": "0.9.2", "license": "MIT", "main": "src/index.js", "files": [ From f8c23ed6da6becf694eb782d331a0f37fd5f2b98 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Sat, 18 Nov 2023 08:29:53 +0530 Subject: [PATCH 25/26] chore: save icon should use yellow color to indicate draft --- packages/bruno-app/src/components/RequestPane/QueryUrl/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js index f07bd5452..3cc297062 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js @@ -80,7 +80,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { }} > Date: Sat, 18 Nov 2023 09:18:40 +0530 Subject: [PATCH 26/26] fix(#962): improved error label when name is not defined while setting env var --- package-lock.json | 49 ++++++++++++++++++++++++---- packages/bruno-electron/package.json | 2 +- packages/bruno-js/src/bru.js | 4 +-- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0f1c2a4c5..33807da43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17373,10 +17373,10 @@ }, "packages/bruno-cli": { "name": "@usebruno/cli", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "dependencies": { - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "axios": "^1.5.1", "chai": "^4.3.7", @@ -17468,7 +17468,7 @@ "version": "v1.1.1", "dependencies": { "@aws-sdk/credential-providers": "^3.425.0", - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "@usebruno/schema": "0.6.0", "about-window": "^1.15.2", @@ -17526,6 +17526,21 @@ "node": ">= 14" } }, + "packages/bruno-electron/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "packages/bruno-electron/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -17658,6 +17673,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "packages/bruno-electron/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, "packages/bruno-electron/node_modules/uuid": { "version": "9.0.0", "license": "MIT", @@ -17694,7 +17714,7 @@ }, "packages/bruno-js": { "name": "@usebruno/js", - "version": "0.9.1", + "version": "0.9.2", "license": "MIT", "dependencies": { "@usebruno/query": "0.1.0", @@ -21477,7 +21497,7 @@ "nanoid": "3.3.4", "next": "12.3.3", "path": "^0.12.7", - "pdfjs-dist": "3.11.174", + "pdfjs-dist": "^3.11.174", "platform": "^1.3.6", "posthog-node": "^2.1.0", "prettier": "^2.7.1", @@ -21579,7 +21599,7 @@ "@usebruno/cli": { "version": "file:packages/bruno-cli", "requires": { - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "axios": "^1.5.1", "chai": "^4.3.7", @@ -22543,7 +22563,7 @@ "version": "file:packages/bruno-electron", "requires": { "@aws-sdk/credential-providers": "^3.425.0", - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "@usebruno/schema": "0.6.0", "about-window": "^1.15.2", @@ -22592,6 +22612,16 @@ "debug": "^4.3.4" } }, + "ajv": { + "version": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -22675,6 +22705,11 @@ "argparse": "^2.0.1" } }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, "uuid": { "version": "9.0.0" } diff --git a/packages/bruno-electron/package.json b/packages/bruno-electron/package.json index d0c562a70..7fa75c1bc 100644 --- a/packages/bruno-electron/package.json +++ b/packages/bruno-electron/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@aws-sdk/credential-providers": "^3.425.0", - "@usebruno/js": "0.9.1", + "@usebruno/js": "0.9.2", "@usebruno/lang": "0.9.0", "@usebruno/schema": "0.6.0", "about-window": "^1.15.2", diff --git a/packages/bruno-js/src/bru.js b/packages/bruno-js/src/bru.js index 884b05a50..4813a73db 100644 --- a/packages/bruno-js/src/bru.js +++ b/packages/bruno-js/src/bru.js @@ -45,7 +45,7 @@ class Bru { setEnvVar(key, value) { if (!key) { - throw new Error('Key is required'); + throw new Error('Creating a env variable without specifying a name is not allowed.'); } // gracefully ignore if key is not present in environment @@ -58,7 +58,7 @@ class Bru { setVar(key, value) { if (!key) { - throw new Error('A variable with an empty name has been created but name is required.'); + throw new Error('Creating a variable without specifying a name is not allowed.'); } if (envVariableNameRegex.test(key) === false) {