@great-detail/support-sdk 0.8.2 → 0.8.3

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.
@@ -1 +1 @@
1
- var Ft=Object.defineProperty;var qt=(o,t)=>{for(var e in t)Ft(o,e,{get:t[e],enumerable:!0})};var Rt=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var xt="https://api.support.greatdetail.com",Tt={"X-Powered-By":"GDSupport/JavaScript"},Lt="api-key";import{z as p}from"zod";var u=class o{constructor(t){this._client=t}static SCHEMA=p.object({event:p.intersection(p.object({id:p.string(),createdAt:p.string().datetime()}),p.discriminatedUnion("type",[p.object({type:p.literal("contact.created"),contact:p.string()}),p.object({type:p.literal("message.created"),message:p.string()})]))});async event({request:t}){let{event:e}=o.SCHEMA.parse(t.body);return{event:e}}};var m=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var h=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/boilerplates",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var f=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var C=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...e,method:"GET"})}};var y=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates",{...e,method:"GET",searchParams:[...this._transport.queryQuery(t)]})}};var R=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var g=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var b=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...e,method:"GET"})}};var x=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){return this._transport.send("v1/boilerplate-categories",{...e,method:"GET",searchParams:[...this._transport.includeQuery(t??{})]})}};var T=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var _=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var O=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var v=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};import{z as _t}from"zod";var F=class o{constructor(t){this._transport=t}static SCHEMA=_t.object({overwrite:_t.boolean().optional()});async send({id:t,body:e,request:r={}}){return this._transport.send("v1/sources/twilio-sendgrid/channels/"+encodeURIComponent(t)+"/sync",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:o.SCHEMA.parse(e)})}};var I=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var U=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var S=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}};var q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...e,method:"GET"})}};var w=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var E=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var ne="SUPPORT_ACCESS_TOKEN",se="SUPPORT_API_KEY",pe="SUPPORT_KEY_NAME",Ot="SUPPORT_BASE_URL";var L=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let r=e.variant??"vcard",n=e.format??(e.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=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var A=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var N=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/contacts",{...e,method:"GET",searchParams:[...this._transport.queryQuery(t)]})}};var B=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...e,method:"GET"})}};var G=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var j=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var M=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var H=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...t?[["filter",t]]:[],...this._transport.includeQuery(e??{})]})}};var D=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var k=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var K=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var V=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var z=class{constructor(t){this._transport=t}async send({query:t,include:e,request:r={}}={}){return this._transport.send("v1/labels",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.includeQuery(e??{})]})}};var Y=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var J=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var W=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var X=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var tt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var et=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var ot=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var c=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var st=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var at=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var it=class o{constructor(t=o.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Tt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var dt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let r=[];if(t){let n=Array.isArray(t)?t:[t];for(let l of n)r.push(["category",l])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:r})}};import It from"is-network-error";import Ut,{HTTPError as St}from"ky";var s=class extends Error{static serverError(t){return new this("Server Error: "+t)}};var i=class extends s{};var lt=class extends i{static unauthenticated(){return new this("An unauthenticated request occurred")}};var ut=class extends i{static forbidden(){return new this("A forbidden request occurred")}};var a=class extends s{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,e){return new this(`Forbidden method for request: ${t} ${e}`)}static teapot(){return new this("I'm a teapot")}static rateLimited(){return new this("Request has been rate-limited")}};var mt=class extends s{};var d=class extends s{static badRequest(){return new this("Bad request")}static unsupportedMediaType(){return new this("Unsupported Media Type")}};var ht=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Ut.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[r=>{for(let n of this.options.requestFilterables){let l=n.getHeaders();for(let[bt,vt]of Object.entries(l))r.headers.has(bt)||r.headers.set(bt,vt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}includeQuery(t){let e=[];for(let r of Object.keys(t))e.push(["include",r]);return e}queryQuery(t){let e=[];return t&&e.push(["query",t]),e}async send(t,e){return await this.client(t,e).catch(r=>{if(It(r))throw new mt("A network error occurred",{cause:r});if(r instanceof St){let n=r.response.status;switch(console.error(JSON.stringify(r.response)),n){case 400:throw d.badRequest();case 401:throw lt.unauthenticated();case 403:throw ut.forbidden();case 404:throw a.notFound(t);case 405:throw a.forbiddenMethod(t,e.method??"GET");case 415:throw d.unsupportedMediaType();case 418:throw a.teapot();case 429:throw a.rateLimited()}if(n>=500&&n<600)throw s.serverError(n)}throw r})}};var ft=class{constructor(t){this._transport=t}async send({account:t,files:e,request:r={}}){let n=new FormData;for(let l of e)n.append("file",l);return this._transport.send("v1/uploads",{...r,method:"POST",body:n,searchParams:{account:t}})}};var Ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var yt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var gt=class o{static DEFAULT_BASE_URL=xt;_transport;constructor(t,{baseURL:e,...r}={}){this._transport=new ht({requestFilterables:[new it,t],...r,baseURL:e?.toString()??o.getBaseURL()})}static getBaseURL(){return process.env[Ot]??this.DEFAULT_BASE_URL}get action(){return{list:new m(this._transport)}}get boilerplate(){return{get:new f(this._transport),list:new y(this._transport),update:new R(this._transport),create:new h(this._transport)}}get boilerplateCategory(){return{get:new b(this._transport),list:new x(this._transport),create:new g(this._transport),update:new T(this._transport),boilerplate:{list:new C(this._transport)}}}get channel(){return{get:new O(this._transport),list:new v(this._transport),update:new I(this._transport),create:new _(this._transport),compositionSection:{list:new q(this._transport)},message:{list:new $(this._transport)},twilioSendgrid:{sync:new F(this._transport)}}}get compositionSection(){return{get:new S(this._transport),list:new w(this._transport),create:new U(this._transport),update:new E(this._transport)}}get contact(){return{get:new A(this._transport),list:new N(this._transport),update:new G(this._transport),create:new P(this._transport),conversation:{list:new M(this._transport)},note:{list:new nt(this._transport),create:new ot(this._transport)},notificationSubscription:{create:new at(this._transport)},vcf:{get:new L(this._transport)}}}get conversation(){return{get:new j(this._transport),list:new H(this._transport),update:new k(this._transport),create:new c(this._transport),message:{list:new J(this._transport)},note:{list:new st(this._transport),create:new c(this._transport)}}}get label(){return{create:new K(this._transport),get:new V(this._transport),list:new z(this._transport),update:new Y(this._transport),delete:new Q(this._transport),contact:{list:new B(this._transport)},conversation:{list:new D(this._transport)}}}get message(){return{list:new W(this._transport)}}get model(){return{get:new Z(this._transport),list:new tt(this._transport),response:{create:new et(this._transport)},correction:{create:new X(this._transport)}}}get note(){return{get:new rt(this._transport),update:new pt(this._transport)}}get source(){return{get:new ct(this._transport),list:new dt(this._transport)}}get upload(){return{get:new yt(this._transport),create:new ft(this._transport),delete:new Ct(this._transport)}}get webhook(){return new u(this)}};export{qt as a,Rt as b,ne as c,se as d,pe as e,xt as f,Lt as g,s as h,i,lt as j,ut as k,a as l,mt as m,d as n,gt as o};
1
+ var Ft=Object.defineProperty;var qt=(o,t)=>{for(var e in t)Ft(o,e,{get:t[e],enumerable:!0})};var gt=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var xt="https://api.support.greatdetail.com",Tt={"X-Powered-By":"GDSupport/JavaScript"},Lt="api-key";import{z as p}from"zod";var u=class o{constructor(t){this._client=t}static SCHEMA=p.object({event:p.intersection(p.object({id:p.string(),createdAt:p.string().datetime()}),p.discriminatedUnion("type",[p.object({type:p.literal("contact.created"),contact:p.string()}),p.object({type:p.literal("message.created"),message:p.string()})]))});async event({request:t}){let{event:e}=o.SCHEMA.parse(t.body);return{event:e}}};var m=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var h=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/boilerplates",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var f=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var C=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...e,method:"GET"})}};var y=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates",{...e,method:"GET",searchParams:[...this._transport.queryQuery(t)]})}};var g=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var R=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var b=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...e,method:"GET"})}};var x=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){return this._transport.send("v1/boilerplate-categories",{...e,method:"GET",searchParams:[...this._transport.includeQuery(t??{})]})}};var T=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var _=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var O=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var v=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};import{z as _t}from"zod";var F=class o{constructor(t){this._transport=t}static SCHEMA=_t.object({overwrite:_t.boolean().optional()});async send({id:t,body:e,request:r={}}){return this._transport.send("v1/sources/twilio-sendgrid/channels/"+encodeURIComponent(t)+"/sync",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:o.SCHEMA.parse(e)})}};var I=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var U=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var S=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}};var q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...e,method:"GET"})}};var w=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var E=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var ne="SUPPORT_ACCESS_TOKEN",se="SUPPORT_API_KEY",pe="SUPPORT_KEY_NAME",Ot="SUPPORT_BASE_URL";var L=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let r=e.variant??"vcard",n=e.format??(e.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=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var A=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var N=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/contacts",{...e,method:"GET",searchParams:[...this._transport.queryQuery(t)]})}};var B=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...e,method:"GET"})}};var G=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var j=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var M=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var H=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...t?[["filter",t]]:[],...this._transport.includeQuery(e??{})]})}};var D=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var k=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var K=class{constructor(t){this._transport=t}async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:t})}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var V=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var z=class{constructor(t){this._transport=t}async send({query:t,include:e,request:r={}}={}){return this._transport.send("v1/labels",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.includeQuery(e??{})]})}};var Y=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var J=class{constructor(t){this._transport=t}async send({id:t,include:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}};var W=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var X=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var tt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var et=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var ot=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var c=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var st=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...r,method:"PATCH",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var at=class{constructor(t){this._transport=t}async send({id:t,body:e,request:r={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...r,method:"POST",headers:{...r.headers,"Content-Type":"application/json"},json:e})}};var it=class o{constructor(t=o.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Tt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var dt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let r=[];if(t){let n=Array.isArray(t)?t:[t];for(let l of n)r.push(["category",l])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:r})}};import It from"is-network-error";import Ut,{HTTPError as St}from"ky";var s=class extends Error{static serverError(t){return new this("Server Error: "+t)}};var i=class extends s{};var lt=class extends i{static unauthenticated(){return new this("An unauthenticated request occurred")}};var ut=class extends i{static forbidden(){return new this("A forbidden request occurred")}};var a=class extends s{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,e){return new this(`Forbidden method for request: ${t} ${e}`)}static teapot(){return new this("I'm a teapot")}static rateLimited(){return new this("Request has been rate-limited")}};var mt=class extends s{};var d=class extends s{static badRequest(){return new this("Bad request")}static unsupportedMediaType(){return new this("Unsupported Media Type")}};var ht=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Ut.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[r=>{for(let n of this.options.requestFilterables){let l=n.getHeaders();for(let[bt,vt]of Object.entries(l))r.headers.has(bt)||r.headers.set(bt,vt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}includeQuery(t){let e=[];for(let r of Object.keys(t))e.push(["include",r]);return e}queryQuery(t){let e=[];return t&&e.push(["query",t]),e}async send(t,e){return await this.client(t,e).catch(r=>{if(It(r))throw new mt("A network error occurred",{cause:r});if(r instanceof St){let n=r.response.status;switch(console.error(JSON.stringify(r.response)),n){case 400:throw d.badRequest();case 401:throw lt.unauthenticated();case 403:throw ut.forbidden();case 404:throw a.notFound(t);case 405:throw a.forbiddenMethod(t,e.method??"GET");case 415:throw d.unsupportedMediaType();case 418:throw a.teapot();case 429:throw a.rateLimited()}if(n>=500&&n<600)throw s.serverError(n)}throw r})}};var ft=class{constructor(t){this._transport=t}async send({account:t,files:e,request:r={}}){let n=new FormData;for(let l of e)n.append("file",l);return this._transport.send("v1/uploads",{...r,method:"POST",body:n,searchParams:{account:t}})}};var Ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var yt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var Rt=class o{static DEFAULT_BASE_URL=xt;_transport;constructor(t,{baseURL:e,...r}={}){this._transport=new ht({requestFilterables:[new it,t],...r,baseURL:e?.toString()??o.getBaseURL()})}static getBaseURL(){return process.env[Ot]??this.DEFAULT_BASE_URL}get action(){return{list:new m(this._transport)}}get boilerplate(){return{get:new f(this._transport),list:new y(this._transport),update:new g(this._transport),create:new h(this._transport)}}get boilerplateCategory(){return{get:new b(this._transport),list:new x(this._transport),create:new R(this._transport),update:new T(this._transport),boilerplate:{list:new C(this._transport)}}}get channel(){return{get:new O(this._transport),list:new v(this._transport),update:new I(this._transport),create:new _(this._transport),compositionSection:{list:new q(this._transport)},message:{list:new $(this._transport)},twilioSendgrid:{sync:new F(this._transport)}}}get compositionSection(){return{get:new S(this._transport),list:new w(this._transport),create:new U(this._transport),update:new E(this._transport)}}get contact(){return{get:new A(this._transport),list:new N(this._transport),update:new G(this._transport),create:new P(this._transport),conversation:{list:new M(this._transport)},note:{list:new nt(this._transport),create:new ot(this._transport)},notificationSubscription:{create:new at(this._transport)},vcf:{get:new L(this._transport)}}}get conversation(){return{get:new j(this._transport),list:new H(this._transport),update:new k(this._transport),create:new c(this._transport),message:{list:new J(this._transport)},note:{list:new st(this._transport),create:new c(this._transport)}}}get label(){return{create:new K(this._transport),get:new V(this._transport),list:new z(this._transport),update:new Y(this._transport),delete:new Q(this._transport),contact:{list:new B(this._transport)},conversation:{list:new D(this._transport)}}}get message(){return{list:new W(this._transport)}}get model(){return{get:new Z(this._transport),list:new tt(this._transport),response:{create:new et(this._transport)},correction:{create:new X(this._transport)}}}get note(){return{get:new rt(this._transport),update:new pt(this._transport)}}get source(){return{get:new ct(this._transport),list:new dt(this._transport)}}get upload(){return{get:new yt(this._transport),create:new ft(this._transport),delete:new Ct(this._transport)}}get webhook(){return new u(this)}};export{qt as a,gt as b,ne as c,se as d,pe as e,xt as f,Lt as g,s as h,i,lt as j,ut as k,a as l,mt as m,d as n,Rt as o};
@@ -1 +1 @@
1
- import{b as y,o as j}from"./chunk-ILZUVSAO.js";import{Command as A}from"commander";import{Command as F}from"commander";import{oraPromise as I}from"ora";function m({client:t,ora:s}){let o=new F("actions").description("Actions");return o.addCommand(new F("list").description("List actions").action(async()=>{let n=await I(()=>t.action.list.send(),{...s,text:"Finding actions"});console.log(await n.json())})),o}import{Command as b}from"commander";import{oraPromise as S}from"ora";function r({client:t,ora:s}){let o=new b("channels").description("Channels");return o.addCommand(new b("list").description("List channels").action(async()=>{let n=await S(()=>t.channel.list.send(),{...s,text:"Finding channels"});console.log(await n.json())})),o}import{Command as d}from"commander";import{oraPromise as v}from"ora";function c({client:t,ora:s}){let o=new d("contacts").description("Contacts");return o.addCommand(new d("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let i=await v(()=>t.contact.get.send({id:n}),{...s,text:"Finding contact"});console.log(await i.json())})),o.addCommand(new d("list").description("List contacts").action(async()=>{let n=await v(()=>t.contact.list.send(),{...s,text:"Finding contacts"});console.log(await n.json())})),o}import{Command as p}from"commander";import{oraPromise as L}from"ora";function l({client:t,ora:s}){let o=new p("conversations").description("Conversations");return o.addCommand(new p("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let i=await L(()=>t.conversation.get.send({id:n}),{...s,text:"Finding conversation"});console.log(await i.json())})),o.addCommand(new p("list").description("List conversations").action(async()=>{let n=await L(()=>t.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await n.json())})),o}import{Command as a}from"commander";import{oraPromise as u}from"ora";function f({client:t,ora:s}){let o=new a("labels").description("Labels");return o.addCommand(new a("get").description("Find label").argument("<label>","Label ID").action(async n=>{let i=await u(()=>t.label.get.send({id:n}),{...s,text:"Finding label"});console.log(await i.json())})),o.addCommand(new a("list").description("List labels").action(async()=>{let n=await u(()=>t.label.list.send(),{...s,text:"Finding labels"});console.log(await n.json())})),o.addCommand(new a("conversations").description("Find label conversations").argument("<label>","Label ID").action(async n=>{let i=await u(()=>t.label.conversation.list.send({id:n}),{...s,text:"Finding conversations"});console.log(await i.json())})),o}import{Command as P}from"commander";import{oraPromise as M}from"ora";function C({client:t,ora:s}){let o=new P("messages").description("Messages");return o.addCommand(new P("list").description("List messages").action(async()=>{let n=await M(()=>t.message.list.send(),{...s,text:"Finding messages"});console.log(await n.json())})),o}import{Command as g}from"commander";import{oraPromise as h}from"ora";function w({client:t,ora:s}){let o=new g("models").description("Models");return o.addCommand(new g("get").description("Find model").argument("<model>","Model ID").action(async n=>{let i=await h(()=>t.model.get.send({id:n}),{...s,text:"Finding model"});console.log(await i.json())})),o.addCommand(new g("list").description("List models").action(async()=>{let n=await h(()=>t.model.list.send(),{...s,text:"Finding models"});console.log(await n.json())})),o}import{Command as O}from"commander";import{oraPromise as D}from"ora";function x({client:t,ora:s}){let o=new O("sources").description("Sources");return o.addCommand(new O("get").description("Find source").argument("<source>","Source ID").action(async n=>{let i=await D(()=>t.source.get.send({id:n}),{...s,text:"Finding source"});console.log(await i.json())})),o.addCommand(new O("list").description("List sources").action(async()=>{let n=await D(()=>t.source.list.send(),{...s,text:"Finding sources"});console.log(await n.json())})),o}var e={ora:{spinner:"simpleDotsScrolling"},client:new j(new y)},G=new A("gds").description("Great Detail Support System").addCommand(m(e)).addCommand(r(e)).addCommand(c(e)).addCommand(l(e)).addCommand(f(e)).addCommand(C(e)).addCommand(w(e)).addCommand(x(e)),go=G;export{go as a};
1
+ import{b as y,o as j}from"./chunk-THIMBTIM.js";import{Command as A}from"commander";import{Command as F}from"commander";import{oraPromise as I}from"ora";function m({client:t,ora:s}){let o=new F("actions").description("Actions");return o.addCommand(new F("list").description("List actions").action(async()=>{let n=await I(()=>t.action.list.send(),{...s,text:"Finding actions"});console.log(await n.json())})),o}import{Command as b}from"commander";import{oraPromise as S}from"ora";function r({client:t,ora:s}){let o=new b("channels").description("Channels");return o.addCommand(new b("list").description("List channels").action(async()=>{let n=await S(()=>t.channel.list.send(),{...s,text:"Finding channels"});console.log(await n.json())})),o}import{Command as d}from"commander";import{oraPromise as v}from"ora";function c({client:t,ora:s}){let o=new d("contacts").description("Contacts");return o.addCommand(new d("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let i=await v(()=>t.contact.get.send({id:n}),{...s,text:"Finding contact"});console.log(await i.json())})),o.addCommand(new d("list").description("List contacts").action(async()=>{let n=await v(()=>t.contact.list.send(),{...s,text:"Finding contacts"});console.log(await n.json())})),o}import{Command as p}from"commander";import{oraPromise as L}from"ora";function l({client:t,ora:s}){let o=new p("conversations").description("Conversations");return o.addCommand(new p("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let i=await L(()=>t.conversation.get.send({id:n}),{...s,text:"Finding conversation"});console.log(await i.json())})),o.addCommand(new p("list").description("List conversations").action(async()=>{let n=await L(()=>t.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await n.json())})),o}import{Command as a}from"commander";import{oraPromise as u}from"ora";function f({client:t,ora:s}){let o=new a("labels").description("Labels");return o.addCommand(new a("get").description("Find label").argument("<label>","Label ID").action(async n=>{let i=await u(()=>t.label.get.send({id:n}),{...s,text:"Finding label"});console.log(await i.json())})),o.addCommand(new a("list").description("List labels").action(async()=>{let n=await u(()=>t.label.list.send(),{...s,text:"Finding labels"});console.log(await n.json())})),o.addCommand(new a("conversations").description("Find label conversations").argument("<label>","Label ID").action(async n=>{let i=await u(()=>t.label.conversation.list.send({id:n}),{...s,text:"Finding conversations"});console.log(await i.json())})),o}import{Command as P}from"commander";import{oraPromise as M}from"ora";function C({client:t,ora:s}){let o=new P("messages").description("Messages");return o.addCommand(new P("list").description("List messages").action(async()=>{let n=await M(()=>t.message.list.send(),{...s,text:"Finding messages"});console.log(await n.json())})),o}import{Command as g}from"commander";import{oraPromise as h}from"ora";function w({client:t,ora:s}){let o=new g("models").description("Models");return o.addCommand(new g("get").description("Find model").argument("<model>","Model ID").action(async n=>{let i=await h(()=>t.model.get.send({id:n}),{...s,text:"Finding model"});console.log(await i.json())})),o.addCommand(new g("list").description("List models").action(async()=>{let n=await h(()=>t.model.list.send(),{...s,text:"Finding models"});console.log(await n.json())})),o}import{Command as O}from"commander";import{oraPromise as D}from"ora";function x({client:t,ora:s}){let o=new O("sources").description("Sources");return o.addCommand(new O("get").description("Find source").argument("<source>","Source ID").action(async n=>{let i=await D(()=>t.source.get.send({id:n}),{...s,text:"Finding source"});console.log(await i.json())})),o.addCommand(new O("list").description("List sources").action(async()=>{let n=await D(()=>t.source.list.send(),{...s,text:"Finding sources"});console.log(await n.json())})),o}var e={ora:{spinner:"simpleDotsScrolling"},client:new j(new y)},G=new A("gds").description("Great Detail Support System").addCommand(m(e)).addCommand(r(e)).addCommand(c(e)).addCommand(l(e)).addCommand(f(e)).addCommand(C(e)).addCommand(w(e)).addCommand(x(e)),go=G;export{go as a};
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { C as Client } from '../index-B2IqpXbf.cjs';
2
+ import { C as Client } from '../index-D3GVdvZ5.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-B2IqpXbf.js';
2
+ import { C as Client } from '../index-D3GVdvZ5.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-I5O65BGR.js";import"../chunk-ILZUVSAO.js";export{a as default};
1
+ import{a}from"../chunk-ZMYYH7TB.js";import"../chunk-THIMBTIM.js";export{a as default};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as r}from"./chunk-I5O65BGR.js";import"./chunk-ILZUVSAO.js";r.parseAsync(process.argv);
2
+ import{a as r}from"./chunk-ZMYYH7TB.js";import"./chunk-THIMBTIM.js";r.parseAsync(process.argv);
@@ -784,8 +784,9 @@ interface IncludeOptions$2 {
784
784
  latestMessage?: boolean;
785
785
  [key: string]: boolean | undefined;
786
786
  }
