@great-detail/support-sdk 0.18.5 → 0.18.6
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/{Client-Cc8Kw6hR.d.cts → Client-Dznu1ulG.d.cts} +1 -1
- package/dist/{Client-Cc8Kw6hR.d.ts → Client-Dznu1ulG.d.ts} +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -3282,4 +3282,4 @@ declare class Client {
|
|
|
3282
3282
|
static getBaseURL(): string;
|
|
3283
3283
|
}
|
|
3284
3284
|
|
|
3285
|
-
export { type
|
|
3285
|
+
export { type UpdateBoilerplateContentPayload as $, type Account as A, type UpdateAccountConversationSettingsResponse as B, Client as C, type DeleteAccountAccessTokenPayload as D, type Action as E, type ActionID as F, type GetAccountOptions as G, type SortOptions as H, type ListActionsOptions as I, type ListActionsResponse as J, type BoilerplateContent as K, type ListAccountAccessTokensOptions as L, type BoilerplateContentID as M, type Nullable as N, type Options as O, type CreateBoilerplateContentPayload as P, type CreateBoilerplateContentOptions as Q, type ResponseTimestamp as R, type SendOptions as S, type CreateBoilerplateContentResponse as T, type UpdateAccountPayload as U, type GetBoilerplateContentOptions as V, type GetBoilerplateContentResponse as W, type ListBoilerplateCategoryBoilerplateContentsOptions as X, type ListBoilerplateCategoryBoilerplateContentsResponse as Y, type ListBoilerplateContentsOptions as Z, type ListBoilerplateContentsResponse as _, type ConversationID as a, type CreateContactPayload as a$, type UpdateBoilerplateContentOptions as a0, type UpdateBoilerplateContentResponse as a1, type BoilerplateCategory as a2, type BoilerplateCategoryID as a3, type CreateBoilerplateCategoryPayload as a4, type CreateBoilerplateCategoryOptions as a5, type CreateBoilerplateCategoryResponse as a6, type GetBoilerplateCategoryOptions as a7, type GetBoilerplateCategoryResponse as a8, type ListBoilerplateCategoriesIncludeOptions as a9, type UpdateChannelConversationSettingsOptions as aA, type UpdateChannelConversationSettingsResponse as aB, type CompositionSection as aC, type CompositionSectionID as aD, type CreateCompositionSectionPayload as aE, type CreateCompositionSectionOptions as aF, type CreateCompositionSectionResponse as aG, type GetCompositionSectionOptions as aH, type GetCompositionSectionResponse as aI, type ListChannelCompositionSectionsOptions as aJ, type ListChannelCompositionSectionsResponse as aK, type ListCompositionSectionsOptions as aL, type ListCompositionSectionsResponse as aM, type UpdateCompositionSectionPayload as aN, type UpdateCompositionSectionOptions as aO, type UpdateCompositionSectionResponse as aP, type Escalation as aQ, type CreateEscalationPayload as aR, type CreateEscalationOptions as aS, type CreateEscalationResponse as aT, type GetEscalationOptions as aU, type GetEscalationResponse as aV, type ListEscalationsOptions as aW, type ListEscalationsResponse as aX, type Contact as aY, type ContactID as aZ, type ContactCustomMetadata as a_, type ListBoilerplateCategoriesOptions as aa, type ListBoilerplateCategoriesResponse as ab, type UpdateBoilerplateCategoryPayload as ac, type UpdateBoilerplateCategoryOptions as ad, type UpdateBoilerplateCategoryResponse as ae, type Channel as af, type ChannelID as ag, type CreateChannelPayload as ah, type CreateChannelOptions as ai, type CreateChannelResponse as aj, type GetChannelOptions as ak, type GetChannelResponse as al, type ListChannelsOptions as am, type ListChannelsResponse as an, type MetaWhatsappChannelGetBusinessProfileOptions as ao, type MetaWhatsappChannelGetBusinessProfileResponse as ap, type TwilioSendChannelSyncPayload as aq, type TwilioSendgridChannelSyncOptions as ar, type TwilioSendgridChannelSyncResponse as as, type UpdateChannelPayload as at, type UpdateChannelOptions as au, type UpdateChannelResponse as av, type ChannelConversationSettings as aw, type GetChannelConversationSettingsOptions as ax, type GetChannelConversationSettingsResponse as ay, type UpdateChannelConversationSettingsPayload as az, type RequestFilterable as b, type CreateMessageOptions as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListLabelConversationsOptions as bA, type ListLabelConversationsResponse as bB, type UpdateConversationPayload as bC, type UpdateConversationOptions as bD, type UpdateConversationResponse as bE, type ConversationSettings as bF, type Label as bG, type CreateLabelPayload as bH, type CreateLabelOptions as bI, type CreateLabelResponse as bJ, type DeleteLabelOptions as bK, type DeleteLabelResponse as bL, type GetLabelOptions as bM, type GetLabelResponse as bN, type LabelID as bO, type ListContactLabelsOptions as bP, type ListContactLabelsResponse as bQ, type ListConversationLabelsOptions as bR, type ListConversationLabelsResponse as bS, type ListLabelsIncludeOptions as bT, type ListLabelsOptions as bU, type ListLabelsResponse as bV, type UpdateLabelPayload as bW, type UpdateLabelOptions as bX, type UpdateLabelResponse as bY, type Message as bZ, type CreateMessagePayload as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationCustomMetadata as bg, type ActiveConversationStatus as bh, type ConcludedConversationStatus as bi, type ConversationStatus as bj, type CreateConversationPayload as bk, type CreateConversationOptions as bl, type CreateConversationResponse as bm, type DeleteConversationOptions as bn, type DeleteConversationResponse as bo, type GetConversationIncludeOptions as bp, type GetConversationOptions as bq, type GetConversationResponse as br, type ListChannelConversationsOptions as bs, type ListChannelConversationsResponse as bt, type ListContactConversationsOptions as bu, type ListContactConversationsResponse as bv, type ListConversationsIncludeOptions as bw, type FilterOptions as bx, type ListConversationOptions as by, type ListConversationsResponse as bz, type Options$4 as c, type UserID as c$, type CreateMessageResponse as c0, type DeleteMessageOptions as c1, type DeleteMessageResponse as c2, type GetMessageOptions as c3, type GetMessageResponse as c4, type ListChannelMessagesIncludeOptions as c5, type ListChannelMessagesOptions as c6, type ListChannelMessagesResponse as c7, type ListConversationMessagesIncludeOptions as c8, type ListConversationMessagesOptions as c9, type ListContactNotesOptions as cA, type ListContactNotesResponse as cB, type ListConversationNotesOptions as cC, type ListConversationNotesResponse as cD, type NoteID as cE, type UpdateNotePayload as cF, type UpdateNoteOptions as cG, type UpdateNoteResponse as cH, type Source as cI, type GetSourceOptions as cJ, type GetSourceResponse as cK, type ListSourcesOptions as cL, type ListSourcesResponse as cM, type SourceID as cN, type Upload as cO, type CreateUploadOptions as cP, type CreateUploadResponse as cQ, type DeleteUploadOptions as cR, type DeleteUploadResponse as cS, type GetUploadOptions as cT, type GetUploadResponse as cU, type ListUploadsOptions as cV, type ListUploadsResponse as cW, type UploadID as cX, type User as cY, type GetUserOptions as cZ, type GetUserResponse as c_, type ListConversationMessagesResponse as ca, type ListMessagesIncludeOptions as cb, type ListMessagesOptions as cc, type ListMessagesResponse as cd, type MessageID as ce, type MessageRole as cf, type MessageStatus as cg, type MessageEventType as ch, type Model as ci, type CreateCorrectionModelPayload as cj, type CreateCorrectionModelOptions as ck, type CreateCorrectionResponse as cl, type CreateResponseModelPayload as cm, type CreateResponseModelOptions as cn, type CreateResponseResponse as co, type GetModelOptions as cp, type GetModelResponse as cq, type ListModelsOptions as cr, type ListModelsResponse as cs, type ModelID as ct, type Note as cu, type CreateNotePayload as cv, type CreateNoteOptions as cw, type CreateNoteResponse as cx, type GetNoteOptions as cy, type GetNoteResponse as cz, type CurrentAccountID as d, type EventWebhookOptions as d0, eventWebhookSchema as d1, type WebhookEventType as d2, type AccountWebhookWebhookEventType as d3, type AccountAccessTokenWebhookEventType as d4, type ContactWebhookEventType as d5, type ConversationWebhookEventType as d6, type MessageWebhookEventType as d7, type WebhookSubscriptionWebhookEventType as d8, type WebhookEventPayload as d9, type WebhookResponse as da, type WebhookSubscription as db, type CreateWebhookSubscriptionPayload as dc, type CreateWebhookSubscriptionOptions as dd, type CreateWebhookSubscriptionResponse as de, type DeleteWebhookSubscriptionOptions as df, type DeleteWebhookSubscriptionResponse as dg, type GetWebhookSubscriptionOptions as dh, type GetWebhookSubscriptionResponse as di, type ListWebhookSubscriptionsOptions as dj, type ListWebhookSubscriptionsResponse as dk, type TestWebhookSubscriptionOptions as dl, type TestWebhookSubscriptionResponse as dm, type WebhookSubscriptionID as dn, type AccountID as e, type CreateAccountPayload as f, type CreateAccountOptions as g, type CreateAccountResponse as h, type GetAccountResponse as i, type UpdateAccountOptions as j, type UpdateAccountResponse as k, type AccountAccessToken as l, type AccountAccessTokenID as m, type CreateAccountAccessTokenPayload as n, type CreateAccountAccessTokenOptions as o, type CreateAccountAccessTokenResponse as p, type DeleteAccountAccessTokenOptions as q, type DeleteAccountAccessTokenResponse as r, type GetAccountAccessTokenOptions as s, type GetAccountAccessTokenResponse as t, type ListAccountAccessTokensResponse as u, type AccountConversationSettings as v, type GetAccountConversationSettingsOptions as w, type GetAccountConversationSettingsResponse as x, type UpdateAccountConversationSettingsPayload as y, type UpdateAccountConversationSettingsOptions as z };
|
|
@@ -3282,4 +3282,4 @@ declare class Client {
|
|
|
3282
3282
|
static getBaseURL(): string;
|
|
3283
3283
|
}
|
|
3284
3284
|
|
|
3285
|
-
export { type
|
|
3285
|
+
export { type UpdateBoilerplateContentPayload as $, type Account as A, type UpdateAccountConversationSettingsResponse as B, Client as C, type DeleteAccountAccessTokenPayload as D, type Action as E, type ActionID as F, type GetAccountOptions as G, type SortOptions as H, type ListActionsOptions as I, type ListActionsResponse as J, type BoilerplateContent as K, type ListAccountAccessTokensOptions as L, type BoilerplateContentID as M, type Nullable as N, type Options as O, type CreateBoilerplateContentPayload as P, type CreateBoilerplateContentOptions as Q, type ResponseTimestamp as R, type SendOptions as S, type CreateBoilerplateContentResponse as T, type UpdateAccountPayload as U, type GetBoilerplateContentOptions as V, type GetBoilerplateContentResponse as W, type ListBoilerplateCategoryBoilerplateContentsOptions as X, type ListBoilerplateCategoryBoilerplateContentsResponse as Y, type ListBoilerplateContentsOptions as Z, type ListBoilerplateContentsResponse as _, type ConversationID as a, type CreateContactPayload as a$, type UpdateBoilerplateContentOptions as a0, type UpdateBoilerplateContentResponse as a1, type BoilerplateCategory as a2, type BoilerplateCategoryID as a3, type CreateBoilerplateCategoryPayload as a4, type CreateBoilerplateCategoryOptions as a5, type CreateBoilerplateCategoryResponse as a6, type GetBoilerplateCategoryOptions as a7, type GetBoilerplateCategoryResponse as a8, type ListBoilerplateCategoriesIncludeOptions as a9, type UpdateChannelConversationSettingsOptions as aA, type UpdateChannelConversationSettingsResponse as aB, type CompositionSection as aC, type CompositionSectionID as aD, type CreateCompositionSectionPayload as aE, type CreateCompositionSectionOptions as aF, type CreateCompositionSectionResponse as aG, type GetCompositionSectionOptions as aH, type GetCompositionSectionResponse as aI, type ListChannelCompositionSectionsOptions as aJ, type ListChannelCompositionSectionsResponse as aK, type ListCompositionSectionsOptions as aL, type ListCompositionSectionsResponse as aM, type UpdateCompositionSectionPayload as aN, type UpdateCompositionSectionOptions as aO, type UpdateCompositionSectionResponse as aP, type Escalation as aQ, type CreateEscalationPayload as aR, type CreateEscalationOptions as aS, type CreateEscalationResponse as aT, type GetEscalationOptions as aU, type GetEscalationResponse as aV, type ListEscalationsOptions as aW, type ListEscalationsResponse as aX, type Contact as aY, type ContactID as aZ, type ContactCustomMetadata as a_, type ListBoilerplateCategoriesOptions as aa, type ListBoilerplateCategoriesResponse as ab, type UpdateBoilerplateCategoryPayload as ac, type UpdateBoilerplateCategoryOptions as ad, type UpdateBoilerplateCategoryResponse as ae, type Channel as af, type ChannelID as ag, type CreateChannelPayload as ah, type CreateChannelOptions as ai, type CreateChannelResponse as aj, type GetChannelOptions as ak, type GetChannelResponse as al, type ListChannelsOptions as am, type ListChannelsResponse as an, type MetaWhatsappChannelGetBusinessProfileOptions as ao, type MetaWhatsappChannelGetBusinessProfileResponse as ap, type TwilioSendChannelSyncPayload as aq, type TwilioSendgridChannelSyncOptions as ar, type TwilioSendgridChannelSyncResponse as as, type UpdateChannelPayload as at, type UpdateChannelOptions as au, type UpdateChannelResponse as av, type ChannelConversationSettings as aw, type GetChannelConversationSettingsOptions as ax, type GetChannelConversationSettingsResponse as ay, type UpdateChannelConversationSettingsPayload as az, type RequestFilterable as b, type CreateMessageOptions as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListLabelConversationsOptions as bA, type ListLabelConversationsResponse as bB, type UpdateConversationPayload as bC, type UpdateConversationOptions as bD, type UpdateConversationResponse as bE, type ConversationSettings as bF, type Label as bG, type CreateLabelPayload as bH, type CreateLabelOptions as bI, type CreateLabelResponse as bJ, type DeleteLabelOptions as bK, type DeleteLabelResponse as bL, type GetLabelOptions as bM, type GetLabelResponse as bN, type LabelID as bO, type ListContactLabelsOptions as bP, type ListContactLabelsResponse as bQ, type ListConversationLabelsOptions as bR, type ListConversationLabelsResponse as bS, type ListLabelsIncludeOptions as bT, type ListLabelsOptions as bU, type ListLabelsResponse as bV, type UpdateLabelPayload as bW, type UpdateLabelOptions as bX, type UpdateLabelResponse as bY, type Message as bZ, type CreateMessagePayload as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationCustomMetadata as bg, type ActiveConversationStatus as bh, type ConcludedConversationStatus as bi, type ConversationStatus as bj, type CreateConversationPayload as bk, type CreateConversationOptions as bl, type CreateConversationResponse as bm, type DeleteConversationOptions as bn, type DeleteConversationResponse as bo, type GetConversationIncludeOptions as bp, type GetConversationOptions as bq, type GetConversationResponse as br, type ListChannelConversationsOptions as bs, type ListChannelConversationsResponse as bt, type ListContactConversationsOptions as bu, type ListContactConversationsResponse as bv, type ListConversationsIncludeOptions as bw, type FilterOptions as bx, type ListConversationOptions as by, type ListConversationsResponse as bz, type Options$4 as c, type UserID as c$, type CreateMessageResponse as c0, type DeleteMessageOptions as c1, type DeleteMessageResponse as c2, type GetMessageOptions as c3, type GetMessageResponse as c4, type ListChannelMessagesIncludeOptions as c5, type ListChannelMessagesOptions as c6, type ListChannelMessagesResponse as c7, type ListConversationMessagesIncludeOptions as c8, type ListConversationMessagesOptions as c9, type ListContactNotesOptions as cA, type ListContactNotesResponse as cB, type ListConversationNotesOptions as cC, type ListConversationNotesResponse as cD, type NoteID as cE, type UpdateNotePayload as cF, type UpdateNoteOptions as cG, type UpdateNoteResponse as cH, type Source as cI, type GetSourceOptions as cJ, type GetSourceResponse as cK, type ListSourcesOptions as cL, type ListSourcesResponse as cM, type SourceID as cN, type Upload as cO, type CreateUploadOptions as cP, type CreateUploadResponse as cQ, type DeleteUploadOptions as cR, type DeleteUploadResponse as cS, type GetUploadOptions as cT, type GetUploadResponse as cU, type ListUploadsOptions as cV, type ListUploadsResponse as cW, type UploadID as cX, type User as cY, type GetUserOptions as cZ, type GetUserResponse as c_, type ListConversationMessagesResponse as ca, type ListMessagesIncludeOptions as cb, type ListMessagesOptions as cc, type ListMessagesResponse as cd, type MessageID as ce, type MessageRole as cf, type MessageStatus as cg, type MessageEventType as ch, type Model as ci, type CreateCorrectionModelPayload as cj, type CreateCorrectionModelOptions as ck, type CreateCorrectionResponse as cl, type CreateResponseModelPayload as cm, type CreateResponseModelOptions as cn, type CreateResponseResponse as co, type GetModelOptions as cp, type GetModelResponse as cq, type ListModelsOptions as cr, type ListModelsResponse as cs, type ModelID as ct, type Note as cu, type CreateNotePayload as cv, type CreateNoteOptions as cw, type CreateNoteResponse as cx, type GetNoteOptions as cy, type GetNoteResponse as cz, type CurrentAccountID as d, type EventWebhookOptions as d0, eventWebhookSchema as d1, type WebhookEventType as d2, type AccountWebhookWebhookEventType as d3, type AccountAccessTokenWebhookEventType as d4, type ContactWebhookEventType as d5, type ConversationWebhookEventType as d6, type MessageWebhookEventType as d7, type WebhookSubscriptionWebhookEventType as d8, type WebhookEventPayload as d9, type WebhookResponse as da, type WebhookSubscription as db, type CreateWebhookSubscriptionPayload as dc, type CreateWebhookSubscriptionOptions as dd, type CreateWebhookSubscriptionResponse as de, type DeleteWebhookSubscriptionOptions as df, type DeleteWebhookSubscriptionResponse as dg, type GetWebhookSubscriptionOptions as dh, type GetWebhookSubscriptionResponse as di, type ListWebhookSubscriptionsOptions as dj, type ListWebhookSubscriptionsResponse as dk, type TestWebhookSubscriptionOptions as dl, type TestWebhookSubscriptionResponse as dm, type WebhookSubscriptionID as dn, type AccountID as e, type CreateAccountPayload as f, type CreateAccountOptions as g, type CreateAccountResponse as h, type GetAccountResponse as i, type UpdateAccountOptions as j, type UpdateAccountResponse as k, type AccountAccessToken as l, type AccountAccessTokenID as m, type CreateAccountAccessTokenPayload as n, type CreateAccountAccessTokenOptions as o, type CreateAccountAccessTokenResponse as p, type DeleteAccountAccessTokenOptions as q, type DeleteAccountAccessTokenResponse as r, type GetAccountAccessTokenOptions as s, type GetAccountAccessTokenResponse as t, type ListAccountAccessTokensResponse as u, type AccountConversationSettings as v, type GetAccountConversationSettingsOptions as w, type GetAccountConversationSettingsResponse as x, type UpdateAccountConversationSettingsPayload as y, type UpdateAccountConversationSettingsOptions as z };
|
package/dist/cli/index.d.cts
CHANGED
package/dist/cli/index.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=Object.create;var w=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var j=(s,t)=>{for(var e in t)w(s,e,{get:t[e],enumerable:!0})},H=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of et(t))!st.call(s,n)&&n!==e&&w(s,n,{get:()=>t[n],enumerable:!(o=tt(t,n))||o.enumerable});return s};var V=(s,t,e)=>(e=s!=null?Z(ot(s)):{},H(t||!s||!s.__esModule?w(e,"default",{value:s,enumerable:!0}):e,s)),nt=s=>H(w({},"__esModule",{value:!0}),s);var rt={};j(rt,{Client:()=>c,DEFAULT_SUPPORT_BASE_URL:()=>M,Error:()=>Q,SupportError:()=>a,default:()=>c,eventWebhookSchema:()=>N});module.exports=nt(rt);var M="https://api.support.greatdetail.com",q={"X-Powered-By":"GDSupport/JavaScript"};var m=class{constructor(t){this._transport=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})}};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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var K="SUPPORT_ACCESS_TOKEN",Y="SUPPORT_KEY_NAME",z="SUPPORT_KEY_PASSWORD",W="SUPPORT_SIGNING_KEY",J="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[Y],password:e=process.env[z]}={}){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(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var f=class{#t;constructor({token:t=process.env[K]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var C=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({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}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})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}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})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var v=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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 x=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.includeQuery(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({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(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"})}};var T=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.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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 I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}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 L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}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 U=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=q;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var S=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 r=Array.isArray(e)?e:[e];for(let p of r)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var E=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 $=V(require("is-network-error"),1),F=V(require("ky"),1);var a=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=F.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[p,X]of Object.entries(r))o.headers.has(p)||o.headers.set(p,X)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,$.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof F.HTTPError?new a(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),N=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var P=class{constructor(t){this._transport=t}async event({key:t=process.env[W],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."+W);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:r}=N.parse(o.body);return{event:r.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 r of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(r)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}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 c=class s{static DEFAULT_BASE_URL=M;static PublicAuthentication=C;static BasicAuthentication=h;static BearerAuthentication=f;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new U,t],...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new g(this._transport),this.channelConversationSettings=new v(this._transport),this.compositionSection=new O(this._transport),this.contact=new x(this._transport),this.conversation=new T(this._transport),this.escalation=new _(this._transport),this.label=new y(this._transport),this.message=new I(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[J]??this.DEFAULT_BASE_URL}};var Q={};j(Q,{SupportError:()=>a});0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SupportError,eventWebhookSchema});
|
|
1
|
+
"use strict";var Z=Object.create;var F=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var j=(s,t)=>{for(var e in t)F(s,e,{get:t[e],enumerable:!0})},H=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of et(t))!st.call(s,n)&&n!==e&&F(s,n,{get:()=>t[n],enumerable:!(o=tt(t,n))||o.enumerable});return s};var V=(s,t,e)=>(e=s!=null?Z(ot(s)):{},H(t||!s||!s.__esModule?F(e,"default",{value:s,enumerable:!0}):e,s)),nt=s=>H(F({},"__esModule",{value:!0}),s);var rt={};j(rt,{Client:()=>c,DEFAULT_SUPPORT_BASE_URL:()=>w,Error:()=>Q,SupportError:()=>a,default:()=>c,eventWebhookSchema:()=>N});module.exports=nt(rt);var w="https://api.support.greatdetail.com",q={"X-Powered-By":"GDSupport/JavaScript"};var m=class{constructor(t){this._transport=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})}};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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var K="SUPPORT_ACCESS_TOKEN",Y="SUPPORT_KEY_NAME",z="SUPPORT_KEY_PASSWORD",W="SUPPORT_SIGNING_KEY",J="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[Y],password:e=process.env[z]}={}){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(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var C=class{#t;constructor({token:t=process.env[K]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var f=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({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}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})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}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})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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 x=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.includeQuery(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({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(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"})}};var T=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.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}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 y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}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 L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}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 U=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=q;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var S=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 r=Array.isArray(e)?e:[e];for(let p of r)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var E=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 $=V(require("is-network-error"),1),M=V(require("ky"),1);var a=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=M.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[p,X]of Object.entries(r))o.headers.has(p)||o.headers.set(p,X)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,$.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof M.HTTPError?new a(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),N=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var P=class{constructor(t){this._transport=t}async event({key:t=process.env[W],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."+W);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:r}=N.parse(o.body);return{event:r.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 r of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(r)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}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 c=class s{static DEFAULT_BASE_URL=w;static PublicAuthentication=f;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new U,t],...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new O(this._transport),this.contact=new x(this._transport),this.conversation=new T(this._transport),this.escalation=new _(this._transport),this.label=new I(this._transport),this.message=new y(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[J]??this.DEFAULT_BASE_URL}};var Q={};j(Q,{SupportError:()=>a});0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SupportError,eventWebhookSchema});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as ConversationID, N as Nullable, R as ResponseTimestamp, S as SendOptions } from './Client-Dznu1ulG.cjs';
|
|
2
|
+
export { A as Account, l as AccountAccessToken, m as AccountAccessTokenID, d4 as AccountAccessTokenWebhookEventType, v as AccountConversationSettings, e as AccountID, d3 as AccountWebhookWebhookEventType, E as Action, F as ActionID, bh as ActiveConversationStatus, a2 as BoilerplateCategory, a3 as BoilerplateCategoryID, K as BoilerplateContent, M as BoilerplateContentID, af as Channel, aw as ChannelConversationSettings, ag as ChannelID, C as Client, aC as CompositionSection, aD as CompositionSectionID, bi as ConcludedConversationStatus, aY as Contact, a_ as ContactCustomMetadata, aZ as ContactID, d5 as ContactWebhookEventType, bf as Conversation, bg as ConversationCustomMetadata, bF as ConversationSettings, bj as ConversationStatus, d6 as ConversationWebhookEventType, o as CreateAccountAccessTokenOptions, n as CreateAccountAccessTokenPayload, p as CreateAccountAccessTokenResponse, g as CreateAccountOptions, f as CreateAccountPayload, h as CreateAccountResponse, a5 as CreateBoilerplateCategoryOptions, a4 as CreateBoilerplateCategoryPayload, a6 as CreateBoilerplateCategoryResponse, Q as CreateBoilerplateContentOptions, P as CreateBoilerplateContentPayload, T as CreateBoilerplateContentResponse, ai as CreateChannelOptions, ah as CreateChannelPayload, aj as CreateChannelResponse, aF as CreateCompositionSectionOptions, aE as CreateCompositionSectionPayload, aG as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bl as CreateConversationOptions, bk as CreateConversationPayload, bm as CreateConversationResponse, ck as CreateCorrectionModelOptions, cj as CreateCorrectionModelPayload, cl as CreateCorrectionResponse, aS as CreateEscalationOptions, aR as CreateEscalationPayload, aT as CreateEscalationResponse, bI as CreateLabelOptions, bH as CreateLabelPayload, bJ as CreateLabelResponse, b$ as CreateMessageOptions, b_ as CreateMessagePayload, c0 as CreateMessageResponse, cw as CreateNoteOptions, cv as CreateNotePayload, cx as CreateNoteResponse, cn as CreateResponseModelOptions, cm as CreateResponseModelPayload, co as CreateResponseResponse, cP as CreateUploadOptions, cQ as CreateUploadResponse, dd as CreateWebhookSubscriptionOptions, dc as CreateWebhookSubscriptionPayload, de as CreateWebhookSubscriptionResponse, d as CurrentAccountID, q as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, r as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bn as DeleteConversationOptions, bo as DeleteConversationResponse, bK as DeleteLabelOptions, bL as DeleteLabelResponse, c1 as DeleteMessageOptions, c2 as DeleteMessageResponse, cR as DeleteUploadOptions, cS as DeleteUploadResponse, df as DeleteWebhookSubscriptionOptions, dg as DeleteWebhookSubscriptionResponse, aQ as Escalation, d0 as EventWebhookOptions, bx as FilterOptions, s as GetAccountAccessTokenOptions, t as GetAccountAccessTokenResponse, w as GetAccountConversationSettingsOptions, x as GetAccountConversationSettingsResponse, G as GetAccountOptions, i as GetAccountResponse, a7 as GetBoilerplateCategoryOptions, a8 as GetBoilerplateCategoryResponse, V as GetBoilerplateContentOptions, W as GetBoilerplateContentResponse, ax as GetChannelConversationSettingsOptions, ay as GetChannelConversationSettingsResponse, ak as GetChannelOptions, al as GetChannelResponse, aH as GetCompositionSectionOptions, aI as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bp as GetConversationIncludeOptions, bq as GetConversationOptions, br as GetConversationResponse, aU as GetEscalationOptions, aV as GetEscalationResponse, bM as GetLabelOptions, bN as GetLabelResponse, c3 as GetMessageOptions, c4 as GetMessageResponse, cp as GetModelOptions, cq as GetModelResponse, cy as GetNoteOptions, cz as GetNoteResponse, cJ as GetSourceOptions, cK as GetSourceResponse, cT as GetUploadOptions, cU as GetUploadResponse, cZ as GetUserOptions, c_ as GetUserResponse, dh as GetWebhookSubscriptionOptions, di as GetWebhookSubscriptionResponse, bG as Label, bO as LabelID, L as ListAccountAccessTokensOptions, u as ListAccountAccessTokensResponse, I as ListActionsOptions, J as ListActionsResponse, a9 as ListBoilerplateCategoriesIncludeOptions, aa as ListBoilerplateCategoriesOptions, ab as ListBoilerplateCategoriesResponse, X as ListBoilerplateCategoryBoilerplateContentsOptions, Y as ListBoilerplateCategoryBoilerplateContentsResponse, Z as ListBoilerplateContentsOptions, _ as ListBoilerplateContentsResponse, aJ as ListChannelCompositionSectionsOptions, aK as ListChannelCompositionSectionsResponse, bs as ListChannelConversationsOptions, bt as ListChannelConversationsResponse, c5 as ListChannelMessagesIncludeOptions, c6 as ListChannelMessagesOptions, c7 as ListChannelMessagesResponse, am as ListChannelsOptions, an as ListChannelsResponse, aL as ListCompositionSectionsOptions, aM as ListCompositionSectionsResponse, bu as ListContactConversationsOptions, bv as ListContactConversationsResponse, bP as ListContactLabelsOptions, bQ as ListContactLabelsResponse, cA as ListContactNotesOptions, cB as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bR as ListConversationLabelsOptions, bS as ListConversationLabelsResponse, c8 as ListConversationMessagesIncludeOptions, c9 as ListConversationMessagesOptions, ca as ListConversationMessagesResponse, cC as ListConversationNotesOptions, cD as ListConversationNotesResponse, by as ListConversationOptions, bw as ListConversationsIncludeOptions, bz as ListConversationsResponse, aW as ListEscalationsOptions, aX as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bA as ListLabelConversationsOptions, bB as ListLabelConversationsResponse, bT as ListLabelsIncludeOptions, bU as ListLabelsOptions, bV as ListLabelsResponse, cb as ListMessagesIncludeOptions, cc as ListMessagesOptions, cd as ListMessagesResponse, cr as ListModelsOptions, cs as ListModelsResponse, cL as ListSourcesOptions, cM as ListSourcesResponse, cV as ListUploadsOptions, cW as ListUploadsResponse, dj as ListWebhookSubscriptionsOptions, dk as ListWebhookSubscriptionsResponse, bZ as Message, ch as MessageEventType, ce as MessageID, cf as MessageRole, cg as MessageStatus, d7 as MessageWebhookEventType, ao as MetaWhatsappChannelGetBusinessProfileOptions, ap as MetaWhatsappChannelGetBusinessProfileResponse, ci as Model, ct as ModelID, cu as Note, cE as NoteID, O as Options, b as RequestFilterable, H as SortOptions, cI as Source, cN as SourceID, dl as TestWebhookSubscriptionOptions, dm as TestWebhookSubscriptionResponse, c as TransportOptions, aq as TwilioSendChannelSyncPayload, ar as TwilioSendgridChannelSyncOptions, as as TwilioSendgridChannelSyncResponse, z as UpdateAccountConversationSettingsOptions, y as UpdateAccountConversationSettingsPayload, B as UpdateAccountConversationSettingsResponse, j as UpdateAccountOptions, U as UpdateAccountPayload, k as UpdateAccountResponse, ad as UpdateBoilerplateCategoryOptions, ac as UpdateBoilerplateCategoryPayload, ae as UpdateBoilerplateCategoryResponse, a0 as UpdateBoilerplateContentOptions, $ as UpdateBoilerplateContentPayload, a1 as UpdateBoilerplateContentResponse, aA as UpdateChannelConversationSettingsOptions, az as UpdateChannelConversationSettingsPayload, aB as UpdateChannelConversationSettingsResponse, au as UpdateChannelOptions, at as UpdateChannelPayload, av as UpdateChannelResponse, aO as UpdateCompositionSectionOptions, aN as UpdateCompositionSectionPayload, aP as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bD as UpdateConversationOptions, bC as UpdateConversationPayload, bE as UpdateConversationResponse, bX as UpdateLabelOptions, bW as UpdateLabelPayload, bY as UpdateLabelResponse, cG as UpdateNoteOptions, cF as UpdateNotePayload, cH as UpdateNoteResponse, cO as Upload, cX as UploadID, cY as User, c$ as UserID, d9 as WebhookEventPayload, d2 as WebhookEventType, da as WebhookResponse, db as WebhookSubscription, dn as WebhookSubscriptionID, d8 as WebhookSubscriptionWebhookEventType, C as default, d1 as eventWebhookSchema } from './Client-Dznu1ulG.cjs';
|
|
2
3
|
import { KyResponse } from 'ky';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
@@ -56,4 +57,67 @@ declare namespace index {
|
|
|
56
57
|
export { type index_ErrorResponse as ErrorResponse, index_SupportError as SupportError };
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Great Detail Support System.
|
|
62
|
+
*
|
|
63
|
+
* @copyright 2025 Great Detail Ltd
|
|
64
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
65
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
66
|
+
* @see https://greatdetail.com
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
type ConversationFeedbackID = string;
|
|
70
|
+
type ConversationFeedback = {
|
|
71
|
+
id: ConversationFeedbackID;
|
|
72
|
+
conversation: ConversationID;
|
|
73
|
+
feedback: {
|
|
74
|
+
id: string;
|
|
75
|
+
rating: number;
|
|
76
|
+
content?: Nullable<string>;
|
|
77
|
+
} & ResponseTimestamp;
|
|
78
|
+
} & ResponseTimestamp;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Great Detail Support System.
|
|
82
|
+
*
|
|
83
|
+
* @copyright 2025 Great Detail Ltd
|
|
84
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
85
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
86
|
+
* @see https://greatdetail.com
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
type CreateConversationConversationFeedbackPayload = {
|
|
90
|
+
feedback: {
|
|
91
|
+
rating: number;
|
|
92
|
+
content?: Nullable<string>;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
interface CreateConversationConversationFeedbackOptions {
|
|
96
|
+
body: CreateConversationConversationFeedbackPayload;
|
|
97
|
+
request?: SendOptions;
|
|
98
|
+
}
|
|
99
|
+
type CreateConversationConversationFeedbackResponse = {
|
|
100
|
+
data: {
|
|
101
|
+
conversationFeedback: ConversationFeedback;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Great Detail Support System.
|
|
107
|
+
*
|
|
108
|
+
* @copyright 2025 Great Detail Ltd
|
|
109
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
110
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
111
|
+
* @see https://greatdetail.com
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
interface ListConversationConversationFeedbackOptions {
|
|
115
|
+
request?: SendOptions;
|
|
116
|
+
}
|
|
117
|
+
type ListConversationConversationFeedbackResponse = {
|
|
118
|
+
data: {
|
|
119
|
+
conversationFeedback: ConversationFeedback;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { type ConversationFeedback, ConversationID, type CreateConversationConversationFeedbackOptions, type CreateConversationConversationFeedbackPayload, type CreateConversationConversationFeedbackResponse, DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ListConversationConversationFeedbackOptions, type ListConversationConversationFeedbackResponse, SupportError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as ConversationID, N as Nullable, R as ResponseTimestamp, S as SendOptions } from './Client-Dznu1ulG.js';
|
|
2
|
+
export { A as Account, l as AccountAccessToken, m as AccountAccessTokenID, d4 as AccountAccessTokenWebhookEventType, v as AccountConversationSettings, e as AccountID, d3 as AccountWebhookWebhookEventType, E as Action, F as ActionID, bh as ActiveConversationStatus, a2 as BoilerplateCategory, a3 as BoilerplateCategoryID, K as BoilerplateContent, M as BoilerplateContentID, af as Channel, aw as ChannelConversationSettings, ag as ChannelID, C as Client, aC as CompositionSection, aD as CompositionSectionID, bi as ConcludedConversationStatus, aY as Contact, a_ as ContactCustomMetadata, aZ as ContactID, d5 as ContactWebhookEventType, bf as Conversation, bg as ConversationCustomMetadata, bF as ConversationSettings, bj as ConversationStatus, d6 as ConversationWebhookEventType, o as CreateAccountAccessTokenOptions, n as CreateAccountAccessTokenPayload, p as CreateAccountAccessTokenResponse, g as CreateAccountOptions, f as CreateAccountPayload, h as CreateAccountResponse, a5 as CreateBoilerplateCategoryOptions, a4 as CreateBoilerplateCategoryPayload, a6 as CreateBoilerplateCategoryResponse, Q as CreateBoilerplateContentOptions, P as CreateBoilerplateContentPayload, T as CreateBoilerplateContentResponse, ai as CreateChannelOptions, ah as CreateChannelPayload, aj as CreateChannelResponse, aF as CreateCompositionSectionOptions, aE as CreateCompositionSectionPayload, aG as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bl as CreateConversationOptions, bk as CreateConversationPayload, bm as CreateConversationResponse, ck as CreateCorrectionModelOptions, cj as CreateCorrectionModelPayload, cl as CreateCorrectionResponse, aS as CreateEscalationOptions, aR as CreateEscalationPayload, aT as CreateEscalationResponse, bI as CreateLabelOptions, bH as CreateLabelPayload, bJ as CreateLabelResponse, b$ as CreateMessageOptions, b_ as CreateMessagePayload, c0 as CreateMessageResponse, cw as CreateNoteOptions, cv as CreateNotePayload, cx as CreateNoteResponse, cn as CreateResponseModelOptions, cm as CreateResponseModelPayload, co as CreateResponseResponse, cP as CreateUploadOptions, cQ as CreateUploadResponse, dd as CreateWebhookSubscriptionOptions, dc as CreateWebhookSubscriptionPayload, de as CreateWebhookSubscriptionResponse, d as CurrentAccountID, q as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, r as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bn as DeleteConversationOptions, bo as DeleteConversationResponse, bK as DeleteLabelOptions, bL as DeleteLabelResponse, c1 as DeleteMessageOptions, c2 as DeleteMessageResponse, cR as DeleteUploadOptions, cS as DeleteUploadResponse, df as DeleteWebhookSubscriptionOptions, dg as DeleteWebhookSubscriptionResponse, aQ as Escalation, d0 as EventWebhookOptions, bx as FilterOptions, s as GetAccountAccessTokenOptions, t as GetAccountAccessTokenResponse, w as GetAccountConversationSettingsOptions, x as GetAccountConversationSettingsResponse, G as GetAccountOptions, i as GetAccountResponse, a7 as GetBoilerplateCategoryOptions, a8 as GetBoilerplateCategoryResponse, V as GetBoilerplateContentOptions, W as GetBoilerplateContentResponse, ax as GetChannelConversationSettingsOptions, ay as GetChannelConversationSettingsResponse, ak as GetChannelOptions, al as GetChannelResponse, aH as GetCompositionSectionOptions, aI as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bp as GetConversationIncludeOptions, bq as GetConversationOptions, br as GetConversationResponse, aU as GetEscalationOptions, aV as GetEscalationResponse, bM as GetLabelOptions, bN as GetLabelResponse, c3 as GetMessageOptions, c4 as GetMessageResponse, cp as GetModelOptions, cq as GetModelResponse, cy as GetNoteOptions, cz as GetNoteResponse, cJ as GetSourceOptions, cK as GetSourceResponse, cT as GetUploadOptions, cU as GetUploadResponse, cZ as GetUserOptions, c_ as GetUserResponse, dh as GetWebhookSubscriptionOptions, di as GetWebhookSubscriptionResponse, bG as Label, bO as LabelID, L as ListAccountAccessTokensOptions, u as ListAccountAccessTokensResponse, I as ListActionsOptions, J as ListActionsResponse, a9 as ListBoilerplateCategoriesIncludeOptions, aa as ListBoilerplateCategoriesOptions, ab as ListBoilerplateCategoriesResponse, X as ListBoilerplateCategoryBoilerplateContentsOptions, Y as ListBoilerplateCategoryBoilerplateContentsResponse, Z as ListBoilerplateContentsOptions, _ as ListBoilerplateContentsResponse, aJ as ListChannelCompositionSectionsOptions, aK as ListChannelCompositionSectionsResponse, bs as ListChannelConversationsOptions, bt as ListChannelConversationsResponse, c5 as ListChannelMessagesIncludeOptions, c6 as ListChannelMessagesOptions, c7 as ListChannelMessagesResponse, am as ListChannelsOptions, an as ListChannelsResponse, aL as ListCompositionSectionsOptions, aM as ListCompositionSectionsResponse, bu as ListContactConversationsOptions, bv as ListContactConversationsResponse, bP as ListContactLabelsOptions, bQ as ListContactLabelsResponse, cA as ListContactNotesOptions, cB as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bR as ListConversationLabelsOptions, bS as ListConversationLabelsResponse, c8 as ListConversationMessagesIncludeOptions, c9 as ListConversationMessagesOptions, ca as ListConversationMessagesResponse, cC as ListConversationNotesOptions, cD as ListConversationNotesResponse, by as ListConversationOptions, bw as ListConversationsIncludeOptions, bz as ListConversationsResponse, aW as ListEscalationsOptions, aX as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bA as ListLabelConversationsOptions, bB as ListLabelConversationsResponse, bT as ListLabelsIncludeOptions, bU as ListLabelsOptions, bV as ListLabelsResponse, cb as ListMessagesIncludeOptions, cc as ListMessagesOptions, cd as ListMessagesResponse, cr as ListModelsOptions, cs as ListModelsResponse, cL as ListSourcesOptions, cM as ListSourcesResponse, cV as ListUploadsOptions, cW as ListUploadsResponse, dj as ListWebhookSubscriptionsOptions, dk as ListWebhookSubscriptionsResponse, bZ as Message, ch as MessageEventType, ce as MessageID, cf as MessageRole, cg as MessageStatus, d7 as MessageWebhookEventType, ao as MetaWhatsappChannelGetBusinessProfileOptions, ap as MetaWhatsappChannelGetBusinessProfileResponse, ci as Model, ct as ModelID, cu as Note, cE as NoteID, O as Options, b as RequestFilterable, H as SortOptions, cI as Source, cN as SourceID, dl as TestWebhookSubscriptionOptions, dm as TestWebhookSubscriptionResponse, c as TransportOptions, aq as TwilioSendChannelSyncPayload, ar as TwilioSendgridChannelSyncOptions, as as TwilioSendgridChannelSyncResponse, z as UpdateAccountConversationSettingsOptions, y as UpdateAccountConversationSettingsPayload, B as UpdateAccountConversationSettingsResponse, j as UpdateAccountOptions, U as UpdateAccountPayload, k as UpdateAccountResponse, ad as UpdateBoilerplateCategoryOptions, ac as UpdateBoilerplateCategoryPayload, ae as UpdateBoilerplateCategoryResponse, a0 as UpdateBoilerplateContentOptions, $ as UpdateBoilerplateContentPayload, a1 as UpdateBoilerplateContentResponse, aA as UpdateChannelConversationSettingsOptions, az as UpdateChannelConversationSettingsPayload, aB as UpdateChannelConversationSettingsResponse, au as UpdateChannelOptions, at as UpdateChannelPayload, av as UpdateChannelResponse, aO as UpdateCompositionSectionOptions, aN as UpdateCompositionSectionPayload, aP as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bD as UpdateConversationOptions, bC as UpdateConversationPayload, bE as UpdateConversationResponse, bX as UpdateLabelOptions, bW as UpdateLabelPayload, bY as UpdateLabelResponse, cG as UpdateNoteOptions, cF as UpdateNotePayload, cH as UpdateNoteResponse, cO as Upload, cX as UploadID, cY as User, c$ as UserID, d9 as WebhookEventPayload, d2 as WebhookEventType, da as WebhookResponse, db as WebhookSubscription, dn as WebhookSubscriptionID, d8 as WebhookSubscriptionWebhookEventType, C as default, d1 as eventWebhookSchema } from './Client-Dznu1ulG.js';
|
|
2
3
|
import { KyResponse } from 'ky';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
@@ -56,4 +57,67 @@ declare namespace index {
|
|
|
56
57
|
export { type index_ErrorResponse as ErrorResponse, index_SupportError as SupportError };
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Great Detail Support System.
|
|
62
|
+
*
|
|
63
|
+
* @copyright 2025 Great Detail Ltd
|
|
64
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
65
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
66
|
+
* @see https://greatdetail.com
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
type ConversationFeedbackID = string;
|
|
70
|
+
type ConversationFeedback = {
|
|
71
|
+
id: ConversationFeedbackID;
|
|
72
|
+
conversation: ConversationID;
|
|
73
|
+
feedback: {
|
|
74
|
+
id: string;
|
|
75
|
+
rating: number;
|
|
76
|
+
content?: Nullable<string>;
|
|
77
|
+
} & ResponseTimestamp;
|
|
78
|
+
} & ResponseTimestamp;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Great Detail Support System.
|
|
82
|
+
*
|
|
83
|
+
* @copyright 2025 Great Detail Ltd
|
|
84
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
85
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
86
|
+
* @see https://greatdetail.com
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
type CreateConversationConversationFeedbackPayload = {
|
|
90
|
+
feedback: {
|
|
91
|
+
rating: number;
|
|
92
|
+
content?: Nullable<string>;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
interface CreateConversationConversationFeedbackOptions {
|
|
96
|
+
body: CreateConversationConversationFeedbackPayload;
|
|
97
|
+
request?: SendOptions;
|
|
98
|
+
}
|
|
99
|
+
type CreateConversationConversationFeedbackResponse = {
|
|
100
|
+
data: {
|
|
101
|
+
conversationFeedback: ConversationFeedback;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Great Detail Support System.
|
|
107
|
+
*
|
|
108
|
+
* @copyright 2025 Great Detail Ltd
|
|
109
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
110
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
111
|
+
* @see https://greatdetail.com
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
interface ListConversationConversationFeedbackOptions {
|
|
115
|
+
request?: SendOptions;
|
|
116
|
+
}
|
|
117
|
+
type ListConversationConversationFeedbackResponse = {
|
|
118
|
+
data: {
|
|
119
|
+
conversationFeedback: ConversationFeedback;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { type ConversationFeedback, ConversationID, type CreateConversationConversationFeedbackOptions, type CreateConversationConversationFeedbackPayload, type CreateConversationConversationFeedbackResponse, DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ListConversationConversationFeedbackOptions, type ListConversationConversationFeedbackResponse, SupportError };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as e,c as t,d as p,e as f,f as o}from"./chunk-BORTTUUM.js";var r={};e(r,{SupportError:()=>p});export{o as Client,t as DEFAULT_SUPPORT_BASE_URL,r as Error,p as SupportError,o as default,f as eventWebhookSchema};
|