@great-detail/support-sdk 0.27.0 → 0.28.0
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/index.cjs +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var pt=Object.create;var Y=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,mt=Object.prototype.hasOwnProperty;var Z=(n,t)=>{for(var e in t)Y(n,e,{get:t[e],enumerable:!0})},tt=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of at(t))!mt.call(n,r)&&r!==e&&Y(n,r,{get:()=>t[r],enumerable:!(o=it(t,r))||o.enumerable});return n};var ut=(n,t,e)=>(e=n!=null?pt(ct(n)):{},tt(t||!n||!n.__esModule?Y(e,"default",{value:n,enumerable:!0}):e,n)),lt=n=>tt(Y({},"__esModule",{value:!0}),n);var Ot={};Z(Ot,{Client:()=>l,DEFAULT_SUPPORT_BASE_URL:()=>K,Error:()=>X,SDK_VERSION:()=>gt,SupportError:()=>m,WHATSAPP_BUSINESS_PROFILE_VERTICAL:()=>dt,WHATSAPP_TEMPLATE_CATEGORIES:()=>Ct,WHATSAPP_TEMPLATE_INDUSTRIES:()=>At,WHATSAPP_TEMPLATE_LANGUAGES:()=>ht,WHATSAPP_TEMPLATE_QUALITY_SCORES:()=>_t,WHATSAPP_TEMPLATE_STATUSES:()=>ft,WHATSAPP_TEMPLATE_SUBCATEGORIES:()=>Tt,WHATSAPP_TEMPLATE_TOPICS:()=>Et,WHATSAPP_TEMPLATE_USECASES:()=>Rt,default:()=>l,eventWebhookSchema:()=>J});module.exports=lt(Ot);var K="https://api.support.greatdetail.com",et={"x-powered-by":"GDS/JavaScript"};var d=class{constructor(t){this._transport=t}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/accounts",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}get(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var f=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{filter:e,pagination:o,request:r={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...r,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:r={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...r,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var h=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var C=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...e,method:"GET"})}listByAccount(t,{filter:e,pagination:o,request:r={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...r,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...o,method:"PATCH",json:{...e,readAt:e.readAt instanceof Date&&typeof e.readAt.getMonth=="function"?e.readAt.toISOString():e.readAt}})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/actions/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,sort:e,pagination:o,request:r={}}={}){return this._transport.send("v1/actions",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var ot="SUPPORT_ACCESS_TOKEN",nt="SUPPORT_KEY_NAME",rt="SUPPORT_KEY_PASSWORD",Q="SUPPORT_SIGNING_KEY",st="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[nt],password:e=process.env[rt]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){let t=typeof this.name=="function"?this.name():this.name,e=typeof this.#t=="function"?this.#t():this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var A=class{#t;constructor({token:t=process.env[ot]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?this.#t():this.#t}`}}};var E=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/boilerplates/categories",{...r,method:"GET",searchParams:this._transport.query.build({include:o,pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"DELETE"})}sendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/sendgrid/sync",{...o,method:"POST",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/composition-sections",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var I=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",r=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(r)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({pagination:t,filter:e,sort:o,request:r={}}={}){return this._transport.send("v1/contacts",{...r,method:"GET",searchParams:this._transport.query.build({pagination:t,sort:o,filter:e})})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}merge(t,e,{request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}/merge`,{...o,method:"POST",json:{contact:e}})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,sort:e,pagination:o,include:r,request:s={}}={}){return this._transport.send("v1/conversations",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:r})})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}triggerResponse(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}/response`,{...e,method:"POST"})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...o,method:"PATCH",json:e})}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/feedback/conversation",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/feedback/conversation",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/escalations",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/escalations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var D=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/imports",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/imports",{...e,method:"POST",json:t})}delete(t,{body:e,request:o={}}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...o,method:"DELETE",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({request:t={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts",{...t,method:"GET"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...o,method:"PATCH",json:e})}};var P=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({whatsappAccount:t,channel:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers",{...o,method:"GET",searchParams:this._transport.query.build({filter:{whatsappAccount:t,channel:e}})})}};var G=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:r,category:s,language:p,request:i={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...i,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:r,category:s,language:p}})})}getByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"GET"})}deleteByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"DELETE"})}};var N=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/labels",{...r,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t,include:o})})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var W=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/messages",{...r,method:"GET",searchParams:this._transport.query.build({pagination:e,include:o,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/models/configs",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/models/configs",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var M=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/interfaces/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models/interfaces",{...t,method:"GET"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notes",{...o,method:"GET",searchParams:this._transport.query.build({filter:t,pagination:e})})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let r=[];if(e){let s=Array.isArray(e)?e:[e];for(let p of s)r.push(["category",p])}return t!==void 0&&r.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:r})}};var w=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};var z=ut(require("ky"),1);var m=class extends Error{constructor(e,o,{requestID:r,body:s,...p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,p);this.response=e;this.request=o;this.requestID=r}requestID};function u(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var H=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:r,custom:s}){return[...Object.entries(o??{}).flatMap(([p,i])=>n._filterExemptColumns.includes(p)?[]:this.query(`filter[${p}]`,i)),...this.query("filter",o?.filter),...Object.entries(r??{}).flatMap(([p,i])=>i?this.query("include",p):[]),...Object.entries(t??{}).flatMap(([p,i])=>i===void 0?[]:this.query("sort",(i==="desc"?"-":"")+u(p))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(s??{}).flatMap(([p,i])=>this.query(p,i))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let r of Array.isArray(e)?e:[e])o.push([t,u(r)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let r=[];if(t===void 0&&e===void 0)return r;let s=t?{dir:"before",value:u(t)}:void 0,p=e?{dir:"after",value:u(e)}:void 0,i=o==="after"?p||s:s||p;return i&&r.push([`page[${i.dir}]`,i.value]),r}};var q=class{client;options;query=H;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=z.default.create({prefixUrl:this.options.baseURL,headers:et,timeout:12e3,...o.request})}getURL(t){return new URL(t,this.options.baseURL).toString()}_generateRequestId(){let t="";if(globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"){let r=new Uint8Array(21);return globalThis.crypto.getRandomValues(r),t+Array.from(r,s=>s.toString(16).padStart(2,"0")).join("")}if(globalThis.crypto&&typeof globalThis.crypto.randomUUID=="function")return t+globalThis.crypto.randomUUID();let e=Date.now().toString(36),o=Math.random().toString(36).slice(2);return`${t}${e}-${o}`}send(t,e={}){let o=this._generateRequestId(),r=e.authentication??this.options.authentication,p=this.client.extend({headers:{...r.getHeaders(),"x-request-id":o}})(t,e).catch(async i=>{throw i instanceof z.HTTPError?new m(i.response,i.request,{requestID:o,body:await i.response.text(),cause:i}):i});return{requestID:o,response:()=>p,json:async()=>(await p).json()}}};var j=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,include:e,pagination:o,request:r={}}={}){return this._transport.send("v1/uploads",{...r,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let r=new FormData;for(let s of t)r.append("file",s);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:r})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),J=a.z.object({data:a.z.object({event:a.z.object({id:a.z.string(),type:a.z.string(),payload:a.z.record(a.z.string(),a.z.string()),createdAt:a.z.iso.datetime()})})});var V=class{constructor(t){this._transport=t}async event({key:t=process.env[Q],maxSignatures:e=3,request:o}){let r=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+Q);if(!r)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(r)?r.slice(0,e):[r]))throw new Error("Untrusted signature")}let{data:s}=J.parse(o.body);return{event:s.event}}async _verifySignature(t,e,o){let r=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let s of o)if(await crypto.subtle.verify("HMAC",r,new TextEncoder().encode(atob(s)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var $=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var l=class n{static DEFAULT_BASE_URL=K;static PublicAuthentication=E;static BasicAuthentication=c;static BearerAuthentication=A;_transport;account;accountAccessToken;accountConversationSettings;accountNotificationEvent;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationContext;conversationFeedback;escalation;label;import;integration;message;modelConfig;modelInterface;note;source;statistics;upload;webhook;webhookSubscription;constructor(t=new c,{baseURL:e,...o}={}){this._transport=new q({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new d(this._transport),this.accountAccessToken=new f(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new T(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new _(this._transport),this.channel=new g(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new I(this._transport),this.conversation=new x(this._transport),this.conversationContext=new v(this._transport),this.conversationFeedback=new S(this._transport),this.escalation=new y(this._transport),this.label=new N(this._transport),this.import=new D(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new P(this._transport),businessProfile:new L(this._transport),template:new G(this._transport)}},this.message=new W(this._transport),this.modelConfig=new k(this._transport),this.modelInterface=new M(this._transport),this.note=new F(this._transport),this.source=new B(this._transport),this.statistics=new w(this._transport),this.upload=new j(this._transport),this.webhook=new V(this._transport),this.webhookSubscription=new $(this._transport)}static getBaseURL(){return process.env[st]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var X={};Z(X,{SupportError:()=>m});var dt=["ALCOHOL","APPAREL","AUTO","BEAUTY","EDU","ENTERTAIN","EVENT_PLAN","FINANCE","GOVT","GROCERY","HEALTH","HOTEL","NONPROFIT","ONLINE_GAMBLING","OTC_DRUGS","OTHER","PHYSICAL_GAMBLING","PROF_SERVICES","RESTAURANT","RETAIL","TRAVEL"];var ft=["PENDING","APPROVED","REJECTED","IN_APPEAL","PAUSED","PENDING_DELETION","DELETED","DISABLED","LIMIT_EXCEEDED"],ht=["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","prs_AF","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","ps_AF","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CL","es_CO","es_CR","es_DO","es_EC","es_HN","es_MX","es_PA","es_PE","es_ES","es_UY","sw","sv","ta","te","th","th","tr","uk","ur","uz","vi","zu"],Ct=["AUTHENTICATION","MARKETING","UTILITY"],Tt=["ORDER_DETAILS","ORDER_STATUS"],At=["E_COMMERCE","FINANCIAL_SERVICES"],Et=["ACCOUNT_UPDATES","CUSTOMER_FEEDBACK","EVENT_REMINDER","FIXED_TEMPLATE_PRICE_TEST","IDENTITY_VERIFICATION","ORDER_MANAGEMENT","PAYMENTS"],Rt=["ACCOUNT_CREATION_CONFIRMATION","PAYMENT_DUE_REMINDER","FEEDBACK_SURVEY","PAYMENT_ACTION_REQUIRED","SHIPMENT_CONFIRMATION","PAYMENT_OVERDUE","DELIVERY_UPDATE","PAYMENT_CONFIRMATION","ORDER_DELAY","FRAUD_ALERT","DELIVERY_FAILED","AUTO_PAY_REMINDER","DELIVERY_CONFIRMATION","PAYMENT_SCHEDULED","ORDER_PICK_UP","PAYMENT_REJECT_FAIL","ORDER_ACTION_NEEDED","STATEMENT_AVAILABLE","ORDER_CONFIRMATION","LOW_BALANCE_WARNING","ORDER_OR_TRANSACTION_CANCEL","RECEIPT_ATTACHMENT","RETURN_CONFIRMATION","STATEMENT_ATTACHMENT","TRANSACTION_ALERT"],_t=["GREEN","YELLOW","RED","UNKNOWN"];var gt="0.27.0";0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SDK_VERSION,SupportError,WHATSAPP_BUSINESS_PROFILE_VERTICAL,WHATSAPP_TEMPLATE_CATEGORIES,WHATSAPP_TEMPLATE_INDUSTRIES,WHATSAPP_TEMPLATE_LANGUAGES,WHATSAPP_TEMPLATE_QUALITY_SCORES,WHATSAPP_TEMPLATE_STATUSES,WHATSAPP_TEMPLATE_SUBCATEGORIES,WHATSAPP_TEMPLATE_TOPICS,WHATSAPP_TEMPLATE_USECASES,eventWebhookSchema});
|
|
1
|
+
"use strict";var pt=Object.create;var Y=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,mt=Object.prototype.hasOwnProperty;var Z=(n,t)=>{for(var e in t)Y(n,e,{get:t[e],enumerable:!0})},tt=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of at(t))!mt.call(n,r)&&r!==e&&Y(n,r,{get:()=>t[r],enumerable:!(o=it(t,r))||o.enumerable});return n};var ut=(n,t,e)=>(e=n!=null?pt(ct(n)):{},tt(t||!n||!n.__esModule?Y(e,"default",{value:n,enumerable:!0}):e,n)),lt=n=>tt(Y({},"__esModule",{value:!0}),n);var Ot={};Z(Ot,{Client:()=>l,DEFAULT_SUPPORT_BASE_URL:()=>K,Error:()=>X,SDK_VERSION:()=>gt,SupportError:()=>m,WHATSAPP_BUSINESS_PROFILE_VERTICAL:()=>dt,WHATSAPP_TEMPLATE_CATEGORIES:()=>Ct,WHATSAPP_TEMPLATE_INDUSTRIES:()=>At,WHATSAPP_TEMPLATE_LANGUAGES:()=>ht,WHATSAPP_TEMPLATE_QUALITY_SCORES:()=>_t,WHATSAPP_TEMPLATE_STATUSES:()=>ft,WHATSAPP_TEMPLATE_SUBCATEGORIES:()=>Tt,WHATSAPP_TEMPLATE_TOPICS:()=>Et,WHATSAPP_TEMPLATE_USECASES:()=>Rt,default:()=>l,eventWebhookSchema:()=>J});module.exports=lt(Ot);var K="https://api.support.greatdetail.com",et={"x-powered-by":"GDS/JavaScript"};var d=class{constructor(t){this._transport=t}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/accounts",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}get(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var f=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{filter:e,pagination:o,request:r={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...r,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:r={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...r,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var h=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var C=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notifications/events/account",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}listByAccount(t,{filter:e,pagination:o,request:r={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...r,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...o,method:"PATCH",json:{...e,readAt:e.readAt instanceof Date&&typeof e.readAt.getMonth=="function"?e.readAt.toISOString():e.readAt}})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/actions/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,sort:e,pagination:o,request:r={}}={}){return this._transport.send("v1/actions",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var ot="SUPPORT_ACCESS_TOKEN",nt="SUPPORT_KEY_NAME",rt="SUPPORT_KEY_PASSWORD",Q="SUPPORT_SIGNING_KEY",st="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[nt],password:e=process.env[rt]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){let t=typeof this.name=="function"?this.name():this.name,e=typeof this.#t=="function"?this.#t():this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var A=class{#t;constructor({token:t=process.env[ot]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?this.#t():this.#t}`}}};var E=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/boilerplates/categories",{...r,method:"GET",searchParams:this._transport.query.build({include:o,pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"DELETE"})}sendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/sendgrid/sync",{...o,method:"POST",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/composition-sections",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var I=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",r=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(r)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({pagination:t,filter:e,sort:o,request:r={}}={}){return this._transport.send("v1/contacts",{...r,method:"GET",searchParams:this._transport.query.build({pagination:t,sort:o,filter:e})})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}merge(t,e,{request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}/merge`,{...o,method:"POST",json:{contact:e}})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,sort:e,pagination:o,include:r,request:s={}}={}){return this._transport.send("v1/conversations",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:r})})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}triggerResponse(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}/response`,{...e,method:"POST"})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...o,method:"PATCH",json:e})}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/feedback/conversation",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/feedback/conversation",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/escalations",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/escalations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var D=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/imports",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/imports",{...e,method:"POST",json:t})}delete(t,{body:e,request:o={}}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...o,method:"DELETE",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({request:t={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts",{...t,method:"GET"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...o,method:"PATCH",json:e})}};var P=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({whatsappAccount:t,channel:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers",{...o,method:"GET",searchParams:this._transport.query.build({filter:{whatsappAccount:t,channel:e}})})}};var G=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:r,category:s,language:p,request:i={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...i,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:r,category:s,language:p}})})}getByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"GET"})}deleteByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"DELETE"})}};var N=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/labels",{...r,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t,include:o})})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var W=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:r={}}={}){return this._transport.send("v1/messages",{...r,method:"GET",searchParams:this._transport.query.build({pagination:e,include:o,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/models/configs",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/models/configs",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var M=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/interfaces/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models/interfaces",{...t,method:"GET"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notes",{...o,method:"GET",searchParams:this._transport.query.build({filter:t,pagination:e})})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let r=[];if(e){let s=Array.isArray(e)?e:[e];for(let p of s)r.push(["category",p])}return t!==void 0&&r.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:r})}};var w=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};var z=ut(require("ky"),1);var m=class extends Error{constructor(e,o,{requestID:r,body:s,...p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,p);this.response=e;this.request=o;this.requestID=r}requestID};function u(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var q=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:r,custom:s}){return[...Object.entries(o??{}).flatMap(([p,i])=>n._filterExemptColumns.includes(p)?[]:this.query(`filter[${p}]`,i)),...this.query("filter",o?.filter),...Object.entries(r??{}).flatMap(([p,i])=>i?this.query("include",p):[]),...Object.entries(t??{}).flatMap(([p,i])=>i===void 0?[]:this.query("sort",(i==="desc"?"-":"")+u(p))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(s??{}).flatMap(([p,i])=>this.query(p,i))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let r of Array.isArray(e)?e:[e])o.push([t,u(r)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let r=[];if(t===void 0&&e===void 0)return r;let s=t?{dir:"before",value:u(t)}:void 0,p=e?{dir:"after",value:u(e)}:void 0,i=o==="after"?p||s:s||p;return i&&r.push([`page[${i.dir}]`,i.value]),r}};var H=class{client;options;query=q;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=z.default.create({prefixUrl:this.options.baseURL,headers:et,timeout:12e3,...o.request})}getURL(t){return new URL(t,this.options.baseURL).toString()}_generateRequestId(){let t="";if(globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"){let r=new Uint8Array(21);return globalThis.crypto.getRandomValues(r),t+Array.from(r,s=>s.toString(16).padStart(2,"0")).join("")}if(globalThis.crypto&&typeof globalThis.crypto.randomUUID=="function")return t+globalThis.crypto.randomUUID();let e=Date.now().toString(36),o=Math.random().toString(36).slice(2);return`${t}${e}-${o}`}send(t,e={}){let o=this._generateRequestId(),r=e.authentication??this.options.authentication,p=this.client.extend({headers:{...r.getHeaders(),"x-request-id":o}})(t,e).catch(async i=>{throw i instanceof z.HTTPError?new m(i.response,i.request,{requestID:o,body:await i.response.text(),cause:i}):i});return{requestID:o,response:()=>p,json:async()=>(await p).json()}}};var j=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,include:e,pagination:o,request:r={}}={}){return this._transport.send("v1/uploads",{...r,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let r=new FormData;for(let s of t)r.append("file",s);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:r})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),J=a.z.object({data:a.z.object({event:a.z.object({id:a.z.string(),type:a.z.string(),payload:a.z.record(a.z.string(),a.z.string()),createdAt:a.z.iso.datetime()})})});var V=class{constructor(t){this._transport=t}async event({key:t=process.env[Q],maxSignatures:e=3,request:o}){let r=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+Q);if(!r)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(r)?r.slice(0,e):[r]))throw new Error("Untrusted signature")}let{data:s}=J.parse(o.body);return{event:s.event}}async _verifySignature(t,e,o){let r=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let s of o)if(await crypto.subtle.verify("HMAC",r,new TextEncoder().encode(atob(s)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var $=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var l=class n{static DEFAULT_BASE_URL=K;static PublicAuthentication=E;static BasicAuthentication=c;static BearerAuthentication=A;_transport;account;accountAccessToken;accountConversationSettings;accountNotificationEvent;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationContext;conversationFeedback;escalation;label;import;integration;message;modelConfig;modelInterface;note;source;statistics;upload;webhook;webhookSubscription;constructor(t=new c,{baseURL:e,...o}={}){this._transport=new H({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new d(this._transport),this.accountAccessToken=new f(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new T(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new _(this._transport),this.channel=new g(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new I(this._transport),this.conversation=new x(this._transport),this.conversationContext=new v(this._transport),this.conversationFeedback=new S(this._transport),this.escalation=new y(this._transport),this.label=new N(this._transport),this.import=new D(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new P(this._transport),businessProfile:new L(this._transport),template:new G(this._transport)}},this.message=new W(this._transport),this.modelConfig=new k(this._transport),this.modelInterface=new M(this._transport),this.note=new F(this._transport),this.source=new B(this._transport),this.statistics=new w(this._transport),this.upload=new j(this._transport),this.webhook=new V(this._transport),this.webhookSubscription=new $(this._transport)}static getBaseURL(){return process.env[st]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var X={};Z(X,{SupportError:()=>m});var dt=["ALCOHOL","APPAREL","AUTO","BEAUTY","EDU","ENTERTAIN","EVENT_PLAN","FINANCE","GOVT","GROCERY","HEALTH","HOTEL","NONPROFIT","ONLINE_GAMBLING","OTC_DRUGS","OTHER","PHYSICAL_GAMBLING","PROF_SERVICES","RESTAURANT","RETAIL","TRAVEL"];var ft=["PENDING","APPROVED","REJECTED","IN_APPEAL","PAUSED","PENDING_DELETION","DELETED","DISABLED","LIMIT_EXCEEDED"],ht=["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","prs_AF","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","ps_AF","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CL","es_CO","es_CR","es_DO","es_EC","es_HN","es_MX","es_PA","es_PE","es_ES","es_UY","sw","sv","ta","te","th","th","tr","uk","ur","uz","vi","zu"],Ct=["AUTHENTICATION","MARKETING","UTILITY"],Tt=["ORDER_DETAILS","ORDER_STATUS"],At=["E_COMMERCE","FINANCIAL_SERVICES"],Et=["ACCOUNT_UPDATES","CUSTOMER_FEEDBACK","EVENT_REMINDER","FIXED_TEMPLATE_PRICE_TEST","IDENTITY_VERIFICATION","ORDER_MANAGEMENT","PAYMENTS"],Rt=["ACCOUNT_CREATION_CONFIRMATION","PAYMENT_DUE_REMINDER","FEEDBACK_SURVEY","PAYMENT_ACTION_REQUIRED","SHIPMENT_CONFIRMATION","PAYMENT_OVERDUE","DELIVERY_UPDATE","PAYMENT_CONFIRMATION","ORDER_DELAY","FRAUD_ALERT","DELIVERY_FAILED","AUTO_PAY_REMINDER","DELIVERY_CONFIRMATION","PAYMENT_SCHEDULED","ORDER_PICK_UP","PAYMENT_REJECT_FAIL","ORDER_ACTION_NEEDED","STATEMENT_AVAILABLE","ORDER_CONFIRMATION","LOW_BALANCE_WARNING","ORDER_OR_TRANSACTION_CANCEL","RECEIPT_ATTACHMENT","RETURN_CONFIRMATION","STATEMENT_ATTACHMENT","TRANSACTION_ALERT"],_t=["GREEN","YELLOW","RED","UNKNOWN"];var gt="0.28.0";0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SDK_VERSION,SupportError,WHATSAPP_BUSINESS_PROFILE_VERTICAL,WHATSAPP_TEMPLATE_CATEGORIES,WHATSAPP_TEMPLATE_INDUSTRIES,WHATSAPP_TEMPLATE_LANGUAGES,WHATSAPP_TEMPLATE_QUALITY_SCORES,WHATSAPP_TEMPLATE_STATUSES,WHATSAPP_TEMPLATE_SUBCATEGORIES,WHATSAPP_TEMPLATE_TOPICS,WHATSAPP_TEMPLATE_USECASES,eventWebhookSchema});
|
package/dist/index.d.cts
CHANGED
|
@@ -782,6 +782,12 @@ declare class AccountNotificationEventAPI {
|
|
|
782
782
|
response: () => Promise<ky.KyResponse<GetAccountNotificationEventResponse>>;
|
|
783
783
|
json: () => Promise<GetAccountNotificationEventResponse>;
|
|
784
784
|
};
|
|
785
|
+
list({ filter, pagination, request, }?: ListAccountNotificationEventsOptions): {
|
|
786
|
+
requestID: string;
|
|
787
|
+
response: () => Promise<ky.KyResponse<ListAccountNotificationEventsResponse>>;
|
|
788
|
+
json: () => Promise<ListAccountNotificationEventsResponse>;
|
|
789
|
+
};
|
|
790
|
+
/** @deprecated will be removed in v0.29.0 */
|
|
785
791
|
listByAccount(account: CurrentAccountID | AccountID, { filter, pagination, request, }?: ListAccountNotificationEventsOptions): {
|
|
786
792
|
requestID: string;
|
|
787
793
|
response: () => Promise<ky.KyResponse<ListAccountNotificationEventsResponse>>;
|
|
@@ -1263,7 +1269,7 @@ declare class BoilerplateCategoryAPI {
|
|
|
1263
1269
|
response: () => Promise<ky.KyResponse<UpdateBoilerplateCategoryResponse>>;
|
|
1264
1270
|
json: () => Promise<UpdateBoilerplateCategoryResponse>;
|
|
1265
1271
|
};
|
|
1266
|
-
delete(id: BoilerplateCategoryID, { request }
|
|
1272
|
+
delete(id: BoilerplateCategoryID, { request }?: DeleteBoilerplateCategoryOptions): {
|
|
1267
1273
|
requestID: string;
|
|
1268
1274
|
response: () => Promise<ky.KyResponse<DeleteBoilerplateCategoryResponse>>;
|
|
1269
1275
|
json: () => Promise<DeleteBoilerplateCategoryResponse>;
|
|
@@ -1407,7 +1413,7 @@ declare class BoilerplateContentAPI {
|
|
|
1407
1413
|
response: () => Promise<ky.KyResponse<UpdateBoilerplateContentResponse>>;
|
|
1408
1414
|
json: () => Promise<UpdateBoilerplateContentResponse>;
|
|
1409
1415
|
};
|
|
1410
|
-
delete(id: BoilerplateContentID, { request }
|
|
1416
|
+
delete(id: BoilerplateContentID, { request }?: DeleteBoilerplateContentOptions): {
|
|
1411
1417
|
requestID: string;
|
|
1412
1418
|
response: () => Promise<ky.KyResponse<DeleteBoilerplateContentResponse>>;
|
|
1413
1419
|
json: () => Promise<DeleteBoilerplateContentResponse>;
|
|
@@ -4500,6 +4506,6 @@ declare namespace index {
|
|
|
4500
4506
|
}
|
|
4501
4507
|
|
|
4502
4508
|
/** SDK Version */
|
|
4503
|
-
declare const SDK_VERSION = "0.
|
|
4509
|
+
declare const SDK_VERSION = "0.28.0";
|
|
4504
4510
|
|
|
4505
4511
|
export { type Account, type AccountAccessToken, type AccountAccessTokenID, type AccountAccessTokenWebhookEventType, type AccountConversationSettings, type AccountID, type AccountNotificationEvent, type AccountNotificationEventEventType, type AccountStatus, type AccountWebhookWebhookEventType, type Action, type ActionID, type ActionStatus, type ActiveConversationStatus, type BoilerplateCategory, type BoilerplateCategoryID, type BoilerplateContent, type BoilerplateContentID, type Channel, type ChannelConversationSettings, type ChannelID, type ChannelStatus, Client, type CompositionSection, type CompositionSectionID, type CompositionSectionLocation, type ConcludedConversationStatus, type Contact, type ContactCustomMetadata, type ContactID, type ContactStatus, type ContactType, type ContactWebhookEventType, type Conversation, type ConversationCustomMetadata, type ConversationFeedback, type ConversationID, type ConversationSettings, type ConversationStatus, type ConversationWebhookEventType, type CountResponsePagination, type CreateAccountAccessTokenOptions, type CreateAccountAccessTokenPayload, type CreateAccountAccessTokenResponse, type CreateAccountOptions, type CreateAccountPayload, type CreateAccountResponse, type CreateBoilerplateCategoryOptions, type CreateBoilerplateCategoryPayload, type CreateBoilerplateCategoryResponse, type CreateBoilerplateContentOptions, type CreateBoilerplateContentPayload, type CreateBoilerplateContentResponse, type CreateChannelOptions, type CreateChannelPayload, type CreateChannelResponse, type CreateCompositionSectionOptions, type CreateCompositionSectionPayload, type CreateCompositionSectionResponse, type CreateContactOptions, type CreateContactPayload, type CreateContactResponse, type CreateConversationFeedbackOptions, type CreateConversationFeedbackPayload, type CreateConversationFeedbackResponse, type CreateConversationOptions, type CreateConversationPayload, type CreateConversationResponse, type CreateEscalationOptions, type CreateEscalationPayload, type CreateEscalationResponse, type CreateImportOptions, type CreateImportPayload, type CreateImportResponse, type CreateLabelOptions, type CreateLabelPayload, type CreateLabelResponse, type CreateMessageOptions, type CreateMessagePayload, type CreateMessageResponse, type CreateModelConfigOptions, type CreateModelConfigPayload, type CreateModelConfigResponse, type CreateNoteOptions, type CreateNotePayload, type CreateNoteResponse, type CreateUploadIncludeOptions, type CreateUploadOptions, type CreateUploadResponse, type CreateWebhookSubscriptionOptions, type CreateWebhookSubscriptionPayload, type CreateWebhookSubscriptionResponse, type CurrentAccountID, type CursorResponsePagination, type CustomChannelCustomMetadata, DEFAULT_SUPPORT_BASE_URL, type DeleteAccountAccessTokenOptions, type DeleteAccountAccessTokenPayload, type DeleteAccountAccessTokenResponse, type DeleteAccountOptions, type DeleteAccountResponse, type DeleteBoilerplateCategoryOptions, type DeleteBoilerplateCategoryResponse, type DeleteBoilerplateContentOptions, type DeleteBoilerplateContentResponse, type DeleteChannelOptions, type DeleteChannelResponse, type DeleteContactOptions, type DeleteContactResponse, type DeleteConversationFeedbackOptions, type DeleteConversationFeedbackResponse, type DeleteConversationOptions, type DeleteConversationResponse, type DeleteEscalationOptions, type DeleteEscalationResponse, type DeleteLabelOptions, type DeleteLabelResponse, type DeleteMessageOptions, type DeleteMessageResponse, type DeleteModelConfigOptions, type DeleteModelConfigResponse, type DeleteUploadOptions, type DeleteUploadResponse, type DeleteWebhookSubscriptionOptions, type DeleteWebhookSubscriptionResponse, type DeleteWhatsappAccountTemplateOptions, type DeleteWhatsappAccountTemplateResponse, index as Error, type ErrorResponse, type ErrorSourcePath, type ErrorSourcePrefix, type ErrorType, type Escalation, type EventWebhookOptions, type GetAccountAccessTokenOptions, type GetAccountAccessTokenResponse, type GetAccountConversationSettingsOptions, type GetAccountConversationSettingsResponse, type GetAccountNotificationEventOptions, type GetAccountNotificationEventResponse, type GetAccountOptions, type GetAccountResponse, type GetActionOptions, type GetActionResponse, type GetBoilerplateCategoryOptions, type GetBoilerplateCategoryResponse, type GetBoilerplateContentOptions, type GetBoilerplateContentResponse, type GetChannelConversationSettingsOptions, type GetChannelConversationSettingsResponse, type GetChannelOptions, type GetChannelResponse, type GetCompositionSectionOptions, type GetCompositionSectionResponse, type GetContactIncludeOptions, type GetContactOptions, type GetContactResponse, type GetContactVCFOptions, type GetConversationFeedbackOptions, type GetConversationFeedbackResponse, type GetConversationIncludeOptions, type GetConversationOptions, type GetConversationResponse, type GetEscalationOptions, type GetEscalationResponse, type GetImportOptions, type GetImportResponse, type GetLabelOptions, type GetLabelResponse, type GetMessageOptions, type GetMessageResponse, type GetModelConfigOptions, type GetModelConfigResponse, type GetModelInterfaceOptions, type GetModelInterfaceResponse, type GetNoteOptions, type GetNoteResponse, type GetSourceOptions, type GetSourceResponse, type GetUploadIncludeOptions, type GetUploadOptions, type GetUploadResponse, type GetWebhookSubscriptionOptions, type GetWebhookSubscriptionResponse, type GetWhatsappAccountIncludeOptions, type GetWhatsappAccountOptions, type GetWhatsappAccountResponse, type GetWhatsappAccountTemplateOptions, type GetWhatsappAccountTemplateResponse, type GetWhatsappBusinessProfileOptions, type GetWhatsappBusinessProfileResponse, type GetWhatsappPhoneNumberIncludeOptions, type GetWhatsappPhoneNumberOptions, type GetWhatsappPhoneNumberResponse, type Import, type ImportID, type ImportStatus, type ImportType, type ImportWebhookEventType, type Label, type LabelID, type LexicalDirection, type LexicalHeadingNode, type LexicalHorizontalRuleNode, type LexicalIndent, type LexicalLinkNode, type LexicalListItemNode, type LexicalListNode, type LexicalParagraphNode, type LexicalQuoteNode, type LexicalRootNode, type LexicalTextNode, type LexicalUploadNode, type ListAccountAccessTokensOptions, type ListAccountAccessTokensResponse, type ListAccountNotificationEventsFilterOptions, type ListAccountNotificationEventsOptions, type ListAccountNotificationEventsResponse, type ListAccountsOptions, type ListAccountsResponse, type ListActionsOptions, type ListActionsResponse, type ListBoilerplateCategoriesIncludeOptions, type ListBoilerplateCategoriesOptions, type ListBoilerplateCategoriesResponse, type ListBoilerplateContentsOptions, type ListBoilerplateContentsResponse, type ListChannelsOptions, type ListChannelsResponse, type ListCompositionSectionsOptions, type ListCompositionSectionsResponse, type ListContactsOptions, type ListContactsResponse, type ListConversationFeedbackOptions, type ListConversationFeedbackResponse, type ListConversationOptions, type ListConversationsFilterOptions, type ListConversationsIncludeOptions, type ListConversationsResponse, type ListEscalationsOptions, type ListEscalationsResponse, type ListImportsOptions, type ListImportsResponse, type ListLabelsIncludeOptions, type ListLabelsOptions, type ListLabelsResponse, type ListMessagesIncludeOptions, type ListMessagesOptions, type ListMessagesResponse, type ListModelConfigsOptions, type ListModelConfigsResponse, type ListModelInterfacesOptions, type ListModelInterfacesResponse, type ListNotesOptions, type ListNotesResponse, type ListSourcesOptions, type ListSourcesResponse, type ListUploadsIncludeOptions, type ListUploadsOptions, type ListUploadsResponse, type ListWebhookSubscriptionsOptions, type ListWebhookSubscriptionsResponse, type ListWhatsappAccountTemplatesOptions, type ListWhatsappAccountTemplatesResponse, type ListWhatsappAccountsOptions, type ListWhatsappAccountsResponse, type ListWhatsappPhoneNumbersOptions, type ListWhatsappPhoneNumbersResponse, type Message, type MessageCustomMetadata, type MessageEventType, type MessageID, type MessageRole, type MessageStatus, type MessageType, type MessageVisibility, type MessageWebhookEventType, type ModelConfig, type ModelInterface, type ModelInterfaceID, type Note, type NoteID, type NotificationEvent, type Options$1 as Options, type ResponseData, type ResponseMeta, type ResponseTimestamp, SDK_VERSION, type SendChannelSyncPayload, type SendgridChannelSyncOptions, type SendgridChannelSyncResponse, type SortOptions, type Source, type SourceAdornment, type SourceID, SupportError, type TestWebhookSubscriptionOptions, type TestWebhookSubscriptionResponse, type Options$5 as TransportOptions, type TriggerResponseConversationOptions, type TriggerResponseConversationResponse, type UpdateAccountConversationSettingsOptions, type UpdateAccountConversationSettingsPayload, type UpdateAccountConversationSettingsResponse, type UpdateAccountOptions, type UpdateAccountPayload, type UpdateAccountResponse, type UpdateBoilerplateCategoryOptions, type UpdateBoilerplateCategoryPayload, type UpdateBoilerplateCategoryResponse, type UpdateBoilerplateContentOptions, type UpdateBoilerplateContentPayload, type UpdateBoilerplateContentResponse, type UpdateChannelConversationSettingsOptions, type UpdateChannelConversationSettingsPayload, type UpdateChannelConversationSettingsResponse, type UpdateChannelOptions, type UpdateChannelPayload, type UpdateChannelResponse, type UpdateCompositionSectionOptions, type UpdateCompositionSectionPayload, type UpdateCompositionSectionResponse, type UpdateContactOptions, type UpdateContactPayload, type UpdateContactResponse, type UpdateConversationOptions, type UpdateConversationPayload, type UpdateConversationResponse, type UpdateLabelOptions, type UpdateLabelPayload, type UpdateLabelResponse, type UpdateModelConfigOptions, type UpdateModelConfigPayload, type UpdateModelConfigResponse, type UpdateNoteOptions, type UpdateNotePayload, type UpdateNoteResponse, type UpdateWhatsappBusinessProfileOptions, type UpdateWhatsappBusinessProfilePayload, type UpdateWhatsappBusinessProfileResponse, type Upload, type UploadID, WHATSAPP_BUSINESS_PROFILE_VERTICAL, WHATSAPP_TEMPLATE_CATEGORIES, WHATSAPP_TEMPLATE_INDUSTRIES, WHATSAPP_TEMPLATE_LANGUAGES, WHATSAPP_TEMPLATE_QUALITY_SCORES, WHATSAPP_TEMPLATE_STATUSES, WHATSAPP_TEMPLATE_SUBCATEGORIES, WHATSAPP_TEMPLATE_TOPICS, WHATSAPP_TEMPLATE_USECASES, type WebhookEventPayload, type WebhookEventType, type WebhookResponse, type WebhookSubscription, type WebhookSubscriptionID, type WebhookSubscriptionWebhookEventType, type WhatsappAccount, type WhatsappAccountDetail, type WhatsappAccountTemplate, type WhatsappBusinessProfileDetail, type WhatsappLibraryTemplate, type WhatsappPhoneNumber, type WhatsappTemplateButton, type WhatsappTemplateCategory, type WhatsappTemplateIndustry, type WhatsappTemplateLanguage, type WhatsappTemplateParameterFormat, type WhatsappTemplateQualityScore, type WhatsappTemplateRejectionReason, type WhatsappTemplateStatus, type WhatsappTemplateSubcategory, type WhatsappTemplateTopic, type WhatsappTemplateUseCase, Client as default, eventWebhookSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -782,6 +782,12 @@ declare class AccountNotificationEventAPI {
|
|
|
782
782
|
response: () => Promise<ky.KyResponse<GetAccountNotificationEventResponse>>;
|
|
783
783
|
json: () => Promise<GetAccountNotificationEventResponse>;
|
|
784
784
|
};
|
|
785
|
+
list({ filter, pagination, request, }?: ListAccountNotificationEventsOptions): {
|
|
786
|
+
requestID: string;
|
|
787
|
+
response: () => Promise<ky.KyResponse<ListAccountNotificationEventsResponse>>;
|
|
788
|
+
json: () => Promise<ListAccountNotificationEventsResponse>;
|
|
789
|
+
};
|
|
790
|
+
/** @deprecated will be removed in v0.29.0 */
|
|
785
791
|
listByAccount(account: CurrentAccountID | AccountID, { filter, pagination, request, }?: ListAccountNotificationEventsOptions): {
|
|
786
792
|
requestID: string;
|
|
787
793
|
response: () => Promise<ky.KyResponse<ListAccountNotificationEventsResponse>>;
|
|
@@ -1263,7 +1269,7 @@ declare class BoilerplateCategoryAPI {
|
|
|
1263
1269
|
response: () => Promise<ky.KyResponse<UpdateBoilerplateCategoryResponse>>;
|
|
1264
1270
|
json: () => Promise<UpdateBoilerplateCategoryResponse>;
|
|
1265
1271
|
};
|
|
1266
|
-
delete(id: BoilerplateCategoryID, { request }
|
|
1272
|
+
delete(id: BoilerplateCategoryID, { request }?: DeleteBoilerplateCategoryOptions): {
|
|
1267
1273
|
requestID: string;
|
|
1268
1274
|
response: () => Promise<ky.KyResponse<DeleteBoilerplateCategoryResponse>>;
|
|
1269
1275
|
json: () => Promise<DeleteBoilerplateCategoryResponse>;
|
|
@@ -1407,7 +1413,7 @@ declare class BoilerplateContentAPI {
|
|
|
1407
1413
|
response: () => Promise<ky.KyResponse<UpdateBoilerplateContentResponse>>;
|
|
1408
1414
|
json: () => Promise<UpdateBoilerplateContentResponse>;
|
|
1409
1415
|
};
|
|
1410
|
-
delete(id: BoilerplateContentID, { request }
|
|
1416
|
+
delete(id: BoilerplateContentID, { request }?: DeleteBoilerplateContentOptions): {
|
|
1411
1417
|
requestID: string;
|
|
1412
1418
|
response: () => Promise<ky.KyResponse<DeleteBoilerplateContentResponse>>;
|
|
1413
1419
|
json: () => Promise<DeleteBoilerplateContentResponse>;
|
|
@@ -4500,6 +4506,6 @@ declare namespace index {
|
|
|
4500
4506
|
}
|
|
4501
4507
|
|
|
4502
4508
|
/** SDK Version */
|
|
4503
|
-
declare const SDK_VERSION = "0.
|
|
4509
|
+
declare const SDK_VERSION = "0.28.0";
|
|
4504
4510
|
|
|
4505
4511
|
export { type Account, type AccountAccessToken, type AccountAccessTokenID, type AccountAccessTokenWebhookEventType, type AccountConversationSettings, type AccountID, type AccountNotificationEvent, type AccountNotificationEventEventType, type AccountStatus, type AccountWebhookWebhookEventType, type Action, type ActionID, type ActionStatus, type ActiveConversationStatus, type BoilerplateCategory, type BoilerplateCategoryID, type BoilerplateContent, type BoilerplateContentID, type Channel, type ChannelConversationSettings, type ChannelID, type ChannelStatus, Client, type CompositionSection, type CompositionSectionID, type CompositionSectionLocation, type ConcludedConversationStatus, type Contact, type ContactCustomMetadata, type ContactID, type ContactStatus, type ContactType, type ContactWebhookEventType, type Conversation, type ConversationCustomMetadata, type ConversationFeedback, type ConversationID, type ConversationSettings, type ConversationStatus, type ConversationWebhookEventType, type CountResponsePagination, type CreateAccountAccessTokenOptions, type CreateAccountAccessTokenPayload, type CreateAccountAccessTokenResponse, type CreateAccountOptions, type CreateAccountPayload, type CreateAccountResponse, type CreateBoilerplateCategoryOptions, type CreateBoilerplateCategoryPayload, type CreateBoilerplateCategoryResponse, type CreateBoilerplateContentOptions, type CreateBoilerplateContentPayload, type CreateBoilerplateContentResponse, type CreateChannelOptions, type CreateChannelPayload, type CreateChannelResponse, type CreateCompositionSectionOptions, type CreateCompositionSectionPayload, type CreateCompositionSectionResponse, type CreateContactOptions, type CreateContactPayload, type CreateContactResponse, type CreateConversationFeedbackOptions, type CreateConversationFeedbackPayload, type CreateConversationFeedbackResponse, type CreateConversationOptions, type CreateConversationPayload, type CreateConversationResponse, type CreateEscalationOptions, type CreateEscalationPayload, type CreateEscalationResponse, type CreateImportOptions, type CreateImportPayload, type CreateImportResponse, type CreateLabelOptions, type CreateLabelPayload, type CreateLabelResponse, type CreateMessageOptions, type CreateMessagePayload, type CreateMessageResponse, type CreateModelConfigOptions, type CreateModelConfigPayload, type CreateModelConfigResponse, type CreateNoteOptions, type CreateNotePayload, type CreateNoteResponse, type CreateUploadIncludeOptions, type CreateUploadOptions, type CreateUploadResponse, type CreateWebhookSubscriptionOptions, type CreateWebhookSubscriptionPayload, type CreateWebhookSubscriptionResponse, type CurrentAccountID, type CursorResponsePagination, type CustomChannelCustomMetadata, DEFAULT_SUPPORT_BASE_URL, type DeleteAccountAccessTokenOptions, type DeleteAccountAccessTokenPayload, type DeleteAccountAccessTokenResponse, type DeleteAccountOptions, type DeleteAccountResponse, type DeleteBoilerplateCategoryOptions, type DeleteBoilerplateCategoryResponse, type DeleteBoilerplateContentOptions, type DeleteBoilerplateContentResponse, type DeleteChannelOptions, type DeleteChannelResponse, type DeleteContactOptions, type DeleteContactResponse, type DeleteConversationFeedbackOptions, type DeleteConversationFeedbackResponse, type DeleteConversationOptions, type DeleteConversationResponse, type DeleteEscalationOptions, type DeleteEscalationResponse, type DeleteLabelOptions, type DeleteLabelResponse, type DeleteMessageOptions, type DeleteMessageResponse, type DeleteModelConfigOptions, type DeleteModelConfigResponse, type DeleteUploadOptions, type DeleteUploadResponse, type DeleteWebhookSubscriptionOptions, type DeleteWebhookSubscriptionResponse, type DeleteWhatsappAccountTemplateOptions, type DeleteWhatsappAccountTemplateResponse, index as Error, type ErrorResponse, type ErrorSourcePath, type ErrorSourcePrefix, type ErrorType, type Escalation, type EventWebhookOptions, type GetAccountAccessTokenOptions, type GetAccountAccessTokenResponse, type GetAccountConversationSettingsOptions, type GetAccountConversationSettingsResponse, type GetAccountNotificationEventOptions, type GetAccountNotificationEventResponse, type GetAccountOptions, type GetAccountResponse, type GetActionOptions, type GetActionResponse, type GetBoilerplateCategoryOptions, type GetBoilerplateCategoryResponse, type GetBoilerplateContentOptions, type GetBoilerplateContentResponse, type GetChannelConversationSettingsOptions, type GetChannelConversationSettingsResponse, type GetChannelOptions, type GetChannelResponse, type GetCompositionSectionOptions, type GetCompositionSectionResponse, type GetContactIncludeOptions, type GetContactOptions, type GetContactResponse, type GetContactVCFOptions, type GetConversationFeedbackOptions, type GetConversationFeedbackResponse, type GetConversationIncludeOptions, type GetConversationOptions, type GetConversationResponse, type GetEscalationOptions, type GetEscalationResponse, type GetImportOptions, type GetImportResponse, type GetLabelOptions, type GetLabelResponse, type GetMessageOptions, type GetMessageResponse, type GetModelConfigOptions, type GetModelConfigResponse, type GetModelInterfaceOptions, type GetModelInterfaceResponse, type GetNoteOptions, type GetNoteResponse, type GetSourceOptions, type GetSourceResponse, type GetUploadIncludeOptions, type GetUploadOptions, type GetUploadResponse, type GetWebhookSubscriptionOptions, type GetWebhookSubscriptionResponse, type GetWhatsappAccountIncludeOptions, type GetWhatsappAccountOptions, type GetWhatsappAccountResponse, type GetWhatsappAccountTemplateOptions, type GetWhatsappAccountTemplateResponse, type GetWhatsappBusinessProfileOptions, type GetWhatsappBusinessProfileResponse, type GetWhatsappPhoneNumberIncludeOptions, type GetWhatsappPhoneNumberOptions, type GetWhatsappPhoneNumberResponse, type Import, type ImportID, type ImportStatus, type ImportType, type ImportWebhookEventType, type Label, type LabelID, type LexicalDirection, type LexicalHeadingNode, type LexicalHorizontalRuleNode, type LexicalIndent, type LexicalLinkNode, type LexicalListItemNode, type LexicalListNode, type LexicalParagraphNode, type LexicalQuoteNode, type LexicalRootNode, type LexicalTextNode, type LexicalUploadNode, type ListAccountAccessTokensOptions, type ListAccountAccessTokensResponse, type ListAccountNotificationEventsFilterOptions, type ListAccountNotificationEventsOptions, type ListAccountNotificationEventsResponse, type ListAccountsOptions, type ListAccountsResponse, type ListActionsOptions, type ListActionsResponse, type ListBoilerplateCategoriesIncludeOptions, type ListBoilerplateCategoriesOptions, type ListBoilerplateCategoriesResponse, type ListBoilerplateContentsOptions, type ListBoilerplateContentsResponse, type ListChannelsOptions, type ListChannelsResponse, type ListCompositionSectionsOptions, type ListCompositionSectionsResponse, type ListContactsOptions, type ListContactsResponse, type ListConversationFeedbackOptions, type ListConversationFeedbackResponse, type ListConversationOptions, type ListConversationsFilterOptions, type ListConversationsIncludeOptions, type ListConversationsResponse, type ListEscalationsOptions, type ListEscalationsResponse, type ListImportsOptions, type ListImportsResponse, type ListLabelsIncludeOptions, type ListLabelsOptions, type ListLabelsResponse, type ListMessagesIncludeOptions, type ListMessagesOptions, type ListMessagesResponse, type ListModelConfigsOptions, type ListModelConfigsResponse, type ListModelInterfacesOptions, type ListModelInterfacesResponse, type ListNotesOptions, type ListNotesResponse, type ListSourcesOptions, type ListSourcesResponse, type ListUploadsIncludeOptions, type ListUploadsOptions, type ListUploadsResponse, type ListWebhookSubscriptionsOptions, type ListWebhookSubscriptionsResponse, type ListWhatsappAccountTemplatesOptions, type ListWhatsappAccountTemplatesResponse, type ListWhatsappAccountsOptions, type ListWhatsappAccountsResponse, type ListWhatsappPhoneNumbersOptions, type ListWhatsappPhoneNumbersResponse, type Message, type MessageCustomMetadata, type MessageEventType, type MessageID, type MessageRole, type MessageStatus, type MessageType, type MessageVisibility, type MessageWebhookEventType, type ModelConfig, type ModelInterface, type ModelInterfaceID, type Note, type NoteID, type NotificationEvent, type Options$1 as Options, type ResponseData, type ResponseMeta, type ResponseTimestamp, SDK_VERSION, type SendChannelSyncPayload, type SendgridChannelSyncOptions, type SendgridChannelSyncResponse, type SortOptions, type Source, type SourceAdornment, type SourceID, SupportError, type TestWebhookSubscriptionOptions, type TestWebhookSubscriptionResponse, type Options$5 as TransportOptions, type TriggerResponseConversationOptions, type TriggerResponseConversationResponse, type UpdateAccountConversationSettingsOptions, type UpdateAccountConversationSettingsPayload, type UpdateAccountConversationSettingsResponse, type UpdateAccountOptions, type UpdateAccountPayload, type UpdateAccountResponse, type UpdateBoilerplateCategoryOptions, type UpdateBoilerplateCategoryPayload, type UpdateBoilerplateCategoryResponse, type UpdateBoilerplateContentOptions, type UpdateBoilerplateContentPayload, type UpdateBoilerplateContentResponse, type UpdateChannelConversationSettingsOptions, type UpdateChannelConversationSettingsPayload, type UpdateChannelConversationSettingsResponse, type UpdateChannelOptions, type UpdateChannelPayload, type UpdateChannelResponse, type UpdateCompositionSectionOptions, type UpdateCompositionSectionPayload, type UpdateCompositionSectionResponse, type UpdateContactOptions, type UpdateContactPayload, type UpdateContactResponse, type UpdateConversationOptions, type UpdateConversationPayload, type UpdateConversationResponse, type UpdateLabelOptions, type UpdateLabelPayload, type UpdateLabelResponse, type UpdateModelConfigOptions, type UpdateModelConfigPayload, type UpdateModelConfigResponse, type UpdateNoteOptions, type UpdateNotePayload, type UpdateNoteResponse, type UpdateWhatsappBusinessProfileOptions, type UpdateWhatsappBusinessProfilePayload, type UpdateWhatsappBusinessProfileResponse, type Upload, type UploadID, WHATSAPP_BUSINESS_PROFILE_VERTICAL, WHATSAPP_TEMPLATE_CATEGORIES, WHATSAPP_TEMPLATE_INDUSTRIES, WHATSAPP_TEMPLATE_LANGUAGES, WHATSAPP_TEMPLATE_QUALITY_SCORES, WHATSAPP_TEMPLATE_STATUSES, WHATSAPP_TEMPLATE_SUBCATEGORIES, WHATSAPP_TEMPLATE_TOPICS, WHATSAPP_TEMPLATE_USECASES, type WebhookEventPayload, type WebhookEventType, type WebhookResponse, type WebhookSubscription, type WebhookSubscriptionID, type WebhookSubscriptionWebhookEventType, type WhatsappAccount, type WhatsappAccountDetail, type WhatsappAccountTemplate, type WhatsappBusinessProfileDetail, type WhatsappLibraryTemplate, type WhatsappPhoneNumber, type WhatsappTemplateButton, type WhatsappTemplateCategory, type WhatsappTemplateIndustry, type WhatsappTemplateLanguage, type WhatsappTemplateParameterFormat, type WhatsappTemplateQualityScore, type WhatsappTemplateRejectionReason, type WhatsappTemplateStatus, type WhatsappTemplateSubcategory, type WhatsappTemplateTopic, type WhatsappTemplateUseCase, Client as default, eventWebhookSchema };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ot=Object.defineProperty;var nt=(r,t)=>{for(var e in t)ot(r,e,{get:t[e],enumerable:!0})};var Y="https://api.support.greatdetail.com",z={"x-powered-by":"GDS/JavaScript"};var u=class{constructor(t){this._transport=t}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/accounts",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}get(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var l=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{filter:e,pagination:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...n,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...n,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var d=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...e,method:"GET"})}listByAccount(t,{filter:e,pagination:o,request:n={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...n,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...o,method:"PATCH",json:{...e,readAt:e.readAt instanceof Date&&typeof e.readAt.getMonth=="function"?e.readAt.toISOString():e.readAt}})}};var h=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/actions/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,sort:e,pagination:o,request:n={}}={}){return this._transport.send("v1/actions",{...n,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var Q="SUPPORT_ACCESS_TOKEN",J="SUPPORT_KEY_NAME",X="SUPPORT_KEY_PASSWORD",K="SUPPORT_SIGNING_KEY",Z="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[J],password:e=process.env[X]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){let t=typeof this.name=="function"?this.name():this.name,e=typeof this.#t=="function"?this.#t():this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var C=class{#t;constructor({token:t=process.env[Q]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?this.#t():this.#t}`}}};var T=class{getHeaders(){return{}}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/boilerplates/categories",{...n,method:"GET",searchParams:this._transport.query.build({include:o,pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var E=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"DELETE"})}sendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/sendgrid/sync",{...o,method:"POST",json:e})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/composition-sections",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({pagination:t,filter:e,sort:o,request:n={}}={}){return this._transport.send("v1/contacts",{...n,method:"GET",searchParams:this._transport.query.build({pagination:t,sort:o,filter:e})})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}merge(t,e,{request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}/merge`,{...o,method:"POST",json:{contact:e}})}};var b=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,sort:e,pagination:o,include:n,request:s={}}={}){return this._transport.send("v1/conversations",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:n})})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}triggerResponse(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}/response`,{...e,method:"POST"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/feedback/conversation",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/feedback/conversation",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/escalations",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/escalations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/imports",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/imports",{...e,method:"POST",json:t})}delete(t,{body:e,request:o={}}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...o,method:"DELETE",json:e})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({request:t={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts",{...t,method:"GET"})}};var D=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...o,method:"PATCH",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({whatsappAccount:t,channel:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers",{...o,method:"GET",searchParams:this._transport.query.build({filter:{whatsappAccount:t,channel:e}})})}};var L=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:n,category:s,language:p,request:i={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...i,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:n,category:s,language:p}})})}getByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"GET"})}deleteByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"DELETE"})}};var P=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t,include:o})})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/messages",{...n,method:"GET",searchParams:this._transport.query.build({pagination:e,include:o,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var N=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/models/configs",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/models/configs",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var W=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/interfaces/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models/interfaces",{...t,method:"GET"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notes",{...o,method:"GET",searchParams:this._transport.query.build({filter:t,pagination:e})})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var M=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let n=[];if(e){let s=Array.isArray(e)?e:[e];for(let p of s)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var F=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};import rt,{HTTPError as st}from"ky";var B=class extends Error{constructor(e,o,{requestID:n,body:s,...p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,p);this.response=e;this.request=o;this.requestID=n}requestID};function m(r){return typeof r=="function"&&(r=r()),typeof r.toString=="function"?r.toString():typeof r=="string"?r:String(r)}var w=class r{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:n,custom:s}){return[...Object.entries(o??{}).flatMap(([p,i])=>r._filterExemptColumns.includes(p)?[]:this.query(`filter[${p}]`,i)),...this.query("filter",o?.filter),...Object.entries(n??{}).flatMap(([p,i])=>i?this.query("include",p):[]),...Object.entries(t??{}).flatMap(([p,i])=>i===void 0?[]:this.query("sort",(i==="desc"?"-":"")+m(p))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(s??{}).flatMap(([p,i])=>this.query(p,i))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let n of Array.isArray(e)?e:[e])o.push([t,m(n)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let n=[];if(t===void 0&&e===void 0)return n;let s=t?{dir:"before",value:m(t)}:void 0,p=e?{dir:"after",value:m(e)}:void 0,i=o==="after"?p||s:s||p;return i&&n.push([`page[${i.dir}]`,i.value]),n}};var H=class{client;options;query=w;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=rt.create({prefixUrl:this.options.baseURL,headers:z,timeout:12e3,...o.request})}getURL(t){return new URL(t,this.options.baseURL).toString()}_generateRequestId(){let t="";if(globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"){let n=new Uint8Array(21);return globalThis.crypto.getRandomValues(n),t+Array.from(n,s=>s.toString(16).padStart(2,"0")).join("")}if(globalThis.crypto&&typeof globalThis.crypto.randomUUID=="function")return t+globalThis.crypto.randomUUID();let e=Date.now().toString(36),o=Math.random().toString(36).slice(2);return`${t}${e}-${o}`}send(t,e={}){let o=this._generateRequestId(),n=e.authentication??this.options.authentication,p=this.client.extend({headers:{...n.getHeaders(),"x-request-id":o}})(t,e).catch(async i=>{throw i instanceof st?new B(i.response,i.request,{requestID:o,body:await i.response.text(),cause:i}):i});return{requestID:o,response:()=>p,json:async()=>(await p).json()}}};var q=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,include:e,pagination:o,request:n={}}={}){return this._transport.send("v1/uploads",{...n,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let n=new FormData;for(let s of t)n.append("file",s);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:n})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};import{z as a}from"zod";var tt=a.object({data:a.object({event:a.object({id:a.string(),type:a.string(),payload:a.record(a.string(),a.string()),createdAt:a.iso.datetime()})})});var j=class{constructor(t){this._transport=t}async event({key:t=process.env[K],maxSignatures:e=3,request:o}){let n=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+K);if(!n)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(n)?n.slice(0,e):[n]))throw new Error("Untrusted signature")}let{data:s}=tt.parse(o.body);return{event:s.event}}async _verifySignature(t,e,o){let n=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let s of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(s)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var V=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var $=class r{static DEFAULT_BASE_URL=Y;static PublicAuthentication=T;static BasicAuthentication=c;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;accountNotificationEvent;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationContext;conversationFeedback;escalation;label;import;integration;message;modelConfig;modelInterface;note;source;statistics;upload;webhook;webhookSubscription;constructor(t=new c,{baseURL:e,...o}={}){this._transport=new H({authentication:t,...o,baseURL:e?.toString()??r.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.accountNotificationEvent=new f(this._transport),this.action=new h(this._transport),this.boilerplateCategory=new A(this._transport),this.boilerplateContent=new E(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new _(this._transport),this.compositionSection=new g(this._transport),this.contact=new O(this._transport),this.conversation=new b(this._transport),this.conversationContext=new I(this._transport),this.conversationFeedback=new x(this._transport),this.escalation=new v(this._transport),this.label=new P(this._transport),this.import=new S(this._transport),this.integration={whatsapp:{account:new y(this._transport),phoneNumber:new U(this._transport),businessProfile:new D(this._transport),template:new L(this._transport)}},this.message=new G(this._transport),this.modelConfig=new N(this._transport),this.modelInterface=new W(this._transport),this.note=new k(this._transport),this.source=new M(this._transport),this.statistics=new F(this._transport),this.upload=new q(this._transport),this.webhook=new j(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[Z]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var et={};nt(et,{SupportError:()=>B});var Fn=["ALCOHOL","APPAREL","AUTO","BEAUTY","EDU","ENTERTAIN","EVENT_PLAN","FINANCE","GOVT","GROCERY","HEALTH","HOTEL","NONPROFIT","ONLINE_GAMBLING","OTC_DRUGS","OTHER","PHYSICAL_GAMBLING","PROF_SERVICES","RESTAURANT","RETAIL","TRAVEL"];var zn=["PENDING","APPROVED","REJECTED","IN_APPEAL","PAUSED","PENDING_DELETION","DELETED","DISABLED","LIMIT_EXCEEDED"],Qn=["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","prs_AF","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","ps_AF","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CL","es_CO","es_CR","es_DO","es_EC","es_HN","es_MX","es_PA","es_PE","es_ES","es_UY","sw","sv","ta","te","th","th","tr","uk","ur","uz","vi","zu"],Jn=["AUTHENTICATION","MARKETING","UTILITY"],Xn=["ORDER_DETAILS","ORDER_STATUS"],Zn=["E_COMMERCE","FINANCIAL_SERVICES"],tr=["ACCOUNT_UPDATES","CUSTOMER_FEEDBACK","EVENT_REMINDER","FIXED_TEMPLATE_PRICE_TEST","IDENTITY_VERIFICATION","ORDER_MANAGEMENT","PAYMENTS"],er=["ACCOUNT_CREATION_CONFIRMATION","PAYMENT_DUE_REMINDER","FEEDBACK_SURVEY","PAYMENT_ACTION_REQUIRED","SHIPMENT_CONFIRMATION","PAYMENT_OVERDUE","DELIVERY_UPDATE","PAYMENT_CONFIRMATION","ORDER_DELAY","FRAUD_ALERT","DELIVERY_FAILED","AUTO_PAY_REMINDER","DELIVERY_CONFIRMATION","PAYMENT_SCHEDULED","ORDER_PICK_UP","PAYMENT_REJECT_FAIL","ORDER_ACTION_NEEDED","STATEMENT_AVAILABLE","ORDER_CONFIRMATION","LOW_BALANCE_WARNING","ORDER_OR_TRANSACTION_CANCEL","RECEIPT_ATTACHMENT","RETURN_CONFIRMATION","STATEMENT_ATTACHMENT","TRANSACTION_ALERT"],or=["GREEN","YELLOW","RED","UNKNOWN"];var ps="0.27.0";export{$ as Client,Y as DEFAULT_SUPPORT_BASE_URL,et as Error,ps as SDK_VERSION,B as SupportError,Fn as WHATSAPP_BUSINESS_PROFILE_VERTICAL,Jn as WHATSAPP_TEMPLATE_CATEGORIES,Zn as WHATSAPP_TEMPLATE_INDUSTRIES,Qn as WHATSAPP_TEMPLATE_LANGUAGES,or as WHATSAPP_TEMPLATE_QUALITY_SCORES,zn as WHATSAPP_TEMPLATE_STATUSES,Xn as WHATSAPP_TEMPLATE_SUBCATEGORIES,tr as WHATSAPP_TEMPLATE_TOPICS,er as WHATSAPP_TEMPLATE_USECASES,$ as default,tt as eventWebhookSchema};
|
|
1
|
+
var ot=Object.defineProperty;var nt=(r,t)=>{for(var e in t)ot(r,e,{get:t[e],enumerable:!0})};var Y="https://api.support.greatdetail.com",z={"x-powered-by":"GDS/JavaScript"};var u=class{constructor(t){this._transport=t}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/accounts",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}get(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var l=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{filter:e,pagination:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...n,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...n,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var d=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notifications/events/account",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}listByAccount(t,{filter:e,pagination:o,request:n={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...n,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notifications/events/account/"+encodeURIComponent(t),{...o,method:"PATCH",json:{...e,readAt:e.readAt instanceof Date&&typeof e.readAt.getMonth=="function"?e.readAt.toISOString():e.readAt}})}};var h=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/actions/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,sort:e,pagination:o,request:n={}}={}){return this._transport.send("v1/actions",{...n,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var Q="SUPPORT_ACCESS_TOKEN",J="SUPPORT_KEY_NAME",X="SUPPORT_KEY_PASSWORD",K="SUPPORT_SIGNING_KEY",Z="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[J],password:e=process.env[X]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){let t=typeof this.name=="function"?this.name():this.name,e=typeof this.#t=="function"?this.#t():this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var C=class{#t;constructor({token:t=process.env[Q]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?this.#t():this.#t}`}}};var T=class{getHeaders(){return{}}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/boilerplates/categories",{...n,method:"GET",searchParams:this._transport.query.build({include:o,pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/boilerplates/categories/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var E=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/boilerplates/contents/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"DELETE"})}sendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/sendgrid/sync",{...o,method:"POST",json:e})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/composition-sections",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({pagination:t,filter:e,sort:o,request:n={}}={}){return this._transport.send("v1/contacts",{...n,method:"GET",searchParams:this._transport.query.build({pagination:t,sort:o,filter:e})})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}merge(t,e,{request:o={}}={}){return this._transport.send(`v1/contacts/${encodeURIComponent(t)}/merge`,{...o,method:"POST",json:{contact:e}})}};var b=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,sort:e,pagination:o,include:n,request:s={}}={}){return this._transport.send("v1/conversations",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:n})})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}triggerResponse(t,{request:e={}}={}){return this._transport.send(`v1/conversations/${encodeURIComponent(t)}/response`,{...e,method:"POST"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send(`v1/conversation/${encodeURIComponent(t)}/context`,{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/feedback/conversation",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/feedback/conversation",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/escalations",{...o,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/escalations/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/imports",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/imports",{...e,method:"POST",json:t})}delete(t,{body:e,request:o={}}){return this._transport.send("v1/imports/"+encodeURIComponent(t),{...o,method:"DELETE",json:e})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({request:t={}}={}){return this._transport.send("v1/integrations/whatsapp/accounts",{...t,method:"GET"})}};var D=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t)+"/business-profile",{...o,method:"PATCH",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({whatsappAccount:t,channel:e,request:o={}}={}){return this._transport.send("v1/integrations/whatsapp/phone-numbers",{...o,method:"GET",searchParams:this._transport.query.build({filter:{whatsappAccount:t,channel:e}})})}};var L=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:n,category:s,language:p,request:i={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...i,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:n,category:s,language:p}})})}getByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"GET"})}deleteByAccount(t,e,{request:o={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates/${e}`,{...o,method:"DELETE"})}};var P=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:this._transport.query.build({pagination:e,filter:t,include:o})})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"GET"})}list({filter:t,pagination:e,include:o,request:n={}}={}){return this._transport.send("v1/messages",{...n,method:"GET",searchParams:this._transport.query.build({pagination:e,include:o,filter:t})})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send(`v1/messages/${encodeURIComponent(t)}`,{...e,method:"DELETE"})}};var N=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/models/configs",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}create({body:t,request:e={}}){return this._transport.send("v1/models/configs",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/models/configs/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var W=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/interfaces/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models/interfaces",{...t,method:"GET"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}list({filter:t,pagination:e,request:o={}}={}){return this._transport.send("v1/notes",{...o,method:"GET",searchParams:this._transport.query.build({filter:t,pagination:e})})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var M=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let n=[];if(e){let s=Array.isArray(e)?e:[e];for(let p of s)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var F=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};import rt,{HTTPError as st}from"ky";var B=class extends Error{constructor(e,o,{requestID:n,body:s,...p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,p);this.response=e;this.request=o;this.requestID=n}requestID};function m(r){return typeof r=="function"&&(r=r()),typeof r.toString=="function"?r.toString():typeof r=="string"?r:String(r)}var w=class r{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:n,custom:s}){return[...Object.entries(o??{}).flatMap(([p,i])=>r._filterExemptColumns.includes(p)?[]:this.query(`filter[${p}]`,i)),...this.query("filter",o?.filter),...Object.entries(n??{}).flatMap(([p,i])=>i?this.query("include",p):[]),...Object.entries(t??{}).flatMap(([p,i])=>i===void 0?[]:this.query("sort",(i==="desc"?"-":"")+m(p))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(s??{}).flatMap(([p,i])=>this.query(p,i))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let n of Array.isArray(e)?e:[e])o.push([t,m(n)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let n=[];if(t===void 0&&e===void 0)return n;let s=t?{dir:"before",value:m(t)}:void 0,p=e?{dir:"after",value:m(e)}:void 0,i=o==="after"?p||s:s||p;return i&&n.push([`page[${i.dir}]`,i.value]),n}};var q=class{client;options;query=w;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=rt.create({prefixUrl:this.options.baseURL,headers:z,timeout:12e3,...o.request})}getURL(t){return new URL(t,this.options.baseURL).toString()}_generateRequestId(){let t="";if(globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"){let n=new Uint8Array(21);return globalThis.crypto.getRandomValues(n),t+Array.from(n,s=>s.toString(16).padStart(2,"0")).join("")}if(globalThis.crypto&&typeof globalThis.crypto.randomUUID=="function")return t+globalThis.crypto.randomUUID();let e=Date.now().toString(36),o=Math.random().toString(36).slice(2);return`${t}${e}-${o}`}send(t,e={}){let o=this._generateRequestId(),n=e.authentication??this.options.authentication,p=this.client.extend({headers:{...n.getHeaders(),"x-request-id":o}})(t,e).catch(async i=>{throw i instanceof st?new B(i.response,i.request,{requestID:o,body:await i.response.text(),cause:i}):i});return{requestID:o,response:()=>p,json:async()=>(await p).json()}}};var H=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...o,method:"GET",searchParams:this._transport.query.build({include:e})})}list({filter:t,include:e,pagination:o,request:n={}}={}){return this._transport.send("v1/uploads",{...n,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let n=new FormData;for(let s of t)n.append("file",s);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:n})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};import{z as a}from"zod";var tt=a.object({data:a.object({event:a.object({id:a.string(),type:a.string(),payload:a.record(a.string(),a.string()),createdAt:a.iso.datetime()})})});var j=class{constructor(t){this._transport=t}async event({key:t=process.env[K],maxSignatures:e=3,request:o}){let n=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+K);if(!n)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(n)?n.slice(0,e):[n]))throw new Error("Untrusted signature")}let{data:s}=tt.parse(o.body);return{event:s.event}}async _verifySignature(t,e,o){let n=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let s of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(s)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var V=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({pagination:t,filter:e,request:o={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...o,method:"GET",searchParams:this._transport.query.build({filter:e,pagination:t})})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var $=class r{static DEFAULT_BASE_URL=Y;static PublicAuthentication=T;static BasicAuthentication=c;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;accountNotificationEvent;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationContext;conversationFeedback;escalation;label;import;integration;message;modelConfig;modelInterface;note;source;statistics;upload;webhook;webhookSubscription;constructor(t=new c,{baseURL:e,...o}={}){this._transport=new q({authentication:t,...o,baseURL:e?.toString()??r.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.accountNotificationEvent=new f(this._transport),this.action=new h(this._transport),this.boilerplateCategory=new A(this._transport),this.boilerplateContent=new E(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new _(this._transport),this.compositionSection=new g(this._transport),this.contact=new O(this._transport),this.conversation=new b(this._transport),this.conversationContext=new I(this._transport),this.conversationFeedback=new x(this._transport),this.escalation=new v(this._transport),this.label=new P(this._transport),this.import=new S(this._transport),this.integration={whatsapp:{account:new y(this._transport),phoneNumber:new U(this._transport),businessProfile:new D(this._transport),template:new L(this._transport)}},this.message=new G(this._transport),this.modelConfig=new N(this._transport),this.modelInterface=new W(this._transport),this.note=new k(this._transport),this.source=new M(this._transport),this.statistics=new F(this._transport),this.upload=new H(this._transport),this.webhook=new j(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[Z]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var et={};nt(et,{SupportError:()=>B});var Fn=["ALCOHOL","APPAREL","AUTO","BEAUTY","EDU","ENTERTAIN","EVENT_PLAN","FINANCE","GOVT","GROCERY","HEALTH","HOTEL","NONPROFIT","ONLINE_GAMBLING","OTC_DRUGS","OTHER","PHYSICAL_GAMBLING","PROF_SERVICES","RESTAURANT","RETAIL","TRAVEL"];var zn=["PENDING","APPROVED","REJECTED","IN_APPEAL","PAUSED","PENDING_DELETION","DELETED","DISABLED","LIMIT_EXCEEDED"],Qn=["af","sq","ar","ar_EG","ar_AE","ar_LB","ar_MA","ar_QA","az","be_BY","bn","bn_IN","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","prs_AF","nl","nl_BE","en","en_GB","en_US","en_AE","en_AU","en_CA","en_GH","en_IE","en_IN","en_JM","en_MY","en_NZ","en_QA","en_SG","en_UG","en_ZA","et","fil","fi","fr","fr_BE","fr_CA","fr_CH","fr_CI","fr_MA","ka","de","de_AT","de_CH","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","ps_AF","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","si_LK","sk","sl","es","es_AR","es_CL","es_CO","es_CR","es_DO","es_EC","es_HN","es_MX","es_PA","es_PE","es_ES","es_UY","sw","sv","ta","te","th","th","tr","uk","ur","uz","vi","zu"],Jn=["AUTHENTICATION","MARKETING","UTILITY"],Xn=["ORDER_DETAILS","ORDER_STATUS"],Zn=["E_COMMERCE","FINANCIAL_SERVICES"],tr=["ACCOUNT_UPDATES","CUSTOMER_FEEDBACK","EVENT_REMINDER","FIXED_TEMPLATE_PRICE_TEST","IDENTITY_VERIFICATION","ORDER_MANAGEMENT","PAYMENTS"],er=["ACCOUNT_CREATION_CONFIRMATION","PAYMENT_DUE_REMINDER","FEEDBACK_SURVEY","PAYMENT_ACTION_REQUIRED","SHIPMENT_CONFIRMATION","PAYMENT_OVERDUE","DELIVERY_UPDATE","PAYMENT_CONFIRMATION","ORDER_DELAY","FRAUD_ALERT","DELIVERY_FAILED","AUTO_PAY_REMINDER","DELIVERY_CONFIRMATION","PAYMENT_SCHEDULED","ORDER_PICK_UP","PAYMENT_REJECT_FAIL","ORDER_ACTION_NEEDED","STATEMENT_AVAILABLE","ORDER_CONFIRMATION","LOW_BALANCE_WARNING","ORDER_OR_TRANSACTION_CANCEL","RECEIPT_ATTACHMENT","RETURN_CONFIRMATION","STATEMENT_ATTACHMENT","TRANSACTION_ALERT"],or=["GREEN","YELLOW","RED","UNKNOWN"];var ps="0.28.0";export{$ as Client,Y as DEFAULT_SUPPORT_BASE_URL,et as Error,ps as SDK_VERSION,B as SupportError,Fn as WHATSAPP_BUSINESS_PROFILE_VERTICAL,Jn as WHATSAPP_TEMPLATE_CATEGORIES,Zn as WHATSAPP_TEMPLATE_INDUSTRIES,Qn as WHATSAPP_TEMPLATE_LANGUAGES,or as WHATSAPP_TEMPLATE_QUALITY_SCORES,zn as WHATSAPP_TEMPLATE_STATUSES,Xn as WHATSAPP_TEMPLATE_SUBCATEGORIES,tr as WHATSAPP_TEMPLATE_TOPICS,er as WHATSAPP_TEMPLATE_USECASES,$ as default,tt as eventWebhookSchema};
|