787
+ type FilterOptions = "unresolved" | "awaiting-contact" | "awaiting-agent";
787
788
  interface Options$s<C extends IncludeOptions$2> {
788
- filter?: "unresolved";
789
+ filter?: FilterOptions;
789
790
  include?: C;
790
791
  request?: RequestInit;
791
792
  }
@@ -784,8 +784,9 @@ interface IncludeOptions$2 {
784
784
  latestMessage?: boolean;
785
785
  [key: string]: boolean | undefined;
786
786
  }
787
+ type FilterOptions = "unresolved" | "awaiting-contact" | "awaiting-agent";
787
788
  interface Options$s<C extends IncludeOptions$2> {
788
- filter?: "unresolved";
789
+ filter?: FilterOptions;
789
790
  include?: C;
790
791
  request?: RequestInit;
791
792
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Authentication, a as Conversation } from './index-B2IqpXbf.cjs';
2
- export { c as Action, B as Boilerplate, g as BoilerplateCategory, l as Channel, C as Client, q as CompositionSection, w as Contact, h as CreateBoilerplateCategoryResponse, d as CreateBoilerplateResponse, p as CreateChannelResponse, t as CreateCompositionSectionResponse, a5 as CreateContactNoteResponse, af as CreateContactNotificationSubscriptionResponse, x as CreateContactResponse, a6 as CreateConversationNoteResponse, a2 as CreateCorrectionResponse, N as CreateLabelResponse, a3 as CreateResponseResponse, ah as CreateUploadResponse, P as DeleteLabelResponse, aj as DeleteUploadResponse, i as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, n as GetChannelResponse, r as GetCompositionSectionResponse, y as GetContactResponse, F as GetConversationResponse, Q as GetLabelResponse, a0 as GetModelResponse, a7 as GetNoteResponse, ac as GetSourceResponse, ai as GetUploadResponse, M as Label, L as ListActionsResponse, j as ListBoilerplateCategoriesResponse, e as ListBoilerplateCategoryBoilerplatesResponse, f as ListBoilerplatesResponse, u as ListChannelCompositionSectionsResponse, _ as ListChannelMessagesResponse, m as ListChannelsResponse, s as ListCompositionSectionsResponse, K as ListContactConversationsResponse, a8 as ListContactNotesResponse, z as ListContactsResponse, Y as ListConversationMessagesResponse, a9 as ListConversationNotesResponse, H as ListConversationsResponse, D as ListLabelContactsResponse, I as ListLabelConversationsResponse, S as ListLabelsResponse, Z as ListMessagesResponse, a1 as ListModelsResponse, ad as ListSourcesResponse, X as Message, $ as Model, a4 as Note, ae as NotificationSubscription, O as Options, R as RequestFilterable, ab as Source, b as TransportOptions, T as TwilioSendgridChannelSyncResponse, k as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, o as UpdateChannelResponse, v as UpdateCompositionSectionResponse, E as UpdateContactResponse, J as UpdateConversationResponse, V as UpdateLabelResponse, aa as UpdateNoteResponse, ag as Upload, W as WebhookResponse, C as default } from './index-B2IqpXbf.cjs';
1
+ import { A as Authentication, a as Conversation } from './index-D3GVdvZ5.cjs';
2
+ export { c as Action, B as Boilerplate, g as BoilerplateCategory, l as Channel, C as Client, q as CompositionSection, w as Contact, h as CreateBoilerplateCategoryResponse, d as CreateBoilerplateResponse, p as CreateChannelResponse, t as CreateCompositionSectionResponse, a5 as CreateContactNoteResponse, af as CreateContactNotificationSubscriptionResponse, x as CreateContactResponse, a6 as CreateConversationNoteResponse, a2 as CreateCorrectionResponse, N as CreateLabelResponse, a3 as CreateResponseResponse, ah as CreateUploadResponse, P as DeleteLabelResponse, aj as DeleteUploadResponse, i as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, n as GetChannelResponse, r as GetCompositionSectionResponse, y as GetContactResponse, F as GetConversationResponse, Q as GetLabelResponse, a0 as GetModelResponse, a7 as GetNoteResponse, ac as GetSourceResponse, ai as GetUploadResponse, M as Label, L as ListActionsResponse, j as ListBoilerplateCategoriesResponse, e as ListBoilerplateCategoryBoilerplatesResponse, f as ListBoilerplatesResponse, u as ListChannelCompositionSectionsResponse, _ as ListChannelMessagesResponse, m as ListChannelsResponse, s as ListCompositionSectionsResponse, K as ListContactConversationsResponse, a8 as ListContactNotesResponse, z as ListContactsResponse, Y as ListConversationMessagesResponse, a9 as ListConversationNotesResponse, H as ListConversationsResponse, D as ListLabelContactsResponse, I as ListLabelConversationsResponse, S as ListLabelsResponse, Z as ListMessagesResponse, a1 as ListModelsResponse, ad as ListSourcesResponse, X as Message, $ as Model, a4 as Note, ae as NotificationSubscription, O as Options, R as RequestFilterable, ab as Source, b as TransportOptions, T as TwilioSendgridChannelSyncResponse, k as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, o as UpdateChannelResponse, v as UpdateCompositionSectionResponse, E as UpdateContactResponse, J as UpdateConversationResponse, V as UpdateLabelResponse, aa as UpdateNoteResponse, ag as Upload, W as WebhookResponse, C as default } from './index-D3GVdvZ5.cjs';
3
3
  import 'ky';
