@great-detail/support-sdk 0.6.0 → 0.6.1
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.
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/{index-CslpVmui.d.cts → index-JciPp5xm.d.cts} +5 -5
- package/dist/{index-CslpVmui.d.ts → index-JciPp5xm.d.ts} +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/dist/cli/index.d.cts
CHANGED
package/dist/cli/index.d.ts
CHANGED
|
@@ -942,7 +942,7 @@ type GetConversationResponse = {
|
|
|
942
942
|
name?: string;
|
|
943
943
|
hasEnded: boolean;
|
|
944
944
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
945
|
-
|
|
945
|
+
channel: string;
|
|
946
946
|
createdAt: string;
|
|
947
947
|
updatedAt: string;
|
|
948
948
|
};
|
|
@@ -965,7 +965,7 @@ type ListContactConversationsResponse = {
|
|
|
965
965
|
name?: string;
|
|
966
966
|
hasEnded: boolean;
|
|
967
967
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
968
|
-
|
|
968
|
+
channel: string;
|
|
969
969
|
createdAt: string;
|
|
970
970
|
updatedAt: string;
|
|
971
971
|
};
|
|
@@ -992,7 +992,7 @@ type ListConversationsResponse<C extends IncludeOptions> = {
|
|
|
992
992
|
name?: string;
|
|
993
993
|
hasEnded: boolean;
|
|
994
994
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
995
|
-
|
|
995
|
+
channel: string;
|
|
996
996
|
createdAt: string;
|
|
997
997
|
updatedAt: string;
|
|
998
998
|
};
|
|
@@ -1034,7 +1034,7 @@ type ListLabelConversationsResponse = {
|
|
|
1034
1034
|
name?: string;
|
|
1035
1035
|
hasEnded: boolean;
|
|
1036
1036
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
1037
|
-
|
|
1037
|
+
channel: string;
|
|
1038
1038
|
createdAt: string;
|
|
1039
1039
|
updatedAt: string;
|
|
1040
1040
|
};
|
|
@@ -1058,7 +1058,7 @@ type UpdateConversationResponse = {
|
|
|
1058
1058
|
name?: string;
|
|
1059
1059
|
hasEnded: boolean;
|
|
1060
1060
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
1061
|
-
|
|
1061
|
+
channel: string;
|
|
1062
1062
|
createdAt: string;
|
|
1063
1063
|
updatedAt: string;
|
|
1064
1064
|
};
|
|
@@ -942,7 +942,7 @@ type GetConversationResponse = {
|
|
|
942
942
|
name?: string;
|
|
943
943
|
hasEnded: boolean;
|
|
944
944
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
945
|
-
|
|
945
|
+
channel: string;
|
|
946
946
|
createdAt: string;
|
|
947
947
|
updatedAt: string;
|
|
948
948
|
};
|
|
@@ -965,7 +965,7 @@ type ListContactConversationsResponse = {
|
|
|
965
965
|
name?: string;
|
|
966
966
|
hasEnded: boolean;
|
|
967
967
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
968
|
-
|
|
968
|
+
channel: string;
|
|
969
969
|
createdAt: string;
|
|
970
970
|
updatedAt: string;
|
|
971
971
|
};
|
|
@@ -992,7 +992,7 @@ type ListConversationsResponse<C extends IncludeOptions> = {
|
|
|
992
992
|
name?: string;
|
|
993
993
|
hasEnded: boolean;
|
|
994
994
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
995
|
-
|
|
995
|
+
channel: string;
|
|
996
996
|
createdAt: string;
|
|
997
997
|
updatedAt: string;
|
|
998
998
|
};
|
|
@@ -1034,7 +1034,7 @@ type ListLabelConversationsResponse = {
|
|
|
1034
1034
|
name?: string;
|
|
1035
1035
|
hasEnded: boolean;
|
|
1036
1036
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
1037
|
-
|
|
1037
|
+
channel: string;
|
|
1038
1038
|
createdAt: string;
|
|
1039
1039
|
updatedAt: string;
|
|
1040
1040
|
};
|
|
@@ -1058,7 +1058,7 @@ type UpdateConversationResponse = {
|
|
|
1058
1058
|
name?: string;
|
|
1059
1059
|
hasEnded: boolean;
|
|
1060
1060
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
1061
|
-
|
|
1061
|
+
channel: string;
|
|
1062
1062
|
createdAt: string;
|
|
1063
1063
|
updatedAt: string;
|
|
1064
1064
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var re=Object.create;var Ut=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Kt=(r,t)=>{for(var e in t)Ut(r,e,{get:t[e],enumerable:!0})},Vt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of se(t))!ie.call(r,s)&&s!==e&&Ut(r,s,{get:()=>t[s],enumerable:!(n=ne(t,s))||n.enumerable});return r};var Wt=(r,t,e)=>(e=r!=null?re(oe(r)):{},Vt(t||!r||!r.__esModule?Ut(e,"default",{value:r,enumerable:!0}):e,r)),ae=r=>Vt(Ut({},"__esModule",{value:!0}),r);var pe={};Kt(pe,{Client:()=>A,DEFAULT_SUPPORT_BASE_URL:()=>qt,Error:()=>Dt,KeyAuthentication:()=>Ft,PublicAuthentication:()=>It,TokenAuthentication:()=>wt,default:()=>A});module.exports=ae(pe);var qt="https://api.support.greatdetail.com",Yt={"X-Powered-By":"GDSupport/JavaScript"},$t="api-key";var y=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var x=require("zod"),T=class r{constructor(t){this._transport=t}static SCHEMA=x.z.object({title:x.z.string(),content:x.z.string(),account:x.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var _=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var E=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 S=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates"+(t?"?query="+encodeURIComponent(t):""),{...e,method:"GET"})}};var Ht=require("zod"),v=class r{constructor(t){this._transport=t}static SCHEMA=Ht.z.object({title:Ht.z.string().optional(),content:Ht.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var O=require("zod"),F=class r{constructor(t){this._transport=t}static SCHEMA=O.z.object({title:O.z.string(),description:O.z.string().optional(),account:O.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var w=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 I=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"})}};var Lt=require("zod"),U=class r{constructor(t){this._transport=t}static SCHEMA=Lt.z.object({title:Lt.z.string().optional(),description:Lt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var o=require("zod"),q=class r{constructor(t){this._transport=t}static SCHEMA=o.z.intersection(o.z.object({name:o.z.string().optional(),account:o.z.string()}),o.z.discriminatedUnion("source",[o.z.object({source:o.z.literal("meta-whatsapp")}),o.z.object({source:o.z.literal("twilio-sendgrid"),twilioSendgrid:o.z.object({displayName:o.z.string().optional(),outboundEmailAddress:o.z.string().email(),replyEmailAddress:o.z.string().optional(),inboundHostname:o.z.string(),apiKey:o.z.string()})})]));async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var H=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var L=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};var i=require("zod"),M=class r{constructor(t){this._transport=t}static SCHEMA=i.z.intersection(i.z.object({name:i.z.string().optional()}),i.z.discriminatedUnion("source",[i.z.object({source:i.z.literal("meta-whatsapp")}),i.z.object({source:i.z.literal("twilio-sendgrid"),twilioSendgrid:i.z.object({displayName:i.z.string().optional(),outboundEmailAddress:i.z.string().email().optional(),replyEmailAddress:i.z.string().optional(),inboundHostname:i.z.string().optional(),apiKey:i.z.string().optional()})})]));async send({id:t,body:e,request:n={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var f=require("zod"),j=class r{constructor(t){this._transport=t}static SCHEMA=f.z.object({account:f.z.string(),channel:f.z.string().optional(),location:f.z.enum(["header","footer"]),content:f.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var N=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 G=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 P=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var Gt=require("zod"),z=class r{constructor(t){this._transport=t}static SCHEMA=Gt.z.object({content:Gt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Jt="SUPPORT_ACCESS_TOKEN",Xt="SUPPORT_API_KEY",Qt="SUPPORT_KEY_NAME",Zt="SUPPORT_BASE_URL";var B=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let n=e.variant??"vcard",s=e.format??(e.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(n)+"&format="+encodeURIComponent(s)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var C=require("zod"),D=class r{constructor(t){this._transport=t}static SCHEMA=C.z.object({name:C.z.string(),account:C.z.string(),emailAddress:C.z.string().email().optional(),telephoneNumber:C.z.string().optional()});async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var k=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"GET"})}};var K=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"})}};var V=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 W=require("zod"),Y=class r{constructor(t){this._transport=t}static SCHEMA=W.z.object({name:W.z.string().optional(),emailAddress:W.z.string().email().optional(),telephoneNumber:W.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"})}};var J=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 X=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:n={}}={}){let s=[];return t&&s.push(["filter",t]),e?.latestMessage&&s.push(["include","latestMessage"]),this._transport.send("v1/conversations",{...n,method:"GET",searchParams:s})}};var Q=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 Mt=require("zod"),Z=class r{constructor(t){this._transport=t}static SCHEMA=Mt.z.object({status:Mt.z.enum(["AwaitingContactConversationStatus","AwaitingAgentConversationStatus","ResolvedConversationStatus","ClosedConversationStatus"]).optional(),hasEnded:Mt.z.boolean().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var tt=require("zod"),et=class r{constructor(t){this._transport=t}static SCHEMA=tt.z.object({title:tt.z.string(),description:tt.z.string().optional(),account:tt.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var st=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"})}};var jt=require("zod"),ot=class r{constructor(t){this._transport=t}static SCHEMA=jt.z.object({title:jt.z.string().optional(),description:jt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var it=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 at=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var ct=require("zod"),dt=class r{constructor(t){this._transport=t}static SCHEMA=ct.z.object({input:ct.z.string().max(65536),original:ct.z.string().max(65536),correction:ct.z.string().max(65536)});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var lt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var ut=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var gt=require("zod"),mt=class r{constructor(t){this._transport=t}static SCHEMA=gt.z.array(gt.z.object({role:gt.z.enum(["user","assistant"]),content:gt.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Pt=require("zod"),ht=class r{constructor(t){this._transport=t}static SCHEMA=Pt.z.object({content:Pt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var zt=require("zod"),b=class r{constructor(t){this._transport=t}static SCHEMA=zt.z.object({content:zt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var ft=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var Ct=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 bt=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 Bt=require("zod"),At=class r{constructor(t){this._transport=t}static SCHEMA=Bt.z.object({content:Bt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var d=require("zod"),Rt=class r{constructor(t){this._transport=t}static SCHEMA=d.z.discriminatedUnion("type",[d.z.object({type:d.z.literal("vapid"),endpoint:d.z.string().url(),keys:d.z.object({p256dh:d.z.string(),auth:d.z.string()})})]);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var yt=class r{constructor(t=r.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Yt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var xt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var Tt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let n=[];if(t){let s=Array.isArray(t)?t:[t];for(let R of s)n.push(["category",R])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:n})}};var te=Wt(require("is-network-error"),1),Nt=Wt(require("ky"),1);var a=class extends Error{};var c=class extends a{};var u=class extends c{static unauthenticated(){return new this("An unauthenticated request occurred")}};var g=class extends c{static forbidden(){return new this("A forbidden request occurred")}};var l=class extends a{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}`)}};var m=class extends a{};var h=class extends a{static badRequest(){return new this("Bad request")}};var _t=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Nt.default.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[n=>{for(let s of this.options.requestFilterables){let R=s.getHeaders();for(let[kt,ee]of Object.entries(R))n.headers.has(kt)||n.headers.set(kt,ee)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}async send(t,e){return await this.client(t,e).catch(n=>{if((0,te.default)(n))throw new m("A network error occurred",{cause:n});if(n instanceof Nt.HTTPError){let s=n.response.status;switch(console.error(JSON.stringify(n.response)),s){case 400:throw h.badRequest();case 401:throw u.unauthenticated();case 403:throw g.forbidden();case 404:throw l.notFound(t);case 405:throw l.forbiddenMethod(t,e.method??"GET")}}throw n})}};var Et=class{constructor(t){this._transport=t}async send({account:t,files:e,request:n={}}){let s=new FormData;for(let R of e)s.append("file",R);return this._transport.send("v1/uploads",{...n,method:"POST",body:s,searchParams:{account:t}})}};var St=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var vt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var p=require("zod"),Ot=class r{constructor(t){this._client=t}static SCHEMA=p.z.object({event:p.z.intersection(p.z.object({id:p.z.string(),createdAt:p.z.string().datetime()}),p.z.discriminatedUnion("type",[p.z.object({type:p.z.literal("contact.created"),contact:p.z.string()}),p.z.object({type:p.z.literal("message.created"),message:p.z.string()})]))});async event({request:t}){let{event:e}=r.SCHEMA.parse(t.body);return{event:e}}};var A=class r{static DEFAULT_BASE_URL=qt;_transport;constructor(t,{baseURL:e,...n}={}){this._transport=new _t({requestFilterables:[new yt,t],...n,baseURL:e?.toString()??r.getBaseURL()})}static getBaseURL(){return process.env[Zt]??this.DEFAULT_BASE_URL}get action(){return{list:new y(this._transport)}}get boilerplate(){return{get:new _(this._transport),list:new S(this._transport),update:new v(this._transport)}}get boilerplateCategory(){return{get:new w(this._transport),list:new I(this._transport),create:new F(this._transport),update:new U(this._transport),boilerplate:{list:new E(this._transport),create:new T(this._transport)}}}get channel(){return{get:new H(this._transport),list:new L(this._transport),update:new M(this._transport),create:new q(this._transport),compositionSection:{list:new G(this._transport)},message:{list:new it(this._transport)}}}get compositionSection(){return{get:new N(this._transport),list:new P(this._transport),create:new j(this._transport),update:new z(this._transport)}}get contact(){return{get:new k(this._transport),list:new K(this._transport),update:new Y(this._transport),create:new D(this._transport),conversation:{list:new J(this._transport)},note:{list:new Ct(this._transport),create:new ht(this._transport)},notificationSubscription:{create:new Rt(this._transport)},vcf:{get:new B(this._transport)}}}get conversation(){return{get:new $(this._transport),list:new X(this._transport),update:new Z(this._transport),create:new b(this._transport),message:{list:new at(this._transport)},note:{list:new bt(this._transport),create:new b(this._transport)}}}get label(){return{create:new et(this._transport),get:new nt(this._transport),list:new st(this._transport),update:new ot(this._transport),delete:new rt(this._transport),contact:{list:new V(this._transport)},conversation:{list:new Q(this._transport)}}}get message(){return{list:new pt(this._transport)}}get model(){return{get:new lt(this._transport),list:new ut(this._transport),response:{create:new mt(this._transport)},correction:{create:new dt(this._transport)}}}get note(){return{get:new ft(this._transport),update:new At(this._transport)}}get source(){return{get:new xt(this._transport),list:new Tt(this._transport)}}get upload(){return{get:new vt(this._transport),create:new Et(this._transport),delete:new St(this._transport)}}get webhook(){return new Ot(this)}};var Dt={};Kt(Dt,{AuthError:()=>c,AuthenticationError:()=>u,AuthorizationError:()=>g,LogicError:()=>l,NetworkError:()=>m,SupportError:()=>a,ValidationError:()=>h});var Ft=class r{static DEFAULT_NAME=$t;name;#t;constructor({name:t=process.env[Qt]??r.DEFAULT_NAME,key:e=process.env[Xt]}={}){if(!e)throw new Error("API Key option must be specified when using Key Authentication");this.name=t,this.#t=e}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var wt=class{#t;constructor({token:t=process.env[Jt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var It=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,KeyAuthentication,PublicAuthentication,TokenAuthentication});
|
|
1
|
+
"use strict";var re=Object.create;var Ut=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Kt=(r,t)=>{for(var e in t)Ut(r,e,{get:t[e],enumerable:!0})},Vt=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ne(t))!ie.call(r,n)&&n!==e&&Ut(r,n,{get:()=>t[n],enumerable:!(s=se(t,n))||s.enumerable});return r};var Wt=(r,t,e)=>(e=r!=null?re(oe(r)):{},Vt(t||!r||!r.__esModule?Ut(e,"default",{value:r,enumerable:!0}):e,r)),ae=r=>Vt(Ut({},"__esModule",{value:!0}),r);var pe={};Kt(pe,{Client:()=>A,DEFAULT_SUPPORT_BASE_URL:()=>qt,Error:()=>Dt,KeyAuthentication:()=>Ft,PublicAuthentication:()=>It,TokenAuthentication:()=>wt,default:()=>A});module.exports=ae(pe);var qt="https://api.support.greatdetail.com",Yt={"X-Powered-By":"GDSupport/JavaScript"},$t="api-key";var y=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var x=require("zod"),T=class r{constructor(t){this._transport=t}static SCHEMA=x.z.object({title:x.z.string(),content:x.z.string(),account:x.z.string()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var _=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var E=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 S=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates"+(t?"?query="+encodeURIComponent(t):""),{...e,method:"GET"})}};var Ht=require("zod"),v=class r{constructor(t){this._transport=t}static SCHEMA=Ht.z.object({title:Ht.z.string().optional(),content:Ht.z.string().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var O=require("zod"),F=class r{constructor(t){this._transport=t}static SCHEMA=O.z.object({title:O.z.string(),description:O.z.string().optional(),account:O.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var w=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 I=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/boilerplate-categories",{...t,method:"GET"})}};var Lt=require("zod"),U=class r{constructor(t){this._transport=t}static SCHEMA=Lt.z.object({title:Lt.z.string().optional(),description:Lt.z.string().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var o=require("zod"),q=class r{constructor(t){this._transport=t}static SCHEMA=o.z.intersection(o.z.object({name:o.z.string().optional(),account:o.z.string()}),o.z.discriminatedUnion("source",[o.z.object({source:o.z.literal("meta-whatsapp")}),o.z.object({source:o.z.literal("twilio-sendgrid"),twilioSendgrid:o.z.object({displayName:o.z.string().optional(),outboundEmailAddress:o.z.string().email(),replyEmailAddress:o.z.string().optional(),inboundHostname:o.z.string(),apiKey:o.z.string()})})]));async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var H=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var L=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};var i=require("zod"),M=class r{constructor(t){this._transport=t}static SCHEMA=i.z.intersection(i.z.object({name:i.z.string().optional()}),i.z.discriminatedUnion("source",[i.z.object({source:i.z.literal("meta-whatsapp")}),i.z.object({source:i.z.literal("twilio-sendgrid"),twilioSendgrid:i.z.object({displayName:i.z.string().optional(),outboundEmailAddress:i.z.string().email().optional(),replyEmailAddress:i.z.string().optional(),inboundHostname:i.z.string().optional(),apiKey:i.z.string().optional()})})]));async send({id:t,body:e,request:s={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var f=require("zod"),j=class r{constructor(t){this._transport=t}static SCHEMA=f.z.object({account:f.z.string(),channel:f.z.string().optional(),location:f.z.enum(["header","footer"]),content:f.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var N=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 G=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 P=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var Gt=require("zod"),z=class r{constructor(t){this._transport=t}static SCHEMA=Gt.z.object({content:Gt.z.string()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Jt="SUPPORT_ACCESS_TOKEN",Xt="SUPPORT_API_KEY",Qt="SUPPORT_KEY_NAME",Zt="SUPPORT_BASE_URL";var B=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let s=e.variant??"vcard",n=e.format??(e.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))}};var C=require("zod"),D=class r{constructor(t){this._transport=t}static SCHEMA=C.z.object({name:C.z.string(),account:C.z.string(),emailAddress:C.z.string().email().optional(),telephoneNumber:C.z.string().optional()});async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var k=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"GET"})}};var K=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"})}};var V=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 W=require("zod"),Y=class r{constructor(t){this._transport=t}static SCHEMA=W.z.object({name:W.z.string().optional(),emailAddress:W.z.string().email().optional(),telephoneNumber:W.z.string().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"})}};var J=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 X=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:s={}}={}){let n=[];return t&&n.push(["filter",t]),e?.latestMessage&&n.push(["include","latestMessage"]),this._transport.send("v1/conversations",{...s,method:"GET",searchParams:n})}};var Q=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 Mt=require("zod"),Z=class r{constructor(t){this._transport=t}static SCHEMA=Mt.z.object({status:Mt.z.enum(["AwaitingContactConversationStatus","AwaitingAgentConversationStatus","ResolvedConversationStatus","ClosedConversationStatus"]).optional(),hasEnded:Mt.z.boolean().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var tt=require("zod"),et=class r{constructor(t){this._transport=t}static SCHEMA=tt.z.object({title:tt.z.string(),description:tt.z.string().optional(),account:tt.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var st=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var nt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/labels",{...t,method:"GET"})}};var jt=require("zod"),ot=class r{constructor(t){this._transport=t}static SCHEMA=jt.z.object({title:jt.z.string().optional(),description:jt.z.string().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var it=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 at=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var ct=require("zod"),dt=class r{constructor(t){this._transport=t}static SCHEMA=ct.z.object({input:ct.z.string().max(65536),original:ct.z.string().max(65536),correction:ct.z.string().max(65536)});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var lt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var ut=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var gt=require("zod"),mt=class r{constructor(t){this._transport=t}static SCHEMA=gt.z.array(gt.z.object({role:gt.z.enum(["user","assistant"]),content:gt.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:s={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Pt=require("zod"),ht=class r{constructor(t){this._transport=t}static SCHEMA=Pt.z.object({content:Pt.z.string()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var zt=require("zod"),b=class r{constructor(t){this._transport=t}static SCHEMA=zt.z.object({content:zt.z.string()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var ft=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var Ct=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 bt=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 Bt=require("zod"),At=class r{constructor(t){this._transport=t}static SCHEMA=Bt.z.object({content:Bt.z.string().optional()});async send({id:t,body:e,request:s={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...s,method:"PATCH",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var d=require("zod"),Rt=class r{constructor(t){this._transport=t}static SCHEMA=d.z.discriminatedUnion("type",[d.z.object({type:d.z.literal("vapid"),endpoint:d.z.string().url(),keys:d.z.object({p256dh:d.z.string(),auth:d.z.string()})})]);async send({id:t,body:e,request:s={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var yt=class r{constructor(t=r.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Yt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var xt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var Tt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let s=[];if(t){let n=Array.isArray(t)?t:[t];for(let R of n)s.push(["category",R])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:s})}};var te=Wt(require("is-network-error"),1),Nt=Wt(require("ky"),1);var a=class extends Error{};var c=class extends a{};var u=class extends c{static unauthenticated(){return new this("An unauthenticated request occurred")}};var g=class extends c{static forbidden(){return new this("A forbidden request occurred")}};var l=class extends a{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}`)}};var m=class extends a{};var h=class extends a{static badRequest(){return new this("Bad request")}};var _t=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Nt.default.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[s=>{for(let n of this.options.requestFilterables){let R=n.getHeaders();for(let[kt,ee]of Object.entries(R))s.headers.has(kt)||s.headers.set(kt,ee)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}async send(t,e){return await this.client(t,e).catch(s=>{if((0,te.default)(s))throw new m("A network error occurred",{cause:s});if(s instanceof Nt.HTTPError){let n=s.response.status;switch(console.error(JSON.stringify(s.response)),n){case 400:throw h.badRequest();case 401:throw u.unauthenticated();case 403:throw g.forbidden();case 404:throw l.notFound(t);case 405:throw l.forbiddenMethod(t,e.method??"GET")}}throw s})}};var Et=class{constructor(t){this._transport=t}async send({account:t,files:e,request:s={}}){let n=new FormData;for(let R of e)n.append("file",R);return this._transport.send("v1/uploads",{...s,method:"POST",body:n,searchParams:{account:t}})}};var St=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var vt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var p=require("zod"),Ot=class r{constructor(t){this._client=t}static SCHEMA=p.z.object({event:p.z.intersection(p.z.object({id:p.z.string(),createdAt:p.z.string().datetime()}),p.z.discriminatedUnion("type",[p.z.object({type:p.z.literal("contact.created"),contact:p.z.string()}),p.z.object({type:p.z.literal("message.created"),message:p.z.string()})]))});async event({request:t}){let{event:e}=r.SCHEMA.parse(t.body);return{event:e}}};var A=class r{static DEFAULT_BASE_URL=qt;_transport;constructor(t,{baseURL:e,...s}={}){this._transport=new _t({requestFilterables:[new yt,t],...s,baseURL:e?.toString()??r.getBaseURL()})}static getBaseURL(){return process.env[Zt]??this.DEFAULT_BASE_URL}get action(){return{list:new y(this._transport)}}get boilerplate(){return{get:new _(this._transport),list:new S(this._transport),update:new v(this._transport)}}get boilerplateCategory(){return{get:new w(this._transport),list:new I(this._transport),create:new F(this._transport),update:new U(this._transport),boilerplate:{list:new E(this._transport),create:new T(this._transport)}}}get channel(){return{get:new H(this._transport),list:new L(this._transport),update:new M(this._transport),create:new q(this._transport),compositionSection:{list:new G(this._transport)},message:{list:new it(this._transport)}}}get compositionSection(){return{get:new N(this._transport),list:new P(this._transport),create:new j(this._transport),update:new z(this._transport)}}get contact(){return{get:new k(this._transport),list:new K(this._transport),update:new Y(this._transport),create:new D(this._transport),conversation:{list:new J(this._transport)},note:{list:new Ct(this._transport),create:new ht(this._transport)},notificationSubscription:{create:new Rt(this._transport)},vcf:{get:new B(this._transport)}}}get conversation(){return{get:new $(this._transport),list:new X(this._transport),update:new Z(this._transport),create:new b(this._transport),message:{list:new at(this._transport)},note:{list:new bt(this._transport),create:new b(this._transport)}}}get label(){return{create:new et(this._transport),get:new st(this._transport),list:new nt(this._transport),update:new ot(this._transport),delete:new rt(this._transport),contact:{list:new V(this._transport)},conversation:{list:new Q(this._transport)}}}get message(){return{list:new pt(this._transport)}}get model(){return{get:new lt(this._transport),list:new ut(this._transport),response:{create:new mt(this._transport)},correction:{create:new dt(this._transport)}}}get note(){return{get:new ft(this._transport),update:new At(this._transport)}}get source(){return{get:new xt(this._transport),list:new Tt(this._transport)}}get upload(){return{get:new vt(this._transport),create:new Et(this._transport),delete:new St(this._transport)}}get webhook(){return new Ot(this)}};var Dt={};Kt(Dt,{AuthError:()=>c,AuthenticationError:()=>u,AuthorizationError:()=>g,LogicError:()=>l,NetworkError:()=>m,SupportError:()=>a,ValidationError:()=>h});var Ft=class r{static DEFAULT_NAME=$t;name;#t;constructor({name:t=process.env[Qt]??r.DEFAULT_NAME,key:e=process.env[Xt]}={}){if(!e)throw new Error("API Key option must be specified when using Key Authentication");this.name=t,this.#t=e}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var wt=class{#t;constructor({token:t=process.env[Jt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var It=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,KeyAuthentication,PublicAuthentication,TokenAuthentication});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Authentication } from './index-
|
|
2
|
-
export { C as Client, b as CreateBoilerplateCategoryBoilerplateResponse, e as CreateBoilerplateCategoryResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-
|
|
1
|
+
import { A as Authentication } from './index-JciPp5xm.cjs';
|
|
2
|
+
export { C as Client, b as CreateBoilerplateCategoryBoilerplateResponse, e as CreateBoilerplateCategoryResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-JciPp5xm.cjs';
|
|
3
3
|
import 'ky';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
@@ -219,7 +219,7 @@ type CreateConversationResponse = {
|
|
|
219
219
|
name?: string;
|
|
220
220
|
hasEnded: boolean;
|
|
221
221
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
222
|
-
|
|
222
|
+
channel: string;
|
|
223
223
|
createdAt: string;
|
|
224
224
|
updatedAt: string;
|
|
225
225
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Authentication } from './index-
|
|
2
|
-
export { C as Client, b as CreateBoilerplateCategoryBoilerplateResponse, e as CreateBoilerplateCategoryResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-
|
|
1
|
+
import { A as Authentication } from './index-JciPp5xm.js';
|
|
2
|
+
export { C as Client, b as CreateBoilerplateCategoryBoilerplateResponse, e as CreateBoilerplateCategoryResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-JciPp5xm.js';
|
|
3
3
|
import 'ky';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
@@ -219,7 +219,7 @@ type CreateConversationResponse = {
|
|
|
219
219
|
name?: string;
|
|
220
220
|
hasEnded: boolean;
|
|
221
221
|
status: "AwaitingContactConversationStatus" | "AwaitingAgentConversationStatus" | "ResolvedConversationStatus" | "ClosedConversationStatus";
|
|
222
|
-
|
|
222
|
+
channel: string;
|
|
223
223
|
createdAt: string;
|
|
224
224
|
updatedAt: string;
|
|
225
225
|
};
|