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.6.3 to 1.7.0

src/payload/request/AddDataset.ts

2

dist/TestRail.node.js

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

"use strict";const t=require("http"),e=require("https"),r=require("node-fetch"),s=require("form-data"),a={keepAlive:!0},n=new t.Agent(a),i=new e.Agent(a),u=t=>"http:"===t.protocol?n:i,o=(t,e)=>r(t,{agent:u,...e});class _ 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}`)}getGroup(t){return this._api("GET",`get_group/${t}`)}getGroups(t){return d("groups",t,(t=>this._api("GET","get_groups",{query:t})))}addGroup(t){return this._api("POST","add_group",{json:t})}updateGroup(t,e){return this._api("POST",`update_group/${t}`,{json:e})}deleteGroup(t){return this._api("POST",`delete_group/${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")}getRoles(t){return d("roles",t,(t=>this._api("GET","get_roles",{query:t})))}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})))}getSharedStepHistory(t,e){return d("step_history",e,(e=>this._api("GET",`get_shared_step_history/${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")}getCaseStatuses(t){return d("case_statuses",t,(t=>this._api("GET","get_case_statuses",{query:t})))}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})}addUser(t){return this._api("POST","add_user",{json:t})}updateUser(t,e){return this._api("POST",`update_user/${t}`,{json:e})}async _api(t,e,{query:r,json:a,form:n}={}){var i;const u={},_=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&&(u.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),n||(u["Content-Type"]="application/json"),a)c=JSON.stringify(a);else if(n){c=new s;for(const[t,e]of Object.entries(n))e.name&&e.value?h(c,t,e.value,e.name):h(c,t,e)}for(;;){const e=await o(_,{method:t,body:c,headers:u});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){var s;if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let a,n,i,u,o=0,_=0;const p=[],d=new Set;do{_=250*o++,a=await r({...e,limit:250,offset:_}),Array.isArray(a)?(u=!1,i=250===a.length,n=a):(u=!0,i=!!(null===(s=null==a?void 0:a._links)||void 0===s?void 0:s.next),n=a[t]||[]);for(const t of n)d.has(t.id)||(d.add(t.id),p.push(t),u=!0)}while(i&&u);return p}function h(t,e,r,a){if("undefined"!=typeof Blob&&"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.FormData)===s){const s=r instanceof Blob?r:new Blob([r]);t.append(e,s,a)}else t.append(e,r,a)}function l(t){return new Promise((e=>setTimeout(e,t)))}p.Exception=_,module.exports=p;
"use strict";const t=require("http"),e=require("https"),r=require("node-fetch"),s=require("form-data"),a={keepAlive:!0},n=new t.Agent(a),i=new e.Agent(a),u=t=>"http:"===t.protocol?n:i,_=(t,e)=>r(t,{agent:u,...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}`)}getDataset(t){return this._api("GET",`get_dataset/${t}`)}getDatasets(t,e){return d("datasets",e,(e=>this._api("GET",`get_datasets/${t}`,{query:e})))}addDataset(t,e){return this._api("POST",`add_dataset/${t}`,{json:e})}updateDataset(t,e){return this._api("POST",`update_dataset/${t}`,{json:e})}deleteDataset(t){return this._api("POST",`delete_dataset/${t}`)}getGroup(t){return this._api("GET",`get_group/${t}`)}getGroups(t){return d("groups",t,(t=>this._api("GET","get_groups",{query:t})))}addGroup(t){return this._api("POST","add_group",{json:t})}updateGroup(t,e){return this._api("POST",`update_group/${t}`,{json:e})}deleteGroup(t){return this._api("POST",`delete_group/${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")}getRoles(t){return d("roles",t,(t=>this._api("GET","get_roles",{query:t})))}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})))}getSharedStepHistory(t,e){return d("step_history",e,(e=>this._api("GET",`get_shared_step_history/${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")}getCaseStatuses(t){return d("case_statuses",t,(t=>this._api("GET","get_case_statuses",{query:t})))}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})}addUser(t){return this._api("POST","add_user",{json:t})}updateUser(t,e){return this._api("POST",`update_user/${t}`,{json:e})}getVariables(t,e){return d("variables",e,(e=>this._api("GET",`get_variables/${t}`,{query:e})))}addVariable(t,e){return this._api("POST",`add_variable/${t}`,{json:e})}updateVariable(t,e){return this._api("POST",`update_variable/${t}`,{json:e})}deleteVariable(t){return this._api("POST",`delete_variable/${t}`)}async _api(t,e,{query:r,json:a,form:n}={}){var i;const u={},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&&(u.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),n||(u["Content-Type"]="application/json"),a)c=JSON.stringify(a);else if(n){c=new s;for(const[t,e]of Object.entries(n))e.name&&e.value?h(c,t,e.value,e.name):h(c,t,e)}for(;;){const e=await _(o,{method:t,body:c,headers:u});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){var s;if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const s=await r(e);return Array.isArray(s)?s:s[t]||[]}let a,n,i,u,_=0,o=0;const p=[],d=new Set;do{o=250*_++,a=await r({...e,limit:250,offset:o}),Array.isArray(a)?(u=!1,i=250===a.length,n=a):(u=!0,i=!!(null===(s=null==a?void 0:a._links)||void 0===s?void 0:s.next),n=a[t]||[]);for(const t of n)d.has(t.id)||(d.add(t.id),p.push(t),u=!0)}while(i&&u);return p}function h(t,e,r,a){if("undefined"!=typeof Blob&&"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.FormData)===s){const s=r instanceof Blob?r:new Blob([r]);t.append(e,s,a)}else t.append(e,r,a)}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}`)}getGroup(t){return this._api("GET",`get_group/${t}`)}getGroups(t){return s("groups",t,(t=>this._api("GET","get_groups",{query:t})))}addGroup(t){return this._api("POST","add_group",{json:t})}updateGroup(t,e){return this._api("POST",`update_group/${t}`,{json:e})}deleteGroup(t){return this._api("POST",`delete_group/${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")}getRoles(t){return s("roles",t,(t=>this._api("GET","get_roles",{query:t})))}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})))}getSharedStepHistory(t,e){return s("step_history",e,(e=>this._api("GET",`get_shared_step_history/${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")}getCaseStatuses(t){return s("case_statuses",t,(t=>this._api("GET","get_case_statuses",{query:t})))}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})}addUser(t){return this._api("POST","add_user",{json:t})}updateUser(t,e){return this._api("POST",`update_user/${t}`,{json:e})}async _api(t,s,{query:n,json:i,form:u}={}){var o;const _={},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}(n);var d;let h;if(this.username&&this.password&&(_.Authorization=`Basic ${d=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(d):Buffer.from(d).toString("base64")}`),u||(_["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:_});if(429===s.status){const t=1e3*parseInt(s.headers.get("Retry-After")||"1");await a(t);continue}if(409===s.status){await a(1e4);continue}const r=(null===(o=s.headers.get("Content-Type"))||void 0===o?void 0:o.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,s){var r;if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const r=await s(e);return Array.isArray(r)?r:r[t]||[]}let a,n,i,u,o=0,_=0;const p=[],d=new Set;do{_=250*o++,a=await s({...e,limit:250,offset:_}),Array.isArray(a)?(u=!1,i=250===a.length,n=a):(u=!0,i=!!(null===(r=null==a?void 0:a._links)||void 0===r?void 0:r.next),n=a[t]||[]);for(const t of n)d.has(t.id)||(d.add(t.id),p.push(t),u=!0)}while(i&&u);return p}function r(t,e,s,r){if("undefined"!=typeof Blob&&"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.FormData)===FormData){const a=s instanceof Blob?s:new Blob([s]);t.append(e,a,r)}else t.append(e,s,r)}function a(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}`)}getDataset(t){return this._api("GET",`get_dataset/${t}`)}getDatasets(t,e){return s("datasets",e,(e=>this._api("GET",`get_datasets/${t}`,{query:e})))}addDataset(t,e){return this._api("POST",`add_dataset/${t}`,{json:e})}updateDataset(t,e){return this._api("POST",`update_dataset/${t}`,{json:e})}deleteDataset(t){return this._api("POST",`delete_dataset/${t}`)}getGroup(t){return this._api("GET",`get_group/${t}`)}getGroups(t){return s("groups",t,(t=>this._api("GET","get_groups",{query:t})))}addGroup(t){return this._api("POST","add_group",{json:t})}updateGroup(t,e){return this._api("POST",`update_group/${t}`,{json:e})}deleteGroup(t){return this._api("POST",`delete_group/${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")}getRoles(t){return s("roles",t,(t=>this._api("GET","get_roles",{query:t})))}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})))}getSharedStepHistory(t,e){return s("step_history",e,(e=>this._api("GET",`get_shared_step_history/${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")}getCaseStatuses(t){return s("case_statuses",t,(t=>this._api("GET","get_case_statuses",{query:t})))}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})}addUser(t){return this._api("POST","add_user",{json:t})}updateUser(t,e){return this._api("POST",`update_user/${t}`,{json:e})}getVariables(t,e){return s("variables",e,(e=>this._api("GET",`get_variables/${t}`,{query:e})))}addVariable(t,e){return this._api("POST",`add_variable/${t}`,{json:e})}updateVariable(t,e){return this._api("POST",`update_variable/${t}`,{json:e})}deleteVariable(t){return this._api("POST",`delete_variable/${t}`)}async _api(t,s,{query:n,json:i,form:u}={}){var _;const o={},d=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}(n);var p;let h;if(this.username&&this.password&&(o.Authorization=`Basic ${p=`${this.username}:${this.password}`,"undefined"!=typeof btoa?btoa(p):Buffer.from(p).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(d,{method:t,body:h,headers:o});if(429===s.status){const t=1e3*parseInt(s.headers.get("Retry-After")||"1");await a(t);continue}if(409===s.status){await a(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,s){var r;if(e&&(e.hasOwnProperty("limit")||e.hasOwnProperty("offset"))){const r=await s(e);return Array.isArray(r)?r:r[t]||[]}let a,n,i,u,_=0,o=0;const d=[],p=new Set;do{o=250*_++,a=await s({...e,limit:250,offset:o}),Array.isArray(a)?(u=!1,i=250===a.length,n=a):(u=!0,i=!!(null===(r=null==a?void 0:a._links)||void 0===r?void 0:r.next),n=a[t]||[]);for(const t of n)p.has(t.id)||(p.add(t.id),d.push(t),u=!0)}while(i&&u);return d}function r(t,e,s,r){if("undefined"!=typeof Blob&&"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.FormData)===FormData){const a=s instanceof Blob?s:new Blob([s]);t.append(e,a,r)}else t.append(e,s,r)}function a(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.6.3",
"version": "1.7.0",
"author": "Corneliu Duplachi",

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

"devDependencies": {
"@faker-js/faker": "^6.2.0",
"@faker-js/faker": "^7.3.0",
"@types/chai": "^4.3.1",

@@ -48,12 +48,12 @@ "@types/chai-as-promised": "^7.1.5",

"deasync": "^0.1.26",
"glob": "^8.0.1",
"glob": "^8.0.3",
"intermock": "^0.2.5",
"mocha": "^9.2.2",
"nock": "^13.2.4",
"rollup": "^2.71.1",
"mocha": "^10.0.0",
"nock": "^13.2.7",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"ts-node": "^10.7.0",
"typescript": "^4.6.4"
"rollup-plugin-typescript2": "^0.32.1",
"ts-node": "^10.8.1",
"typescript": "^4.7.4"
}
}

@@ -6,2 +6,3 @@ export * from './AddAttachment';

export * from './AddConfigGroup';
export * from './AddDataset';
export * from './AddGroup';

@@ -23,2 +24,3 @@ export * from './AddMilestone';

export * from './AddUser';
export * from './AddVariable';
export * from './CaseFilters';

@@ -25,0 +27,0 @@ export * from './CopyCasesToSection';

@@ -16,2 +16,3 @@ export * from './Attachment';

export * from './CreatedAttachment';
export * from './Dataset';
export * from './FieldConfig';

@@ -41,1 +42,2 @@ export * from './Group';

export * from './User';
export * from './Variables';

@@ -169,2 +169,26 @@ import { Request, Response } from './payload';

// Datasets
getDataset(datasetId: number): Promise<Response.Dataset> {
return this._api('GET', `get_dataset/${datasetId}`);
}
getDatasets(projectId: number, filters?: Request.Pagination): Promise<Response.Dataset[]> {
return pagination('datasets', filters, (filters) => {
return this._api('GET', `get_datasets/${projectId}`, { query: filters });
});
}
addDataset(projectId: number, payload: Request.AddDataset): Promise<Response.Group> {
return this._api('POST', `add_dataset/${projectId}`, { json: payload });
}
updateDataset(datasetId: number, payload: Request.AddDataset): Promise<Response.Group> {
return this._api('POST', `update_dataset/${datasetId}`, { json: payload });
}
deleteDataset(datasetId: number): Promise<void> {
return this._api('POST', `delete_dataset/${datasetId}`);
}
// Groups

@@ -524,2 +548,22 @@

// Users
getVariables(projectId: number, filters?: Request.TestFilters): Promise<Response.Variable[]> {
return pagination('variables', filters, (filters) => {
return this._api('GET', `get_variables/${projectId}`, { query: filters });
});
}
addVariable(projectId: number, payload: Request.AddVariable): Promise<Response.Variable> {
return this._api('POST', `add_variable/${projectId}`, { json: payload });
}
updateVariable(variableId: number, payload: Request.AddVariable): Promise<Response.Variable> {
return this._api('POST', `update_variable/${variableId}`, { json: payload });
}
deleteVariable(variableId: number): Promise<void> {
return this._api('POST', `delete_variable/${variableId}`);
}
// Internal

@@ -526,0 +570,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