Repository: postmanlabs/postman-code-generators
Pull request #554 (2021-12-18 00:36:50)

[Snyk] Upgrade jsdoc from 3.6.6 to 3.6.7
<h3>Snyk has created this PR to upgrade jsdoc from 3.6.6 to 3.6.7.</h3>

:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
<hr/>

- The recommended version is **1 version** ahead of your current version.
- The recommended version was released **7 months ago**, on 2021-05-15.

The recommended version fixes:

Severity                   | Issue                | PriorityScore (*)                 | Exploit Maturity |
:-------------------------:|:-------------------------|-------------------------|:-------------------------
<img src="https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/m.png" width="20" height="20" title="medium severity"/>  | Regular Expression Denial of Service (ReDoS)<br/> [SNYK-JS-MARKED-584281](https://snyk.io/vuln/SNYK-JS-MARKED-584281) | **520/1000**  <br/> **Why?** Has a fix available, CVSS 5.9  | No Known Exploit 

(*) Note that the real score may have changed since the PR was raised.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>jsdoc</b></summary>
    <ul>
      <li>
        <b>3.6.7</b> - 2021-05-15
      </li>
      <li>
        <b>3.6.6</b> - 2020-09-20
      </li>
    </ul>
    from <a href="https://snyk.io/redirect/github/jsdoc/jsdoc/releases">jsdoc GitHub release notes</a>
  </details>
</details>


<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>jsdoc</b></summary>
    <ul>
      <li><a href="https://snyk.io/redirect/github/jsdoc/jsdoc/commit/e1f1919d689e84a06413370bc9a717cd6e7cab5f">e1f1919</a> 3.6.7</li>
      <li><a href="https://snyk.io/redirect/github/jsdoc/jsdoc/commit/f7a64bdae6c702d055a973c5ba955e249fbcbad4">f7a64bd</a> chore(deps): update selected dependencies</li>
    </ul>

   <a href="https://snyk.io/redirect/github/jsdoc/jsdoc/compare/3f5c46262f77f27b4cd2fe0f03d167b4fc3c906b...e1f1919d689e84a06413370bc9a717cd6e7cab5f">Compare</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.*

For more information:  <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmMTlkODVjYS0wOGM3LTQ1MWItYTQ2ZC0yOWU0NzdiMzA5MzMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImYxOWQ4NWNhLTA4YzctNDUxYi1hNDZkLTI5ZTQ3N2IzMDkzMyJ9fQ==" width="0" height="0"/><img src="https://app.snyk.io/badges/merge-advice/?package_manager=npm&package_name=jsdoc&from_version=3.6.6&to_version=3.6.7&pr_id=f19d85ca-08c7-451b-a46d-29e477b30933&visibility=false&has_feature_flag=false" width="0" height="0"/>

🧐 [View latest project report](https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e/settings/integration?pkg&#x3D;jsdoc&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!--- (snyk:metadata:{"prId":"f19d85ca-08c7-451b-a46d-29e477b30933","prPublicId":"f19d85ca-08c7-451b-a46d-29e477b30933","dependencies":[{"name":"jsdoc","from":"3.6.6","to":"3.6.7"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"8519ba8e-6a7d-469a-88b3-7891b4c1c14e","env":"prod","prType":"upgrade","vulns":["SNYK-JS-MARKED-584281"],"issuesToFix":[{"issueId":"SNYK-JS-MARKED-584281","severity":"medium","title":"Regular Expression Denial of Service (ReDoS)","exploitMaturity":"no-known-exploit","priorityScore":520,"priorityScoreFactors":[{"type":"exploit","label":"Unproven","score":11},{"type":"fixability","label":true,"score":214},{"type":"cvssScore","label":"5.9","score":295}]}],"upgrade":["SNYK-JS-MARKED-584281"],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2021-05-15T01:26:37.090Z"},"templateVariants":["merge-advice-badge-shown","priorityScore"],"hasFixes":true,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[520]}) --->



Patch:
diff --git a/.eslintrc b/.eslintrc
index faa56f0..d80fe87 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -8,9 +8,6 @@
     "node": true,
     "es6": true
   },
-  "parserOptions": {
-    "ecmaVersion": 2018
-  },
   "rules": {
     // Possible Errors
     "for-direction": "error",
diff --git a/.gitignore b/.gitignore
index 5a57e17..e3034d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,5 +67,4 @@ typings/
 out/
 
 newmanResponses.json
-dummyFile*.txt
-dummyBinaryFile
+dummyFile*.txt
\ No newline at end of file
diff --git a/codegens/curl/README.md b/codegens/curl/README.md
index a9962c1..c52d534 100644
--- a/codegens/curl/README.md
+++ b/codegens/curl/README.md
@@ -18,7 +18,7 @@ Convert function takes three parameters
     * `indentCount` - The number of indentation characters to add per code level
     * `trimRequestBody` - Trim request body fields
     * `followRedirect` - Boolean denoting whether to redirect a request
-    * `requestTimeoutInSeconds` - Integer denoting time after which the request will bail out in seconds
+    * `requestTimeout` - Integer denoting time after which the request will bail out in milli-seconds
     * `multiLine` - Boolean denoting whether to output code snippet with multi line breaks
     * `longFormat` - Boolean denoting whether to use longform cURL options in snippet
     * `quoteType` - String denoting the quote type to use (single or double) for URL
diff --git a/codegens/curl/lib/index.js b/codegens/curl/lib/index.js
index 253ffed..2688153 100644
--- a/codegens/curl/lib/index.js
+++ b/codegens/curl/lib/index.js
@@ -18,7 +18,7 @@ self = module.exports = {
       format, snippet, silent, url, quoteType;
 
     redirect = options.followRedirect;
-    timeout = options.requestTimeoutInSeconds;
+    timeout = options.requestTimeout;
     multiLine = options.multiLine;
     format = options.longFormat;
     trim = options.trimRequestBody;
@@ -222,11 +222,11 @@ self = module.exports = {
           '(Use double quotes when running curl in cmd.exe and single quotes for the rest)'
       },
       {
-        name: 'Set request timeout (in seconds)',
-        id: 'requestTimeoutInSeconds',
+        name: 'Set request timeout',
+        id: 'requestTimeout',
         type: 'positiveInteger',
         default: 0,
-        description: 'Set number of seconds the request should wait for a response before ' +
+        description: 'Set number of milliseconds the request should wait for a response before ' +
           'timing out (use 0 for infinity)'
       },
       {
diff --git a/codegens/curl/lib/util.js b/codegens/curl/lib/util.js
index 8346fb5..30173c1 100644
--- a/codegens/curl/lib/util.js
+++ b/codegens/curl/lib/util.js
@@ -5,7 +5,7 @@ var self = module.exports = {
      *
      * @param {String} inputString
      * @param {Boolean} [trim] - indicates whether to trim string or not
-     * @param {String} [quoteType] - indicates which quoteType has to be escaped
+     * @param {Boolean} [quoteType] - indicates which quoteType has to be escaped
      * @param {Boolean} [backSlash] - indicates whether to escape backslash(\\)
      * @returns {String}
      */
@@ -20,8 +20,6 @@ var self = module.exports = {
 
     if (quoteType === '"') {
       inputString = inputString.replace(/"/g, '\\"');
-      // Escape backslash if double quote was already escaped before call to sanitize
-      inputString = inputString.replace(/(?<!\\)\\\\"/g, '\\\\\\"');
     }
     else if (quoteType === '\'') {
       // for curl escaping of single quotes inside single quotes involves changing of ' to '\''
diff --git a/codegens/java-okhttp/lib/okhttp.js b/codegens/java-okhttp/lib/okhttp.js
index ee2aec5..e4d73b5 100644
--- a/codegens/java-okhttp/lib/okhttp.js
+++ b/codegens/java-okhttp/lib/okhttp.js
@@ -6,7 +6,7 @@ var _ = require('./lodash'),
   sanitizeOptions = require('./util').sanitizeOptions;
 
 //  Since Java OkHttp requires to add extralines of code to handle methods with body
-const METHODS_WITHOUT_BODY = ['HEAD', 'COPY', 'UNLOCK', 'UNLINK', 'PURGE', 'LINK', 'VIEW'];
+const METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'COPY', 'UNLOCK', 'UNLINK', 'PURGE', 'LINK', 'VIEW'];
 
 /**
  * returns snippet of java okhttp by parsing data from Postman-SDK request object
diff --git a/codegens/nodejs-native/package.json b/codegens/nodejs-native/package.json
index a49771d..57eb30f 100644
--- a/codegens/nodejs-native/package.json
+++ b/codegens/nodejs-native/package.json
@@ -30,7 +30,7 @@
     "postman-collection": "3.6.11"
   },
   "devDependencies": {
-    "follow-redirects": "1.14.1"
+    "follow-redirects": "1.13.3"
   },
   "engines": {
     "node": ">=8"
diff --git a/package-lock.json b/package-lock.json
index 66b2028..d61099b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -523,6 +523,12 @@
       "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==",
       "dev": true
     },
+    "bluebird": {
+      "version": "3.7.2",
+      "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+      "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
+      "dev": true
+    },
     "bn.js": {
       "version": "4.11.8",
       "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
@@ -844,12 +850,12 @@
       "dev": true
     },
     "catharsis": {
-      "version": "0.8.11",
-      "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz",
-      "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==",
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
+      "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
       "dev": true,
       "requires": {
-        "lodash": "^4.17.14"
+        "lodash": "^4.17.15"
       }
     },
     "chai": {
@@ -3779,12 +3785,12 @@
       }
     },
     "js2xmlparser": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz",
-      "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==",
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz",
+      "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==",
       "dev": true,
       "requires": {
-        "xmlcreate": "^2.0.3"
+        "xmlcreate": "^2.0.4"
       }
     },
     "jsbn": {
@@ -3794,37 +3800,31 @@
       "dev": true
     },
     "jsdoc": {
-      "version": "3.6.6",
-      "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz",
-      "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==",
+      "version": "3.6.7",
+      "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.7.tgz",
+      "integrity": "sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw==",
       "dev": true,
       "requires": {
         "@babel/parser": "^7.9.4",
         "bluebird": "^3.7.2",
-        "catharsis": "^0.8.11",
+        "catharsis": "^0.9.0",
         "escape-string-regexp": "^2.0.0",
         "js2xmlparser": "^4.0.1",
         "klaw": "^3.0.0",
         "markdown-it": "^10.0.0",
         "markdown-it-anchor": "^5.2.7",
-        "marked": "^0.8.2",
+        "marked": "^2.0.3",
         "mkdirp": "^1.0.4",
         "requizzle": "^0.2.3",
         "strip-json-comments": "^3.1.0",
         "taffydb": "2.6.2",
-        "underscore": "~1.10.2"
+        "underscore": "~1.13.1"
       },
       "dependencies": {
         "@babel/parser": {
-          "version": "7.12.1",
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.1.tgz",
-          "integrity": "sha512-xjZsx0sBjb6J2+QkoHI69UeD2EWbsyUW0WyZKOoJ9sBrQLxfOApWEefR9dIVOYJVj97VRXnLKLDvnn3dPDNgww==",
-          "dev": true
-        },
-        "bluebird": {
-          "version": "3.7.2",
-          "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
-          "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
+          "version": "7.16.6",
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz",
+          "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==",
           "dev": true
         },
         "escape-string-regexp": {
@@ -3834,9 +3834,9 @@
           "dev": true
         },
         "marked": {
-          "version": "0.8.2",
-          "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
-          "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
+          "version": "2.1.3",
+          "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz",
+          "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==",
           "dev": true
         },
         "mkdirp": {
@@ -3852,9 +3852,9 @@
           "dev": true
         },
         "underscore": {
-          "version": "1.10.2",
-          "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz",
-          "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==",
+          "version": "1.13.2",
+          "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz",
+          "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==",
           "dev": true
         }
       }
@@ -5141,15 +5141,6 @@
         "find-up": "^3.0.0"
       }
     },
-    "plur": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz",
-      "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=",
-      "dev": true,
-      "requires": {
-        "irregular-plurals": "^1.0.0"
-      }
-    },
     "posix-character-classes": {
       "version": "0.1.1",
       "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@@ -7301,9 +7292,9 @@
       "dev": true
     },
     "xmlcreate": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz",
-      "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==",
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz",
+      "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==",
       "dev": true
     },
     "xtend": {
diff --git a/package.json b/package.json
index 65244e6..305469f 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
     "istanbul": "0.4.5",
     "js-yaml": "3.14.0",
     "newman": "5.2.0",
-    "jsdoc": "3.6.6",
+    "jsdoc": "3.6.7",
     "mocha": "5.2.0",
     "lodash": "4.17.20",
     "nyc": "14.1.1",


Test patch:
diff --git a/codegens/curl/test/unit/convert.test.js b/codegens/curl/test/unit/convert.test.js
index e54eff7..9d7f0e7 100644
--- a/codegens/curl/test/unit/convert.test.js
+++ b/codegens/curl/test/unit/convert.test.js
@@ -499,38 +499,6 @@ describe('curl convert function', function () {
       });
     });
 
-    it('should not add appropriate escaping characters when quote type is "double"', function () {
-      var request = new sdk.Request({
-        'method': 'POST',
-        'header': [],
-        'body': {
-          'mode': 'graphql',
-          'graphql': {
-            'query': '{\n  findScenes(\n    filter: {per_page: 0}\n    scene_filter: {is_missing: "performers"}){\n    count\n    scenes {\n      id\n      title\n      path\n    }\n  }\n}', // eslint-disable-line
-            'variables': '{\n\t"variable_key": "variable_value"\n}'
-          }
-        },
-        'url': {
-          'raw': 'https://postman-echo.com/post',
-          'protocol': 'https',
-          'host': [
-            'postman-echo',
-            'com'
-          ],
-          'path': [
-            'post'
-          ]
-        }
-      });
-      convert(request, { quoteType: 'double', lineContinuationCharacter: '^' }, function (error, snippet) {
-        if (error) {
-          expect.fail(null, null, error);
-        }
-
-        expect(snippet).to.include('{\\"query\\":\\"{\\n  findScenes(\\n    filter: {per_page: 0}\\n    scene_filter: {is_missing: \\\\\\"performers\\\\\\"})'); // eslint-disable-line
-      });
-    });
-
     describe('getUrlStringfromUrlObject function', function () {
       var rawUrl, urlObject, outputUrlString;
 
diff --git a/test/codegen/newman/fixtures/basicCollection.json b/test/codegen/newman/fixtures/basicCollection.json
index 0c0f9c7..6af3701 100644
--- a/test/codegen/newman/fixtures/basicCollection.json
+++ b/test/codegen/newman/fixtures/basicCollection.json
@@ -288,7 +288,7 @@
 				"body": {
 					"mode": "graphql",
 					"graphql": {
-						"query": "{\n  findScenes(\n    filter: {per_page: 0}\n    scene_filter: {is_missing: \"performers\"}){\n    count\n    scenes {\n      id\n      title\n      path\n    }\n  }\n}",
+						"query": "{\n    body{\n        graphql\n    }\n}",
 						"variables": "{\n\t\"variable_key\": \"variable_value\"\n}"
 					}
 				},
diff --git a/test/codegen/structure.test.js b/test/codegen/structure.test.js
index a70d962..7fbdf0b 100644
--- a/test/codegen/structure.test.js
+++ b/test/codegen/structure.test.js
@@ -44,13 +44,6 @@ const expectedOptions = {
       description: 'Set number of milliseconds the request should wait' +
       ' for a response before timing out (use 0 for infinity)'
     },
-    requestTimeoutInSeconds: {
-      name: 'Set request timeout (in seconds)',
-      type: 'positiveInteger',
-      default: 0,
-      description: 'Set number of seconds the request should wait' +
-      ' for a response before timing out (use 0 for infinity)'
-    },
     followRedirect: {
       name: 'Follow redirects',
       type: 'boolean',
@@ -91,7 +84,6 @@ const expectedOptions = {
     'indentCount',
     'trimRequestBody',
     'requestTimeout',
-    'requestTimeoutInSeconds',
     'silent',
     'includeBoilerplate',
     'followRedirect',