PageSourceSearch

https://panel.whogohost.com/_nuxt/YGyC60h6.js

js whogohost.com collected 2026-09-25 19:40:09 UTC 9,927 bytes, 28 lines download raw bytes

1import{_ as le}from"./DzQMdnUJ.js";import{_ as oe}from"./rIwbi0pI.js";import{_ as ne}from"./CkRcqgUx.js";import{_ as re}from"./1QHu81DH.js";import{ba as ie,e as de,b as ue,cu as me,T as ce,o as pe,f as l,g as r,k as a,h as n,w as t,V as f,l as b,s as y,j as u,z as H,q as _,am as fe,B as _e,af as ye,n as s,t as i,m as k,p as M,F as P,D as E,X as g,L as $,M as m,aw as he}from"./Be4KCvjK.js";import{a as S,V as xe}from"./CuvcycVf.js";import{V as B,a as W,b as Y,c as j}from"./C6lwIKyV.js";import{V as q}from"./B4qPfXun.js";import"./ZLeBMBwv.js";import"./DY6hnFug.js";(function(){try{var h=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},v=new h.Error().stack;v&&(h._sentryDebugIds=h._sentryDebugIds||{},h._sentryDebugIds[v]="a39b3792-3e57-4f0d-a868-96493ef93338",h._sentryDebugIdIdentifier="sentry-dbid-a39b3792-3e57-4f0d-a868-96493ef93338")}catch{}})();const be={key:0},ge={class:"text-body-2"},ve={class:"text-body-2",style:{"white-space":"pre-wrap","word-break":"break-word"}},Te={key:0,"min-height":"320px",class:"text-center py-16 border-none"},we={class:"d-flex align-center ga-2"},Ve={class:"text-body-2 text-grey-darken-1"},ke={class:"text-body-2 font-weight-medium"},Pe={key:0,class:"mb-4 px-6 pt-4"},Ee={class:"text-body-2 text-medium-emphasis"},$e={key:1,class:"mx-n6 mt-n2 mb-n4"},Ie={class:"text-body-2 font-weight-medium"},Re={key:2,class:"text-body-2 text-medium-emphasis px-6 pt-4 pb-2"},Ae={key:0,"min-height":"320px",class:"text-center py-16 border-none"},De={class:"d-flex flex-column"},Ce={class:"text-subtitle-1 font-weight-medium text-capitalize"},Le={key:0,class:"text-body-2 text-medium-emphasis"},Ue={class:"mx-n6 mt-n2 mb-n4"},Fe={class:"text-body-2 font-weight-medium"},qe=ie({__name:"api-docs",setup(h){de({title:"Resellers - API Documentation"});const{$apiFetch:v}=ue(),N=me(),{clientInfo:G}=ce(N),x=$("information"),K=[{title:"Information",value:"information"},{title:"Calls",value:"calls"},{title:"Models",value:"models"}],I=$(null),T=$(!0),R=$(null),A=m(()=>T.value),X=m(()=>R.value),D=m(()=>I.value?.data),z=m(()=>D.value?.info||null),w=m(()=>z.value?.api_url||null),J=m(()=>z.value?.authentication||null),C=m(()=>D.value?.calls||[]),L=m(()=>D.value?.models||[]),Q=m(()=>G.value?.email||"Your login email"),Z=m(()=>{const d=w.value||"https://example.com/modules/addons/DomainsReseller/api/index.php",e=Q.value;return`<?php
2
3$endpoint  = "${d}";
4$action    = "/order/domains/renew";
5$params    = [
6    "domain"     => "example.com",
7    "regperiod"  => "3",
8    "addons"     => [
9        "dnsmanagement"     => 0,
10        "emailforwarding"   => 1,
11        "idprotection"      => 1,
12    ]
13];
14$headers = [
15    "username: ${e}",
16    "token: ". base64_encode(hash_hmac("sha256", "YOUR_API_KEY", "${e}:".gmdate("y-m-d H")))
17];
18
19$curl = curl_init();
20curl_setopt($curl, CURLOPT_URL, "{$endpoint}{$action}");
21curl_setopt($curl, CURLOPT_POST, true);
22curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
23curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
24curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
25curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
26
27$response = curl_exec($curl);
28curl_close($curl);`}),ee=d=>({GET:"primary-dark",POST:"secondary",PUT:"warning",PATCH:"warning",DELETE:"error"})[d?.toUpperCase()]||"grey",O=d=>d?Array.isArray(d)?d.join(", "):d:"",te=async()=>{const e=he("reseller-api-documentation");if(e.data.value?.lastFetched&&Date.now()-new Date(e.data.value.lastFetched).getTime()<3e5){I.value=e.data.value,T.value=!1;return}T.value=!0,R.value=null;try{const c=await v("/api/resellers/domain/api/documentation",{method:"GET"});if(c?.result==="success"){const V={...c,lastFetched:new Date};I.value=V,e.data.value=V}else throw new Error(c?.message||"Failed to fetch documentation")}catch(c){console.error("Failed to fetch API documentation:",c),R.value=c}finally{T.value=!1}};return pe(async()=>{await te()}),(d,e)=>{const c=le,V=oe,ae=ne,se=re;return l(),r("div",null,[a(c,{title:"API Documentation",subtitle:"View the API documentation for the reseller","show-divider":!1}),n(A)?(l(),r("div",be,[a(b,null,{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[a(V,{name:"loader",width:"400px"})]),_:1})]),_:1})])):y("",!0),n(A)?y("",!0):(l(),u(ae,{key:1,class:"mb-4",modelValue:n(x),"onUpdate:modelValue":e[0]||(e[0]=o=>H(x)?x.value=o:null),items:K},null,8,["modelValue"])),n(X)?(l(),u(fe,{key:2,type:"error",variant:"tonal",class:"mb-4"},{default:t(()=>[...e[2]||(e[2]=[_(" Failed to load API documentation data. Please try again. ",-1)])]),_:1})):n(A)?y("",!0):(l(),u(xe,{key:3,modelValue:n(x),"onUpdate:modelValue":e[1]||(e[1]=o=>H(x)?x.value=o:null),direction:"horizontal"},{default:t(()=>[a(S,{value:"information"},{default:t(()=>[a(b,null,{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[a(_e,null,{default:t(()=>[...e[3]||(e[3]=[_("Endpoint",-1)])]),_:1}),a(ye,{"model-value":n(w)||"N/A",readonly:"",color:"grey","bg-color":"grey-lighten-5"},{"append-inner":t(()=>[n(w)?(l(),u(se,{key:0,text:n(w),"copy-only":""},null,8,["text"])):y("",!0)]),_:1},8,["model-value"])]),_:1})]),_:1}),a(b,{class:"mt-4"},{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[...e[4]||(e[4]=[s("h2",{class:"text-h6 font-weight-medium text-medium-emphasis"},"Authorization",-1)])]),_:1}),a(f,{cols:"12"},{default:t(()=>[e[5]||(e[5]=s("p",{class:"mb-2 text-body-2 font-weight-medium"},"Username",-1)),s("p",ge,i(n(J)?.description||"This is an email address of the reseller's client registered in your WHMCS."),1)]),_:1}),a(f,{cols:"12"},{default:t(()=>[e[7]||(e[7]=s("p",{class:"mb-2 text-body-2 font-weight-medium"},"Token",-1)),e[8]||(e[8]=s("p",{class:"text-body-2 mb-2"},"Token is an API Key transformed into SHA256 hash using the reseller's email address and the current time encoded with base64.",-1)),a(k,{color:"grey-lighten-4",rounded:"lg",class:"pa-3"},{default:t(()=>[...e[6]||(e[6]=[s("code",{class:"text-error text-body-2"},'base64_encode(hash_hmac("sha256", "<api-key>", "<email>:<gmdate("y-m-d H")>"))',-1)])]),_:1})]),_:1})]),_:1}),a(b,{class:"mt-4"},{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[...e[9]||(e[9]=[s("h2",{class:"text-h6 font-weight-medium text-medium-emphasis"},"Example",-1)])]),_:1}),a(f,{cols:"12"},{default:t(()=>[a(k,{color:"grey-lighten-4",rounded:"lg",class:"pa-4"},{default:t(()=>[s("pre",ve,i(n(Z)),1)]),_:1})]),_:1})]),_:1})]),_:1}),a(S,{value:"calls"},{default:t(()=>[a(b,null,{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[a(k,{class:"border-thin rounded-lg"},{default:t(()=>[!n(C)||n(C).length===0?(l(),r("div",Te,[a(M,{size:"64",color:"grey-lighten-1"},{default:t(()=>[...e[10]||(e[10]=[_(" $apiIcon ",-1)])]),_:1}),e[11]||(e[11]=s("p",{class:"text-h6 mt-4"},"No API Calls Available",-1)),e[12]||(e[12]=s("p",{class:"text-body-2 text-medium-emphasis"},"API call documentation is not available.",-1))])):(l(),u(B,{key:1,variant:"accordion",multiple:""},{default:t(()=>[(l(!0),r(P,null,E(n(C),(o,U)=>(l(),u(W,{key:U},{default:t(()=>[a(Y,null,{default:t(()=>[s("div",we,[a(g,{color:ee(o.method),density:"compact",label:"",variant:"flat",style:{"min-width":"60px"},class:"mr-2 d-flex justify-center"},{default:t(()=>[_(i(o.method),1)]),_:2},1032,["color"]),s("span",Ve,i(o.path),1),s("span",ke,"- "+i(o.name),1)])]),_:2},1024),a(j,{class:"px-0 bg-grey-lighten-5 border-t-thin"},{default:t(()=>[o.description?(l(),r("div",Pe,[s("p",Ee,i(o.description),1)])):y("",!0),o.parameters&&o.parameters.length>0?(l(),r("div",$e,[a(q,{density:"comfortable",class:"bg-transparent"},{default:t(()=>[e[13]||(e[13]=s("thead",null,[s("tr",null,[s("th",{class:"text-left text-subtitle-2 text-medium-emphasis"},"Parameter"),s("th",{class:"text-left text-subtitle-2 text-medium-emphasis"},"Type & Validators")])],-1)),s("tbody",null,[(l(!0),r(P,null,E(o.parameters,(p,F)=>(l(),r("tr",{key:F},[s("td",Ie,i(p.name),1),s("td",null,[a(g,{size:"x-small",color:"grey-lighten-2",variant:"flat",class:"mr-1"},{default:t(()=>[_(" Type: "+i(p.type),1)]),_:2},1024),p.validators?(l(),u(g,{key:0,size:"x-small",color:"error",variant:"tonal"},{default:t(()=>[_(" Validators: "+i(O(p.validators)),1)]),_:2},1024)):y("",!0)])]))),128))])]),_:2},1024)])):(l(),r("div",Re," No parameters required. "))]),_:2},1024)]),_:2},1024))),128))]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1}),a(S,{value:"models"},{default:t(()=>[a(b,null,{default:t(()=>[a(f,{cols:"12"},{default:t(()=>[a(k,{class:"border-thin rounded-lg"},{default:t(()=>[!n(L)||n(L).length===0?(l(),r("div",Ae,[a(M,{size:"64",color:"grey-lighten-1"},{default:t(()=>[...e[14]||(e[14]=[_(" $apiIcon ",-1)])]),_:1}),e[15]||(e[15]=s("p",{class:"text-h6 mt-4"},"No Data Models Available",-1)),e[16]||(e[16]=s("p",{class:"text-body-2 text-medium-emphasis"},"Data model documentation is not available.",-1))])):(l(),u(B,{key:1,variant:"accordion",multiple:""},{default:t(()=>[(l(!0),r(P,null,E(n(L),(o,U)=>(l(),u(W,{key:U},{default:t(()=>[a(Y,null,{default:t(()=>[s("div",De,[s("span",Ce,i(o.name),1),o.description?(l(),r("span",Le,i(o.description),1)):y("",!0)])]),_:2},1024),a(j,{class:"px-0 bg-grey-lighten-5 border-t-thin"},{default:t(()=>[s("div",Ue,[a(q,{density:"comfortable",class:"bg-transparent"},{default:t(()=>[e[17]||(e[17]=s("thead",null,[s("tr",null,[s("th",{class:"text-left text-subtitle-2 text-medium-emphasis"},"Field"),s("th",{class:"text-left text-subtitle-2 text-medium-emphasis"},"Type & Validators")])],-1)),s("tbody",null,[(l(!0),r(P,null,E(o.properties,(p,F)=>(l(),r("tr",{key:F},[s("td",Fe,i(p.name),1),s("td",null,[a(g,{size:"x-small",color:"grey-lighten-2",variant:"flat",class:"mr-1"},{default:t(()=>[_(" Type: "+i(p.type),1)]),_:2},1024),p.validators?(l(),u(g,{key:0,size:"x-small",color:"error",variant:"tonal"},{default:t(()=>[_(" Validators: "+i(O(p.validators)),1)]),_:2},1024)):y("",!0)])]))),128))])]),_:2},1024)])]),_:2},1024)]),_:2},1024))),128))]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))])}}});
28export{qe as default};

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.