@great-detail/support-sdk 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var pe=Object.defineProperty;var le=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})};var Zt="https://api.support.greatdetail.com",te={"X-Powered-By":"GDSupport/JavaScript"},ge="api-key";var p=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"}).then(r=>new pt(r))}},pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as rt}from"zod";var c=class e{constructor(t){this._transport=t}static SCHEMA=rt.object({title:rt.string(),content:rt.string(),account:rt.string()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new ct(n))}},ct=class{constructor(t){this.response=t}async result(){return this.response.json()}};var d=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new dt(s))}},dt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var l=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...r,method:"GET"}).then(s=>new lt(s))}},lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplates",{...t,method:"GET"}).then(r=>new ut(r))}},ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as gt}from"zod";var g=class e{constructor(t){this._transport=t}static SCHEMA=gt.object({title:gt.string().optional(),content:gt.string().optional()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new mt(n))}},mt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as st}from"zod";var m=class e{constructor(t){this._transport=t}static SCHEMA=st.object({title:st.string(),description:st.string().optional(),account:st.string()});async send({body:t,request:r={}}){return this._transport.send("v1/boilerplate-categories",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(s=>new ht(s))}},ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new yt(s))}},yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var y=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"}).then(r=>new bt(r))}},bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as ft}from"zod";var b=class e{constructor(t){this._transport=t}static SCHEMA=ft.object({title:ft.string().optional(),description:ft.string().optional()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Rt(n))}},Rt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"}).then(r=>new xt(r))}},xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var we="SUPPORT_ACCESS_TOKEN",Fe="SUPPORT_API_KEY",Ie="SUPPORT_KEY_NAME",ee="SUPPORT_BASE_URL";var R=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:r={}}){let s=r.variant??"vcard",n=r.format??(r.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(s)+"&format="+encodeURIComponent(n)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};import{z as x}from"zod";var A=class e{constructor(t){this._transport=t}static SCHEMA=x.object({name:x.string(),account:x.string(),emailAddress:x.string().email().optional(),telephoneNumber:x.string().optional()});async send({body:t,request:r={}}){return this._transport.send("v1/contacts",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(s=>new At(s))}},At=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new Ct(s))}},Ct=class{constructor(t){this.response=t}async result(){return this.response.json()}};var T=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"}).then(r=>new Tt(r))}},Tt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...r,method:"GET"}).then(s=>new _t(s))}},_t=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as nt}from"zod";var P=class e{constructor(t){this._transport=t}static SCHEMA=nt.object({name:nt.string().optional(),emailAddress:nt.string().email().optional(),telephoneNumber:nt.string().optional()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Pt(n))}},Pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new St(s))}},St=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...r,method:"GET"}).then(s=>new Ot(s))}},Ot=class{constructor(t){this.response=t}async result(){return this.response.json()}};var E=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/conversations",{...t,method:"GET"}).then(r=>new Et(r))}},Et=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...r,method:"GET"}).then(s=>new vt(s))}},vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as re}from"zod";var w=class e{constructor(t){this._transport=t}static SCHEMA=re.object({hasEnded:re.boolean()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new wt(n))}},wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as ot}from"zod";var F=class e{constructor(t){this._transport=t}static SCHEMA=ot.object({title:ot.string(),description:ot.string().optional(),account:ot.string()});async send({body:t,request:r={}}){return this._transport.send("v1/labels",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(s=>new Ft(s))}},Ft=class{constructor(t){this.response=t}async result(){return this.response.json()}};var I=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"DELETE"}).then(s=>new It(s))}},It=class{constructor(t){this.response=t}async result(){return this.response.json()}};var q=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new qt(s))}},qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var U=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"}).then(r=>new Ut(r))}},Ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as jt}from"zod";var j=class e{constructor(t){this._transport=t}static SCHEMA=jt.object({title:jt.string().optional(),description:jt.string().optional()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Ht(n))}},Ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var H=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET"}).then(s=>new Lt(s))}},Lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var L=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"}).then(r=>new Mt(r))}},Mt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as it}from"zod";var M=class e{constructor(t){this._transport=t}static SCHEMA=it.object({input:it.string().max(65536),original:it.string().max(65536),correction:it.string().max(65536)});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Nt(n))}},Nt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var N=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new Gt(s))}},Gt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var G=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"}).then(r=>new zt(r))}},zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as at}from"zod";var z=class e{constructor(t){this._transport=t}static SCHEMA=at.array(at.object({role:at.enum(["user","assistant"]),content:at.string().max(65536).nullable()})).min(1);async send({id:t,body:r,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Bt(n))}},Bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as se}from"zod";var B=class e{constructor(t){this._transport=t}static SCHEMA=se.object({content:se.string()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Dt(n))}},Dt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as ne}from"zod";var D=class e{constructor(t){this._transport=t}static SCHEMA=ne.object({content:ne.string()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Jt(n))}},Jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var J=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new Vt(s))}},Vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var V=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"GET"}).then(s=>new kt(s))}},kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var k=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"GET"}).then(s=>new Kt(s))}},Kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as oe}from"zod";var K=class e{constructor(t){this._transport=t}static SCHEMA=oe.object({content:oe.string().optional()});async send({id:t,body:r,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(r))}).then(n=>new Yt(n))}},Yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Y=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=te;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var $=class{constructor(t){this._transport=t}async send({id:t,request:r={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...r,method:"GET"}).then(s=>new $t(s))}},$t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var W=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/sources",{...t,method:"GET"}).then(r=>new Wt(r))}},Wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};import ce from"is-network-error";import de from"ky";var o=class extends Error{};var i=class extends o{};var X=class extends i{static unauthenticated(){return new this("An unauthenticated request occurred")}};var Q=class extends i{static forbidden(){return new this("A forbidden request occurred")}};var a=class extends o{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,r){return new this(`Forbidden method for request: ${t} ${r}`)}};var Z=class extends o{};var tt=class extends o{static badRequest(){return new this("Bad request")}};var et=class{options;constructor({baseURL:t,...r}){this.options={...r,baseURL:t}}getURL(t){return new URL(t,this.options.baseURL).toString()}getRequest(t,r){r.headers=new Headers(r.headers);for(let s of this.options.requestFilterables){let n=s.getHeaders();for(let[ie,ae]of Object.entries(n))r.headers.set(ie,ae)}return new Request(this.getURL(t),r)}async send(t,r){return await de(this.getRequest(t,r)).then(s=>{if(!s.ok){let n=s.status;switch(console.error(JSON.stringify(s)),n){case 400:throw tt.badRequest();case 401:throw X.unauthenticated();case 403:throw Q.forbidden();case 404:throw a.notFound(t);case 405:throw a.forbiddenMethod(t,r.method??"GET")}}return s}).catch(s=>{throw ce(s)?new Z("A network error occurred",{cause:s}):s})}};var Xt=class e{static DEFAULT_BASE_URL=Zt;_transport;constructor(t,{baseURL:r,...s}={}){this._transport=new et({requestFilterables:[new Y,t],...s,baseURL:r?.toString()??e.getBaseURL()})}static getBaseURL(){return process.env[ee]??this.DEFAULT_BASE_URL}get action(){return{list:new p(this._transport)}}get boilerplate(){return{get:new d(this._transport),list:new u(this._transport),update:new g(this._transport)}}get boilerplateCategory(){return{get:new h(this._transport),list:new y(this._transport),create:new m(this._transport),update:new b(this._transport),boilerplate:{list:new l(this._transport),create:new c(this._transport)}}}get channel(){return{list:new f(this._transport)}}get contact(){return{get:new C(this._transport),list:new T(this._transport),update:new P(this._transport),create:new A(this._transport),conversation:{list:new O(this._transport)},note:{list:new V(this._transport),create:new B(this._transport)},vcf:{get:new R(this._transport)}}}get conversation(){return{get:new S(this._transport),list:new E(this._transport),update:new w(this._transport),message:{list:new H(this._transport)},note:{list:new k(this._transport),create:new D(this._transport)}}}get label(){return{create:new F(this._transport),get:new q(this._transport),list:new U(this._transport),update:new j(this._transport),delete:new I(this._transport),contact:{list:new _(this._transport)},conversation:{list:new v(this._transport)}}}get message(){return{list:new L(this._transport)}}get model(){return{get:new N(this._transport),list:new G(this._transport),response:{create:new z(this._transport)},correction:{create:new M(this._transport)}}}get note(){return{get:new J(this._transport),update:new K(this._transport)}}get source(){return{get:new $(this._transport),list:new W(this._transport)}}};var Qt=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};export{le as a,Zt as b,ge as c,we as d,Fe as e,Ie as f,o as g,i as h,X as i,Q as j,a as k,Z as l,tt as m,Xt as n,Qt as o};
@@ -1 +1 @@
1
- import{n as y,o as F}from"./chunk-O5KZWMF7.js";import{Command as A}from"commander";import{Command as b}from"commander";import{oraPromise as I}from"ora";function m({client:n,ora:s}){let o=new b("actions").description("Actions");return o.addCommand(new b("list").description("List actions").action(async()=>{let t=await I(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as v}from"commander";import{oraPromise as S}from"ora";function r({client:n,ora:s}){let o=new v("channels").description("Channels");return o.addCommand(new v("list").description("List channels").action(async()=>{let t=await S(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as d}from"commander";import{oraPromise as L}from"ora";function c({client:n,ora:s}){let o=new d("contacts").description("Contacts");return o.addCommand(new d("get").description("Find contact").argument("<contact>","Contact ID").action(async t=>{let e=await L(()=>n.contact.get.send({id:t}),{...s,text:"Finding contact"});console.log(await e.result())})),o.addCommand(new d("list").description("List contacts").action(async()=>{let t=await L(()=>n.contact.list.send(),{...s,text:"Finding contacts"});console.log(await t.result())})),o}import{Command as p}from"commander";import{oraPromise as P}from"ora";function l({client:n,ora:s}){let o=new p("conversations").description("Conversations");return o.addCommand(new p("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async t=>{let e=await P(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await e.result())})),o.addCommand(new p("list").description("List conversations").action(async()=>{let t=await P(()=>n.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await t.result())})),o}import{Command as a}from"commander";import{oraPromise as u}from"ora";function f({client:n,ora:s}){let o=new a("labels").description("Labels");return o.addCommand(new a("get").description("Find label").argument("<label>","Label ID").action(async t=>{let e=await u(()=>n.label.get.send({id:t}),{...s,text:"Finding label"});console.log(await e.result())})),o.addCommand(new a("list").description("List labels").action(async()=>{let t=await u(()=>n.label.list.send(),{...s,text:"Finding labels"});console.log(await t.result())})),o.addCommand(new a("conversations").description("Find label conversations").argument("<label>","Label ID").action(async t=>{let e=await u(()=>n.label.conversation.list.send({id:t}),{...s,text:"Finding conversations"});console.log(await e.result())})),o}import{Command as h}from"commander";import{oraPromise as M}from"ora";function C({client:n,ora:s}){let o=new h("messages").description("Messages");return o.addCommand(new h("list").description("List messages").action(async()=>{let t=await M(()=>n.message.list.send(),{...s,text:"Finding messages"});console.log(await t.result())})),o}import{Command as g}from"commander";import{oraPromise as j}from"ora";function w({client:n,ora:s}){let o=new g("models").description("Models");return o.addCommand(new g("get").description("Find model").argument("<model>","Model ID").action(async t=>{let e=await j(()=>n.model.get.send({id:t}),{...s,text:"Finding model"});console.log(await e.result())})),o.addCommand(new g("list").description("List models").action(async()=>{let t=await j(()=>n.model.list.send(),{...s,text:"Finding models"});console.log(await t.result())})),o}import{Command as O}from"commander";import{oraPromise as D}from"ora";function x({client:n,ora:s}){let o=new O("sources").description("Sources");return o.addCommand(new O("get").description("Find source").argument("<source>","Source ID").action(async t=>{let e=await D(()=>n.source.get.send({id:t}),{...s,text:"Finding source"});console.log(await e.result())})),o.addCommand(new O("list").description("List sources").action(async()=>{let t=await D(()=>n.source.list.send(),{...s,text:"Finding sources"});console.log(await t.result())})),o}var i={ora:{spinner:"simpleDotsScrolling"},client:new y(new F)},G=new A("gds").description("Great Detail Support System").addCommand(m(i)).addCommand(r(i)).addCommand(c(i)).addCommand(l(i)).addCommand(f(i)).addCommand(C(i)).addCommand(w(i)).addCommand(x(i)),go=G;export{go as a};
1
+ import{n as y,o as F}from"./chunk-P5VYQSL7.js";import{Command as A}from"commander";import{Command as b}from"commander";import{oraPromise as I}from"ora";function m({client:n,ora:s}){let o=new b("actions").description("Actions");return o.addCommand(new b("list").description("List actions").action(async()=>{let t=await I(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as v}from"commander";import{oraPromise as S}from"ora";function r({client:n,ora:s}){let o=new v("channels").description("Channels");return o.addCommand(new v("list").description("List channels").action(async()=>{let t=await S(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as d}from"commander";import{oraPromise as L}from"ora";function c({client:n,ora:s}){let o=new d("contacts").description("Contacts");return o.addCommand(new d("get").description("Find contact").argument("<contact>","Contact ID").action(async t=>{let e=await L(()=>n.contact.get.send({id:t}),{...s,text:"Finding contact"});console.log(await e.result())})),o.addCommand(new d("list").description("List contacts").action(async()=>{let t=await L(()=>n.contact.list.send(),{...s,text:"Finding contacts"});console.log(await t.result())})),o}import{Command as p}from"commander";import{oraPromise as P}from"ora";function l({client:n,ora:s}){let o=new p("conversations").description("Conversations");return o.addCommand(new p("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async t=>{let e=await P(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await e.result())})),o.addCommand(new p("list").description("List conversations").action(async()=>{let t=await P(()=>n.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await t.result())})),o}import{Command as a}from"commander";import{oraPromise as u}from"ora";function f({client:n,ora:s}){let o=new a("labels").description("Labels");return o.addCommand(new a("get").description("Find label").argument("<label>","Label ID").action(async t=>{let e=await u(()=>n.label.get.send({id:t}),{...s,text:"Finding label"});console.log(await e.result())})),o.addCommand(new a("list").description("List labels").action(async()=>{let t=await u(()=>n.label.list.send(),{...s,text:"Finding labels"});console.log(await t.result())})),o.addCommand(new a("conversations").description("Find label conversations").argument("<label>","Label ID").action(async t=>{let e=await u(()=>n.label.conversation.list.send({id:t}),{...s,text:"Finding conversations"});console.log(await e.result())})),o}import{Command as h}from"commander";import{oraPromise as M}from"ora";function C({client:n,ora:s}){let o=new h("messages").description("Messages");return o.addCommand(new h("list").description("List messages").action(async()=>{let t=await M(()=>n.message.list.send(),{...s,text:"Finding messages"});console.log(await t.result())})),o}import{Command as g}from"commander";import{oraPromise as j}from"ora";function w({client:n,ora:s}){let o=new g("models").description("Models");return o.addCommand(new g("get").description("Find model").argument("<model>","Model ID").action(async t=>{let e=await j(()=>n.model.get.send({id:t}),{...s,text:"Finding model"});console.log(await e.result())})),o.addCommand(new g("list").description("List models").action(async()=>{let t=await j(()=>n.model.list.send(),{...s,text:"Finding models"});console.log(await t.result())})),o}import{Command as O}from"commander";import{oraPromise as D}from"ora";function x({client:n,ora:s}){let o=new O("sources").description("Sources");return o.addCommand(new O("get").description("Find source").argument("<source>","Source ID").action(async t=>{let e=await D(()=>n.source.get.send({id:t}),{...s,text:"Finding source"});console.log(await e.result())})),o.addCommand(new O("list").description("List sources").action(async()=>{let t=await D(()=>n.source.list.send(),{...s,text:"Finding sources"});console.log(await t.result())})),o}var i={ora:{spinner:"simpleDotsScrolling"},client:new y(new F)},G=new A("gds").description("Great Detail Support System").addCommand(m(i)).addCommand(r(i)).addCommand(c(i)).addCommand(l(i)).addCommand(f(i)).addCommand(C(i)).addCommand(w(i)).addCommand(x(i)),go=G;export{go as a};
@@ -1 +1 @@
1
- "use strict";var He=Object.create;var lt=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var ze=(e,t)=>{for(var s in t)lt(e,s,{get:t[s],enumerable:!0})},we=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ne(t))!De.call(e,n)&&n!==s&&lt(e,n,{get:()=>t[n],enumerable:!(r=Me(t,n))||r.enumerable});return e};var Te=(e,t,s)=>(s=e!=null?He(Ge(e)):{},we(t||!e||!e.__esModule?lt(s,"default",{value:e,enumerable:!0}):s,e)),Be=e=>we(lt({},"__esModule",{value:!0}),e);var ke={};ze(ke,{default:()=>Ve});module.exports=Be(ke);var qe=require("commander");var d=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var l=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"}).then(s=>new Ct(s))}},Ct=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=require("zod"),m=class e{constructor(t){this._transport=t}static SCHEMA=u.z.object({title:u.z.string(),content:u.z.string(),account:u.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Rt(n))}},Rt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var g=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new At(r))}},At=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"GET"}).then(r=>new Ot(r))}},Ot=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplates",{...t,method:"GET"}).then(s=>new wt(s))}},wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ut=require("zod"),y=class e{constructor(t){this._transport=t}static SCHEMA=ut.z.object({title:ut.z.string().optional(),content:ut.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Tt(n))}},Tt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=require("zod"),x=class e{constructor(t){this._transport=t}static SCHEMA=b.z.object({title:b.z.string(),description:b.z.string().optional(),account:b.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/boilerplate-categories",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Pt(r))}},Pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new _t(r))}},_t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"}).then(s=>new St(s))}},St=class{constructor(t){this.response=t}async result(){return this.response.json()}};var mt=require("zod"),A=class e{constructor(t){this._transport=t}static SCHEMA=mt.z.object({title:mt.z.string().optional(),description:mt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new vt(n))}},vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"}).then(s=>new Et(s))}},Et=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Pe="SUPPORT_BASE_URL";var _e="https://api.support.greatdetail.com",Se={"X-Powered-By":"GDSupport/JavaScript"};var w=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:s={}}){let r=s.variant??"vcard",n=s.format??(s.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(r)+"&format="+encodeURIComponent(n)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var p=require("zod"),T=class e{constructor(t){this._transport=t}static SCHEMA=p.z.object({name:p.z.string(),account:p.z.string(),emailAddress:p.z.string().email().optional(),telephoneNumber:p.z.string().optional()});async send({body:t,request:s={}}){return this._transport.send("v1/contacts",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Ft(r))}},Ft=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new It(r))}},It=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"}).then(s=>new jt(s))}},jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...s,method:"GET"}).then(r=>new qt(r))}},qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=require("zod"),E=class e{constructor(t){this._transport=t}static SCHEMA=v.z.object({name:v.z.string().optional(),emailAddress:v.z.string().email().optional(),telephoneNumber:v.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Ut(n))}},Ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};var F=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Lt(r))}},Lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var I=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/conversations",{...t,method:"GET"}).then(s=>new Ht(s))}},Ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var j=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Mt(r))}},Mt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Nt=require("zod"),q=class e{constructor(t){this._transport=t}static SCHEMA=Nt.z.object({hasEnded:Nt.z.boolean()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Gt(n))}},Gt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var U=require("zod"),L=class e{constructor(t){this._transport=t}static SCHEMA=U.z.object({title:U.z.string(),description:U.z.string().optional(),account:U.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Dt(r))}},Dt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var H=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"DELETE"}).then(r=>new zt(r))}},zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var M=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Bt(r))}},Bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var N=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"}).then(s=>new Jt(s))}},Jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var gt=require("zod"),G=class e{constructor(t){this._transport=t}static SCHEMA=gt.z.object({title:gt.z.string().optional(),description:gt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Vt(n))}},Vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var D=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET"}).then(r=>new kt(r))}},kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var z=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"}).then(s=>new Kt(s))}},Kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var B=require("zod"),J=class e{constructor(t){this._transport=t}static SCHEMA=B.z.object({input:B.z.string().max(65536),original:B.z.string().max(65536),correction:B.z.string().max(65536)});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Yt(n))}},Yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var V=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new $t(r))}},$t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var k=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"}).then(s=>new Wt(s))}},Wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var K=require("zod"),Y=class e{constructor(t){this._transport=t}static SCHEMA=K.z.array(K.z.object({role:K.z.enum(["user","assistant"]),content:K.z.string().max(65536).nullable()})).min(1);async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Xt(n))}},Xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Qt=require("zod"),$=class e{constructor(t){this._transport=t}static SCHEMA=Qt.z.object({content:Qt.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Zt(n))}},Zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var te=require("zod"),W=class e{constructor(t){this._transport=t}static SCHEMA=te.z.object({content:te.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new ee(n))}},ee=class{constructor(t){this.response=t}async result(){return this.response.json()}};var X=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new se(r))}},se=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new re(r))}},re=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new ne(r))}},ne=class{constructor(t){this.response=t}async result(){return this.response.json()}};var oe=require("zod"),tt=class e{constructor(t){this._transport=t}static SCHEMA=oe.z.object({content:oe.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new ie(n))}},ie=class{constructor(t){this.response=t}async result(){return this.response.json()}};var et=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Se;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var st=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new ae(r))}},ae=class{constructor(t){this.response=t}async result(){return this.response.json()}};var rt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/sources",{...t,method:"GET"}).then(s=>new pe(s))}},pe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ve=Te(require("is-network-error"),1),Ee=Te(require("ky"),1);var o=class extends Error{};var a=class extends o{};var nt=class extends a{static unauthenticated(){return new this("An unauthenticated request occurred")}};var ot=class extends a{static forbidden(){return new this("A forbidden request occurred")}};var c=class extends o{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,s){return new this(`Forbidden method for request: ${t} ${s}`)}};var it=class extends o{};var at=class extends o{static badRequest(){return new this("Bad request")}};var pt=class{options;constructor({baseURL:t,...s}){this.options={...s,baseURL:t}}getURL(t){return new URL(t,this.options.baseURL).toString()}getRequest(t,s){s.headers=new Headers(s.headers);for(let r of this.options.requestFilterables){let n=r.getHeaders();for(let[Ue,Le]of Object.entries(n))s.headers.set(Ue,Le)}return new Request(this.getURL(t),s)}async send(t,s){return await(0,Ee.default)(this.getRequest(t,s)).then(r=>{if(!r.ok){let n=r.status;switch(console.error(JSON.stringify(r)),n){case 400:throw at.badRequest();case 401:throw nt.unauthenticated();case 403:throw ot.forbidden();case 404:throw c.notFound(t);case 405:throw c.forbiddenMethod(t,s.method??"GET")}}return r}).catch(r=>{throw(0,ve.default)(r)?new it("A network error occurred",{cause:r}):r})}};var ct=class e{static DEFAULT_BASE_URL=_e;_transport;constructor(t,{baseURL:s,...r}={}){this._transport=new pt({requestFilterables:[new et,t],...r,baseURL:s?.toString()??e.getBaseURL()})}static getBaseURL(){return process.env[Pe]??this.DEFAULT_BASE_URL}get action(){return{list:new l(this._transport)}}get boilerplate(){return{get:new g(this._transport),list:new f(this._transport),update:new y(this._transport)}}get boilerplateCategory(){return{get:new C(this._transport),list:new R(this._transport),create:new x(this._transport),update:new A(this._transport),boilerplate:{list:new h(this._transport),create:new m(this._transport)}}}get channel(){return{list:new O(this._transport)}}get contact(){return{get:new P(this._transport),list:new _(this._transport),update:new E(this._transport),create:new T(this._transport),vcf:{get:new w(this._transport)},note:{list:new Q(this._transport),create:new $(this._transport)}}}get conversation(){return{get:new F(this._transport),list:new I(this._transport),update:new q(this._transport),message:{list:new D(this._transport)},note:{list:new Z(this._transport),create:new W(this._transport)}}}get label(){return{create:new L(this._transport),get:new M(this._transport),list:new N(this._transport),update:new G(this._transport),delete:new H(this._transport),contact:{list:new S(this._transport)},conversation:{list:new j(this._transport)}}}get message(){return{list:new z(this._transport)}}get model(){return{get:new V(this._transport),list:new k(this._transport),response:{create:new Y(this._transport)},correction:{create:new J(this._transport)}}}get note(){return{get:new X(this._transport),update:new tt(this._transport)}}get source(){return{get:new st(this._transport),list:new rt(this._transport)}}};var ce=require("commander"),Fe=require("ora");function de({client:e,ora:t}){let s=new ce.Command("actions").description("Actions");return s.addCommand(new ce.Command("list").description("List actions").action(async()=>{let r=await(0,Fe.oraPromise)(()=>e.action.list.send(),{...t,text:"Finding actions"});console.log(await r.result())})),s}var le=require("commander"),Ie=require("ora");function ue({client:e,ora:t}){let s=new le.Command("channels").description("Channels");return s.addCommand(new le.Command("list").description("List channels").action(async()=>{let r=await(0,Ie.oraPromise)(()=>e.channel.list.send(),{...t,text:"Finding channels"});console.log(await r.result())})),s}var ht=require("commander"),me=require("ora");function ge({client:e,ora:t}){let s=new ht.Command("contacts").description("Contacts");return s.addCommand(new ht.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async r=>{let n=await(0,me.oraPromise)(()=>e.contact.get.send({id:r}),{...t,text:"Finding contact"});console.log(await n.result())})),s.addCommand(new ht.Command("list").description("List contacts").action(async()=>{let r=await(0,me.oraPromise)(()=>e.contact.list.send(),{...t,text:"Finding contacts"});console.log(await r.result())})),s}var ft=require("commander"),he=require("ora");function fe({client:e,ora:t}){let s=new ft.Command("conversations").description("Conversations");return s.addCommand(new ft.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async r=>{let n=await(0,he.oraPromise)(()=>e.conversation.get.send({id:r}),{...t,text:"Finding conversation"});console.log(await n.result())})),s.addCommand(new ft.Command("list").description("List conversations").action(async()=>{let r=await(0,he.oraPromise)(()=>e.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await r.result())})),s}var dt=require("commander"),yt=require("ora");function ye({client:e,ora:t}){let s=new dt.Command("labels").description("Labels");return s.addCommand(new dt.Command("get").description("Find label").argument("<label>","Label ID").action(async r=>{let n=await(0,yt.oraPromise)(()=>e.label.get.send({id:r}),{...t,text:"Finding label"});console.log(await n.result())})),s.addCommand(new dt.Command("list").description("List labels").action(async()=>{let r=await(0,yt.oraPromise)(()=>e.label.list.send(),{...t,text:"Finding labels"});console.log(await r.result())})),s.addCommand(new dt.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async r=>{let n=await(0,yt.oraPromise)(()=>e.label.conversation.list.send({id:r}),{...t,text:"Finding conversations"});console.log(await n.result())})),s}var be=require("commander"),je=require("ora");function xe({client:e,ora:t}){let s=new be.Command("messages").description("Messages");return s.addCommand(new be.Command("list").description("List messages").action(async()=>{let r=await(0,je.oraPromise)(()=>e.message.list.send(),{...t,text:"Finding messages"});console.log(await r.result())})),s}var bt=require("commander"),Ce=require("ora");function Re({client:e,ora:t}){let s=new bt.Command("models").description("Models");return s.addCommand(new bt.Command("get").description("Find model").argument("<model>","Model ID").action(async r=>{let n=await(0,Ce.oraPromise)(()=>e.model.get.send({id:r}),{...t,text:"Finding model"});console.log(await n.result())})),s.addCommand(new bt.Command("list").description("List models").action(async()=>{let r=await(0,Ce.oraPromise)(()=>e.model.list.send(),{...t,text:"Finding models"});console.log(await r.result())})),s}var xt=require("commander"),Ae=require("ora");function Oe({client:e,ora:t}){let s=new xt.Command("sources").description("Sources");return s.addCommand(new xt.Command("get").description("Find source").argument("<source>","Source ID").action(async r=>{let n=await(0,Ae.oraPromise)(()=>e.source.get.send({id:r}),{...t,text:"Finding source"});console.log(await n.result())})),s.addCommand(new xt.Command("list").description("List sources").action(async()=>{let r=await(0,Ae.oraPromise)(()=>e.source.list.send(),{...t,text:"Finding sources"});console.log(await r.result())})),s}var i={ora:{spinner:"simpleDotsScrolling"},client:new ct(new d)},Je=new qe.Command("gds").description("Great Detail Support System").addCommand(de(i)).addCommand(ue(i)).addCommand(ge(i)).addCommand(fe(i)).addCommand(ye(i)).addCommand(xe(i)).addCommand(Re(i)).addCommand(Oe(i)),Ve=Je;
1
+ "use strict";var Ne=Object.create;var ut=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var ze=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Je=(e,t)=>{for(var s in t)ut(e,s,{get:t[s],enumerable:!0})},Pe=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of De(t))!Be.call(e,n)&&n!==s&&ut(e,n,{get:()=>t[n],enumerable:!(r=Ge(t,n))||r.enumerable});return e};var _e=(e,t,s)=>(s=e!=null?Ne(ze(e)):{},Pe(t||!e||!e.__esModule?ut(s,"default",{value:e,enumerable:!0}):s,e)),Ve=e=>Pe(ut({},"__esModule",{value:!0}),e);var Ye={};Je(Ye,{default:()=>Ke});module.exports=Ve(Ye);var Le=require("commander");var d=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var l=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"}).then(s=>new Rt(s))}},Rt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=require("zod"),m=class e{constructor(t){this._transport=t}static SCHEMA=u.z.object({title:u.z.string(),content:u.z.string(),account:u.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new At(n))}},At=class{constructor(t){this.response=t}async result(){return this.response.json()}};var g=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Ot(r))}},Ot=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"GET"}).then(r=>new wt(r))}},wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplates",{...t,method:"GET"}).then(s=>new Tt(s))}},Tt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var mt=require("zod"),y=class e{constructor(t){this._transport=t}static SCHEMA=mt.z.object({title:mt.z.string().optional(),content:mt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Pt(n))}},Pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=require("zod"),C=class e{constructor(t){this._transport=t}static SCHEMA=b.z.object({title:b.z.string(),description:b.z.string().optional(),account:b.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/boilerplate-categories",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new _t(r))}},_t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new vt(r))}},vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"}).then(s=>new St(s))}},St=class{constructor(t){this.response=t}async result(){return this.response.json()}};var gt=require("zod"),A=class e{constructor(t){this._transport=t}static SCHEMA=gt.z.object({title:gt.z.string().optional(),description:gt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Et(n))}},Et=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"}).then(s=>new Ft(s))}},Ft=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ve="SUPPORT_BASE_URL";var Se="https://api.support.greatdetail.com",Ee={"X-Powered-By":"GDSupport/JavaScript"};var w=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:s={}}){let r=s.variant??"vcard",n=s.format??(s.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(r)+"&format="+encodeURIComponent(n)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var p=require("zod"),T=class e{constructor(t){this._transport=t}static SCHEMA=p.z.object({name:p.z.string(),account:p.z.string(),emailAddress:p.z.string().email().optional(),telephoneNumber:p.z.string().optional()});async send({body:t,request:s={}}){return this._transport.send("v1/contacts",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new It(r))}},It=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new jt(r))}},jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"}).then(s=>new qt(s))}},qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...s,method:"GET"}).then(r=>new Ut(r))}},Ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=require("zod"),E=class e{constructor(t){this._transport=t}static SCHEMA=S.z.object({name:S.z.string().optional(),emailAddress:S.z.string().email().optional(),telephoneNumber:S.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Lt(n))}},Lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var F=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Ht(r))}},Ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var I=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Mt(r))}},Mt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var j=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/conversations",{...t,method:"GET"}).then(s=>new Nt(s))}},Nt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Gt(r))}},Gt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Dt=require("zod"),U=class e{constructor(t){this._transport=t}static SCHEMA=Dt.z.object({hasEnded:Dt.z.boolean()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new zt(n))}},zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var L=require("zod"),H=class e{constructor(t){this._transport=t}static SCHEMA=L.z.object({title:L.z.string(),description:L.z.string().optional(),account:L.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Bt(r))}},Bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var M=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"DELETE"}).then(r=>new Jt(r))}},Jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var N=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Vt(r))}},Vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var G=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"}).then(s=>new kt(s))}},kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ht=require("zod"),D=class e{constructor(t){this._transport=t}static SCHEMA=ht.z.object({title:ht.z.string().optional(),description:ht.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Kt(n))}},Kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET"}).then(r=>new Yt(r))}},Yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var B=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"}).then(s=>new $t(s))}},$t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var J=require("zod"),V=class e{constructor(t){this._transport=t}static SCHEMA=J.z.object({input:J.z.string().max(65536),original:J.z.string().max(65536),correction:J.z.string().max(65536)});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Wt(n))}},Wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var k=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Xt(r))}},Xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var K=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"}).then(s=>new Qt(s))}},Qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Y=require("zod"),$=class e{constructor(t){this._transport=t}static SCHEMA=Y.z.array(Y.z.object({role:Y.z.enum(["user","assistant"]),content:Y.z.string().max(65536).nullable()})).min(1);async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Zt(n))}},Zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var te=require("zod"),W=class e{constructor(t){this._transport=t}static SCHEMA=te.z.object({content:te.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new ee(n))}},ee=class{constructor(t){this.response=t}async result(){return this.response.json()}};var se=require("zod"),X=class e{constructor(t){this._transport=t}static SCHEMA=se.z.object({content:se.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new re(n))}},re=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new ne(r))}},ne=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new oe(r))}},oe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var tt=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new ie(r))}},ie=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ae=require("zod"),et=class e{constructor(t){this._transport=t}static SCHEMA=ae.z.object({content:ae.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new pe(n))}},pe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var st=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Ee;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new ce(r))}},ce=class{constructor(t){this.response=t}async result(){return this.response.json()}};var nt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/sources",{...t,method:"GET"}).then(s=>new de(s))}},de=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Fe=_e(require("is-network-error"),1),Ie=_e(require("ky"),1);var o=class extends Error{};var a=class extends o{};var ot=class extends a{static unauthenticated(){return new this("An unauthenticated request occurred")}};var it=class extends a{static forbidden(){return new this("A forbidden request occurred")}};var c=class extends o{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,s){return new this(`Forbidden method for request: ${t} ${s}`)}};var at=class extends o{};var pt=class extends o{static badRequest(){return new this("Bad request")}};var ct=class{options;constructor({baseURL:t,...s}){this.options={...s,baseURL:t}}getURL(t){return new URL(t,this.options.baseURL).toString()}getRequest(t,s){s.headers=new Headers(s.headers);for(let r of this.options.requestFilterables){let n=r.getHeaders();for(let[He,Me]of Object.entries(n))s.headers.set(He,Me)}return new Request(this.getURL(t),s)}async send(t,s){return await(0,Ie.default)(this.getRequest(t,s)).then(r=>{if(!r.ok){let n=r.status;switch(console.error(JSON.stringify(r)),n){case 400:throw pt.badRequest();case 401:throw ot.unauthenticated();case 403:throw it.forbidden();case 404:throw c.notFound(t);case 405:throw c.forbiddenMethod(t,s.method??"GET")}}return r}).catch(r=>{throw(0,Fe.default)(r)?new at("A network error occurred",{cause:r}):r})}};var dt=class e{static DEFAULT_BASE_URL=Se;_transport;constructor(t,{baseURL:s,...r}={}){this._transport=new ct({requestFilterables:[new st,t],...r,baseURL:s?.toString()??e.getBaseURL()})}static getBaseURL(){return process.env[ve]??this.DEFAULT_BASE_URL}get action(){return{list:new l(this._transport)}}get boilerplate(){return{get:new g(this._transport),list:new f(this._transport),update:new y(this._transport)}}get boilerplateCategory(){return{get:new x(this._transport),list:new R(this._transport),create:new C(this._transport),update:new A(this._transport),boilerplate:{list:new h(this._transport),create:new m(this._transport)}}}get channel(){return{list:new O(this._transport)}}get contact(){return{get:new P(this._transport),list:new _(this._transport),update:new E(this._transport),create:new T(this._transport),conversation:{list:new I(this._transport)},note:{list:new Z(this._transport),create:new W(this._transport)},vcf:{get:new w(this._transport)}}}get conversation(){return{get:new F(this._transport),list:new j(this._transport),update:new U(this._transport),message:{list:new z(this._transport)},note:{list:new tt(this._transport),create:new X(this._transport)}}}get label(){return{create:new H(this._transport),get:new N(this._transport),list:new G(this._transport),update:new D(this._transport),delete:new M(this._transport),contact:{list:new v(this._transport)},conversation:{list:new q(this._transport)}}}get message(){return{list:new B(this._transport)}}get model(){return{get:new k(this._transport),list:new K(this._transport),response:{create:new $(this._transport)},correction:{create:new V(this._transport)}}}get note(){return{get:new Q(this._transport),update:new et(this._transport)}}get source(){return{get:new rt(this._transport),list:new nt(this._transport)}}};var le=require("commander"),je=require("ora");function ue({client:e,ora:t}){let s=new le.Command("actions").description("Actions");return s.addCommand(new le.Command("list").description("List actions").action(async()=>{let r=await(0,je.oraPromise)(()=>e.action.list.send(),{...t,text:"Finding actions"});console.log(await r.result())})),s}var me=require("commander"),qe=require("ora");function ge({client:e,ora:t}){let s=new me.Command("channels").description("Channels");return s.addCommand(new me.Command("list").description("List channels").action(async()=>{let r=await(0,qe.oraPromise)(()=>e.channel.list.send(),{...t,text:"Finding channels"});console.log(await r.result())})),s}var ft=require("commander"),he=require("ora");function fe({client:e,ora:t}){let s=new ft.Command("contacts").description("Contacts");return s.addCommand(new ft.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async r=>{let n=await(0,he.oraPromise)(()=>e.contact.get.send({id:r}),{...t,text:"Finding contact"});console.log(await n.result())})),s.addCommand(new ft.Command("list").description("List contacts").action(async()=>{let r=await(0,he.oraPromise)(()=>e.contact.list.send(),{...t,text:"Finding contacts"});console.log(await r.result())})),s}var yt=require("commander"),ye=require("ora");function be({client:e,ora:t}){let s=new yt.Command("conversations").description("Conversations");return s.addCommand(new yt.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async r=>{let n=await(0,ye.oraPromise)(()=>e.conversation.get.send({id:r}),{...t,text:"Finding conversation"});console.log(await n.result())})),s.addCommand(new yt.Command("list").description("List conversations").action(async()=>{let r=await(0,ye.oraPromise)(()=>e.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await r.result())})),s}var lt=require("commander"),bt=require("ora");function Ce({client:e,ora:t}){let s=new lt.Command("labels").description("Labels");return s.addCommand(new lt.Command("get").description("Find label").argument("<label>","Label ID").action(async r=>{let n=await(0,bt.oraPromise)(()=>e.label.get.send({id:r}),{...t,text:"Finding label"});console.log(await n.result())})),s.addCommand(new lt.Command("list").description("List labels").action(async()=>{let r=await(0,bt.oraPromise)(()=>e.label.list.send(),{...t,text:"Finding labels"});console.log(await r.result())})),s.addCommand(new lt.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async r=>{let n=await(0,bt.oraPromise)(()=>e.label.conversation.list.send({id:r}),{...t,text:"Finding conversations"});console.log(await n.result())})),s}var xe=require("commander"),Ue=require("ora");function Re({client:e,ora:t}){let s=new xe.Command("messages").description("Messages");return s.addCommand(new xe.Command("list").description("List messages").action(async()=>{let r=await(0,Ue.oraPromise)(()=>e.message.list.send(),{...t,text:"Finding messages"});console.log(await r.result())})),s}var Ct=require("commander"),Ae=require("ora");function Oe({client:e,ora:t}){let s=new Ct.Command("models").description("Models");return s.addCommand(new Ct.Command("get").description("Find model").argument("<model>","Model ID").action(async r=>{let n=await(0,Ae.oraPromise)(()=>e.model.get.send({id:r}),{...t,text:"Finding model"});console.log(await n.result())})),s.addCommand(new Ct.Command("list").description("List models").action(async()=>{let r=await(0,Ae.oraPromise)(()=>e.model.list.send(),{...t,text:"Finding models"});console.log(await r.result())})),s}var xt=require("commander"),we=require("ora");function Te({client:e,ora:t}){let s=new xt.Command("sources").description("Sources");return s.addCommand(new xt.Command("get").description("Find source").argument("<source>","Source ID").action(async r=>{let n=await(0,we.oraPromise)(()=>e.source.get.send({id:r}),{...t,text:"Finding source"});console.log(await n.result())})),s.addCommand(new xt.Command("list").description("List sources").action(async()=>{let r=await(0,we.oraPromise)(()=>e.source.list.send(),{...t,text:"Finding sources"});console.log(await r.result())})),s}var i={ora:{spinner:"simpleDotsScrolling"},client:new dt(new d)},ke=new Le.Command("gds").description("Great Detail Support System").addCommand(ue(i)).addCommand(ge(i)).addCommand(fe(i)).addCommand(be(i)).addCommand(Ce(i)).addCommand(Re(i)).addCommand(Oe(i)).addCommand(Te(i)),Ke=ke;
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { C as Client } from '../index-ng6eKA5J.cjs';
2
+ import { C as Client } from '../index-nN1ajzrl.cjs';
3
3
  import { Options as Options$1 } from 'ora';
4
4
  import 'ky';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { C as Client } from '../index-ng6eKA5J.js';
2
+ import { C as Client } from '../index-nN1ajzrl.js';
3
3
  import { Options as Options$1 } from 'ora';
4
4
  import 'ky';
5
5
  import 'zod';
package/dist/cli/index.js CHANGED
@@ -1 +1 @@
1
- import{a}from"../chunk-MIIHAFPV.js";import"../chunk-O5KZWMF7.js";export{a as default};
1
+ import{a}from"../chunk-YZZSFAQF.js";import"../chunk-P5VYQSL7.js";export{a as default};
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var He=Object.create;var Oe=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var ze=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ne(t))!De.call(e,n)&&n!==s&&Oe(e,n,{get:()=>t[n],enumerable:!(r=Me(t,n))||r.enumerable});return e};var we=(e,t,s)=>(s=e!=null?He(Ge(e)):{},ze(t||!e||!e.__esModule?Oe(s,"default",{value:e,enumerable:!0}):s,e));var je=require("commander");var d=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var l=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"}).then(s=>new xt(s))}},xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=require("zod"),m=class e{constructor(t){this._transport=t}static SCHEMA=u.z.object({title:u.z.string(),content:u.z.string(),account:u.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Ct(n))}},Ct=class{constructor(t){this.response=t}async result(){return this.response.json()}};var g=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Rt(r))}},Rt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"GET"}).then(r=>new At(r))}},At=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplates",{...t,method:"GET"}).then(s=>new Ot(s))}},Ot=class{constructor(t){this.response=t}async result(){return this.response.json()}};var lt=require("zod"),y=class e{constructor(t){this._transport=t}static SCHEMA=lt.z.object({title:lt.z.string().optional(),content:lt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new wt(n))}},wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=require("zod"),x=class e{constructor(t){this._transport=t}static SCHEMA=b.z.object({title:b.z.string(),description:b.z.string().optional(),account:b.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/boilerplate-categories",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Tt(r))}},Tt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Pt(r))}},Pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"}).then(s=>new _t(s))}},_t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ut=require("zod"),A=class e{constructor(t){this._transport=t}static SCHEMA=ut.z.object({title:ut.z.string().optional(),description:ut.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new St(n))}},St=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"}).then(s=>new vt(s))}},vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Te="SUPPORT_BASE_URL";var Pe="https://api.support.greatdetail.com",_e={"X-Powered-By":"GDSupport/JavaScript"};var w=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:s={}}){let r=s.variant??"vcard",n=s.format??(s.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(r)+"&format="+encodeURIComponent(n)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var p=require("zod"),T=class e{constructor(t){this._transport=t}static SCHEMA=p.z.object({name:p.z.string(),account:p.z.string(),emailAddress:p.z.string().email().optional(),telephoneNumber:p.z.string().optional()});async send({body:t,request:s={}}){return this._transport.send("v1/contacts",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Et(r))}},Et=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Ft(r))}},Ft=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"}).then(s=>new It(s))}},It=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...s,method:"GET"}).then(r=>new jt(r))}},jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=require("zod"),E=class e{constructor(t){this._transport=t}static SCHEMA=v.z.object({name:v.z.string().optional(),emailAddress:v.z.string().email().optional(),telephoneNumber:v.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new qt(n))}},qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var F=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Ut(r))}},Ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};var I=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/conversations",{...t,method:"GET"}).then(s=>new Lt(s))}},Lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var j=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Ht(r))}},Ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Mt=require("zod"),q=class e{constructor(t){this._transport=t}static SCHEMA=Mt.z.object({hasEnded:Mt.z.boolean()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Nt(n))}},Nt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var U=require("zod"),L=class e{constructor(t){this._transport=t}static SCHEMA=U.z.object({title:U.z.string(),description:U.z.string().optional(),account:U.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Gt(r))}},Gt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var H=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"DELETE"}).then(r=>new Dt(r))}},Dt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var M=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new zt(r))}},zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var N=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"}).then(s=>new Bt(s))}},Bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var mt=require("zod"),G=class e{constructor(t){this._transport=t}static SCHEMA=mt.z.object({title:mt.z.string().optional(),description:mt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Jt(n))}},Jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var D=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET"}).then(r=>new Vt(r))}},Vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var z=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"}).then(s=>new kt(s))}},kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var B=require("zod"),J=class e{constructor(t){this._transport=t}static SCHEMA=B.z.object({input:B.z.string().max(65536),original:B.z.string().max(65536),correction:B.z.string().max(65536)});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Kt(n))}},Kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var V=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Yt(r))}},Yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var k=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"}).then(s=>new $t(s))}},$t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var K=require("zod"),Y=class e{constructor(t){this._transport=t}static SCHEMA=K.z.array(K.z.object({role:K.z.enum(["user","assistant"]),content:K.z.string().max(65536).nullable()})).min(1);async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Wt(n))}},Wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Xt=require("zod"),$=class e{constructor(t){this._transport=t}static SCHEMA=Xt.z.object({content:Xt.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Qt(n))}},Qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Zt=require("zod"),W=class e{constructor(t){this._transport=t}static SCHEMA=Zt.z.object({content:Zt.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new te(n))}},te=class{constructor(t){this.response=t}async result(){return this.response.json()}};var X=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new ee(r))}},ee=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new se(r))}},se=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new re(r))}},re=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ne=require("zod"),tt=class e{constructor(t){this._transport=t}static SCHEMA=ne.z.object({content:ne.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new oe(n))}},oe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var et=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=_e;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var st=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new ie(r))}},ie=class{constructor(t){this.response=t}async result(){return this.response.json()}};var rt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/sources",{...t,method:"GET"}).then(s=>new ae(s))}},ae=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Se=we(require("is-network-error"),1),ve=we(require("ky"),1);var o=class extends Error{};var a=class extends o{};var nt=class extends a{static unauthenticated(){return new this("An unauthenticated request occurred")}};var ot=class extends a{static forbidden(){return new this("A forbidden request occurred")}};var c=class extends o{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,s){return new this(`Forbidden method for request: ${t} ${s}`)}};var it=class extends o{};var at=class extends o{static badRequest(){return new this("Bad request")}};var pt=class{options;constructor({baseURL:t,...s}){this.options={...s,baseURL:t}}getURL(t){return new URL(t,this.options.baseURL).toString()}getRequest(t,s){s.headers=new Headers(s.headers);for(let r of this.options.requestFilterables){let n=r.getHeaders();for(let[Ue,Le]of Object.entries(n))s.headers.set(Ue,Le)}return new Request(this.getURL(t),s)}async send(t,s){return await(0,ve.default)(this.getRequest(t,s)).then(r=>{if(!r.ok){let n=r.status;switch(console.error(JSON.stringify(r)),n){case 400:throw at.badRequest();case 401:throw nt.unauthenticated();case 403:throw ot.forbidden();case 404:throw c.notFound(t);case 405:throw c.forbiddenMethod(t,s.method??"GET")}}return r}).catch(r=>{throw(0,Se.default)(r)?new it("A network error occurred",{cause:r}):r})}};var ct=class e{static DEFAULT_BASE_URL=Pe;_transport;constructor(t,{baseURL:s,...r}={}){this._transport=new pt({requestFilterables:[new et,t],...r,baseURL:s?.toString()??e.getBaseURL()})}static getBaseURL(){return process.env[Te]??this.DEFAULT_BASE_URL}get action(){return{list:new l(this._transport)}}get boilerplate(){return{get:new g(this._transport),list:new f(this._transport),update:new y(this._transport)}}get boilerplateCategory(){return{get:new C(this._transport),list:new R(this._transport),create:new x(this._transport),update:new A(this._transport),boilerplate:{list:new h(this._transport),create:new m(this._transport)}}}get channel(){return{list:new O(this._transport)}}get contact(){return{get:new P(this._transport),list:new _(this._transport),update:new E(this._transport),create:new T(this._transport),vcf:{get:new w(this._transport)},note:{list:new Q(this._transport),create:new $(this._transport)}}}get conversation(){return{get:new F(this._transport),list:new I(this._transport),update:new q(this._transport),message:{list:new D(this._transport)},note:{list:new Z(this._transport),create:new W(this._transport)}}}get label(){return{create:new L(this._transport),get:new M(this._transport),list:new N(this._transport),update:new G(this._transport),delete:new H(this._transport),contact:{list:new S(this._transport)},conversation:{list:new j(this._transport)}}}get message(){return{list:new z(this._transport)}}get model(){return{get:new V(this._transport),list:new k(this._transport),response:{create:new Y(this._transport)},correction:{create:new J(this._transport)}}}get note(){return{get:new X(this._transport),update:new tt(this._transport)}}get source(){return{get:new st(this._transport),list:new rt(this._transport)}}};var pe=require("commander"),Ee=require("ora");function ce({client:e,ora:t}){let s=new pe.Command("actions").description("Actions");return s.addCommand(new pe.Command("list").description("List actions").action(async()=>{let r=await(0,Ee.oraPromise)(()=>e.action.list.send(),{...t,text:"Finding actions"});console.log(await r.result())})),s}var de=require("commander"),Fe=require("ora");function le({client:e,ora:t}){let s=new de.Command("channels").description("Channels");return s.addCommand(new de.Command("list").description("List channels").action(async()=>{let r=await(0,Fe.oraPromise)(()=>e.channel.list.send(),{...t,text:"Finding channels"});console.log(await r.result())})),s}var gt=require("commander"),ue=require("ora");function me({client:e,ora:t}){let s=new gt.Command("contacts").description("Contacts");return s.addCommand(new gt.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async r=>{let n=await(0,ue.oraPromise)(()=>e.contact.get.send({id:r}),{...t,text:"Finding contact"});console.log(await n.result())})),s.addCommand(new gt.Command("list").description("List contacts").action(async()=>{let r=await(0,ue.oraPromise)(()=>e.contact.list.send(),{...t,text:"Finding contacts"});console.log(await r.result())})),s}var ht=require("commander"),ge=require("ora");function he({client:e,ora:t}){let s=new ht.Command("conversations").description("Conversations");return s.addCommand(new ht.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async r=>{let n=await(0,ge.oraPromise)(()=>e.conversation.get.send({id:r}),{...t,text:"Finding conversation"});console.log(await n.result())})),s.addCommand(new ht.Command("list").description("List conversations").action(async()=>{let r=await(0,ge.oraPromise)(()=>e.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await r.result())})),s}var dt=require("commander"),ft=require("ora");function fe({client:e,ora:t}){let s=new dt.Command("labels").description("Labels");return s.addCommand(new dt.Command("get").description("Find label").argument("<label>","Label ID").action(async r=>{let n=await(0,ft.oraPromise)(()=>e.label.get.send({id:r}),{...t,text:"Finding label"});console.log(await n.result())})),s.addCommand(new dt.Command("list").description("List labels").action(async()=>{let r=await(0,ft.oraPromise)(()=>e.label.list.send(),{...t,text:"Finding labels"});console.log(await r.result())})),s.addCommand(new dt.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async r=>{let n=await(0,ft.oraPromise)(()=>e.label.conversation.list.send({id:r}),{...t,text:"Finding conversations"});console.log(await n.result())})),s}var ye=require("commander"),Ie=require("ora");function be({client:e,ora:t}){let s=new ye.Command("messages").description("Messages");return s.addCommand(new ye.Command("list").description("List messages").action(async()=>{let r=await(0,Ie.oraPromise)(()=>e.message.list.send(),{...t,text:"Finding messages"});console.log(await r.result())})),s}var yt=require("commander"),xe=require("ora");function Ce({client:e,ora:t}){let s=new yt.Command("models").description("Models");return s.addCommand(new yt.Command("get").description("Find model").argument("<model>","Model ID").action(async r=>{let n=await(0,xe.oraPromise)(()=>e.model.get.send({id:r}),{...t,text:"Finding model"});console.log(await n.result())})),s.addCommand(new yt.Command("list").description("List models").action(async()=>{let r=await(0,xe.oraPromise)(()=>e.model.list.send(),{...t,text:"Finding models"});console.log(await r.result())})),s}var bt=require("commander"),Re=require("ora");function Ae({client:e,ora:t}){let s=new bt.Command("sources").description("Sources");return s.addCommand(new bt.Command("get").description("Find source").argument("<source>","Source ID").action(async r=>{let n=await(0,Re.oraPromise)(()=>e.source.get.send({id:r}),{...t,text:"Finding source"});console.log(await n.result())})),s.addCommand(new bt.Command("list").description("List sources").action(async()=>{let r=await(0,Re.oraPromise)(()=>e.source.list.send(),{...t,text:"Finding sources"});console.log(await r.result())})),s}var i={ora:{spinner:"simpleDotsScrolling"},client:new ct(new d)},Be=new je.Command("gds").description("Great Detail Support System").addCommand(ce(i)).addCommand(le(i)).addCommand(me(i)).addCommand(he(i)).addCommand(fe(i)).addCommand(be(i)).addCommand(Ce(i)).addCommand(Ae(i)),qe=Be;qe.parseAsync(process.argv);
2
+ "use strict";var Ne=Object.create;var Te=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var ze=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Je=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of De(t))!Be.call(e,n)&&n!==s&&Te(e,n,{get:()=>t[n],enumerable:!(r=Ge(t,n))||r.enumerable});return e};var Pe=(e,t,s)=>(s=e!=null?Ne(ze(e)):{},Je(t||!e||!e.__esModule?Te(s,"default",{value:e,enumerable:!0}):s,e));var Ue=require("commander");var d=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var l=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"}).then(s=>new xt(s))}},xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=require("zod"),m=class e{constructor(t){this._transport=t}static SCHEMA=u.z.object({title:u.z.string(),content:u.z.string(),account:u.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Rt(n))}},Rt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var g=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new At(r))}},At=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"GET"}).then(r=>new Ot(r))}},Ot=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplates",{...t,method:"GET"}).then(s=>new wt(s))}},wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ut=require("zod"),y=class e{constructor(t){this._transport=t}static SCHEMA=ut.z.object({title:ut.z.string().optional(),content:ut.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Tt(n))}},Tt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=require("zod"),C=class e{constructor(t){this._transport=t}static SCHEMA=b.z.object({title:b.z.string(),description:b.z.string().optional(),account:b.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/boilerplate-categories",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Pt(r))}},Pt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new _t(r))}},_t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"}).then(s=>new vt(s))}},vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var mt=require("zod"),A=class e{constructor(t){this._transport=t}static SCHEMA=mt.z.object({title:mt.z.string().optional(),description:mt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new St(n))}},St=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"}).then(s=>new Et(s))}},Et=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _e="SUPPORT_BASE_URL";var ve="https://api.support.greatdetail.com",Se={"X-Powered-By":"GDSupport/JavaScript"};var w=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:s={}}){let r=s.variant??"vcard",n=s.format??(s.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(r)+"&format="+encodeURIComponent(n)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var p=require("zod"),T=class e{constructor(t){this._transport=t}static SCHEMA=p.z.object({name:p.z.string(),account:p.z.string(),emailAddress:p.z.string().email().optional(),telephoneNumber:p.z.string().optional()});async send({body:t,request:s={}}){return this._transport.send("v1/contacts",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new Ft(r))}},Ft=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new It(r))}},It=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"}).then(s=>new jt(s))}},jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...s,method:"GET"}).then(r=>new qt(r))}},qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=require("zod"),E=class e{constructor(t){this._transport=t}static SCHEMA=S.z.object({name:S.z.string().optional(),emailAddress:S.z.string().email().optional(),telephoneNumber:S.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Ut(n))}},Ut=class{constructor(t){this.response=t}async result(){return this.response.json()}};var F=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Lt(r))}},Lt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var I=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Ht(r))}},Ht=class{constructor(t){this.response=t}async result(){return this.response.json()}};var j=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/conversations",{...t,method:"GET"}).then(s=>new Mt(s))}},Mt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...s,method:"GET"}).then(r=>new Nt(r))}},Nt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Gt=require("zod"),U=class e{constructor(t){this._transport=t}static SCHEMA=Gt.z.object({hasEnded:Gt.z.boolean()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Dt(n))}},Dt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var L=require("zod"),H=class e{constructor(t){this._transport=t}static SCHEMA=L.z.object({title:L.z.string(),description:L.z.string().optional(),account:L.z.string()});async send({body:t,request:s={}}){return this._transport.send("v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))}).then(r=>new zt(r))}},zt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var M=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"DELETE"}).then(r=>new Bt(r))}},Bt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var N=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Jt(r))}},Jt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var G=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"}).then(s=>new Vt(s))}},Vt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var gt=require("zod"),D=class e{constructor(t){this._transport=t}static SCHEMA=gt.z.object({title:gt.z.string().optional(),description:gt.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new kt(n))}},kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET"}).then(r=>new Kt(r))}},Kt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var B=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"}).then(s=>new Yt(s))}},Yt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var J=require("zod"),V=class e{constructor(t){this._transport=t}static SCHEMA=J.z.object({input:J.z.string().max(65536),original:J.z.string().max(65536),correction:J.z.string().max(65536)});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new $t(n))}},$t=class{constructor(t){this.response=t}async result(){return this.response.json()}};var k=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new Wt(r))}},Wt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var K=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"}).then(s=>new Xt(s))}},Xt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Y=require("zod"),$=class e{constructor(t){this._transport=t}static SCHEMA=Y.z.array(Y.z.object({role:Y.z.enum(["user","assistant"]),content:Y.z.string().max(65536).nullable()})).min(1);async send({id:t,body:s,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new Qt(n))}},Qt=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Zt=require("zod"),W=class e{constructor(t){this._transport=t}static SCHEMA=Zt.z.object({content:Zt.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new te(n))}},te=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ee=require("zod"),X=class e{constructor(t){this._transport=t}static SCHEMA=ee.z.object({content:ee.z.string()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new se(n))}},se=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new re(r))}},re=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new ne(r))}},ne=class{constructor(t){this.response=t}async result(){return this.response.json()}};var tt=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"GET"}).then(r=>new oe(r))}},oe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ie=require("zod"),et=class e{constructor(t){this._transport=t}static SCHEMA=ie.z.object({content:ie.z.string().optional()});async send({id:t,body:s,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))}).then(n=>new ae(n))}},ae=class{constructor(t){this.response=t}async result(){return this.response.json()}};var st=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Se;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:s={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...s,method:"GET"}).then(r=>new pe(r))}},pe=class{constructor(t){this.response=t}async result(){return this.response.json()}};var nt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/sources",{...t,method:"GET"}).then(s=>new ce(s))}},ce=class{constructor(t){this.response=t}async result(){return this.response.json()}};var Ee=Pe(require("is-network-error"),1),Fe=Pe(require("ky"),1);var o=class extends Error{};var a=class extends o{};var ot=class extends a{static unauthenticated(){return new this("An unauthenticated request occurred")}};var it=class extends a{static forbidden(){return new this("A forbidden request occurred")}};var c=class extends o{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,s){return new this(`Forbidden method for request: ${t} ${s}`)}};var at=class extends o{};var pt=class extends o{static badRequest(){return new this("Bad request")}};var ct=class{options;constructor({baseURL:t,...s}){this.options={...s,baseURL:t}}getURL(t){return new URL(t,this.options.baseURL).toString()}getRequest(t,s){s.headers=new Headers(s.headers);for(let r of this.options.requestFilterables){let n=r.getHeaders();for(let[He,Me]of Object.entries(n))s.headers.set(He,Me)}return new Request(this.getURL(t),s)}async send(t,s){return await(0,Fe.default)(this.getRequest(t,s)).then(r=>{if(!r.ok){let n=r.status;switch(console.error(JSON.stringify(r)),n){case 400:throw pt.badRequest();case 401:throw ot.unauthenticated();case 403:throw it.forbidden();case 404:throw c.notFound(t);case 405:throw c.forbiddenMethod(t,s.method??"GET")}}return r}).catch(r=>{throw(0,Ee.default)(r)?new at("A network error occurred",{cause:r}):r})}};var dt=class e{static DEFAULT_BASE_URL=ve;_transport;constructor(t,{baseURL:s,...r}={}){this._transport=new ct({requestFilterables:[new st,t],...r,baseURL:s?.toString()??e.getBaseURL()})}static getBaseURL(){return process.env[_e]??this.DEFAULT_BASE_URL}get action(){return{list:new l(this._transport)}}get boilerplate(){return{get:new g(this._transport),list:new f(this._transport),update:new y(this._transport)}}get boilerplateCategory(){return{get:new x(this._transport),list:new R(this._transport),create:new C(this._transport),update:new A(this._transport),boilerplate:{list:new h(this._transport),create:new m(this._transport)}}}get channel(){return{list:new O(this._transport)}}get contact(){return{get:new P(this._transport),list:new _(this._transport),update:new E(this._transport),create:new T(this._transport),conversation:{list:new I(this._transport)},note:{list:new Z(this._transport),create:new W(this._transport)},vcf:{get:new w(this._transport)}}}get conversation(){return{get:new F(this._transport),list:new j(this._transport),update:new U(this._transport),message:{list:new z(this._transport)},note:{list:new tt(this._transport),create:new X(this._transport)}}}get label(){return{create:new H(this._transport),get:new N(this._transport),list:new G(this._transport),update:new D(this._transport),delete:new M(this._transport),contact:{list:new v(this._transport)},conversation:{list:new q(this._transport)}}}get message(){return{list:new B(this._transport)}}get model(){return{get:new k(this._transport),list:new K(this._transport),response:{create:new $(this._transport)},correction:{create:new V(this._transport)}}}get note(){return{get:new Q(this._transport),update:new et(this._transport)}}get source(){return{get:new rt(this._transport),list:new nt(this._transport)}}};var de=require("commander"),Ie=require("ora");function le({client:e,ora:t}){let s=new de.Command("actions").description("Actions");return s.addCommand(new de.Command("list").description("List actions").action(async()=>{let r=await(0,Ie.oraPromise)(()=>e.action.list.send(),{...t,text:"Finding actions"});console.log(await r.result())})),s}var ue=require("commander"),je=require("ora");function me({client:e,ora:t}){let s=new ue.Command("channels").description("Channels");return s.addCommand(new ue.Command("list").description("List channels").action(async()=>{let r=await(0,je.oraPromise)(()=>e.channel.list.send(),{...t,text:"Finding channels"});console.log(await r.result())})),s}var ht=require("commander"),ge=require("ora");function he({client:e,ora:t}){let s=new ht.Command("contacts").description("Contacts");return s.addCommand(new ht.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async r=>{let n=await(0,ge.oraPromise)(()=>e.contact.get.send({id:r}),{...t,text:"Finding contact"});console.log(await n.result())})),s.addCommand(new ht.Command("list").description("List contacts").action(async()=>{let r=await(0,ge.oraPromise)(()=>e.contact.list.send(),{...t,text:"Finding contacts"});console.log(await r.result())})),s}var ft=require("commander"),fe=require("ora");function ye({client:e,ora:t}){let s=new ft.Command("conversations").description("Conversations");return s.addCommand(new ft.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async r=>{let n=await(0,fe.oraPromise)(()=>e.conversation.get.send({id:r}),{...t,text:"Finding conversation"});console.log(await n.result())})),s.addCommand(new ft.Command("list").description("List conversations").action(async()=>{let r=await(0,fe.oraPromise)(()=>e.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await r.result())})),s}var lt=require("commander"),yt=require("ora");function be({client:e,ora:t}){let s=new lt.Command("labels").description("Labels");return s.addCommand(new lt.Command("get").description("Find label").argument("<label>","Label ID").action(async r=>{let n=await(0,yt.oraPromise)(()=>e.label.get.send({id:r}),{...t,text:"Finding label"});console.log(await n.result())})),s.addCommand(new lt.Command("list").description("List labels").action(async()=>{let r=await(0,yt.oraPromise)(()=>e.label.list.send(),{...t,text:"Finding labels"});console.log(await r.result())})),s.addCommand(new lt.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async r=>{let n=await(0,yt.oraPromise)(()=>e.label.conversation.list.send({id:r}),{...t,text:"Finding conversations"});console.log(await n.result())})),s}var Ce=require("commander"),qe=require("ora");function xe({client:e,ora:t}){let s=new Ce.Command("messages").description("Messages");return s.addCommand(new Ce.Command("list").description("List messages").action(async()=>{let r=await(0,qe.oraPromise)(()=>e.message.list.send(),{...t,text:"Finding messages"});console.log(await r.result())})),s}var bt=require("commander"),Re=require("ora");function Ae({client:e,ora:t}){let s=new bt.Command("models").description("Models");return s.addCommand(new bt.Command("get").description("Find model").argument("<model>","Model ID").action(async r=>{let n=await(0,Re.oraPromise)(()=>e.model.get.send({id:r}),{...t,text:"Finding model"});console.log(await n.result())})),s.addCommand(new bt.Command("list").description("List models").action(async()=>{let r=await(0,Re.oraPromise)(()=>e.model.list.send(),{...t,text:"Finding models"});console.log(await r.result())})),s}var Ct=require("commander"),Oe=require("ora");function we({client:e,ora:t}){let s=new Ct.Command("sources").description("Sources");return s.addCommand(new Ct.Command("get").description("Find source").argument("<source>","Source ID").action(async r=>{let n=await(0,Oe.oraPromise)(()=>e.source.get.send({id:r}),{...t,text:"Finding source"});console.log(await n.result())})),s.addCommand(new Ct.Command("list").description("List sources").action(async()=>{let r=await(0,Oe.oraPromise)(()=>e.source.list.send(),{...t,text:"Finding sources"});console.log(await r.result())})),s}var i={ora:{spinner:"simpleDotsScrolling"},client:new dt(new d)},Ve=new Ue.Command("gds").description("Great Detail Support System").addCommand(le(i)).addCommand(me(i)).addCommand(he(i)).addCommand(ye(i)).addCommand(be(i)).addCommand(xe(i)).addCommand(Ae(i)).addCommand(we(i)),Le=Ve;Le.parseAsync(process.argv);
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as r}from"./chunk-MIIHAFPV.js";import"./chunk-O5KZWMF7.js";r.parseAsync(process.argv);
2
+ import{a as r}from"./chunk-YZZSFAQF.js";import"./chunk-P5VYQSL7.js";r.parseAsync(process.argv);