PageSourceSearch

https://go.chatway.app/assets/DeveloperTools-CuhrO5y4.js

js chatway.app collected 2026-10-02 02:32:07 UTC 14,233 bytes, 2 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`release-202609300849`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`94dd50df-6381-4cb6-9fed-4aea9a95dd0a`,e._sentryDebugIdIdentifier=`sentry-dbid-94dd50df-6381-4cb6-9fed-4aea9a95dd0a`)}catch{}})();import{a as e}from"./rolldown-runtime-BT3GMMfx.js";import{A as t,Et as n,F as r,H as i,I as a,It as o,M as s,Mt as c,Nt as l,O as u,Ot as d,P as f,Q as p,R as m,Z as h,et as g,ht as _,it as v,j as y,k as b,nt as x,ot as S,w as C}from"./vendor-vue-core-DI5wj9bP.js";import{Ct as w,v as T}from"./utils-CL0hl12X.js";import{l as E,t as D}from"./user-TQfZ8_Hw.js";import{o as O}from"./vendor-utils-DEw0FKGV.js";import{t as k}from"./toast-Bw7mV9qC.js";import{r as A}from"./dist-D9TmNvWT.js";import{t as j}from"./Tooltip-DWtxWN0K.js";import{a as M,n as N,p as P,u as F}from"./vendor-forms-HWkCcuzf.js";import{t as I}from"./UpgradeNowButton-CVb1pthK.js";import{t as L}from"./Modal-BHVYbZnp.js";import{t as R}from"./InputField-Cx_fmgAZ.js";import{t as z}from"./SettingsHeader-BkxFn0AK.js";var B=e(O()),V={class:`p-4`},ee={key:0,class:`grid gap-y-6 mt-6`},H={class:`relative`},U=m({__name:`GenerateApiKeyModal`,props:{showModal:{type:Boolean,default:!1}},emits:[`hideModal`,`append`,`update`],setup(e,{emit:o}){let l=new E,f=i(`apiKeyState`),m=d(!1),h=d(!1),v=d(!1),x=d(``),C=d(``),T=o,D=e,O=n({apiName:``}),A=P({apiName:{required:N.withMessage(`API Name is required`,F),maxLength:M(255),isUnique:N.withMessage(`API Name already exists`,e=>!e||!f?.state?.apiKeys?!0:!f.state.apiKeys.some(t=>t.attributes.name.trim().toLowerCase()===e.trim().toLowerCase()))}},O),j=u(()=>v.value?`Okay, Got it`:m.value?`Processing`:`Generate`),I=u(()=>v.value?!1:A.value.$error),z=u(()=>v.value?``:`Cancel`),B=()=>{T(`hideModal`),setTimeout(()=>{A.value.$reset(),O.apiName=``,U()},200)},U=()=>{v.value=!1,x.value=``,C.value=``,W&&=(clearTimeout(W),null)},W=null,G=async()=>{try{await navigator.clipboard.writeText(x.value),k().set({message:`Copied to clipboard`,type:`success`})}catch(e){console.error(`Failed to copy`,e)}},K=async()=>{if(C.value){h.value=!0;try{let e=await l.revokeApiKey(C.value);k().set({message:e.message,type:`success`}),T(`update`,e.data),B()}catch(e){w(e)}finally{h.value=!1}}},q=()=>{v.value?K():B()},J=()=>{v.value?B():Y()},Y=async()=>{if(A.value.$touch(),!A.value.$invalid){m.value=!0;try{let e=await l.createApiKey({name:O.apiName});x.value=e.data.attributes.secret||``,C.value=e.data.id,v.value=!0,k().set({message:e.message,type:`success`}),T(`append`,e.data),W=setTimeout(()=>{v.value&&B()},6e4)}catch(e){w(e)}finally{m.value=!1}}};return p(()=>{U()}),(e,n)=>{let i=S(`CwIcon`);return D.showModal?(g(),t(L,{key:0,closeModal:!0,"header-title":`Generate API Key`,actionButtonTypeOneText:z.value,isLoading:m.value,isLoadingTypeOneButton:h.value,actionButtonTypeTwoText:j.value,disableButtonTwo:I.value,backdropClickClose:!1,onActionButtonTypeOne:q,onActionButtonTypeTwo:J,onCloseModal:B},{default:_(()=>[b(`div`,V,[a(R,{label:`API Name`,type:`text`,forValue:`apiName`,placeholder:`Type here...`,value:c(A).apiName.$model,hasError:!v.value&&c(A).apiName.$error,validationMessage:v.value?[]:c(A).apiName.$errors,readonly:v.value,onInput:n[0]||=e=>c(A).apiName.$model=e,onBlur:n[1]||=e=>c(A).apiName.$touch()},null,8,[`value`,`hasError`,`validationMessage`,`readonly`]),v.value?(g(),s(`div`,ee,[b(`div`,H,[a(R,{label:`Security Key`,type:`text`,value:x.value,readonly:!0,classes:`!pr-10`,autocomplete:`off`},null,8,[`value`]),b(`button`,{class:`absolute top-[47px] w-[32px] h-[32px] right-2.5 -translate-y-1/2 p-1 rounded hover:bg-grey100 transition-colors`,onClick:G,title:`Copy to clipboard`,"aria-label":`Copy security key to clipboard`},[a(i,{name:`copy`,class:`w-5 h-5 text-grey600`,"aria-label":`copy`})])]),n[2]||=b(`div`,{class:`bg-[#FFF9E7] px-4 py-3 rounded-xl`},[b(`p`,{class:`text-base text-grey900 m-0 p-0`},[b(`span`,{class:`font-semibold`},`Attention:`),r(` Make a note of your security key as it is displayed only once `)])],-1)])):y(``,!0)])]),_:1},8,[`actionButtonTypeOneText`,`isLoading`,`isLoadingTypeOneButton`,`actionButtonTypeTwoText`,`disableButtonTwo`])):y(``,!0)}}}
1),W=m({__name:`RevokeApiKeyModal`,props:{showModal:{type:Boolean},apiKeyId:{}},emits:[`closeModal`,`update`],setup(e,{emit:n}){let r=e,i=n,a=new E,o=d(!1),s=()=>{i(`closeModal`)},c=async()=>{if(r.apiKeyId){o.value=!0;try{let e=await a.revokeApiKey(r.apiKeyId);k().set({message:e.message,type:`success`}),i(`update`,e.data),s()}catch(e){w(e)}finally{o.value=!1}}};return(e,n)=>e.showModal?(g(),t(L,{key:0,closeModal:e.showModal,headerTitle:`Revoke Access`,actionButtonTypeOneText:`Cancel`,actionButtonTypeTwoText:`Revoke`,onCloseModal:s,onActionButtonTypeOne:s,onActionButtonTypeTwo:c,isLoading:o.value},{default:_(()=>n[0]||=[b(`div`,{class:`px-6 py-4`},[b(`p`,{class:`m-0 text-grey900 text-base leading-normal`},` Do you want to revoke access to this API key? This action cannot be undone. `)],-1)]),_:1},8,[`closeModal`,`isLoading`])):y(``,!0)}}),G=[`src`],K={key:0},q={class:`p-4 w-76 bg-white rounded-lg shadow-lg`},J={href:`https://developers.chatway.app`,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-x-2 px-3 py-1.5 text-sm rounded-sm text-grey900 bg-grey100`},Y={key:1,class:`pt-10`},X={key:0,class:`hidden lg:grid lg:grid-cols-[120px_120px_90px_120px_90px_70px_1fr] xl:grid-cols-[140px_160px_90px_140px_90px_80px_1fr] gap-x-2 pb-4`},Z={key:1,class:`animate-pulse grid gap-y-3`},Q={key:2,class:`grid gap-4 lg:gap-0 sm:grid-cols-2 lg:block`},te={class:`w-fit`},ne={class:`text-sm text-grey900 font-semibold lg:font-normal pt-3 px-3 lg:pt-0 lg:px-0 inline-block max-w-50 lg:max-w-32.5 truncate!`},re={class:`p-2 text-sm max-w-2xs break-all`},ie={class:`text-sm text-grey900 border-b block border-b-grey200 border-solid mb-3 pb-3 lg:p-0 lg:m-0 lg:border-0 px-3 lg:px-0 truncate lg:max-w-30 xl:max-w-none`},ae={class:`inline-flex gap-x-1 items-center px-3 lg:px-0 text-sm text-grey900`},oe={class:`gap-1 inline-flex lg:hidden`},se={class:`inline-flex gap-x-1 items-center px-3 lg:px-0 text-sm text-grey900 my-2 lg:my-0 [&_.v-popper]:flex`},ce={class:`gap-1 inline-flex lg:hidden`},le={class:`truncate inline-block max-w-47.5 lg:max-w-32.5`},ue={class:`p-2 text-sm max-w-2xs break-all`},de={class:`inline-flex gap-x-1 items-center px-3 pb-3 lg:px-0 lg:pb-0 text-sm text-grey900`},fe={class:`gap-1 inline-flex lg:hidden`},pe={class:`absolute top-3 right-3 lg:static w-fit`},$={key:0,class:`border-t border-solid border-t-grey200 lg:border-none`},me=[`onClick`],he={key:3,class:`mt-4 flex justify-center lg:justify-start`},ge=m({__name:`ApiKeys`,setup(e){let t=D(),n=u(()=>t.isProUserOrTrial),p=i(`apiKeyState`),m=d(!1),h=d(!1),x=d(``),w=d(!1),E=u(()=>[...p?.state?.apiKeys||[]].sort((e,t)=>e.attributes.is_revoked===t.attributes.is_revoked?0:e.attributes.is_revoked?1:-1)),O=u(()=>e=>e.attributes.is_revoked?e.attributes.revoked_by.attributes.name:e.attributes.created_by.attributes.name),k=u(()=>w.value?E.value:E.value.slice(0,5)),A=u(()=>p?.state.isFetching),M=()=>{n.value&&(m.value=!0)},N=()=>{m.value=!1},P=e=>{x.value=e,h.value=!0},F=()=>{h.value=!1,x.value=``},L=e=>{p?.addApiKey(e)},R=e=>{p?.updateApiKey(e)};return(e,t)=>{let i=S(`CwIcon`);return g(),s(C,null,[A.value?y(``,!0):(g(),s(`div`,{key:0,class:l({"flex justify-center items-center min-h-[60vh]":!E.value.length})},[b(`div`,{class:l({"flex flex-col items-center gap-6 mx-4 text-center":!E.value.length})},[E.value.length?y(``,!0):(g(),s(`img`,{key:0,src:`${c(T)}images/dev-tools-empty-state.png`,class:`sm:max-w-87.5`,alt:`developer tools`},null,8,G)),b(`div`,null,[b(`p`,{class:l([`mb-4 mt-0`,{"sm:max-w-174":!E.value.length}])},[t[2]||=r(` Manage your API keys securely. Create, review, or revoke access for third-party integrations. `),E.value.length?y(``,!0):(g(),s(`span`,K,t[1]||=[b(`br`,null,null,-1)])),t[3]||=r(` Refer to the API Documentation for usage details and best practices. `)],2),b(`div`,{class:l([`flex flex-col lg:flex-row lg:items-center gap-3 items-start`,{"justify-center items-center!":!E.value.length}])},[a(j,{triggers:[`click`],placement:`bottom`,disabled:n.value},{content:_(()=>[b(`div`,q,[t[4]||=b(`p`,{class:`text-xs text-grey900 leading-5 mx-0 mt-0 mb-3 p-0`},` Extend Chatway’s functionality by integrating it with other tools using our APIs. To access the APIs, generate a security ke
1y that is available on Solo, Team, and Plus plans. `,-1),a(I,{text:`Upgrade`,class:`w-full!`})])]),default:_(()=>[b(`button`,{class:`inline-flex items-center gap-x-2 px-3 py-1.5 text-sm rounded-sm text-white bg-grey900`,onClick:M},`Generate API Key`)]),_:1},8,[`disabled`]),b(`a`,J,[t[5]||=r(` View API Documentation `),a(i,{name:`external-link`,class:`text-grey600`,"aria-label":`open external link`})])],2)])],2)],2)),n.value?(g(),s(`div`,Y,[!c(p)?.state.isFetching&&c(p)?.state.apiKeys.length>0?(g(),s(`div`,X,t[6]||=[f(`<p class="m-0 p-0 text-sm text-grey900 font-semibold">API Name</p><p class="m-0 p-0 text-sm text-grey900 font-semibold">Security Key</p><p class="m-0 p-0 text-sm text-grey900 font-semibold">Created</p><p class="m-0 p-0 text-sm text-grey900 font-semibold">User Name</p><p class="m-0 p-0 text-sm text-grey900 font-semibold">Last Used</p><p class="m-0 p-0 text-sm text-grey900 font-semibold">Status</p>`,6)])):y(``,!0),c(p)?.state.isFetching?(g(),s(`div`,Z,[(g(),s(C,null,v(4,e=>b(`div`,{key:e,class:`items-center border-b border-solid border-b-grey100`},t[7]||=[b(`div`,{class:`h-8 bg-grey200 rounded`},null,-1)])),64))])):(g(),s(`div`,Q,[(g(!0),s(C,null,v(k.value,e=>(g(),s(`div`,{key:e.id,class:`rounded-lg lg:rounded-none flex flex-col items-stretch lg:grid lg:grid-cols-[120px_120px_90px_120px_90px_70px_1fr] xl:grid-cols-[140px_160px_90px_140px_90px_80px_1fr] lg:h-14 lg:items-center border lg:border-x-0 lg:-mb-px border-solid border-grey200 lg:border-t-grey200 gap-x-2 relative`},[b(`div`,te,[a(j,{triggers:[`hover`],placement:`top`},{content:_(()=>[b(`div`,re,o(e.attributes.name),1)]),default:_(()=>[b(`span`,ne,o(e.attributes.name),1)]),_:2},1024)]),b(`span`,ie,o(e.attributes.secret_preview),1),b(`div`,ae,[b(`span`,oe,[a(i,{name:`calendar`,class:`text-grey600 w-4 h-4`,"aria-label":`calendar`}),t[8]||=r(` Created: `)]),r(` `+o(c(B.default)(e.attributes.created_at).format(`DD/MM/YYYY`)),1)]),b(`div`,se,[b(`span`,ce,[a(i,{name:`user`,class:`text-grey600 w-4 h-4`,"aria-label":`user`}),t[9]||=r(` User: `)]),a(j,{triggers:[`hover`],placement:`top`},{content:_(()=>[b(`div`,ue,o(O.value(e)),1)]),default:_(()=>[b(`span`,le,o(O.value(e)),1)]),_:2},1024)]),b(`div`,de,[b(`span`,fe,[a(i,{name:`clock`,class:`text-grey600 w-4 h-4`,"aria-label":`clock`}),t[10]||=r(` Last used: `)]),r(` `+o(e.attributes.last_used_at?c(B.default)(e.attributes.last_used_at).format(`DD/MM/YYYY`):`Never Used`),1)]),b(`div`,pe,[b(`span`,{class:l([`uppercase text-[10px] text-grey900 px-3 py-1.5 lg:border lg:border-solid lg:border-grey200 rounded-sm font-semibold inline-flex items-center gap-x-1`,{"bg-negative100/10 lg:bg-transparent":e.attributes.is_revoked,"bg-positive200/10 lg:bg-transparent":!e.attributes.is_revoked}])},[b(`span`,{class:l([`w-2 h-2 rounded-full`,{"bg-negative100":e.attributes.is_revoked,"bg-positive200":!e.attributes.is_revoked}])},null,2),r(` `+o(e.attributes.is_revoked?`REVOKED`:`ACTIVE`),1)],2)]),e.attributes.is_revoked?y(``,!0):(g(),s(`div`,$,[b(`button`,{class:`py-2 px-2.5 lg:px-3 lg:border lg:border-solid lg:border-grey200 lg:rounded-lg inline-flex items-center gap-x-1.5 text-negative100 lg:text-grey900 text-sm h-auto group hover:border-negative100 hover:text-negative100 transition-colors duration-300 w-full lg:w-auto justify-center bg-grey100 lg:bg-white rounded-b-lg`,onClick:t=>P(e.id)},[a(i,{name:`minus-circle`,class:`text-negative100 lg:text-grey600 w-4 h-4 lg:w-4.75 lg:h-4.75 group-hover:text-negative100`,"aria-label":`delete api key`}),t[11]||=r(` Revoke `)],8,me)]))]))),128))])),E.value.length>5&&!w.value?(g(),s(`div`,he,[b(`button`,{class:`inline-flex items-center justify-center px-4 py-2 w-full lg:w-auto text-sm rounded-sm text-grey900 bg-grey100 hover:bg-grey200 transition-colors`,onClick:t[0]||=e=>w.value=!0},` View all `)])):y(``,!0)])):y(``,!0),a(U,{showModal:m.value,onHideModal:N,onAppend:L,onUpdate:R},null,8,[`showModal`]),a(W,{showModal:h.value,apiKeyId:x.value,onCloseModal:F,onUpdate:R},null,8,[`showModal`,`apiKeyId`])],64)}}}),_e={class:`bg-white w-full lg:rounded-tr-xl flex flex-col h-full`},ve={class:`grow overflow-auto pb-14`},ye={class:`max-w-5xl py-6 px-4 md:p-6 mx-auto`},be={key:0,class:`rounded-b-lg px-6 min-h-fit mt-auto`},xe={class:`bg-[#FEFAEC] px-6 py-4 text-sm text-grey900 text-center`},Se=m({__name:`DeveloperTools`,setup(e){A({title:`Developer Tools`});let t=new E,i=D(),o=n({apiKeys:[],isFetching:!1}),l=async()=>{o.isFetching=!0;try{o.apiKeys=(await t.getApiList()).data}catch(e){console.error(e)}finally{o.isFetching=!1}};return x(`apiKeyState`,{state:o,addApiKey:e=>{o.apiKeys.unshift(e)},updateApiKey:e=>
1{let t=o.apiKeys.findIndex(t=>t.id===e.id);t!==-1&&(o.apiKeys[t]=e)}}),h(()=>{l()}),(e,t)=>{let n=S(`CwIcon`),o=S(`router-link`);return g(),s(`div`,_e,[a(z,{title:`Developer Tools`},{extraHeaderContent:_(()=>[a(o,{to:{name:`settings-code-view`},target:`_blank`,class:`inline-flex items-center gap-x-2 px-3 py-1.5 text-sm rounded-sm text-grey900 bg-grey100`},{default:_(()=>[t[0]||=r(` Install Chatway `),a(n,{name:`external-link`,class:`text-grey600`,"aria-label":`open external link`})]),_:1})]),_:1}),b(`div`,ve,[b(`div`,ye,[a(ge)])]),c(i).showProMessage?(g(),s(`div`,be,[t[7]||=b(`div`,{class:`bg-gradient h-0.75`},null,-1),b(`div`,xe,[t[2]||=b(`strong`,null,`Please note:`,-1),t[3]||=r(` API is a Premium feature. After the trial period ends it will no longer be `),t[4]||=b(`br`,null,null,-1),t[5]||=r(` available for you, `),a(o,{class:`text-sm underline focus-visible:outline-0 focus-visible:text-primaryDark`,to:`/plans`},{default:_(()=>t[1]||=[r(`Upgrade now`)]),_:1}),t[6]||=r(` to continue using this feature. `)])])):y(``,!0)])}}});export{Se as default};
2//# sourceMappingURL=DeveloperTools-CuhrO5y4.js.map

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.