Socket
Socket
Sign inDemoInstall

@dlenroc/testrail

Package Overview
Dependencies
13
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.0 to 1.8.1

2

dist/TestRail.node.js

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

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

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

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

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -19,4 +19,5 @@ import type { TestRailCtx } from './TestRailCtx';

// @ts-ignore - Backward compatibility
...config?.username && { username: config?.username || config?.user },
...config?.password && { password: config?.password },
...config?.user && { username: config.user },
...config?.username && { username: config.username },
...config?.password && { password: config.password },
...config?.signal && { signal: config.signal }

@@ -23,0 +24,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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc