Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dlenroc/testrail

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dlenroc/testrail - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [1.4.2](https://www.github.com/dlenroc/node-testrail-api/compare/v1.4.1...v1.4.2) (2021-09-17)
### Bug Fixes
* `updateRunInPlanEntry` method ([fbedff6](https://www.github.com/dlenroc/node-testrail-api/commit/fbedff6eb241a69154bb43fde85c25fe5fbd4d58))
### [1.4.1](https://www.github.com/dlenroc/node-testrail-api/compare/v1.4.0...v1.4.1) (2021-07-10)

@@ -7,0 +14,0 @@

2

dist/TestRail.d.ts

@@ -59,3 +59,3 @@ import { Request, Response } from './payload';

updatePlanEntry(planId: number, entryId: string, payload: Request.UpdatePlanEntry): Promise<Response.PlanEntry>;
updateRunInPlanEntry(planId: number, runId: number, payload: Request.UpdateRunInPlanEntry): Promise<Response.PlanEntry>;
updateRunInPlanEntry(runId: number, payload: Request.UpdateRunInPlanEntry): Promise<Response.PlanEntry>;
closePlan(planId: number): Promise<Response.Plan>;

@@ -62,0 +62,0 @@ deletePlan(planId: number): Promise<void>;

@@ -1,2 +0,2 @@

"use strict";const t=require("http"),e=require("https"),r=require("node-fetch"),s=require("form-data"),n={keepAlive:!0},a=new t.Agent(n),i=new e.Agent(n),_=t=>"http:"===t.protocol?a:i,u=(t,e)=>r(t,{agent:_,...e});class o extends Error{constructor(t){super(t),this.name="TestRailException"}}class p{constructor(t){this.username=(null==t?void 0:t.username)||(null==t?void 0:t.user),this.password=null==t?void 0:t.password,this.baseURL=((null==t?void 0:t.host)||"")+"/index.php?/api/v2/"}addAttachmentToCase(t,e){return this._api("POST",`add_attachment_to_case/${t}`,{form:{attachment:e}})}addAttachmentToPlan(t,e){return this._api("POST",`add_attachment_to_plan/${t}`,{form:{attachment:e}})}addAttachmentToPlanEntry(t,e,r){return this._api("POST",`add_attachment_to_plan_entry/${t}/${e}`,{form:{attachment:r}})}addAttachmentToResult(t,e){return this._api("POST",`add_attachment_to_result/${t}`,{form:{attachment:e}})}addAttachmentToRun(t,e){return this._api("POST",`add_attachment_to_run/${t}`,{form:{attachment:e}})}getAttachmentsForCase(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_case/${t}`,{query:e})))}getAttachmentsForPlan(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_plan/${t}`,{query:e})))}getAttachmentsForPlanEntry(t,e){return this._api("GET",`get_attachments_for_plan_entry/${t}/${e}`)}getAttachmentsForRun(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_run/${t}`,{query:e})))}getAttachmentsForTest(t){return this._api("GET",`get_attachments_for_test/${t}`)}getAttachment(t){return this._api("GET",`get_attachment/${t}`)}deleteAttachment(t){return this._api("POST",`delete_attachment/${t}`)}getCase(t){return this._api("GET",`get_case/${t}`)}getCases(t,e){return d("cases",e,(e=>this._api("GET",`get_cases/${t}`,{query:e})))}getHistoryForCase(t,e){return d("history",e,(e=>this._api("GET",`get_history_for_case/${t}`,{query:e})))}addCase(t,e){return this._api("POST",`add_case/${t}`,{json:e})}copyCasesToSection(t,e){return this._api("POST",`copy_cases_to_section/${t}`,{json:e})}updateCase(t,e){return this._api("POST",`update_case/${t}`,{json:e})}updateCases(t,e){return this._api("POST",`update_cases/${t}`,{json:e})}moveCasesToSection(t,e){return this._api("POST",`move_cases_to_section/${t}`,{json:e})}deleteCase(t){return this._api("POST",`delete_case/${t}`)}deleteCases(t,e){return this._api("POST",`delete_cases/${t}`,{json:e})}getCaseFields(){return this._api("GET","get_case_fields")}addCaseField(t){return this._api("POST","add_case_field",{json:t})}getCaseTypes(){return this._api("GET","get_case_types")}getConfigs(t){return this._api("GET",`get_configs/${t}`)}addConfigGroup(t,e){return this._api("POST",`add_config_group/${t}`,{json:e})}addConfig(t,e){return this._api("POST",`add_config/${t}`,{json:e})}updateConfigGroup(t,e){return this._api("POST",`update_config_group/${t}`,{json:e})}updateConfig(t,e){return this._api("POST",`update_config/${t}`,{json:e})}deleteConfigGroup(t){return this._api("POST",`delete_config_group/${t}`)}deleteConfig(t){return this._api("POST",`delete_config/${t}`)}getMilestone(t){return this._api("GET",`get_milestone/${t}`)}getMilestones(t,e){return d("milestones",e,(e=>this._api("GET",`get_milestones/${t}`,{query:e})))}addMilestone(t,e){return this._api("POST",`add_milestone/${t}`,{json:e})}updateMilestone(t,e){return this._api("POST",`update_milestone/${t}`,{json:e})}deleteMilestone(t){return this._api("POST",`delete_milestone/${t}`)}getPlan(t){return this._api("GET",`get_plan/${t}`)}getPlans(t,e){return d("plans",e,(e=>this._api("GET",`get_plans/${t}`,{query:e})))}addPlan(t,e){return this._api("POST",`add_plan/${t}`,{json:e})}addPlanEntry(t,e){return this._api("POST",`add_plan_entry/${t}`,{json:e})}addRunToPlanEntry(t,e,r){return this._api("POST",`add_run_to_plan_entry/${t}/${e}`,{json:r})}updatePlan(t,e){return this._api("POST",`update_plan/${t}`,{json:e})}updatePlanEntry(t,e,r){return this._api("POST",`update_plan_entry/${t}/${e}`,{json:r})}updateRunInPlanEntry(t,e,r){return this._api("POST",`update_run_in_plan_entry/${t}/${e}`,{json:r})}closePlan(t){return this._api("POST",`close_plan/${t}`)}deletePlan(t){return this._api("POST",`delete_plan/${t}`)}deletePlanEntry(t,e){return this._api("POST",`delete_plan_entry/${t}/${e}`)}deleteRunFromPlanEntry(t){return this._api("POST",`delete_run_from_plan_entry/${t}`)}getPriorities(){return this._api("GET","get_priorities")}getProject(t){return this._api("GET",`get_project/${t}`)}getProjects(t){return d("projects",t,(t=>this._api("GET","get_projects",{query:t})))}addProject(t){return this._api("POST","add_project",{json:t})}updateProject(t,e){return this._api("POST",`update_project/${t}`,{json:e})}deleteProject(t){return this._api("POST",`delete_project/${t}`)}getReports(t){return this._api("GET",`get_reports/${t}`)}runReport(t){return this._api("POST",`run_report/${t}`)}getResults(t,e){return d("results",e,(e=>this._api("GET",`get_results/${t}`,{query:e})))}getResultsForCase(t,e,r){return d("results",r,(r=>this._api("GET",`get_results_for_case/${t}/${e}`,{query:r})))}getResultsForRun(t,e){return d("results",e,(e=>this._api("GET",`get_results_for_run/${t}`,{query:e})))}addResult(t,e){return this._api("POST",`add_result/${t}`,{json:e})}addResultForCase(t,e,r){return this._api("POST",`add_result_for_case/${t}/${e}`,{json:r})}addResults(t,e){return this._api("POST",`add_results/${t}`,{json:e})}addResultsForCases(t,e){return this._api("POST",`add_results_for_cases/${t}`,{json:e})}getResultFields(){return this._api("GET","get_result_fields")}getRun(t){return this._api("GET",`get_run/${t}`)}getRuns(t,e){return d("runs",e,(e=>this._api("GET",`get_runs/${t}`,{query:e})))}addRun(t,e){return this._api("POST",`add_run/${t}`,{json:e})}updateRun(t,e){return this._api("POST",`update_run/${t}`,{json:e})}closeRun(t){return this._api("POST",`close_run/${t}`)}deleteRun(t){return this._api("POST",`delete_run/${t}`)}getSection(t){return this._api("GET",`get_section/${t}`)}getSections(t,e){return d("sections",e,(e=>this._api("GET",`get_sections/${t}`,{query:e})))}addSection(t,e){return this._api("POST",`add_section/${t}`,{json:e})}moveSection(t,e){return this._api("POST",`move_section/${t}`,{json:e})}updateSection(t,e){return this._api("POST",`update_section/${t}`,{json:e})}deleteSection(t){return this._api("POST",`delete_section/${t}`)}getSharedStep(t){return this._api("GET",`get_shared_step/${t}`)}getSharedSteps(t,e){return d("shared_steps",e,(e=>this._api("GET",`get_shared_steps/${t}`,{query:e})))}addSharedStep(t,e){return this._api("POST",`add_shared_step/${t}`,{json:e})}updateSharedStep(t,e){return this._api("POST",`update_shared_step/${t}`,{json:e})}deleteSharedStep(t,e){return this._api("POST",`delete_shared_step/${t}`,{json:e})}getStatuses(){return this._api("GET","get_statuses")}getSuite(t){return this._api("GET",`get_suite/${t}`)}getSuites(t){return this._api("GET",`get_suites/${t}`)}addSuite(t,e){return this._api("POST",`add_suite/${t}`,{json:e})}updateSuite(t,e){return this._api("POST",`update_suite/${t}`,{json:e})}deleteSuite(t){return this._api("POST",`delete_suite/${t}`)}getTemplates(t){return this._api("GET",`get_templates/${t}`)}getTest(t){return this._api("GET",`get_test/${t}`)}getTests(t,e){return d("tests",e,(e=>this._api("GET",`get_tests/${t}`,{query:e})))}getUser(t){return this._api("GET",`get_user/${t}`)}getCurrentUser(){return this._api("GET","get_current_user")}getUserByEmail(t){return this._api("GET","get_user_by_email",{query:{email:t}})}getUsers(t){return this._api("GET","get_users",{query:t})}async _api(t,e,{query:r,json:n,form:a}={}){var i;const _={},o=this.baseURL+e+function(t){if(!t)return"";let e="";for(const[r,s]of Object.entries(t)){let t=s;"boolean"==typeof s?t=+s:Array.isArray(s)&&(t=s.join(",")),e+=`&${r}=${encodeURIComponent(t)}`}return e}(r);var d;let c;if(this.username&&this.password&&(_.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),a||(_["Content-Type"]="application/json"),n)c=JSON.stringify(n);else if(a){c=new s;for(const[t,e]of Object.entries(a))e.name&&e.value?h(c,t,e.value,e.name):h(c,t,e)}for(;;){const e=await u(o,{method:t,body:c,headers:_});if(429===e.status){const t=1e3*parseInt(e.headers.get("Retry-After")||"1");await l(t);continue}if(409===e.status){await l(1e4);continue}const r=(null===(i=e.headers.get("Content-Type"))||void 0===i?void 0:i.includes("json"))?await e.json().catch((()=>({}))):await e.blob();if(e.ok)return r;throw new p.Exception(r.error||"No additional error message received")}}}async function d(t,e,r){if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let s=0,n=0;const a=[],i=new Set;for(;;){n=250*s++;let _=await d(t,{...e,limit:250,offset:n},r);if(_=_.filter((t=>!i.has(t.id)&&i.add(t.id))),a.push(..._),250!=_.length)break}return a}function h(t,e,r,s){if(s&&"undefined"!=typeof Blob){const n=r instanceof Blob?r:new Blob([r]);t.append(e,n,s)}else t.append(e,r,s)}function l(t){return new Promise((e=>setTimeout(e,t)))}p.Exception=o,module.exports=p;
"use strict";const t=require("http"),e=require("https"),r=require("node-fetch"),s=require("form-data"),n={keepAlive:!0},a=new t.Agent(n),i=new e.Agent(n),_=t=>"http:"===t.protocol?a:i,u=(t,e)=>r(t,{agent:_,...e});class o extends Error{constructor(t){super(t),this.name="TestRailException"}}class p{constructor(t){this.username=(null==t?void 0:t.username)||(null==t?void 0:t.user),this.password=null==t?void 0:t.password,this.baseURL=((null==t?void 0:t.host)||"")+"/index.php?/api/v2/"}addAttachmentToCase(t,e){return this._api("POST",`add_attachment_to_case/${t}`,{form:{attachment:e}})}addAttachmentToPlan(t,e){return this._api("POST",`add_attachment_to_plan/${t}`,{form:{attachment:e}})}addAttachmentToPlanEntry(t,e,r){return this._api("POST",`add_attachment_to_plan_entry/${t}/${e}`,{form:{attachment:r}})}addAttachmentToResult(t,e){return this._api("POST",`add_attachment_to_result/${t}`,{form:{attachment:e}})}addAttachmentToRun(t,e){return this._api("POST",`add_attachment_to_run/${t}`,{form:{attachment:e}})}getAttachmentsForCase(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_case/${t}`,{query:e})))}getAttachmentsForPlan(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_plan/${t}`,{query:e})))}getAttachmentsForPlanEntry(t,e){return this._api("GET",`get_attachments_for_plan_entry/${t}/${e}`)}getAttachmentsForRun(t,e){return d("attachments",e,(e=>this._api("GET",`get_attachments_for_run/${t}`,{query:e})))}getAttachmentsForTest(t){return this._api("GET",`get_attachments_for_test/${t}`)}getAttachment(t){return this._api("GET",`get_attachment/${t}`)}deleteAttachment(t){return this._api("POST",`delete_attachment/${t}`)}getCase(t){return this._api("GET",`get_case/${t}`)}getCases(t,e){return d("cases",e,(e=>this._api("GET",`get_cases/${t}`,{query:e})))}getHistoryForCase(t,e){return d("history",e,(e=>this._api("GET",`get_history_for_case/${t}`,{query:e})))}addCase(t,e){return this._api("POST",`add_case/${t}`,{json:e})}copyCasesToSection(t,e){return this._api("POST",`copy_cases_to_section/${t}`,{json:e})}updateCase(t,e){return this._api("POST",`update_case/${t}`,{json:e})}updateCases(t,e){return this._api("POST",`update_cases/${t}`,{json:e})}moveCasesToSection(t,e){return this._api("POST",`move_cases_to_section/${t}`,{json:e})}deleteCase(t){return this._api("POST",`delete_case/${t}`)}deleteCases(t,e){return this._api("POST",`delete_cases/${t}`,{json:e})}getCaseFields(){return this._api("GET","get_case_fields")}addCaseField(t){return this._api("POST","add_case_field",{json:t})}getCaseTypes(){return this._api("GET","get_case_types")}getConfigs(t){return this._api("GET",`get_configs/${t}`)}addConfigGroup(t,e){return this._api("POST",`add_config_group/${t}`,{json:e})}addConfig(t,e){return this._api("POST",`add_config/${t}`,{json:e})}updateConfigGroup(t,e){return this._api("POST",`update_config_group/${t}`,{json:e})}updateConfig(t,e){return this._api("POST",`update_config/${t}`,{json:e})}deleteConfigGroup(t){return this._api("POST",`delete_config_group/${t}`)}deleteConfig(t){return this._api("POST",`delete_config/${t}`)}getMilestone(t){return this._api("GET",`get_milestone/${t}`)}getMilestones(t,e){return d("milestones",e,(e=>this._api("GET",`get_milestones/${t}`,{query:e})))}addMilestone(t,e){return this._api("POST",`add_milestone/${t}`,{json:e})}updateMilestone(t,e){return this._api("POST",`update_milestone/${t}`,{json:e})}deleteMilestone(t){return this._api("POST",`delete_milestone/${t}`)}getPlan(t){return this._api("GET",`get_plan/${t}`)}getPlans(t,e){return d("plans",e,(e=>this._api("GET",`get_plans/${t}`,{query:e})))}addPlan(t,e){return this._api("POST",`add_plan/${t}`,{json:e})}addPlanEntry(t,e){return this._api("POST",`add_plan_entry/${t}`,{json:e})}addRunToPlanEntry(t,e,r){return this._api("POST",`add_run_to_plan_entry/${t}/${e}`,{json:r})}updatePlan(t,e){return this._api("POST",`update_plan/${t}`,{json:e})}updatePlanEntry(t,e,r){return this._api("POST",`update_plan_entry/${t}/${e}`,{json:r})}updateRunInPlanEntry(t,e){return this._api("POST",`update_run_in_plan_entry/${t}`,{json:e})}closePlan(t){return this._api("POST",`close_plan/${t}`)}deletePlan(t){return this._api("POST",`delete_plan/${t}`)}deletePlanEntry(t,e){return this._api("POST",`delete_plan_entry/${t}/${e}`)}deleteRunFromPlanEntry(t){return this._api("POST",`delete_run_from_plan_entry/${t}`)}getPriorities(){return this._api("GET","get_priorities")}getProject(t){return this._api("GET",`get_project/${t}`)}getProjects(t){return d("projects",t,(t=>this._api("GET","get_projects",{query:t})))}addProject(t){return this._api("POST","add_project",{json:t})}updateProject(t,e){return this._api("POST",`update_project/${t}`,{json:e})}deleteProject(t){return this._api("POST",`delete_project/${t}`)}getReports(t){return this._api("GET",`get_reports/${t}`)}runReport(t){return this._api("POST",`run_report/${t}`)}getResults(t,e){return d("results",e,(e=>this._api("GET",`get_results/${t}`,{query:e})))}getResultsForCase(t,e,r){return d("results",r,(r=>this._api("GET",`get_results_for_case/${t}/${e}`,{query:r})))}getResultsForRun(t,e){return d("results",e,(e=>this._api("GET",`get_results_for_run/${t}`,{query:e})))}addResult(t,e){return this._api("POST",`add_result/${t}`,{json:e})}addResultForCase(t,e,r){return this._api("POST",`add_result_for_case/${t}/${e}`,{json:r})}addResults(t,e){return this._api("POST",`add_results/${t}`,{json:e})}addResultsForCases(t,e){return this._api("POST",`add_results_for_cases/${t}`,{json:e})}getResultFields(){return this._api("GET","get_result_fields")}getRun(t){return this._api("GET",`get_run/${t}`)}getRuns(t,e){return d("runs",e,(e=>this._api("GET",`get_runs/${t}`,{query:e})))}addRun(t,e){return this._api("POST",`add_run/${t}`,{json:e})}updateRun(t,e){return this._api("POST",`update_run/${t}`,{json:e})}closeRun(t){return this._api("POST",`close_run/${t}`)}deleteRun(t){return this._api("POST",`delete_run/${t}`)}getSection(t){return this._api("GET",`get_section/${t}`)}getSections(t,e){return d("sections",e,(e=>this._api("GET",`get_sections/${t}`,{query:e})))}addSection(t,e){return this._api("POST",`add_section/${t}`,{json:e})}moveSection(t,e){return this._api("POST",`move_section/${t}`,{json:e})}updateSection(t,e){return this._api("POST",`update_section/${t}`,{json:e})}deleteSection(t){return this._api("POST",`delete_section/${t}`)}getSharedStep(t){return this._api("GET",`get_shared_step/${t}`)}getSharedSteps(t,e){return d("shared_steps",e,(e=>this._api("GET",`get_shared_steps/${t}`,{query:e})))}addSharedStep(t,e){return this._api("POST",`add_shared_step/${t}`,{json:e})}updateSharedStep(t,e){return this._api("POST",`update_shared_step/${t}`,{json:e})}deleteSharedStep(t,e){return this._api("POST",`delete_shared_step/${t}`,{json:e})}getStatuses(){return this._api("GET","get_statuses")}getSuite(t){return this._api("GET",`get_suite/${t}`)}getSuites(t){return this._api("GET",`get_suites/${t}`)}addSuite(t,e){return this._api("POST",`add_suite/${t}`,{json:e})}updateSuite(t,e){return this._api("POST",`update_suite/${t}`,{json:e})}deleteSuite(t){return this._api("POST",`delete_suite/${t}`)}getTemplates(t){return this._api("GET",`get_templates/${t}`)}getTest(t){return this._api("GET",`get_test/${t}`)}getTests(t,e){return d("tests",e,(e=>this._api("GET",`get_tests/${t}`,{query:e})))}getUser(t){return this._api("GET",`get_user/${t}`)}getCurrentUser(){return this._api("GET","get_current_user")}getUserByEmail(t){return this._api("GET","get_user_by_email",{query:{email:t}})}getUsers(t){return this._api("GET","get_users",{query:t})}async _api(t,e,{query:r,json:n,form:a}={}){var i;const _={},o=this.baseURL+e+function(t){if(!t)return"";let e="";for(const[r,s]of Object.entries(t)){let t=s;"boolean"==typeof s?t=+s:Array.isArray(s)&&(t=s.join(",")),e+=`&${r}=${encodeURIComponent(t)}`}return e}(r);var d;let c;if(this.username&&this.password&&(_.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),a||(_["Content-Type"]="application/json"),n)c=JSON.stringify(n);else if(a){c=new s;for(const[t,e]of Object.entries(a))e.name&&e.value?h(c,t,e.value,e.name):h(c,t,e)}for(;;){const e=await u(o,{method:t,body:c,headers:_});if(429===e.status){const t=1e3*parseInt(e.headers.get("Retry-After")||"1");await l(t);continue}if(409===e.status){await l(1e4);continue}const r=(null===(i=e.headers.get("Content-Type"))||void 0===i?void 0:i.includes("json"))?await e.json().catch((()=>({}))):await e.blob();if(e.ok)return r;throw new p.Exception(r.error||"No additional error message received")}}}async function d(t,e,r){if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let s=0,n=0;const a=[],i=new Set;for(;;){n=250*s++;let _=await d(t,{...e,limit:250,offset:n},r);if(_=_.filter((t=>!i.has(t.id)&&i.add(t.id))),a.push(..._),250!=_.length)break}return a}function h(t,e,r,s){if(s&&"undefined"!=typeof Blob){const n=r instanceof Blob?r:new Blob([r]);t.append(e,n,s)}else t.append(e,r,s)}function l(t){return new Promise((e=>setTimeout(e,t)))}p.Exception=o,module.exports=p;
//# sourceMappingURL=TestRail.node.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).TestRail=e()}(this,(function(){"use strict";class t extends Error{constructor(t){super(t),this.name="TestRailException"}}class e{constructor(t){this.username=(null==t?void 0:t.username)||(null==t?void 0:t.user),this.password=null==t?void 0:t.password,this.baseURL=((null==t?void 0:t.host)||"")+"/index.php?/api/v2/"}addAttachmentToCase(t,e){return this._api("POST",`add_attachment_to_case/${t}`,{form:{attachment:e}})}addAttachmentToPlan(t,e){return this._api("POST",`add_attachment_to_plan/${t}`,{form:{attachment:e}})}addAttachmentToPlanEntry(t,e,s){return this._api("POST",`add_attachment_to_plan_entry/${t}/${e}`,{form:{attachment:s}})}addAttachmentToResult(t,e){return this._api("POST",`add_attachment_to_result/${t}`,{form:{attachment:e}})}addAttachmentToRun(t,e){return this._api("POST",`add_attachment_to_run/${t}`,{form:{attachment:e}})}getAttachmentsForCase(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_case/${t}`,{query:e})))}getAttachmentsForPlan(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_plan/${t}`,{query:e})))}getAttachmentsForPlanEntry(t,e){return this._api("GET",`get_attachments_for_plan_entry/${t}/${e}`)}getAttachmentsForRun(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_run/${t}`,{query:e})))}getAttachmentsForTest(t){return this._api("GET",`get_attachments_for_test/${t}`)}getAttachment(t){return this._api("GET",`get_attachment/${t}`)}deleteAttachment(t){return this._api("POST",`delete_attachment/${t}`)}getCase(t){return this._api("GET",`get_case/${t}`)}getCases(t,e){return s("cases",e,(e=>this._api("GET",`get_cases/${t}`,{query:e})))}getHistoryForCase(t,e){return s("history",e,(e=>this._api("GET",`get_history_for_case/${t}`,{query:e})))}addCase(t,e){return this._api("POST",`add_case/${t}`,{json:e})}copyCasesToSection(t,e){return this._api("POST",`copy_cases_to_section/${t}`,{json:e})}updateCase(t,e){return this._api("POST",`update_case/${t}`,{json:e})}updateCases(t,e){return this._api("POST",`update_cases/${t}`,{json:e})}moveCasesToSection(t,e){return this._api("POST",`move_cases_to_section/${t}`,{json:e})}deleteCase(t){return this._api("POST",`delete_case/${t}`)}deleteCases(t,e){return this._api("POST",`delete_cases/${t}`,{json:e})}getCaseFields(){return this._api("GET","get_case_fields")}addCaseField(t){return this._api("POST","add_case_field",{json:t})}getCaseTypes(){return this._api("GET","get_case_types")}getConfigs(t){return this._api("GET",`get_configs/${t}`)}addConfigGroup(t,e){return this._api("POST",`add_config_group/${t}`,{json:e})}addConfig(t,e){return this._api("POST",`add_config/${t}`,{json:e})}updateConfigGroup(t,e){return this._api("POST",`update_config_group/${t}`,{json:e})}updateConfig(t,e){return this._api("POST",`update_config/${t}`,{json:e})}deleteConfigGroup(t){return this._api("POST",`delete_config_group/${t}`)}deleteConfig(t){return this._api("POST",`delete_config/${t}`)}getMilestone(t){return this._api("GET",`get_milestone/${t}`)}getMilestones(t,e){return s("milestones",e,(e=>this._api("GET",`get_milestones/${t}`,{query:e})))}addMilestone(t,e){return this._api("POST",`add_milestone/${t}`,{json:e})}updateMilestone(t,e){return this._api("POST",`update_milestone/${t}`,{json:e})}deleteMilestone(t){return this._api("POST",`delete_milestone/${t}`)}getPlan(t){return this._api("GET",`get_plan/${t}`)}getPlans(t,e){return s("plans",e,(e=>this._api("GET",`get_plans/${t}`,{query:e})))}addPlan(t,e){return this._api("POST",`add_plan/${t}`,{json:e})}addPlanEntry(t,e){return this._api("POST",`add_plan_entry/${t}`,{json:e})}addRunToPlanEntry(t,e,s){return this._api("POST",`add_run_to_plan_entry/${t}/${e}`,{json:s})}updatePlan(t,e){return this._api("POST",`update_plan/${t}`,{json:e})}updatePlanEntry(t,e,s){return this._api("POST",`update_plan_entry/${t}/${e}`,{json:s})}updateRunInPlanEntry(t,e,s){return this._api("POST",`update_run_in_plan_entry/${t}/${e}`,{json:s})}closePlan(t){return this._api("POST",`close_plan/${t}`)}deletePlan(t){return this._api("POST",`delete_plan/${t}`)}deletePlanEntry(t,e){return this._api("POST",`delete_plan_entry/${t}/${e}`)}deleteRunFromPlanEntry(t){return this._api("POST",`delete_run_from_plan_entry/${t}`)}getPriorities(){return this._api("GET","get_priorities")}getProject(t){return this._api("GET",`get_project/${t}`)}getProjects(t){return s("projects",t,(t=>this._api("GET","get_projects",{query:t})))}addProject(t){return this._api("POST","add_project",{json:t})}updateProject(t,e){return this._api("POST",`update_project/${t}`,{json:e})}deleteProject(t){return this._api("POST",`delete_project/${t}`)}getReports(t){return this._api("GET",`get_reports/${t}`)}runReport(t){return this._api("POST",`run_report/${t}`)}getResults(t,e){return s("results",e,(e=>this._api("GET",`get_results/${t}`,{query:e})))}getResultsForCase(t,e,r){return s("results",r,(s=>this._api("GET",`get_results_for_case/${t}/${e}`,{query:s})))}getResultsForRun(t,e){return s("results",e,(e=>this._api("GET",`get_results_for_run/${t}`,{query:e})))}addResult(t,e){return this._api("POST",`add_result/${t}`,{json:e})}addResultForCase(t,e,s){return this._api("POST",`add_result_for_case/${t}/${e}`,{json:s})}addResults(t,e){return this._api("POST",`add_results/${t}`,{json:e})}addResultsForCases(t,e){return this._api("POST",`add_results_for_cases/${t}`,{json:e})}getResultFields(){return this._api("GET","get_result_fields")}getRun(t){return this._api("GET",`get_run/${t}`)}getRuns(t,e){return s("runs",e,(e=>this._api("GET",`get_runs/${t}`,{query:e})))}addRun(t,e){return this._api("POST",`add_run/${t}`,{json:e})}updateRun(t,e){return this._api("POST",`update_run/${t}`,{json:e})}closeRun(t){return this._api("POST",`close_run/${t}`)}deleteRun(t){return this._api("POST",`delete_run/${t}`)}getSection(t){return this._api("GET",`get_section/${t}`)}getSections(t,e){return s("sections",e,(e=>this._api("GET",`get_sections/${t}`,{query:e})))}addSection(t,e){return this._api("POST",`add_section/${t}`,{json:e})}moveSection(t,e){return this._api("POST",`move_section/${t}`,{json:e})}updateSection(t,e){return this._api("POST",`update_section/${t}`,{json:e})}deleteSection(t){return this._api("POST",`delete_section/${t}`)}getSharedStep(t){return this._api("GET",`get_shared_step/${t}`)}getSharedSteps(t,e){return s("shared_steps",e,(e=>this._api("GET",`get_shared_steps/${t}`,{query:e})))}addSharedStep(t,e){return this._api("POST",`add_shared_step/${t}`,{json:e})}updateSharedStep(t,e){return this._api("POST",`update_shared_step/${t}`,{json:e})}deleteSharedStep(t,e){return this._api("POST",`delete_shared_step/${t}`,{json:e})}getStatuses(){return this._api("GET","get_statuses")}getSuite(t){return this._api("GET",`get_suite/${t}`)}getSuites(t){return this._api("GET",`get_suites/${t}`)}addSuite(t,e){return this._api("POST",`add_suite/${t}`,{json:e})}updateSuite(t,e){return this._api("POST",`update_suite/${t}`,{json:e})}deleteSuite(t){return this._api("POST",`delete_suite/${t}`)}getTemplates(t){return this._api("GET",`get_templates/${t}`)}getTest(t){return this._api("GET",`get_test/${t}`)}getTests(t,e){return s("tests",e,(e=>this._api("GET",`get_tests/${t}`,{query:e})))}getUser(t){return this._api("GET",`get_user/${t}`)}getCurrentUser(){return this._api("GET","get_current_user")}getUserByEmail(t){return this._api("GET","get_user_by_email",{query:{email:t}})}getUsers(t){return this._api("GET","get_users",{query:t})}async _api(t,s,{query:a,json:i,form:u}={}){var _;const o={},p=this.baseURL+s+function(t){if(!t)return"";let e="";for(const[s,r]of Object.entries(t)){let t=r;"boolean"==typeof r?t=+r:Array.isArray(r)&&(t=r.join(",")),e+=`&${s}=${encodeURIComponent(t)}`}return e}(a);var d;let h;if(this.username&&this.password&&(o.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),u||(o["Content-Type"]="application/json"),i)h=JSON.stringify(i);else if(u){h=new FormData;for(const[t,e]of Object.entries(u))e.name&&e.value?r(h,t,e.value,e.name):r(h,t,e)}for(;;){const s=await fetch(p,{method:t,body:h,headers:o});if(429===s.status){const t=1e3*parseInt(s.headers.get("Retry-After")||"1");await n(t);continue}if(409===s.status){await n(1e4);continue}const r=(null===(_=s.headers.get("Content-Type"))||void 0===_?void 0:_.includes("json"))?await s.json().catch((()=>({}))):await s.blob();if(s.ok)return r;throw new e.Exception(r.error||"No additional error message received")}}}async function s(t,e,r){if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let n=0,a=0;const i=[],u=new Set;for(;;){a=250*n++;let _=await s(t,{...e,limit:250,offset:a},r);if(_=_.filter((t=>!u.has(t.id)&&u.add(t.id))),i.push(..._),250!=_.length)break}return i}function r(t,e,s,r){if(r&&"undefined"!=typeof Blob){const n=s instanceof Blob?s:new Blob([s]);t.append(e,n,r)}else t.append(e,s,r)}function n(t){return new Promise((e=>setTimeout(e,t)))}return e.Exception=t,e}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).TestRail=e()}(this,(function(){"use strict";class t extends Error{constructor(t){super(t),this.name="TestRailException"}}class e{constructor(t){this.username=(null==t?void 0:t.username)||(null==t?void 0:t.user),this.password=null==t?void 0:t.password,this.baseURL=((null==t?void 0:t.host)||"")+"/index.php?/api/v2/"}addAttachmentToCase(t,e){return this._api("POST",`add_attachment_to_case/${t}`,{form:{attachment:e}})}addAttachmentToPlan(t,e){return this._api("POST",`add_attachment_to_plan/${t}`,{form:{attachment:e}})}addAttachmentToPlanEntry(t,e,s){return this._api("POST",`add_attachment_to_plan_entry/${t}/${e}`,{form:{attachment:s}})}addAttachmentToResult(t,e){return this._api("POST",`add_attachment_to_result/${t}`,{form:{attachment:e}})}addAttachmentToRun(t,e){return this._api("POST",`add_attachment_to_run/${t}`,{form:{attachment:e}})}getAttachmentsForCase(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_case/${t}`,{query:e})))}getAttachmentsForPlan(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_plan/${t}`,{query:e})))}getAttachmentsForPlanEntry(t,e){return this._api("GET",`get_attachments_for_plan_entry/${t}/${e}`)}getAttachmentsForRun(t,e){return s("attachments",e,(e=>this._api("GET",`get_attachments_for_run/${t}`,{query:e})))}getAttachmentsForTest(t){return this._api("GET",`get_attachments_for_test/${t}`)}getAttachment(t){return this._api("GET",`get_attachment/${t}`)}deleteAttachment(t){return this._api("POST",`delete_attachment/${t}`)}getCase(t){return this._api("GET",`get_case/${t}`)}getCases(t,e){return s("cases",e,(e=>this._api("GET",`get_cases/${t}`,{query:e})))}getHistoryForCase(t,e){return s("history",e,(e=>this._api("GET",`get_history_for_case/${t}`,{query:e})))}addCase(t,e){return this._api("POST",`add_case/${t}`,{json:e})}copyCasesToSection(t,e){return this._api("POST",`copy_cases_to_section/${t}`,{json:e})}updateCase(t,e){return this._api("POST",`update_case/${t}`,{json:e})}updateCases(t,e){return this._api("POST",`update_cases/${t}`,{json:e})}moveCasesToSection(t,e){return this._api("POST",`move_cases_to_section/${t}`,{json:e})}deleteCase(t){return this._api("POST",`delete_case/${t}`)}deleteCases(t,e){return this._api("POST",`delete_cases/${t}`,{json:e})}getCaseFields(){return this._api("GET","get_case_fields")}addCaseField(t){return this._api("POST","add_case_field",{json:t})}getCaseTypes(){return this._api("GET","get_case_types")}getConfigs(t){return this._api("GET",`get_configs/${t}`)}addConfigGroup(t,e){return this._api("POST",`add_config_group/${t}`,{json:e})}addConfig(t,e){return this._api("POST",`add_config/${t}`,{json:e})}updateConfigGroup(t,e){return this._api("POST",`update_config_group/${t}`,{json:e})}updateConfig(t,e){return this._api("POST",`update_config/${t}`,{json:e})}deleteConfigGroup(t){return this._api("POST",`delete_config_group/${t}`)}deleteConfig(t){return this._api("POST",`delete_config/${t}`)}getMilestone(t){return this._api("GET",`get_milestone/${t}`)}getMilestones(t,e){return s("milestones",e,(e=>this._api("GET",`get_milestones/${t}`,{query:e})))}addMilestone(t,e){return this._api("POST",`add_milestone/${t}`,{json:e})}updateMilestone(t,e){return this._api("POST",`update_milestone/${t}`,{json:e})}deleteMilestone(t){return this._api("POST",`delete_milestone/${t}`)}getPlan(t){return this._api("GET",`get_plan/${t}`)}getPlans(t,e){return s("plans",e,(e=>this._api("GET",`get_plans/${t}`,{query:e})))}addPlan(t,e){return this._api("POST",`add_plan/${t}`,{json:e})}addPlanEntry(t,e){return this._api("POST",`add_plan_entry/${t}`,{json:e})}addRunToPlanEntry(t,e,s){return this._api("POST",`add_run_to_plan_entry/${t}/${e}`,{json:s})}updatePlan(t,e){return this._api("POST",`update_plan/${t}`,{json:e})}updatePlanEntry(t,e,s){return this._api("POST",`update_plan_entry/${t}/${e}`,{json:s})}updateRunInPlanEntry(t,e){return this._api("POST",`update_run_in_plan_entry/${t}`,{json:e})}closePlan(t){return this._api("POST",`close_plan/${t}`)}deletePlan(t){return this._api("POST",`delete_plan/${t}`)}deletePlanEntry(t,e){return this._api("POST",`delete_plan_entry/${t}/${e}`)}deleteRunFromPlanEntry(t){return this._api("POST",`delete_run_from_plan_entry/${t}`)}getPriorities(){return this._api("GET","get_priorities")}getProject(t){return this._api("GET",`get_project/${t}`)}getProjects(t){return s("projects",t,(t=>this._api("GET","get_projects",{query:t})))}addProject(t){return this._api("POST","add_project",{json:t})}updateProject(t,e){return this._api("POST",`update_project/${t}`,{json:e})}deleteProject(t){return this._api("POST",`delete_project/${t}`)}getReports(t){return this._api("GET",`get_reports/${t}`)}runReport(t){return this._api("POST",`run_report/${t}`)}getResults(t,e){return s("results",e,(e=>this._api("GET",`get_results/${t}`,{query:e})))}getResultsForCase(t,e,r){return s("results",r,(s=>this._api("GET",`get_results_for_case/${t}/${e}`,{query:s})))}getResultsForRun(t,e){return s("results",e,(e=>this._api("GET",`get_results_for_run/${t}`,{query:e})))}addResult(t,e){return this._api("POST",`add_result/${t}`,{json:e})}addResultForCase(t,e,s){return this._api("POST",`add_result_for_case/${t}/${e}`,{json:s})}addResults(t,e){return this._api("POST",`add_results/${t}`,{json:e})}addResultsForCases(t,e){return this._api("POST",`add_results_for_cases/${t}`,{json:e})}getResultFields(){return this._api("GET","get_result_fields")}getRun(t){return this._api("GET",`get_run/${t}`)}getRuns(t,e){return s("runs",e,(e=>this._api("GET",`get_runs/${t}`,{query:e})))}addRun(t,e){return this._api("POST",`add_run/${t}`,{json:e})}updateRun(t,e){return this._api("POST",`update_run/${t}`,{json:e})}closeRun(t){return this._api("POST",`close_run/${t}`)}deleteRun(t){return this._api("POST",`delete_run/${t}`)}getSection(t){return this._api("GET",`get_section/${t}`)}getSections(t,e){return s("sections",e,(e=>this._api("GET",`get_sections/${t}`,{query:e})))}addSection(t,e){return this._api("POST",`add_section/${t}`,{json:e})}moveSection(t,e){return this._api("POST",`move_section/${t}`,{json:e})}updateSection(t,e){return this._api("POST",`update_section/${t}`,{json:e})}deleteSection(t){return this._api("POST",`delete_section/${t}`)}getSharedStep(t){return this._api("GET",`get_shared_step/${t}`)}getSharedSteps(t,e){return s("shared_steps",e,(e=>this._api("GET",`get_shared_steps/${t}`,{query:e})))}addSharedStep(t,e){return this._api("POST",`add_shared_step/${t}`,{json:e})}updateSharedStep(t,e){return this._api("POST",`update_shared_step/${t}`,{json:e})}deleteSharedStep(t,e){return this._api("POST",`delete_shared_step/${t}`,{json:e})}getStatuses(){return this._api("GET","get_statuses")}getSuite(t){return this._api("GET",`get_suite/${t}`)}getSuites(t){return this._api("GET",`get_suites/${t}`)}addSuite(t,e){return this._api("POST",`add_suite/${t}`,{json:e})}updateSuite(t,e){return this._api("POST",`update_suite/${t}`,{json:e})}deleteSuite(t){return this._api("POST",`delete_suite/${t}`)}getTemplates(t){return this._api("GET",`get_templates/${t}`)}getTest(t){return this._api("GET",`get_test/${t}`)}getTests(t,e){return s("tests",e,(e=>this._api("GET",`get_tests/${t}`,{query:e})))}getUser(t){return this._api("GET",`get_user/${t}`)}getCurrentUser(){return this._api("GET","get_current_user")}getUserByEmail(t){return this._api("GET","get_user_by_email",{query:{email:t}})}getUsers(t){return this._api("GET","get_users",{query:t})}async _api(t,s,{query:a,json:i,form:u}={}){var _;const o={},p=this.baseURL+s+function(t){if(!t)return"";let e="";for(const[s,r]of Object.entries(t)){let t=r;"boolean"==typeof r?t=+r:Array.isArray(r)&&(t=r.join(",")),e+=`&${s}=${encodeURIComponent(t)}`}return e}(a);var d;let h;if(this.username&&this.password&&(o.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),u||(o["Content-Type"]="application/json"),i)h=JSON.stringify(i);else if(u){h=new FormData;for(const[t,e]of Object.entries(u))e.name&&e.value?r(h,t,e.value,e.name):r(h,t,e)}for(;;){const s=await fetch(p,{method:t,body:h,headers:o});if(429===s.status){const t=1e3*parseInt(s.headers.get("Retry-After")||"1");await n(t);continue}if(409===s.status){await n(1e4);continue}const r=(null===(_=s.headers.get("Content-Type"))||void 0===_?void 0:_.includes("json"))?await s.json().catch((()=>({}))):await s.blob();if(s.ok)return r;throw new e.Exception(r.error||"No additional error message received")}}}async function s(t,e,r){if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let n=0,a=0;const i=[],u=new Set;for(;;){a=250*n++;let _=await s(t,{...e,limit:250,offset:a},r);if(_=_.filter((t=>!u.has(t.id)&&u.add(t.id))),i.push(..._),250!=_.length)break}return i}function r(t,e,s,r){if(r&&"undefined"!=typeof Blob){const n=s instanceof Blob?s:new Blob([s]);t.append(e,n,r)}else t.append(e,s,r)}function n(t){return new Promise((e=>setTimeout(e,t)))}return e.Exception=t,e}));
//# sourceMappingURL=TestRail.umd.js.map
{
"name": "@dlenroc/testrail",
"description": "TestRail API client with error handling and typing",
"version": "1.4.1",
"version": "1.4.2",
"author": "Corneliu Duplachi",

@@ -37,24 +37,24 @@ "license": "MIT",

"devDependencies": {
"@types/chai": "^4.2.14",
"@types/chai-as-promised": "^7.1.3",
"@types/chai": "^4.2.21",
"@types/chai-as-promised": "^7.1.4",
"@types/deasync": "^0.1.1",
"@types/faker": "^5.1.4",
"@types/glob": "^7.1.3",
"@types/mocha": "^8.0.4",
"@types/faker": "^5.5.8",
"@types/glob": "^7.1.4",
"@types/mocha": "^9.0.0",
"@types/node": "*",
"chai": "^4.2.0",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"deasync": "^0.1.21",
"faker": "^5.1.0",
"glob": "^7.1.6",
"deasync": "^0.1.23",
"faker": "^5.5.3",
"glob": "^7.1.7",
"intermock": "^0.2.5",
"mocha": "^8.0.0",
"nock": "^13.0.5",
"replace-in-file": "^6.1.0",
"rollup": "^2.34.0",
"mocha": "^9.1.1",
"nock": "^13.1.3",
"replace-in-file": "^6.2.0",
"rollup": "^2.56.3",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"ts-node": "^10.0.0",
"typescript": "^4.1.2"
"ts-node": "^10.2.1",
"typescript": "^4.4.3"
}
}