4
4
  import 'zod';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Authentication, a as Conversation } from './index-B2IqpXbf.js';
2
- export { c as Action, B as Boilerplate, g as BoilerplateCategory, l as Channel, C as Client, q as CompositionSection, w as Contact, h as CreateBoilerplateCategoryResponse, d as CreateBoilerplateResponse, p as CreateChannelResponse, t as CreateCompositionSectionResponse, a5 as CreateContactNoteResponse, af as CreateContactNotificationSubscriptionResponse, x as CreateContactResponse, a6 as CreateConversationNoteResponse, a2 as CreateCorrectionResponse, N as CreateLabelResponse, a3 as CreateResponseResponse, ah as CreateUploadResponse, P as DeleteLabelResponse, aj as DeleteUploadResponse, i as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, n as GetChannelResponse, r as GetCompositionSectionResponse, y as GetContactResponse, F as GetConversationResponse, Q as GetLabelResponse, a0 as GetModelResponse, a7 as GetNoteResponse, ac as GetSourceResponse, ai as GetUploadResponse, M as Label, L as ListActionsResponse, j as ListBoilerplateCategoriesResponse, e as ListBoilerplateCategoryBoilerplatesResponse, f as ListBoilerplatesResponse, u as ListChannelCompositionSectionsResponse, _ as ListChannelMessagesResponse, m as ListChannelsResponse, s as ListCompositionSectionsResponse, K as ListContactConversationsResponse, a8 as ListContactNotesResponse, z as ListContactsResponse, Y as ListConversationMessagesResponse, a9 as ListConversationNotesResponse, H as ListConversationsResponse, D as ListLabelContactsResponse, I as ListLabelConversationsResponse, S as ListLabelsResponse, Z as ListMessagesResponse, a1 as ListModelsResponse, ad as ListSourcesResponse, X as Message, $ as Model, a4 as Note, ae as NotificationSubscription, O as Options, R as RequestFilterable, ab as Source, b as TransportOptions, T as TwilioSendgridChannelSyncResponse, k as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, o as UpdateChannelResponse, v as UpdateCompositionSectionResponse, E as UpdateContactResponse, J as UpdateConversationResponse, V as UpdateLabelResponse, aa as UpdateNoteResponse, ag as Upload, W as WebhookResponse, C as default } from './index-B2IqpXbf.js';
1
+ import { A as Authentication, a as Conversation } from './index-D3GVdvZ5.js';
2
+ export { c as Action, B as Boilerplate, g as BoilerplateCategory, l as Channel, C as Client, q as CompositionSection, w as Contact, h as CreateBoilerplateCategoryResponse, d as CreateBoilerplateResponse, p as CreateChannelResponse, t as CreateCompositionSectionResponse, a5 as CreateContactNoteResponse, af as CreateContactNotificationSubscriptionResponse, x as CreateContactResponse, a6 as CreateConversationNoteResponse, a2 as CreateCorrectionResponse, N as CreateLabelResponse, a3 as CreateResponseResponse, ah as CreateUploadResponse, P as DeleteLabelResponse, aj as DeleteUploadResponse, i as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, n as GetChannelResponse, r as GetCompositionSectionResponse, y as GetContactResponse, F as GetConversationResponse, Q as GetLabelResponse, a0 as GetModelResponse, a7 as GetNoteResponse, ac as GetSourceResponse, ai as GetUploadResponse, M as Label, L as ListActionsResponse, j as ListBoilerplateCategoriesResponse, e as ListBoilerplateCategoryBoilerplatesResponse, f as ListBoilerplatesResponse, u as ListChannelCompositionSectionsResponse, _ as ListChannelMessagesResponse, m as ListChannelsResponse, s as ListCompositionSectionsResponse, K as ListContactConversationsResponse, a8 as ListContactNotesResponse, z as ListContactsResponse, Y as ListConversationMessagesResponse, a9 as ListConversationNotesResponse, H as ListConversationsResponse, D as ListLabelContactsResponse, I as ListLabelConversationsResponse, S as ListLabelsResponse, Z as ListMessagesResponse, a1 as ListModelsResponse, ad as ListSourcesResponse, X as Message, $ as Model, a4 as Note, ae as NotificationSubscription, O as Options, R as RequestFilterable, ab as Source, b as TransportOptions, T as TwilioSendgridChannelSyncResponse, k as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, o as UpdateChannelResponse, v as UpdateCompositionSectionResponse, E as UpdateContactResponse, J as UpdateConversationResponse, V as UpdateLabelResponse, aa as UpdateNoteResponse, ag as Upload, W as WebhookResponse, C as default } from './index-D3GVdvZ5.js';
3
3
  import 'ky';
4
4
  import 'zod';
5
5
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as d,b as g,c as s,d as p,e as n,f as _,g as a,h as f,i as m,j as u,k as c,l as x,m as l,n as h,o as A}from"./chunk-ILZUVSAO.js";var E={};d(E,{AuthError:()=>m,AuthenticationError:()=>u,AuthorizationError:()=>c,LogicError:()=>x,NetworkError:()=>l,SupportError:()=>f,ValidationError:()=>h});var t=class e{static DEFAULT_NAME=a;name;#r;constructor({name:r=process.env[n]??e.DEFAULT_NAME,key:i=process.env[p]}={}){if(!i)throw new Error("API Key option must be specified when using Key Authentication");this.name=r,this.#r=i}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#r)}`}}};var o=class{#r;constructor({token:r=process.env[s]}={}){if(!r)throw new Error("Access Token option must be specified when using Token Authentication");this.#r=r}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#r}`}}};export{A as Client,_ as DEFAULT_SUPPORT_BASE_URL,E as Error,t as KeyAuthentication,g as PublicAuthentication,o as TokenAuthentication,A as default};
1
+ import{a as d,b as g,c as s,d as p,e as n,f as _,g as a,h as f,i as m,j as u,k as c,l as x,m as l,n as h,o as A}from"./chunk-THIMBTIM.js";var E={};d(E,{AuthError:()=>m,AuthenticationError:()=>u,AuthorizationError:()=>c,LogicError:()=>x,NetworkError:()=>l,SupportError:()=>f,ValidationError:()=>h});var t=class e{static DEFAULT_NAME=a;name;#r;constructor({name:r=process.env[n]??e.DEFAULT_NAME,key:i=process.env[p]}={}){if(!i)throw new Error("API Key option must be specified when using Key Authentication");this.name=r,this.#r=i}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#r)}`}}};var o=class{#r;constructor({token:r=process.env[s]}={}){if(!r)throw new Error("Access Token option must be specified when using Token Authentication");this.#r=r}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#r}`}}};export{A as Client,_ as DEFAULT_SUPPORT_BASE_URL,E as Error,t as KeyAuthentication,g as PublicAuthentication,o as TokenAuthentication,A as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-detail/support-sdk",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "type": "module",
5
5
  "description": "JavaScript SDK for the Great Detail Support System",
6
6
  "author": "Great Detail Ltd <info@greatdetail.com>",