Repository: saucelabs/node-saucelabs
Pull request #131 (2021-11-24 11:33:42)

Update docs
- update docs
- Minor fix: add full queryParams in jobs api


Patch:
diff --git a/apis/sauce.json b/apis/sauce.json
index 2db2f52..5099863 100644
--- a/apis/sauce.json
+++ b/apis/sauce.json
@@ -2241,6 +2241,9 @@
         "parameters":[
           {
             "$ref":"#/parameters/jobIds"
+          },
+          {
+            "$ref":"#/parameters/full"
           }
         ],
         "responses":{
diff --git a/docs/interface.md b/docs/interface.md
index 3778afb..231ada7 100644
--- a/docs/interface.md
+++ b/docs/interface.md
@@ -29,15 +29,6 @@ The following commands are available via package or cli tool:
         <code>api.listUserOrganization(username)</code>
       </td>
     </tr>
-    <tr>
-      <td>
-        <b>GET</b> <code>/v1.1/{username}/builds</code><br>
-        No description available.
-        <h3>Example:</h3>
-        <code>api.listBuilds(username, { ...options })</code>
-        <br><h4>Options</h4>
-        <ul>          <li><b>limit</b>: Number of results to return</li>          <li><b>subaccounts</b>: Include subaccounts in list of jobs</li>        </ul>      </td>
-    </tr>
     <tr>
       <td>
         <b>GET</b> <code>/v1.1/{username}/jobs</code><br>
@@ -191,31 +182,6 @@ The following commands are available via package or cli tool:
         <code>api.getCurrentUserFull()</code>
       </td>
     </tr>
-    <tr>
-      <td>
-        <b>GET</b> <code>/v1/{username}/all_tunnels</code><br>
-        No description available.
-        <h3>Example:</h3>
-        <code>api.listAllTunnels(username)</code>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <b>GET</b> <code>/v1/{username}/builds/{id}/failed-jobs</code><br>
-        No description available.
-        <h3>Example:</h3>
-        <code>api.listBuildFailedJobs(username, id)</code>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <b>GET</b> <code>/v1/builds/{id}/jobs</code><br>
-        No description available.
-        <h3>Example:</h3>
-        <code>api.listBuildJobs(id, { ...options })</code>
-        <br><h4>Options</h4>
-        <ul>          <li><b>full</b>: Should the response result contain everything or just the basics</li>        </ul>      </td>
-    </tr>
     <tr>
       <td>
         <b>GET</b> <code>/v1/{username}/jobs/{id}</code><br>
@@ -240,6 +206,14 @@ The following commands are available via package or cli tool:
         <code>api.stopJob(username, id)</code>
       </td>
     </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/v1/{username}/all_tunnels</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.listAllTunnels(username)</code>
+      </td>
+    </tr>
     <tr>
       <td>
         <b>GET</b> <code>/v1/{username}/tunnels</code><br>
@@ -274,6 +248,15 @@ The following commands are available via package or cli tool:
         <br><h4>Options</h4>
         <ul>          <li><b>filepath</b>: file path to store the asset at</li>        </ul>      </td>
     </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/v1.1/jobs</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getJobsV1_1(id, { ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>full</b>: Should the response result contain everything or just the basics</li>        </ul>      </td>
+    </tr>
     <tr>
       <td>
         <b>POST</b> <code>/storage/upload</code><br>
@@ -874,4 +857,58 @@ This endpoint requires API Key authentication and will also return your private
         <code>api.getExecutions(executionId)</code>
       </td>
     </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/teams</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getTeamsV1({ ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>name</b>: name</li>        </ul>      </td>
+    </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/users</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getUsersV1({ ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>username</b>: username</li>          <li><b>teams</b>: List of team_ids</li>          <li><b>team-name</b>: team-name</li>          <li><b>roles</b>: roles</li>          <li><b>phrase</b>: phrase</li>          <li><b>status</b>: status</li>          <li><b>limit</b>: Number of results to return</li>          <li><b>offset</b>: Starting number</li>        </ul>      </td>
+    </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/{build_source}/</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getBuildsV2(build_source, { ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>user_id</b>: user_id</li>          <li><b>org_id</b>: org_id</li>          <li><b>group_id</b>: group_id</li>          <li><b>team_id</b>: team_id</li>          <li><b>status</b>: status</li>          <li><b>name</b>: start</li>          <li><b>end</b>: end</li>          <li><b>limit</b>: Number of results to return</li>          <li><b>offset</b>: Starting number</li>          <li><b>sort</b>: sort</li>        </ul>      </td>
+    </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/{build_source}/{build_id}/</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getBuildV2(build_source, { ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>build_id</b>: build_id</li>          <li><b>user_id</b>: user_id</li>          <li><b>org_id</b>: org_id</li>          <li><b>group_id</b>: group_id</li>          <li><b>team_id</b>: team_id</li>        </ul>      </td>
+    </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/{build_source}/jobs/{job_id}/build/</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getBuildByJobIdV2(build_source, { ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>job_id</b>: job_id</li>          <li><b>user_id</b>: user_id</li>          <li><b>org_id</b>: org_id</li>          <li><b>group_id</b>: group_id</li>          <li><b>team_id</b>: team_id</li>        </ul>      </td>
+    </tr>
+    <tr>
+      <td>
+        <b>GET</b> <code>/{build_source}/{build_id}/jobs/</code><br>
+        No description available.
+        <h3>Example:</h3>
+        <code>api.getBuildsJobsV2(build_source, { ...options })</code>
+        <br><h4>Options</h4>
+        <ul>          <li><b>build_id</b>: build_id</li>          <li><b>user_id</b>: user_id</li>          <li><b>org_id</b>: org_id</li>          <li><b>group_id</b>: group_id</li>          <li><b>team_id</b>: team_id</li>          <li><b>modified_since</b>: modified_since</li>          <li><b>completed</b>: completed</li>          <li><b>errored</b>: errored</li>          <li><b>failed</b>: failed</li>          <li><b>finished</b>: finished</li>          <li><b>new</b>: new</li>          <li><b>passed</b>: passed</li>          <li><b>public</b>: public</li>          <li><b>queued</b>: queued</li>          <li><b>running</b>: running</li>          <li><b>faulty</b>: faulty</li>          <li><b>limit</b>: Number of results to return</li>          <li><b>offset</b>: Starting number</li>        </ul>      </td>
+    </tr>
   </tbody></table>
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 2388b16..234759e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -460,16 +460,18 @@ export default class SauceLabs {
             e[k] = v
             return e
         }, {})
+
         /**
          * stringify queryParams if stringifyOptions exists within description
          */
         const modifiedParams = description.stringifyOptions ?
             stringify(body, description.stringifyOptions) :
             body;
-            /**
-             * make request
-             */
-            const uri = getAPIHost(servers, basePath, this._options) + url
+
+        /**
+         * make request
+         */
+        const uri = getAPIHost(servers, basePath, this._options) + url
         try {
             const response = await this._api[method](uri, {
                 ...(


Test patch:
diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap
index 42df422..9b5210e 100644
--- a/tests/__snapshots__/index.test.js.snap
+++ b/tests/__snapshots__/index.test.js.snap
@@ -34,7 +34,7 @@ Array [
     "https://api.us-west-1.saucelabs.com/rest/v1.1/jobs",
     Object {
       "responseType": "json",
-      "searchParams": "id=job-1&id=job-2",
+      "searchParams": "full=true&id=job-1&id=job-2",
     },
   ],
 ]
@@ -71,7 +71,7 @@ Array [
     "https://api.us-west-1.saucelabs.com/rest/v1.1/jobs",
     Object {
       "responseType": "json",
-      "searchParams": "id=job-1&id=job-2",
+      "searchParams": "full=true&id=job-1&id=job-2",
     },
   ],
 ]