PageSourceSearch

https://app.testmap.ai/_next/static/chunks/960-75d55280a211fa60.js

js testmap.ai collected 2026-10-02 01:12:27 UTC 20,353 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[960],{90960:(e,t,o)=>{o.d(t,{FH:()=>d,Je:()=>c,Zq:()=>a,j1:()=>i,k4:()=>s,kA:()=>n});let r="/api";async function a(e,t){try{let o,a=(null==t?void 0:t.method)||"GET",n="".concat(r).concat(e);if(console.log("\uD83C\uDF10 [FETCH-API] ".concat(a," ").concat(e," -> ").concat(n)),(null==t?void 0:t.body)&&"string"==typeof t.body)try{let e=JSON.parse(t.body);console.log("\uD83D\uDCE4 [FETCH-API] Request body:",{organizationId:e.organizationId,projectId:e.projectId,title:e.title,hasOrganizationId:!!e.organizationId,bodyKeys:Object.keys(e),fullEndpoint:n})}catch(e){console.log("\uD83D\uDCE4 [FETCH-API] Request body (raw):",t.body)}let s={"Content-Type":"application/json",...null==t?void 0:t.headers};console.log("\uD83D\uDD27 [FETCH-API] Request options:",{method:a,hasCredentials:!0,hasBody:!!(null==t?void 0:t.body),headers:s,baseUrl:r,fullUrl:"".concat(r).concat(e)});let c=await fetch("".concat(r).concat(e),{headers:s,credentials:"include",...t,...(null==t?void 0:t.headers)?{headers:s}:{}}),d=c.headers.get("content-type"),i=c.status;if(console.log("\uD83D\uDCE5 [FETCH-API] Response: ".concat(i," ").concat(c.statusText," from ").concat(e)),console.log("\uD83D\uDCE5 [FETCH-API] Content-Type: ".concat(d)),d&&d.includes("application/json")&&204!==i){let e=await c.text();console.log("\uD83D\uDCE5 [FETCH-API] Raw response text:",e);try{o=e?JSON.parse(e):null,console.log("\uD83D\uDCE5 [FETCH-API] Parsed response data:",{success:null==o?void 0:o.success,hasData:!!(null==o?void 0:o.data),dataType:typeof(null==o?void 0:o.data),isArray:Array.isArray(null==o?void 0:o.data),dataLength:Array.isArray(null==o?void 0:o.data)?o.data.length:"not array",error:null==o?void 0:o.error})}catch(t){return console.error("\uD83D\uDCE5 [FETCH-API] Failed to parse JSON from response: ".concat(e)),{success:!1,error:"Invalid JSON response: ".concat(t instanceof Error?t.message:"Unknown error")}}}else o=null,console.log("\uD83D\uDCE5 [FETCH-API] No JSON content, data set to null");if(!c.ok){if(console.error("API Error: ".concat(i," ").concat(c.statusText," from ").concat(e),null==o?void 0:o.error),401===i){console.error("Authentication error: 401 Unauthorized");let e=(null==o?void 0:o.error)||"Your session has expired or you are not authenticated";return{success:!1,error:e}}return(null==o?void 0:o.upgradeRequired)&&window.dispatchEvent(new CustomEvent("plan-limit-exceeded",{detail:{reason:(null==o?void 0:o.reason)||(null==o?void 0:o.message)||(null==o?void 0:o.error)||"Subscription limit reached",upgradeRequired:!0,planName:null==o?void 0:o.planName,limitType:null==o?void 0:o.limitType,current:null==o?void 0:o.current,max:null==o?void 0:o.max}})),{success:!1,error:(null==o?void 0:o.reason)||(null==o?void 0:o.message)||(null==o?void 0:o.error)||"Error: ".concat(i," ").concat(c.statusText)}}if(o&&"object"==typeof o&&"success"in o&&"data"in o)return console.log("\uD83D\uDCE4 [FETCH-API] Returning structured response:",{success:o.success,dataType:typeof o.data,isArray:Array.isArray(o.data),dataLength:Array.isArray(o.data)?o.data.length:"not array",error:o.error}),{success:o.success,data:o.data,error:o.error};if(o&&"object"==typeof o&&"items"in o&&Array.isArray(o.items))return console.log("\uD83D\uDCE4 [FETCH-API] Returning paginated response with ".concat(o.items.length," items (total: ").concat(o.total||"unknown",")")),{success:!0,data:o};return console.log("\uD83D\uDCE4 [FETCH-API] Returning direct data:",{dataType:typeof o,isArray:Array.isArray(o),dataLength:Array.isArray(o)?o.length:"not array"}),{success:!0,data:o}}catch(e){return console.error("API call error:",e),{success:!1,error:e instanceof Error?e.message:"An error occurred"}}}let n={getAll:async e=>{let t=new URLSearchParams;(null==e?void 0:e.folderId)&&t.append("folderId",e.folderId),(null==e?void 0:e.search)&&""!==e.search.trim()&&t.append("search",e.search.trim()),(null==e?void 0:e.statuses)&&e.statuses.length>0&&t.append("status",e.statuses.join(",")),(null==e?void 0:e.tags)&&e.tags.length>0&&t.append("tags",e.tags.join(",")),(null==e?void 0:e.customFields)&&Object.keys(e.customFields).length>0&&t.append("customFields",JSON.stringify(e.customFields)),(null==e?void 0:e.fieldId)&&t.append("fieldId",e.fieldId),(null==e?void 0:e.fieldValue)!==void 0&&t.append("fieldValue",e.fieldValue),(null==e?void 0:e.includeSubfolders)!==void 0&&t.append("includeSubfolders",e.includeSubfolders.toString()),(null==e?void 0:e.sort)&&t.append("sort",e.sort),(null==e?void 0:e.order)&&t.append("order",e.order),(null==e?void 0:e.page)!==void 0&&t.append("page",e.page.toString()),(null==e?void 0:e.projectId)&&t.append("projectId",e.projectId),(null==e?void 0:e.organizationId)&&t.append("organizationId",e.organizationId);let o=(null==e?void 0:e.limit)!==void 0?e.limit:15;t.append("limit",o.toString());let r=t.toString()?"?".concat(t.toString()):"";return a("/test-cases".concat(r))}
1,groupByField:async e=>{let t=new URLSearchParams;return t.append("fieldId",e.fieldId),e.projectId&&t.append("projectId",e.projectId),a("/test-cases/group-by-field?".concat(t.toString()))},getById:async(e,t)=>{if(t||(t=localStorage.getItem("currentOrganizationId")||void 0),!t)return console.error("No organizationId provided to getById - this is required for test case API calls"),{success:!1,error:"organizationId is required for test case API calls"};let o=new URLSearchParams;o.append("organizationId",t);let r=o.toString()?"?".concat(o.toString()):"";return a("/test-cases/".concat(e).concat(r))},create:async e=>{console.log("\uD83D\uDE80 [FRONTEND] testCasesApi.create called with:",{title:e.title,projectId:e.projectId,organizationId:e.organizationId,hasOrganizationId:!!e.organizationId,bodyKeys:Object.keys(e)});let t=await a("/test-cases",{method:"POST",body:JSON.stringify(e)});return console.log("\uD83D\uDCE4 [FRONTEND] testCasesApi.create result:",{success:t.success,error:t.error,hasData:!!t.data}),t},update:async(e,t,o)=>{if(console.log("Updating test case:",e,"with data:",JSON.stringify(t)),o||(o=localStorage.getItem("currentOrganizationId")||void 0),!o)return console.error("No organizationId provided to update - this is required for test case API calls"),{success:!1,error:"organizationId is required for test case API calls"};let r=new URLSearchParams;r.append("organizationId",o);let n=r.toString()?"?".concat(r.toString()):"";return a("/test-cases/".concat(e).concat(n),{method:"PUT",body:JSON.stringify(t)})},delete:async(e,t)=>{if(t||(t=localStorage.getItem("currentOrganizationId")||void 0),!t)return console.error("No organizationId provided to delete - this is required for test case API calls"),{success:!1,error:"organizationId is required for test case API calls"};let o=new URLSearchParams;o.append("organizationId",t);let r=o.toString()?"?".concat(o.toString()):"";return a("/test-cases/".concat(e).concat(r),{method:"DELETE"})},updatePositions:async e=>a("/test-cases/positions",{method:"PUT",body:JSON.stringify(e)}),aiReview:async e=>{try{console.log("Sending AI review request for test case:",e);let t=await fetch("/api/test-cases/review?id=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}}),o=await t.json();if(!t.ok)return{success:!1,error:o.error||"Failed to review test case"};return console.log("AI review successful, updated test case:",o),{success:!0,data:o}}catch(e){return console.error("AI review error:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}},copy:async e=>a("/test-cases/copy",{method:"POST",body:JSON.stringify(e)})},s={getAll:async e=>{try{console.log("[API:Folders] Iniciando getAll com params:",e);let t=new URLSearchParams;(null==e?void 0:e.projectId)&&t.append("projectId",e.projectId),(null==e?void 0:e.organizationId)&&t.append("organizationId",e.organizationId);let o=t.toString()?"?".concat(t.toString()):"";console.log("[API:Folders] Chamando fetchApi('/folders".concat(o,"')"));let r=await a("/folders".concat(o));return console.log("[API:Folders] Resposta de getAll:",r),r}catch(e){return console.error("[API:Folders] Erro em getAll folders:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}},getById:async e=>{try{return console.log("[API:Folders] Buscando pasta com ID: ".concat(e)),await a("/folders/".concat(e))}catch(e){return console.error("Error getting folder by ID:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}},create:async e=>{try{if(console.log("[API:Folders] Criando nova pasta:",e),!e.projectId||!e.organizationId)return console.error("[API:Folders] Faltando projectId ou organizationId para criar pasta"),{success:!1,error:"Missing required fields (projectId and organizationId)"};let t=await a("/folders",{method:"POST",body:JSON.stringify(e)});return console.log("[API:Folders] Resposta da cria\xe7\xe3o de pasta:",t),t}catch(e){return console.error("[API:Folders] Erro ao criar pasta:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}},update:async(e,t)=>{try{console.log("=== FOLDERS API UPDATE START ==="),console.log("[API:F
1olders] Atualizando pasta ".concat(e,":"),t),console.log("[API:Folders] folder.parentId:",t.parentId),console.log("[API:Folders] folder.parentId === undefined:",void 0===t.parentId),console.log("[API:Folders] folder.parentId === null:",null===t.parentId),console.log('[API:Folders] "parentId" in folder:',"parentId"in t),console.log("[API:Folders] JSON.stringify(folder):",JSON.stringify(t));let o=await a("/folders/".concat(e),{method:"PUT",body:JSON.stringify(t)});return console.log("[API:Folders] fetchApi response:",o),console.log("=== FOLDERS API UPDATE END ==="),o}catch(e){return console.error("=== FOLDERS API UPDATE ERROR ==="),console.error("Error updating folder:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}},delete:async(e,t)=>{try{console.log("[API:Folders] Deletando pasta ".concat(e));let o=new URLSearchParams;t&&o.append("organizationId",t);let r=o.toString()?"?".concat(o.toString()):"";return await a("/folders/".concat(e).concat(r),{method:"DELETE"})}catch(e){return console.error("Error deleting folder:",e),{success:!1,error:e instanceof Error?e.message:"An unexpected error occurred"}}}},c={getAll:async e=>{let t=new URLSearchParams;if((null==e?void 0:e.projectId)&&t.append("projectId",e.projectId),null==e||!e.organizationId)return console.error("No organizationId provided for test runs API call"),{success:!1,error:"organizationId is required for test runs API calls"};t.append("organizationId",e.organizationId),(null==e?void 0:e.page)!==void 0&&t.append("page",e.page.toString()),(null==e?void 0:e.limit)!==void 0&&t.append("limit",e.limit.toString()),(null==e?void 0:e.status)&&t.append("status",e.status),(null==e?void 0:e.environment)&&t.append("environment",e.environment),(null==e?void 0:e.assigneeId)&&t.append("assigneeId",e.assigneeId),(null==e?void 0:e.milestoneId)&&t.append("milestoneId",e.milestoneId),(null==e?void 0:e.sortBy)&&t.append("sortBy",e.sortBy),(null==e?void 0:e.sortOrder)&&t.append("sortOrder",e.sortOrder),(null==e?void 0:e.archived)&&t.append("archived","true");let o=t.toString()?"?".concat(t.toString()):"";return a("/test-runs".concat(o))},getTestRunsByProject:async(e,t)=>{let o=new URLSearchParams;o.append("projectId",e),(null==t?void 0:t.organizationId)&&o.append("organizationId",t.organizationId),(null==t?void 0:t.page)!==void 0&&o.append("page",t.page.toString()),(null==t?void 0:t.limit)!==void 0&&o.append("limit",t.limit.toString()),(null==t?void 0:t.status)&&o.append("status",t.status),(null==t?void 0:t.environment)&&o.append("environment",t.environment),(null==t?void 0:t.browser)&&o.append("browser",t.browser),(null==t?void 0:t.sortBy)&&o.append("sortBy",t.sortBy),(null==t?void 0:t.sortOrder)&&o.append("sortOrder",t.sortOrder),(null==t?void 0:t.fromDate)&&o.append("fromDate",t.fromDate),(null==t?void 0:t.toDate)&&o.append("toDate",t.toDate);let r=o.toString()?"?".concat(o.toString()):"";return a("/projects/".concat(e,"/test-runs").concat(r))},getById:async e=>a("/test-runs/".concat(e)),create:async e=>a("/test-runs",{method:"POST",body:JSON.stringify(e)}),update:async(e,t)=>a("/test-runs/".concat(e),{method:"PUT",body:JSON.stringify(t)}),updateTestCaseStatus:async(e,t,o)=>a("/test-runs/".concat(e,"/test-cases/").concat(t,"/status"),{method:"PUT",body:JSON.stringify({status:o})}),updateTestCaseNotes:async(e,t,o)=>a("/test-runs/".concat(e,"/test-cases/").concat(t,"/notes"),{method:"PUT",body:JSON.stringify({notes:o})}),updateTestStepResult:async(e,t,o)=>a("/test-runs/".concat(e,"/test-steps"),{method:"PUT",body:JSON.stringify({stepIndex:t,...o})}),getStepAttachments:async(e,t)=>a("/test-runs/".concat(e,"/test-steps/").concat(t,"/attachments")),uploadStepAttachment:async(e,t,o)=>{let r=new FormData;return r.append("file",o),fetch("/api/test-runs/".concat(e,"/test-steps/").concat(t,"/attachments"),{method:"POST",body:r}).then(async e=>{let t=await e.json();return{success:e.ok,data:e.ok?t:void 0,error:e.ok?void 0:t.error||"Failed to upload attachment"}}).catch(e=>({success:!1,data:void 0,error:e.message||"Failed to upload attachment"}))},deleteStepAttachment:async(e,t,o)=>a("/test-runs/".concat(e,"/test-steps/").concat(t,"/attachments?attachmentId=").concat(o),{method:"DELETE"}),uploadAttachment:async(e,t,o)=>{let r=new FormData;return r.append("file",o),fetch("/api/test-runs/".concat(e,"/test-cases/").concat(t,"/attachments"),{method:"POST",body:r}).then(async e=>{let t=await e.json();return{success:e.ok,data:e.ok?t:void 0,error:e.ok?void 0:t.error||"Failed to upload attachment"}}).catch(e=>({success:!1,data:void 0,error:e.message||"Failed to upload attachment"}))},deleteAttachment:async(e,t,o)=>a("/test-runs/".concat(e,"/test-cases/").concat(t,"/attachments?attachmentId=").concat(o),{method:"DELETE"}),delete:async e=>a("/test-runs/".concat(e),{method:"DELETE"}),compareRuns:async e=>a("/test-runs/compare",{method:"POST",body:JSON.stringify({runIds:e})}),createParallelSession:async e=>a("/test-runs/parallel",{method:"POST",body:JSON.stringify(e)}),getParallelSessionStatus:async e=>a("/test-runs/parallel?sessionId=".concat(e)),addParallelResults:async(e,t)=>a("/test-runs/parallel/".concat(e,"/results"),{method:"POST",body:JSON.stringify(t)}),submitTestRunResults:async(e,t,o,r)=>a("/test-runs/".concat(e,"/results?projectId=").concat(t),{method:"POST",body:JSON.stringify({results:o,executionSource:r||"automated"})}),assignTestRun:async(e,t,o)=>a("/test-runs/".concat(e,"/assign"),{method:"POST",body:JSON.stringify({assigneeId:t,assigneeName:o})}),getComments:async e=>a("/test-runs/".concat(e,"/comments")),addComment:async(e,t,o,r)=>a("/test-runs/".concat(e,"/comments"),{method:"POST",body:JSON.stringify({content:t,authorId:o,authorName:r})}),deleteComment:async(e,t)=>a("/test-runs/comments/".concat(e,"?testRunId=").concat(encodeURIComponent(t)),{method:"DELETE"}),updateExecution:async(e,t)=>a("/test-runs/".concat(e,"/execution"),{method:"PUT",body:JSON.stringify(t)}),getRunStatusSummary:async(e,t,o)=>{try{console.log("Getting test run status summary for project ".concat(e,", run ").concat(t));let a=new URLSearchParams;a.append("organizationId",o);let n=await fetch("".concat(r,"/projects/").concat(e,"/test-runs/").concat(t,"/status?").concat(a.toString()));if(!n.ok){let e=await n.json();return{success:!1,error:e.error||"Failed to get run status summary"}}let s=await n.json();return{success:!0,data:s}}catch(e){return console.error("Error getting test run status summary:",e),{success:!1,error:e instanceof Error?e.message:"Error getting test run status summary"}}}},d={getTestRun:async e=>{let t=await c.getById(e);if(!t.success||!t.data)throw Error(t.error||"Failed to fetch test run");return t.data},getTestRuns:async function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=await c.getAll(t);if(!o.success)throw Error(o.error||"Failed to fetch test runs");return{data:o.data,total:(null==(e=o.data)?void 0:e.length)||0}},getTestRunStats:async e=>({passed:0,failed:0,pending:0,total:0}),updateTestCaseStatus:async(e,t,o)=>{let r=await c.updateTestCaseStatus(e,t,o);if(!r.success)throw Error(r.error||"Failed to update test case status")},updateTestStepStatus:async(e,t,o,r)=>{console.log("Updating test step status: ".concat(e,", ").concat(t,", ").concat(o,", ").concat(r))},getProjectById:async e=>{let t=await fetch("/api/projects/".concat(e));if(!t.ok)throw Error("Failed to fetch project");return t.json()},assignTestRun:async(e,t,o)=>{let r=await c.assignTestRun(e,t,o);if(!r.success)throw Error(r.error||"Failed to assign test run")},getComments:async e=>{let t=await c.getComments(e);if(!t.success)throw Error(t.error||"Failed to fetch comments");return t.data||[]},addComment:async(e,t,o,r)=>{let a=await c.addComment(e,t,o,r);if(!a.success)throw Error(a.error||"Failed to add comment");return a.data},deleteComment:async(e,t)=>{let o=await c.deleteComment(e,t);if(!o.success)throw Error(o.error||"Failed to delete comment")},updateExecution:async(e,t)=>{let o=await c.updateExecution(e,t);if(!o.success)throw Error(o.error||"Failed to update execution")}},i={getAll:async e=>{let t=new URLSearchParams;if(null==e||!e.organizationId)return{success:!1,error:"Organization ID is required"};t.append("organizationId",e.organizationId),(null==e?void 0:e.configId)&&t.append("configId",e.configId),(null==e?void 0:e.status)&&t.append("status",e.status),(null==e?void 0:e.page)!==void 0&&t.append("page",e.page.toString()),(null==e?void 0:e.size)!==void 0&&t.append("size",e.size.toString()),(null==e?void 0:e.onlyWithProcessedItems)===!0&&t.append("onlyWithProcessedItems","true"),(null==e?void 0:e.status)&&t.append("status",e.status),(null==e?void 0:e.configId)&&t.append("configId",e.configId);let o=t.toString()?"?".concat(t.toString()):"";try{let e=await a("/test-generation/jobs".concat(o));if(e.success&&e.data){if(e.data.jobs&&Array.isArray(e.data.jobs))return console.log("API client: Resposta j\xe1 no formato esperado com ".concat(e.data.jobs.length," jobs")),e;if(Array.isArray(e.data))return console.log("API client: Resposta \xe9 um array com ".concat(e.data.length," jobs, formatando")),{success:!0,data:{jobs:e.data,pagination:{total:e.data.length}}};return{success:!0,data:{jobs:Array.isArray(e.data)?e.data:[e.data],pagination:{total:Array.isArray(e.data)?e.data.length:1}}}}return e}catch(e){return console.error("Error fetching jobs:",e),{success:!1,error:e instanceof Error?e.message:"Unknown error fetching jobs"}}},getById:async(e,t)=>{if(!e||!t)return{success:!1,error:"Job ID and Organization ID are required"};let o=new URLSearchParams;o.append("organizationId",t);try{let t=await a("/test-generation/jobs/".concat(e,"?").concat(o.toString()));if(t.success&&t.data){if(t.data.id&&t.data.status)return console.log("API client: getById - O job est\xe1 diretamente em data"),t;if(t.data.job&&t.data.job.id)return console.log("API client: getById - O job est\xe1 em data.job"),{success:!0,data:t.data.job};if(t.data.data&&t.data.data.id)return console.log("API client: getById - O job est\xe1 em data.data"),{success:!0,data:t.data.data}}return t}catch(t){return console.error("Error fetching job ".concat(e,":"),t),{success:!1,error:t instanceof Error?t.message:"Unknown error fetching job ".concat(e)}}},create:async e=>a("/test-generation/jobs",{method:"POST",body:JSON.stringify(e)}),cancel:async(e,t)=>{let o=new URLSearchParams;return o.append("organizationId",t),a("/test-generation/jobs/".concat(e,"?").concat(o.toString()),{method:"DELETE"})},getProcessedItems:async(e,t)=>{let o=new URLSearchParams;return o.append("organizationId",t),a("/organization/ai-test-generation/jobs/".concat(e,"/processed-items?").concat(o.toString()))},getWorkItemHistory:async(e,t,o)=>{let r=new URLSearchParams;return r.append("organizationId",t),(null==o?void 0:o.workItemId)&&r.append("workItemId",o.workItemId),(null==o?void 0:o.limit)&&r.append("limit",o.limit.toString()),(null==o?void 0:o.offset)&&r.append("offset",o.offset.toString()),a("/organization/ai-test-generation/jobs/".concat(e,"/work-item-history?").concat(r.toString()))},reprocessWorkItem:async(e,t)=>a("/organization/ai-test-generation/work-items/".concat(e,"/reprocess"),{method:"POST",body:JSON.stringify(t)})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.