PageSourceSearch

https://teamroom.ai/assets/projects.hooks-CttLl0mO.js

js teamroom.ai collected 2026-10-05 13:47:49 UTC 4,539 bytes, 1 lines download raw bytes

1import{d as e}from"./dist-CHUVrWTQ.js";import{a as t,t as n}from"./es-DsBNjVxz.js";import{a as r,c as i,n as a,r as o,s}from"./utils-BgZLUUGp.js";import{d as c,s as l,t as u}from"./client-CRCMCNb9.js";import{S as d}from"./utils-Bkkdctm-.js";var f=new class{getBasePath(e){return`organizations/${e}/projects`}async getProjects(e){return u.extend({headers:l({correlationIdProps:{action:`get_all`,resource:`projects`}})}).get(this.getBasePath(e)).json()}async getProject(e,t){return u.extend({headers:l({correlationIdProps:{action:`get_one`,resource:`projects`,id:t}})}).get(`${this.getBasePath(e)}/${t}`).json()}async createProject(e,t){return u.extend({headers:l({correlationIdProps:{action:`create`,resource:`projects`}})}).post(this.getBasePath(e),{json:t}).json()}async validateAlias(e,t){return u.extend({headers:l({correlationIdProps:{action:`validate_alias`,resource:`projects`}})}).get(`${this.getBasePath(e)}/validate-alias`,{searchParams:{alias:t},retry:{limit:0}}).json()}async getSuggestedAlias(e,t){return u.extend({headers:l({correlationIdProps:{action:`suggested_alias`,resource:`projects`}})}).get(`${this.getBasePath(e)}/suggested-alias`,{searchParams:{name:t},retry:{limit:0}}).json()}async updateProject(e,t,n){return u.extend({headers:l({correlationIdProps:{action:`update`,resource:`projects`,id:t}})}).patch(`${this.getBasePath(e)}/${t}`,{json:n}).json()}async archiveProject(e,t){return u.extend({headers:l({correlationIdProps:{action:`delete`,resource:`projects`,id:t}})}).delete(`${this.getBasePath(e)}/${t}`).json()}async getArchivedProjects(e){return u.extend({headers:l({correlationIdProps:{action:`archived`,resource:`projects`,id:e}})}).get(`${this.getBasePath(e)}/archived`).json()}async getProjectSession(e,t){return u.extend({headers:l({correlationIdProps:{action:`get_project_session`,resource:`projects`,id:e}})}).get(`${this.getBasePath(e)}/${t}/session`,{retry:{limit:0}}).json()}async updateProjectSession({orgId:e,projectId:t,data:n}){return u.extend({headers:l({correlationIdProps:{action:`update_project_session`,resource:`projects`,id:e}})}).put(`${this.getBasePath(e)}/${t}/session`,{json:n}).json()}async getProjectJob(e,t,n){return u.extend({headers:l({correlationIdProps:{action:`get_project_job`,resource:`projects`,id:n}})}).get(`${this.getBasePath(e)}/${t}/jobs/${n}`).json()}async getProjectCredits(e,t,n){return u.extend({headers:l({correlationIdProps:{action:`get_credits`,resource:`projects`,id:t}})}).get(`${this.getBasePath(e)}/${t}/credits`,{...n?{searchParams:{resourceType:n}}:{}}).json()}},p=function(e){return e.PENDING=`PENDING`,e.COMPLETED=`COMPLETED`,e.CANCELLED=`CANCELLED`,e.ACTIVE=`ACTIVE`,e.INACTIVE=`INACTIVE`,e}({}),m=()=>{let e=d();return n({queryKey:[r,`projects`,e],queryFn:()=>f.getProjects(e),enabled:!!e})},h=()=>{let e=d();return n({queryKey:[r,`archived_projects`,e],queryFn:()=>f.getArchivedProjects(e),enabled:!!e})},g=()=>{let e=d();return c({mutationFn:t=>f.archiveProject(e,t),onSuccess:()=>{i.invalidateQueries([r,`projects`,e]),i.invalidateQueries([r,`archived_projects`,e])}})},_=()=>{let n=d(),{projectId:i}=e(),a=t();return c({mutationFn:e=>f.updateProject(n,i,e),onSuccess:()=>{a.invalidateQueries([r,`projects`,n]),a.invalidateQueries([r,`project`,n,i])}})},v=()=>c(({orgId:e,projectId:t})=>i.fetchQuery({queryKey:[r,`project`,e,t],queryFn:()=>f.getProject(e,t)})),y=(e,t=!0)=>{let{orgId:i,projectId:a}=s(),o=e||a||``,c=i||``;return n({queryKey:[r,`project`,i,o],queryFn:()=>f.getProject(c,o),enabled:!!i&&!!o&&t})},b=e=>{let{orgId:t=``,projectId:r=``}=s();return n({queryKey:a(t,r),queryFn:async()=>{try{return await f.getProjectSession(t,r)}catch(e){if(e?.data?.error?.code===`NotFoundException`)return null;throw e}},retry:(e,t)=>t?.data?.error?.code!==`NotFoundException`&&e<2,...e,enabled:!!t&&!!r&&e?.enabled})},x=()=>{let{orgId:e=``,projectId:n=``}=s(),i=t();return c({mutationFn:t=>f.updateProjectSession({orgId:t.orgId||e,projectId:t.projectId||n,data:t.data}),onSuccess:()=>{i.invalidateQueries([r,`projects`,e])}})},S=e=>{let t=e?.orgIds||[],r=[...new Set(t.filter(Boolean))];return n({queryKey:o(r),queryFn:async()=>{let e=r.map(async e=>(await f.getProjects(e)).map(t=>({...t,orgId:e})));return(await Promise.all(e)).flat()},enabled:r.length>0})},C=(e,t,i)=>{let{orgId:a,projectId:o}=s(),c=i||a||``,l=t||o||``;return n({queryKey:[r,`project_credits`,c,l,e],queryFn:()=>f.getProjectCredits(c,l,e),enabled:!!c&&!!l,staleTime:0,refetchOnMount:`always`})};export{y as a,S as c,p as d,f,b as i,_ as l,h as n,C as o,v as r,m as s,g as t,x as u};

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.