diff --git a/.editorconfig b/.editorconfig index 366bdb572..c39d438f6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,8 +6,8 @@ indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true +trim_trailing_whitespace = false +insert_final_newline = false [targets/**/fixtures/*] insert_final_newline = false diff --git a/.github/workflows/hopp-publish.yml b/.github/workflows/hopp-publish.yml new file mode 100644 index 000000000..87d43b6f7 --- /dev/null +++ b/.github/workflows/hopp-publish.yml @@ -0,0 +1,26 @@ +name: Publish Package to NPM + +on: + release: + types: [published] + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - run: npm install + + - name: Publish package + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_ACCESS_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.MD similarity index 100% rename from CONTRIBUTING.md rename to CONTRIBUTING.MD diff --git a/package-lock.json b/package-lock.json index 2dd07b596..a99c666be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "httpsnippet", + "name": "@hoppscotch/httpsnippet", "version": "3.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "httpsnippet", + "name": "@hoppscotch/httpsnippet", "version": "3.0.4", "license": "MIT", "dependencies": { @@ -36,14 +36,14 @@ "eslint-plugin-jest-formatting": "^3.1.0", "eslint-plugin-simple-import-sort": "^7.0.0", "jest": "^27.5.1", - "markdownlint-cli2": "^0.5.1", + "markdownlint-cli2": "^0.13.0", "prettier": "^2.6.2", "ts-jest": "^27.1.4", "type-fest": "^2.12.2", "typescript": "^4.6.3" }, "engines": { - "node": "^14.19.1 || ^16.14.2 || ^18.0.0" + "node": "^14.19.1 || ^16.14.2 || ^18.0.0 " } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1055,6 +1055,18 @@ "node": ">= 8" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "dev": true, @@ -2087,9 +2099,9 @@ "license": "MIT" }, "node_modules/entities": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", - "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -2473,9 +2485,10 @@ "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.2.11", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2809,9 +2822,10 @@ } }, "node_modules/ignore": { - "version": "5.2.0", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } @@ -3811,6 +3825,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "node_modules/kleur": { "version": "3.0.3", "dev": true, @@ -3864,12 +3884,12 @@ "license": "MIT" }, "node_modules/linkify-it": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", - "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, "dependencies": { - "uc.micro": "^1.0.1" + "uc.micro": "^2.0.0" } }, "node_modules/locate-path": { @@ -3941,87 +3961,94 @@ "license": "MIT" }, "node_modules/markdown-it": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", - "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, "dependencies": { "argparse": "^2.0.1", - "entities": "~3.0.1", - "linkify-it": "^4.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" }, "bin": { - "markdown-it": "bin/markdown-it.js" + "markdown-it": "bin/markdown-it.mjs" } }, "node_modules/markdownlint": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.26.2.tgz", - "integrity": "sha512-2Am42YX2Ex5SQhRq35HxYWDfz1NLEOZWWN25nqd2h3AHRKsGRE+Qg1gt1++exW792eXTrR4jCNHfShfWk9Nz8w==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.34.0.tgz", + "integrity": "sha512-qwGyuyKwjkEMOJ10XN6OTKNOVYvOIi35RNvDLNxTof5s8UmyGHlCdpngRHoRGNvQVGuxO3BJ7uNSgdeX166WXw==", "dev": true, "dependencies": { - "markdown-it": "13.0.1" + "markdown-it": "14.1.0", + "markdownlint-micromark": "0.1.9" }, "engines": { - "node": ">=14" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/DavidAnson" } }, "node_modules/markdownlint-cli2": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/markdownlint-cli2/-/markdownlint-cli2-0.5.1.tgz", - "integrity": "sha512-f3Nb1GF/c8YSrV/FntsCWzpa5mLFJRlO+wzEgv+lkNQjU6MZflUwc2FbyEDPTo6oVhP2VyUOkK0GkFgfuktl1w==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/markdownlint-cli2/-/markdownlint-cli2-0.13.0.tgz", + "integrity": "sha512-Pg4nF7HlopU97ZXtrcVISWp3bdsuc5M0zXyLp2/sJv2zEMlInrau0ZKK482fQURzVezJzWBpNmu4u6vGAhij+g==", "dev": true, "dependencies": { - "globby": "13.1.2", - "markdownlint": "0.26.2", - "markdownlint-cli2-formatter-default": "0.0.3", - "micromatch": "4.0.5", - "strip-json-comments": "5.0.0", - "yaml": "2.1.1" + "globby": "14.0.1", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.1", + "markdownlint": "0.34.0", + "markdownlint-cli2-formatter-default": "0.0.4", + "micromatch": "4.0.5" }, "bin": { - "markdownlint-cli2": "markdownlint-cli2.js", - "markdownlint-cli2-config": "markdownlint-cli2-config.js", - "markdownlint-cli2-fix": "markdownlint-cli2-fix.js" + "markdownlint-cli2": "markdownlint-cli2.js" }, "engines": { - "node": ">=14" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/DavidAnson" } }, "node_modules/markdownlint-cli2-formatter-default": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.3.tgz", - "integrity": "sha512-QEAJitT5eqX1SNboOD+SO/LNBpu4P4je8JlR02ug2cLQAqmIhh8IJnSK7AcaHBHhNADqdGydnPpQOpsNcEEqCw==", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.4.tgz", + "integrity": "sha512-xm2rM0E+sWgjpPn1EesPXx5hIyrN2ddUnUwnbCsD/ONxYtw3PX6LydvdH6dciWAoFDpwzbHM1TO7uHfcMd6IYg==", "dev": true, "peerDependencies": { "markdownlint-cli2": ">=0.0.4" } }, "node_modules/markdownlint-cli2/node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", "dev": true, "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/markdownlint-cli2/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "node_modules/markdownlint-cli2/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, "engines": { "node": ">=12" @@ -4030,10 +4057,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/markdownlint-cli2/node_modules/strip-json-comments": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz", - "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==", + "node_modules/markdownlint-cli2/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true, "engines": { "node": ">=14.16" @@ -4042,10 +4069,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdownlint-micromark": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.9.tgz", + "integrity": "sha512-5hVs/DzAFa8XqYosbEAEg6ok6MF2smDj89ztn9pKkCtdKHVdPQuGMH7frFfYL9mLkvfFe4pTyAMffLbjf3/EyA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/DavidAnson" + } + }, "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true }, "node_modules/merge-stream": { @@ -4431,6 +4470,15 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "dev": true, @@ -5015,11 +5063,23 @@ } }, "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "dev": true }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universalify": { "version": "0.1.2", "dev": true, @@ -5248,15 +5308,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/yargs": { "version": "17.4.0", "license": "MIT", @@ -6046,6 +6097,12 @@ "fastq": "^1.6.0" } }, + "@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true + }, "@sinonjs/commons": { "version": "1.8.3", "dev": true, @@ -6702,9 +6759,9 @@ "version": "8.0.0" }, "entities": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", - "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true }, "error-ex": { @@ -6937,7 +6994,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.11", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -7154,7 +7213,9 @@ } }, "ignore": { - "version": "5.2.0", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true }, "import-fresh": { @@ -7875,6 +7936,12 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "kleur": { "version": "3.0.3", "dev": true @@ -7909,12 +7976,12 @@ "dev": true }, "linkify-it": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", - "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, "requires": { - "uc.micro": "^1.0.1" + "uc.micro": "^2.0.0" } }, "locate-path": { @@ -7965,79 +8032,88 @@ "version": "0.0.7" }, "markdown-it": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", - "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, "requires": { "argparse": "^2.0.1", - "entities": "~3.0.1", - "linkify-it": "^4.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" } }, "markdownlint": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.26.2.tgz", - "integrity": "sha512-2Am42YX2Ex5SQhRq35HxYWDfz1NLEOZWWN25nqd2h3AHRKsGRE+Qg1gt1++exW792eXTrR4jCNHfShfWk9Nz8w==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.34.0.tgz", + "integrity": "sha512-qwGyuyKwjkEMOJ10XN6OTKNOVYvOIi35RNvDLNxTof5s8UmyGHlCdpngRHoRGNvQVGuxO3BJ7uNSgdeX166WXw==", "dev": true, "requires": { - "markdown-it": "13.0.1" + "markdown-it": "14.1.0", + "markdownlint-micromark": "0.1.9" } }, "markdownlint-cli2": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/markdownlint-cli2/-/markdownlint-cli2-0.5.1.tgz", - "integrity": "sha512-f3Nb1GF/c8YSrV/FntsCWzpa5mLFJRlO+wzEgv+lkNQjU6MZflUwc2FbyEDPTo6oVhP2VyUOkK0GkFgfuktl1w==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/markdownlint-cli2/-/markdownlint-cli2-0.13.0.tgz", + "integrity": "sha512-Pg4nF7HlopU97ZXtrcVISWp3bdsuc5M0zXyLp2/sJv2zEMlInrau0ZKK482fQURzVezJzWBpNmu4u6vGAhij+g==", "dev": true, "requires": { - "globby": "13.1.2", - "markdownlint": "0.26.2", - "markdownlint-cli2-formatter-default": "0.0.3", - "micromatch": "4.0.5", - "strip-json-comments": "5.0.0", - "yaml": "2.1.1" + "globby": "14.0.1", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.1", + "markdownlint": "0.34.0", + "markdownlint-cli2-formatter-default": "0.0.4", + "micromatch": "4.0.5" }, "dependencies": { "globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", "dev": true, "requires": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" } }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true }, - "strip-json-comments": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz", - "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==", + "slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true } } }, "markdownlint-cli2-formatter-default": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.3.tgz", - "integrity": "sha512-QEAJitT5eqX1SNboOD+SO/LNBpu4P4je8JlR02ug2cLQAqmIhh8IJnSK7AcaHBHhNADqdGydnPpQOpsNcEEqCw==", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.4.tgz", + "integrity": "sha512-xm2rM0E+sWgjpPn1EesPXx5hIyrN2ddUnUwnbCsD/ONxYtw3PX6LydvdH6dciWAoFDpwzbHM1TO7uHfcMd6IYg==", "dev": true, "requires": {} }, + "markdownlint-micromark": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.9.tgz", + "integrity": "sha512-5hVs/DzAFa8XqYosbEAEg6ok6MF2smDj89ztn9pKkCtdKHVdPQuGMH7frFfYL9mLkvfFe4pTyAMffLbjf3/EyA==", + "dev": true + }, "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true }, "merge-stream": { @@ -8275,6 +8351,12 @@ "version": "2.1.1", "dev": true }, + "punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true + }, "queue-microtask": { "version": "1.2.3", "dev": true @@ -8604,9 +8686,15 @@ "dev": true }, "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true + }, + "unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", "dev": true }, "universalify": { @@ -8747,12 +8835,6 @@ "version": "4.0.0", "dev": true }, - "yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", - "dev": true - }, "yargs": { "version": "17.4.0", "requires": { diff --git a/package.json b/package.json index ea2456625..abeaaaae7 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "version": "3.0.4", - "name": "httpsnippet", + "name": "@hoppscotch/httpsnippet", "description": "HTTP Request snippet generator for *most* languages", - "author": "Kong ", - "homepage": "https://github.com/Kong/httpsnippet", + "author": "Hoppscotch Team ", + "homepage": "https://github.com/Hoppscotch/httpsnippet", "license": "MIT", "main": "dist/httpsnippet.js", "types": "dist/httpsnippet.d.ts", @@ -39,11 +39,11 @@ "xmlhttprequest" ], "engines": { - "node": "^14.19.1 || ^16.14.2 || ^18.0.0 || ^20.0.0" + "node": "^14.19.1 || ^16.14.2 || ^18.0.0 " }, - "repository": "Kong/httpsnippet", + "repository": "Hoppscotch/httpsnippet", "bugs": { - "url": "https://github.com/Kong/httpsnippet/issues" + "url": "https://github.com/Hoppscotch/httpsnippet/issues" }, "scripts": { "clean": "tsc --build tsconfig.build.json --clean", @@ -54,7 +54,9 @@ "lint:markdown": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"", "build": "tsc --build tsconfig.build.json", "build:types": "tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly", - "test": "jest" + "test": "jest", + "dev": "tsc --watch --preserveWatchOutput", + "test:watch": "jest --watch" }, "devDependencies": { "@types/eslint": "^8.4.1", @@ -72,7 +74,7 @@ "eslint-plugin-jest": "^26.1.3", "eslint-plugin-jest-formatting": "^3.1.0", "eslint-plugin-simple-import-sort": "^7.0.0", - "markdownlint-cli2": "^0.5.1", + "markdownlint-cli2": "^0.13.0", "jest": "^27.5.1", "prettier": "^2.6.2", "ts-jest": "^27.1.4", diff --git a/src/httpsnippet.ts b/src/httpsnippet.ts index 8d315a5cf..2db690b16 100644 --- a/src/httpsnippet.ts +++ b/src/httpsnippet.ts @@ -310,10 +310,12 @@ export class HTTPSnippet { ...uriObj, }); //? + const decodedFullUrl = decodeURIComponent(fullUrl); + return { ...request, allHeaders, - fullUrl, + fullUrl: decodedFullUrl, url, uriObj, }; diff --git a/src/targets/c/libcurl/fixtures/nested.c b/src/targets/c/libcurl/fixtures/nested.c index 6b7a7e879..e52183767 100644 --- a/src/targets/c/libcurl/fixtures/nested.c +++ b/src/targets/c/libcurl/fixtures/nested.c @@ -1,6 +1,6 @@ CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); -curl_easy_setopt(hnd, CURLOPT_URL, "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value"); +curl_easy_setopt(hnd, CURLOPT_URL, "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value"); CURLcode ret = curl_easy_perform(hnd); \ No newline at end of file diff --git a/src/targets/csharp/httpclient/fixtures/nested.cs b/src/targets/csharp/httpclient/fixtures/nested.cs index d513d83f3..65987ff8f 100644 --- a/src/targets/csharp/httpclient/fixtures/nested.cs +++ b/src/targets/csharp/httpclient/fixtures/nested.cs @@ -3,7 +3,7 @@ var request = new HttpRequestMessage { Method = HttpMethod.Get, - RequestUri = new Uri("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value"), + RequestUri = new Uri("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value"), }; using (var response = await client.SendAsync(request)) { diff --git a/src/targets/csharp/restsharp/fixtures/nested.cs b/src/targets/csharp/restsharp/fixtures/nested.cs index e28bf3190..784ee7805 100644 --- a/src/targets/csharp/restsharp/fixtures/nested.cs +++ b/src/targets/csharp/restsharp/fixtures/nested.cs @@ -1,3 +1,3 @@ -var client = new RestClient("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value"); +var client = new RestClient("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); \ No newline at end of file diff --git a/src/targets/go/native/fixtures/nested.go b/src/targets/go/native/fixtures/nested.go index cd95ccda7..7eb401687 100644 --- a/src/targets/go/native/fixtures/nested.go +++ b/src/targets/go/native/fixtures/nested.go @@ -8,7 +8,7 @@ import ( func main() { - url := "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value" + url := "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value" req, _ := http.NewRequest("GET", url, nil) diff --git a/src/targets/java/asynchttp/fixtures/nested.java b/src/targets/java/asynchttp/fixtures/nested.java index b05658ca7..4ee91ad89 100644 --- a/src/targets/java/asynchttp/fixtures/nested.java +++ b/src/targets/java/asynchttp/fixtures/nested.java @@ -1,5 +1,5 @@ AsyncHttpClient client = new DefaultAsyncHttpClient(); -client.prepare("GET", "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value") +client.prepare("GET", "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value") .execute() .toCompletableFuture() .thenAccept(System.out::println) diff --git a/src/targets/java/nethttp/fixtures/nested.java b/src/targets/java/nethttp/fixtures/nested.java index abe7fce7e..14b729386 100644 --- a/src/targets/java/nethttp/fixtures/nested.java +++ b/src/targets/java/nethttp/fixtures/nested.java @@ -1,5 +1,5 @@ HttpRequest request = HttpRequest.newBuilder() - .uri(URI.create("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value")) + .uri(URI.create("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value")) .method("GET", HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); diff --git a/src/targets/java/okhttp/fixtures/nested.java b/src/targets/java/okhttp/fixtures/nested.java index 1debd4815..a35a80dfe 100644 --- a/src/targets/java/okhttp/fixtures/nested.java +++ b/src/targets/java/okhttp/fixtures/nested.java @@ -1,7 +1,7 @@ OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() - .url("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value") + .url("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value") .get() .build(); diff --git a/src/targets/java/unirest/fixtures/nested.java b/src/targets/java/unirest/fixtures/nested.java index 95e6476b7..2c4b36fe8 100644 --- a/src/targets/java/unirest/fixtures/nested.java +++ b/src/targets/java/unirest/fixtures/nested.java @@ -1,2 +1,2 @@ -HttpResponse response = Unirest.get("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value") +HttpResponse response = Unirest.get("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value") .asString(); \ No newline at end of file diff --git a/src/targets/javascript/fetch/fixtures/nested.js b/src/targets/javascript/fetch/fixtures/nested.js index 4a64cd6ca..3da4596c6 100644 --- a/src/targets/javascript/fetch/fixtures/nested.js +++ b/src/targets/javascript/fetch/fixtures/nested.js @@ -1,4 +1,4 @@ -const url = 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value'; +const url = 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'; const options = {method: 'GET'}; try { diff --git a/src/targets/javascript/jquery/fixtures/nested.js b/src/targets/javascript/jquery/fixtures/nested.js index 4a8ead252..af089d88f 100644 --- a/src/targets/javascript/jquery/fixtures/nested.js +++ b/src/targets/javascript/jquery/fixtures/nested.js @@ -1,7 +1,7 @@ const settings = { async: true, crossDomain: true, - url: 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value', + url: 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value', method: 'GET', headers: {} }; diff --git a/src/targets/javascript/xhr/fixtures/nested.js b/src/targets/javascript/xhr/fixtures/nested.js index b4170a350..c781da688 100644 --- a/src/targets/javascript/xhr/fixtures/nested.js +++ b/src/targets/javascript/xhr/fixtures/nested.js @@ -9,6 +9,6 @@ xhr.addEventListener('readystatechange', function () { } }); -xhr.open('GET', 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value'); +xhr.open('GET', 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'); xhr.send(data); \ No newline at end of file diff --git a/src/targets/kotlin/okhttp/fixtures/nested.kt b/src/targets/kotlin/okhttp/fixtures/nested.kt index 5e947bf90..8b6a0db9d 100644 --- a/src/targets/kotlin/okhttp/fixtures/nested.kt +++ b/src/targets/kotlin/okhttp/fixtures/nested.kt @@ -1,7 +1,7 @@ val client = OkHttpClient() val request = Request.Builder() - .url("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value") + .url("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value") .get() .build() diff --git a/src/targets/node/fetch/fixtures/nested.js b/src/targets/node/fetch/fixtures/nested.js index c0dec5020..1ceccc7d7 100644 --- a/src/targets/node/fetch/fixtures/nested.js +++ b/src/targets/node/fetch/fixtures/nested.js @@ -1,6 +1,6 @@ const fetch = require('node-fetch'); -const url = 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value'; +const url = 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'; const options = {method: 'GET'}; try { diff --git a/src/targets/objc/nsurlsession/fixtures/nested.m b/src/targets/objc/nsurlsession/fixtures/nested.m index 233d2f04f..5df4f95cd 100644 --- a/src/targets/objc/nsurlsession/fixtures/nested.m +++ b/src/targets/objc/nsurlsession/fixtures/nested.m @@ -1,6 +1,6 @@ #import -NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value"] +NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0]; [request setHTTPMethod:@"GET"]; diff --git a/src/targets/ocaml/cohttp/fixtures/nested.ml b/src/targets/ocaml/cohttp/fixtures/nested.ml index 901559c9e..399e773bd 100644 --- a/src/targets/ocaml/cohttp/fixtures/nested.ml +++ b/src/targets/ocaml/cohttp/fixtures/nested.ml @@ -2,7 +2,7 @@ open Cohttp_lwt_unix open Cohttp open Lwt -let uri = Uri.of_string "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value" in +let uri = Uri.of_string "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value" in Client.call `GET uri >>= fun (res, body_stream) -> diff --git a/src/targets/php/curl/fixtures/nested.php b/src/targets/php/curl/fixtures/nested.php index 69a0a33b1..5e90314de 100644 --- a/src/targets/php/curl/fixtures/nested.php +++ b/src/targets/php/curl/fixtures/nested.php @@ -3,7 +3,7 @@ $curl = curl_init(); curl_setopt_array($curl, [ - CURLOPT_URL => "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value", + CURLOPT_URL => "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, diff --git a/src/targets/php/guzzle/fixtures/nested.php b/src/targets/php/guzzle/fixtures/nested.php index 00429e831..e16dbdbec 100644 --- a/src/targets/php/guzzle/fixtures/nested.php +++ b/src/targets/php/guzzle/fixtures/nested.php @@ -2,6 +2,6 @@ $client = new \GuzzleHttp\Client(); -$response = $client->request('GET', 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value'); +$response = $client->request('GET', 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'); echo $response->getBody(); \ No newline at end of file diff --git a/src/targets/powershell/restmethod/fixtures/nested.ps1 b/src/targets/powershell/restmethod/fixtures/nested.ps1 index cd2b5a97e..81f719bd8 100644 --- a/src/targets/powershell/restmethod/fixtures/nested.ps1 +++ b/src/targets/powershell/restmethod/fixtures/nested.ps1 @@ -1 +1 @@ -$response = Invoke-RestMethod -Uri 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' -Method GET \ No newline at end of file +$response = Invoke-RestMethod -Uri 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' -Method GET \ No newline at end of file diff --git a/src/targets/powershell/webrequest/fixtures/nested.ps1 b/src/targets/powershell/webrequest/fixtures/nested.ps1 index afd5485a5..d358fd682 100644 --- a/src/targets/powershell/webrequest/fixtures/nested.ps1 +++ b/src/targets/powershell/webrequest/fixtures/nested.ps1 @@ -1 +1 @@ -$response = Invoke-WebRequest -Uri 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' -Method GET \ No newline at end of file +$response = Invoke-WebRequest -Uri 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' -Method GET \ No newline at end of file diff --git a/src/targets/ruby/native/fixtures/nested.rb b/src/targets/ruby/native/fixtures/nested.rb index d0bbd40ce..faa4d6cab 100644 --- a/src/targets/ruby/native/fixtures/nested.rb +++ b/src/targets/ruby/native/fixtures/nested.rb @@ -1,7 +1,7 @@ require 'uri' require 'net/http' -url = URI("http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value") +url = URI("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value") http = Net::HTTP.new(url.host, url.port) diff --git a/src/targets/shell/curl/fixtures/dont-deglob.sh b/src/targets/shell/curl/fixtures/dont-deglob.sh index 049ebdba3..63a81f234 100644 --- a/src/targets/shell/curl/fixtures/dont-deglob.sh +++ b/src/targets/shell/curl/fixtures/dont-deglob.sh @@ -1 +1 @@ -curl --request GET --url 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' \ No newline at end of file +curl --request GET --url 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' \ No newline at end of file diff --git a/src/targets/shell/curl/fixtures/nested.sh b/src/targets/shell/curl/fixtures/nested.sh index 2126d58f9..89ece9a9e 100644 --- a/src/targets/shell/curl/fixtures/nested.sh +++ b/src/targets/shell/curl/fixtures/nested.sh @@ -1,2 +1,2 @@ curl --request GET \ - --url 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' \ No newline at end of file + --url 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' \ No newline at end of file diff --git a/src/targets/shell/httpie/fixtures/nested.sh b/src/targets/shell/httpie/fixtures/nested.sh index 1e07f2691..a726a8679 100644 --- a/src/targets/shell/httpie/fixtures/nested.sh +++ b/src/targets/shell/httpie/fixtures/nested.sh @@ -1 +1 @@ -http GET 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' \ No newline at end of file +http GET 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' \ No newline at end of file diff --git a/src/targets/shell/wget/fixtures/nested.sh b/src/targets/shell/wget/fixtures/nested.sh index 6c2c988cc..f32554509 100644 --- a/src/targets/shell/wget/fixtures/nested.sh +++ b/src/targets/shell/wget/fixtures/nested.sh @@ -1,4 +1,4 @@ wget --quiet \ --method GET \ --output-document \ - - 'http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value' \ No newline at end of file + - 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value' \ No newline at end of file diff --git a/src/targets/swift/nsurlsession/fixtures/nested.swift b/src/targets/swift/nsurlsession/fixtures/nested.swift index 43aaf84a8..04691624e 100644 --- a/src/targets/swift/nsurlsession/fixtures/nested.swift +++ b/src/targets/swift/nsurlsession/fixtures/nested.swift @@ -1,6 +1,6 @@ import Foundation -let request = NSMutableURLRequest(url: NSURL(string: "http://mockbin.com/har?foo%5Bbar%5D=baz%2Czap&fiz=buz&key=value")! as URL, +let request = NSMutableURLRequest(url: NSURL(string: "http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" diff --git a/src/targets/targets.test.ts b/src/targets/targets.test.ts index bbd10748d..befb3c68c 100644 --- a/src/targets/targets.test.ts +++ b/src/targets/targets.test.ts @@ -4,7 +4,17 @@ import path from 'path'; import short from '../fixtures/requests/short.json'; import { availableTargets, extname } from '../helpers/utils'; import { HTTPSnippet, Request } from '../httpsnippet'; -import { addTarget, addTargetClient, Client, ClientId, isClient, isTarget, Target, TargetId, targets } from './targets'; +import { + addTarget, + addTargetClient, + Client, + ClientId, + isClient, + isTarget, + Target, + TargetId, + targets, +} from './targets'; const expectedBasePath = ['src', 'fixtures', 'requests'];