@@ -1,6 +0,4 @@

[![Node.js CI](https://github.com/dlenroc/node-testrail-api/workflows/Node.js%20CI/badge.svg)](https://github.com/dlenroc/node-testrail-api/actions?query=workflow%3A"Node.js+CI")
[![Supported Node.js version](https://img.shields.io/node/v/@dlenroc/testrail)](https://github.com/dlenroc/node-testrail-api/actions?query=workflow%3A"Node.js+CI")
[![NPM Version](https://img.shields.io/npm/v/@dlenroc/testrail?cacheSeconds=86400)](https://www.npmjs.com/package/@dlenroc/testrail)
# @dlenroc/testrail · [![NPM Version](https://img.shields.io/npm/v/@dlenroc/testrail)](https://www.npmjs.com/package/@dlenroc/testrail) [![Supported Node.js version](https://img.shields.io/node/v/@dlenroc/testrail)](https://github.com/dlenroc/node-testrail-api/actions?query=workflow%3A"Node.js+CI")
#### Installation
## Installation

@@ -11,3 +9,3 @@ ```bash

#### Example
## Example

@@ -31,420 +29,420 @@ ```typescript

#### Attachments
### Attachments
```typescript
addAttachmentToCase(caseId: number, payload: AddAttachment): Promise<CreatedAttachment>;
addAttachmentToCase(caseId: number, payload: AddAttachment): Promise<CreatedAttachment>
```
```typescript
addAttachmentToPlan(planId: number, payload: AddAttachment): Promise<CreatedAttachment>;
addAttachmentToPlan(planId: number, payload: AddAttachment): Promise<CreatedAttachment>
```
```typescript
addAttachmentToPlanEntry(planId: number, entryId: string, payload: AddAttachment): Promise<CreatedAttachment>;
addAttachmentToPlanEntry(planId: number, entryId: string, payload: AddAttachment): Promise<CreatedAttachment>
```
```typescript
addAttachmentToResult(resultId: number, payload: AddAttachment): Promise<CreatedAttachment>;
addAttachmentToResult(resultId: number, payload: AddAttachment): Promise<CreatedAttachment>
```
```typescript
addAttachmentToRun(runId: number, payload: AddAttachment): Promise<CreatedAttachment>;
addAttachmentToRun(runId: number, payload: AddAttachment): Promise<CreatedAttachment>
```
```typescript
getAttachmentsForCase(caseId: number, filters?: Pagination): Promise<AttachmentForCase[]>;
getAttachmentsForCase(caseId: number, filters?: Pagination): Promise<AttachmentForCase[]>
```
```typescript
getAttachmentsForPlan(planId: number, filters?: Pagination): Promise<AttachmentForPlan[]>;
getAttachmentsForPlan(planId: number, filters?: Pagination): Promise<AttachmentForPlan[]>
```
```typescript
getAttachmentsForPlanEntry(planId: number, entryId: string): Promise<AttachmentForPlanEntry[]>;
getAttachmentsForPlanEntry(planId: number, entryId: string): Promise<AttachmentForPlanEntry[]>
```
```typescript
getAttachmentsForRun(runId: number, filters?: Pagination): Promise<AttachmentForRun[]>;
getAttachmentsForRun(runId: number, filters?: Pagination): Promise<AttachmentForRun[]>
```
```typescript
getAttachmentsForTest(testId: number): Promise<AttachmentForTest[]>;
getAttachmentsForTest(testId: number): Promise<AttachmentForTest[]>
```
```typescript
getAttachment(attachmentId: number): Promise<Blob>;
getAttachment(attachmentId: string): Promise<Blob>
```
```typescript
deleteAttachment(attachmentId: number): Promise<void>;
deleteAttachment(attachmentId: string): Promise<void>
```
#### Cases
### Cases
```typescript
getCase(caseId: number): Promise<Case>;
getCase(caseId: number): Promise<Case>
```
```typescript
getCases(projectId: number, filters?: CaseFilters): Promise<Case[]>;
getCases(projectId: number, filters?: CaseFilters): Promise<Case[]>
```
```typescript
getHistoryForCase(caseId: number, filters?: Pagination): Promise<CaseHistory[]>;
getHistoryForCase(caseId: number, filters?: Pagination): Promise<CaseHistory[]>
```
```typescript
addCase(sectionId: number, payload: AddCase): Promise<Case>;
addCase(sectionId: number, payload: AddCase): Promise<Case>
```
```typescript
copyCasesToSection(sectionId: number, payload: CopyCasesToSection): Promise<void>;
copyCasesToSection(sectionId: number, payload: CopyCasesToSection): Promise<void>
```
```typescript
updateCase(caseId: number, payload: UpdateCase): Promise<Case>;
updateCase(caseId: number, payload: UpdateCase): Promise<Case>
```
```typescript
updateCases(suiteId: number, payload: UpdateCases): Promise<void>;
updateCases(suiteId: number, payload: UpdateCases): Promise<void>
```
```typescript
moveCasesToSection(sectionId: number, payload: MoveCasesToSection): Promise<void>;
moveCasesToSection(sectionId: number, payload: MoveCasesToSection): Promise<void>
```
```typescript
deleteCase(caseId: number): Promise<void>;
deleteCase(caseId: number): Promise<void>
```
```typescript
deleteCases(suiteId: number, payload: DeleteCases): Promise<void>;
deleteCases(suiteId: number, payload: DeleteCases): Promise<void>
```
#### Case Fields
### Case Fields
```typescript
getCaseFields(): Promise<CaseField[]>;
getCaseFields(): Promise<CaseField[]>
```
```typescript
addCaseField(payload: AddCaseField): Promise<CaseField>;
addCaseField(payload: AddCaseField): Promise<CaseField>
```
#### Case Types
### Case Types
```typescript
getCaseTypes(): Promise<CaseType[]>;
getCaseTypes(): Promise<CaseType[]>
```
#### Configurations
### Configurations
```typescript
getConfigs(projectId: number): Promise<Config[]>;
getConfigs(projectId: number): Promise<Config[]>
```
```typescript
addConfigGroup(projectId: number, payload: AddConfigGroup): Promise<Config>;
addConfigGroup(projectId: number, payload: AddConfigGroup): Promise<Config>
```
```typescript
addConfig(configGroupId: number, payload: AddConfig): Promise<ConfigItem>;
addConfig(configGroupId: number, payload: AddConfig): Promise<ConfigItem>
```
```typescript
updateConfigGroup(configGroupId: number, payload: UpdateConfigGroup): Promise<Config>;
updateConfigGroup(configGroupId: number, payload: UpdateConfigGroup): Promise<Config>
```
```typescript
updateConfig(configId: number, payload: UpdateConfig): Promise<ConfigItem>;
updateConfig(configId: number, payload: UpdateConfig): Promise<ConfigItem>
```
```typescript
deleteConfigGroup(configGroupId: number): Promise<void>;
deleteConfigGroup(configGroupId: number): Promise<void>
```
```typescript
deleteConfig(configId: number): Promise<void>;
deleteConfig(configId: number): Promise<void>
```
#### Milestones
### Milestones
```typescript
getMilestone(milestoneId: number): Promise<Milestone>;
getMilestone(milestoneId: number): Promise<Milestone>
```
```typescript
getMilestones(projectId: number, filters?: MilestoneFilters): Promise<Milestone[]>;
getMilestones(projectId: number, filters?: MilestoneFilters): Promise<Milestone[]>
```
```typescript
addMilestone(projectId: number, payload: AddMilestone): Promise<Milestone>;
addMilestone(projectId: number, payload: AddMilestone): Promise<Milestone>
```
```typescript
updateMilestone(milestoneId: number, payload: UpdateMilestone): Promise<Milestone>;
updateMilestone(milestoneId: number, payload: UpdateMilestone): Promise<Milestone>
```
```typescript
deleteMilestone(milestoneId: number): Promise<void>;
deleteMilestone(milestoneId: number): Promise<void>
```
#### Plans
### Plans
```typescript
getPlan(planId: number): Promise<Plan>;
getPlan(planId: number): Promise<Plan>
```
```typescript
getPlans(projectId: number, filters?: PlanFilters): Promise<PlanItem[]>;
getPlans(projectId: number, filters?: PlanFilters): Promise<PlanItem[]>
```
```typescript
addPlan(projectId: number, payload: AddPlan): Promise<Plan>;
addPlan(projectId: number, payload: AddPlan): Promise<Plan>
```
```typescript
addPlanEntry(planId: number, payload: AddPlanEntry): Promise<PlanEntry>;
addPlanEntry(planId: number, payload: AddPlanEntry): Promise<PlanEntry>
```
```typescript
addRunToPlanEntry(planId: number, entryId: string, payload: AddRunToPlanEntry): Promise<PlanEntry>;
addRunToPlanEntry(planId: number, entryId: string, payload: AddRunToPlanEntry): Promise<PlanEntry>
```
```typescript
updatePlan(planId: number, payload: UpdatePlan): Promise<Plan>;
updatePlan(planId: number, payload: UpdatePlan): Promise<Plan>
```
```typescript
updatePlanEntry(planId: number, entryId: string, payload: UpdatePlanEntry): Promise<PlanEntry>;
updatePlanEntry(planId: number, entryId: string, payload: UpdatePlanEntry): Promise<PlanEntry>
```
```typescript
updateRunInPlanEntry(planId: number, runId: number, payload: UpdateRunInPlanEntry): Promise<PlanEntry>;
updateRunInPlanEntry(runId: number, payload: UpdateRunInPlanEntry): Promise<PlanEntry>
```
```typescript
closePlan(planId: number): Promise<Plan>;
closePlan(planId: number): Promise<Plan>
```
```typescript
deletePlan(planId: number): Promise<void>;
deletePlan(planId: number): Promise<void>
```
```typescript
deletePlanEntry(planId: number, entryId: string): Promise<void>;
deletePlanEntry(planId: number, entryId: string): Promise<void>
```
```typescript
deleteRunFromPlanEntry(runId: number): Promise<void>;
deleteRunFromPlanEntry(runId: number): Promise<void>
```
#### Priorities
### Priorities
```typescript
getPriorities(): Promise<Priority[]>;
getPriorities(): Promise<Priority[]>
```
#### Projects
### Projects
```typescript
getProject(projectId: number): Promise<Project>;
getProject(projectId: number): Promise<Project>
```
```typescript
getProjects(filters?: ProjectFilters): Promise<Project[]>;
getProjects(filters?: ProjectFilters): Promise<Project[]>
```
```typescript
addProject(payload: AddProject): Promise<Project>;
addProject(payload: AddProject): Promise<Project>
```
```typescript
updateProject(projectId: number, payload: UpdateProject): Promise<Project>;
updateProject(projectId: number, payload: UpdateProject): Promise<Project>
```
```typescript
deleteProject(projectId: number): Promise<void>;
deleteProject(projectId: number): Promise<void>
```
#### Reports
### Reports
```typescript
getReports(projectId: number): Promise<Report[]>;
getReports(projectId: number): Promise<Report[]>
```
```typescript
runReport(reportTemplateId: number): Promise<ReportUrls>;
runReport(reportTemplateId: number): Promise<ReportUrls>
```
#### Results
### Results
```typescript
getResults(testId: number, filters?: ResultFilters): Promise<Result[]>;
getResults(testId: number, filters?: ResultFilters): Promise<Result[]>
```
```typescript
getResultsForCase(runId: number, caseId: number, filters?: ResultFilters): Promise<Result[]>;
getResultsForCase(runId: number, caseId: number, filters?: ResultFilters): Promise<Result[]>
```
```typescript
getResultsForRun(runId: number, filters?: ResultForRunFilters): Promise<Result[]>;
getResultsForRun(runId: number, filters?: ResultForRunFilters): Promise<Result[]>
```
```typescript
addResult(testId: number, payload: AddResult): Promise<Result>;
addResult(testId: number, payload: AddResult): Promise<Result>
```
```typescript
addResultForCase(runId: number, caseId: number, payload: AddResult): Promise<Result>;
addResultForCase(runId: number, caseId: number, payload: AddResult): Promise<Result>
```
```typescript
addResults(runId: number, payload: AddResults): Promise<Result[]>;
addResults(runId: number, payload: AddResults): Promise<Result[]>
```
```typescript
addResultsForCases(runId: number, payload: AddResultsForCases): Promise<Result[]>;
addResultsForCases(runId: number, payload: AddResultsForCases): Promise<Result[]>
```
#### Result Fields
### Result Fields
```typescript
getResultFields(): Promise<ResultField[]>;
getResultFields(): Promise<ResultField[]>
```
#### Runs
### Runs
```typescript
getRun(runId: number): Promise<Run>;
getRun(runId: number): Promise<Run>
```
```typescript
getRuns(projectId: number, filters?: RunFilters): Promise<Run[]>;
getRuns(projectId: number, filters?: RunFilters): Promise<Run[]>
```
```typescript
addRun(projectId: number, payload: AddRun): Promise<Run>;
addRun(projectId: number, payload: AddRun): Promise<Run>
```
```typescript
updateRun(runId: number, payload: UpdateRun): Promise<Run>;
updateRun(runId: number, payload: UpdateRun): Promise<Run>
```
```typescript
closeRun(runId: number): Promise<Run>;
closeRun(runId: number): Promise<Run>
```
```typescript
deleteRun(runId: number): Promise<void>;
deleteRun(runId: number): Promise<void>
```
#### Sections
### Sections
```typescript
getSection(sectionId: number): Promise<Section>;
getSection(sectionId: number): Promise<Section>
```
```typescript
getSections(projectId: number, filters?: SectionFilters): Promise<Section[]>;
getSections(projectId: number, filters?: SectionFilters): Promise<Section[]>
```
```typescript
addSection(projectId: number, payload: AddSection): Promise<Section>;
addSection(projectId: number, payload: AddSection): Promise<Section>
```
```typescript
moveSection(sectionId: number, payload: MoveSection): Promise<Section>;
moveSection(sectionId: number, payload: MoveSection): Promise<Section>
```
```typescript
updateSection(sectionId: number, payload: UpdateSection): Promise<Section>;
updateSection(sectionId: number, payload: UpdateSection): Promise<Section>
```
```typescript
deleteSection(sectionId: number): Promise<void>;
deleteSection(sectionId: number): Promise<void>
```
#### Shared Steps
### Shared steps
```typescript
getSharedStep(stepId: number): Promise<SharedStep>;
getSharedStep(stepId: number): Promise<SharedStep>
```
```typescript
getSharedSteps(projectId: number, filters?: SharedStepFilters): Promise<SharedStep[]>;
getSharedSteps(projectId: number, filters?: SharedStepFilters): Promise<SharedStep[]>
```
```typescript
addSharedStep(projectId: number, payload: AddSharedStep): Promise<SharedStep>;
addSharedStep(projectId: number, payload: AddSharedStep): Promise<SharedStep>
```
```typescript
updateSharedStep(stepId: number, payload: UpdateSharedStep): Promise<SharedStep>;
updateSharedStep(stepId: number, payload: UpdateSharedStep): Promise<SharedStep>
```
```typescript
deleteSharedStep(stepId: number, payload?: DeleteSharedStep): Promise<void>;
deleteSharedStep(stepId: number, payload?: DeleteSharedStep): Promise<void>
```
#### Statuses
### Statuses
```typescript
getStatuses(): Promise<Status[]>;
getStatuses(): Promise<Status[]>
```
#### Suites
### Suites
```typescript
getSuite(suiteId: number): Promise<Suite>;
getSuite(suiteId: number): Promise<Suite>
```
```typescript
getSuites(projectId: number): Promise<Suite[]>;
getSuites(projectId: number): Promise<Suite[]>
```
```typescript
addSuite(projectId: number, payload: AddSuite): Promise<Suite>;
addSuite(projectId: number, payload: AddSuite): Promise<Suite>
```
```typescript
updateSuite(suiteId: number, payload: UpdateSuite): Promise<Suite>;
updateSuite(suiteId: number, payload: UpdateSuite): Promise<Suite>
```
```typescript
deleteSuite(suiteId: number): Promise<void>;
deleteSuite(suiteId: number): Promise<void>
```
#### Templates
### Templates
```typescript
getTemplates(projectId: number): Promise<Template[]>;
getTemplates(projectId: number): Promise<Template[]>
```
#### Tests
### Tests
```typescript
getTest(testId: number): Promise<Test>;
getTest(testId: number): Promise<Test>
```
```typescript
getTests(runId: number, filters?: TestFilters): Promise<Test[]>;
getTests(runId: number, filters?: TestFilters): Promise<Test[]>
```
#### Users
### Users
```typescript
getUser(userId: number): Promise<User>;
getUser(userId: number): Promise<User>
```
```typescript
getCurrentUser(): Promise<User>;
getCurrentUser(): Promise<User>
```
```typescript
getUserByEmail(email: string): Promise<User>;
getUserByEmail(email: string): Promise<User>
```
```typescript
getUsers(filters?: UserFilters): Promise<User[]>;
getUsers(filters?: UserFilters): Promise<User[]>
```

@@ -225,4 +225,4 @@ import { Request, Response } from './payload';

updateRunInPlanEntry(planId: number, runId: number, payload: Request.UpdateRunInPlanEntry): Promise<Response.PlanEntry> {
return this._api('POST', `update_run_in_plan_entry/${planId}/${runId}`, { json: payload });
updateRunInPlanEntry(runId: number, payload: Request.UpdateRunInPlanEntry): Promise<Response.PlanEntry> {
return this._api('POST', `update_run_in_plan_entry/${runId}`, { json: payload });
}

@@ -229,0 +229,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc