@great-detail/support-sdk 0.24.3 → 0.25.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/{Client-CZ3Y0jmo.d.cts → Client-DE_bNRkN.d.cts} +22 -1
- package/dist/{Client-CZ3Y0jmo.d.ts → Client-DE_bNRkN.d.ts} +22 -1
- package/dist/chunk-RTRINZVE.js +1 -0
- package/dist/{chunk-4EZUC5Y5.js → chunk-YQRKO6KD.js} +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/package.json +3 -1
- package/dist/chunk-N2FWKT3O.js +0 -1
|
@@ -943,6 +943,22 @@ type Action = {
|
|
|
943
943
|
endedAt?: string;
|
|
944
944
|
} & ResponseTimestamp;
|
|
945
945
|
|
|
946
|
+
/**
|
|
947
|
+
* Great Detail Support System.
|
|
948
|
+
*
|
|
949
|
+
* @copyright 2025 Great Detail Ltd
|
|
950
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
951
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
952
|
+
* @see https://greatdetail.com
|
|
953
|
+
*/
|
|
954
|
+
|
|
955
|
+
interface GetActionOptions {
|
|
956
|
+
request?: SendOptions;
|
|
957
|
+
}
|
|
958
|
+
type GetActionResponse = ResponseData<{
|
|
959
|
+
action: Action;
|
|
960
|
+
}>;
|
|
961
|
+
|
|
946
962
|
/**
|
|
947
963
|
* Great Detail Support System.
|
|
948
964
|
*
|
|
@@ -971,6 +987,11 @@ type ListActionsResponse = ResponseMeta<{
|
|
|
971
987
|
declare class ActionAPI {
|
|
972
988
|
protected _transport: FetchTransport;
|
|
973
989
|
constructor(_transport: FetchTransport);
|
|
990
|
+
get(id: ActionID, { request }?: GetActionOptions): {
|
|
991
|
+
requestID: string;
|
|
992
|
+
response: () => Promise<ky.KyResponse<GetActionResponse>>;
|
|
993
|
+
json: () => Promise<GetActionResponse>;
|
|
994
|
+
};
|
|
974
995
|
list({ filter, sort, pagination, request }?: ListActionsOptions): {
|
|
975
996
|
requestID: string;
|
|
976
997
|
response: () => Promise<ky.KyResponse<ListActionsResponse>>;
|
|
@@ -4355,4 +4376,4 @@ declare class Client {
|
|
|
4355
4376
|
};
|
|
4356
4377
|
}
|
|
4357
4378
|
|
|
4358
|
-
export { type BoilerplateContentID as $, type Account as A, type AccountConversationSettings as B, Client as C, type DeleteAccountAccessTokenPayload as D, type GetAccountConversationSettingsOptions as E, type GetAccountConversationSettingsResponse as F, type GetAccountOptions as G, type UpdateAccountConversationSettingsPayload as H, type UpdateAccountConversationSettingsOptions as I, type UpdateAccountConversationSettingsResponse as J, type AccountNotificationEvent as K, type ListAccountsOptions as L, type GetAccountNotificationEventOptions as M, type GetAccountNotificationEventResponse as N, type Options as O, type ListAccountNotificationEventsFilterOptions as P, type ListAccountNotificationEventsOptions as Q, type ResponseData as R, type ListAccountNotificationEventsResponse as S, type Action as T, type UpdateAccountPayload as U, type ActionID as V, type ActionStatus as W, type SortOptions as X, type ListActionsOptions as Y, type ListActionsResponse as Z, type BoilerplateContent as _, type Options$4 as a, type CreateEscalationOptions as a$, type CreateBoilerplateContentPayload as a0, type CreateBoilerplateContentOptions as a1, type CreateBoilerplateContentResponse as a2, type GetBoilerplateContentOptions as a3, type GetBoilerplateContentResponse as a4, type ListBoilerplateContentsOptions as a5, type ListBoilerplateContentsResponse as a6, type UpdateBoilerplateContentPayload as a7, type UpdateBoilerplateContentOptions as a8, type UpdateBoilerplateContentResponse as a9, type SendChannelSyncPayload as aA, type SendgridChannelSyncOptions as aB, type SendgridChannelSyncResponse as aC, type UpdateChannelPayload as aD, type UpdateChannelOptions as aE, type UpdateChannelResponse as aF, type ChannelConversationSettings as aG, type GetChannelConversationSettingsOptions as aH, type GetChannelConversationSettingsResponse as aI, type UpdateChannelConversationSettingsPayload as aJ, type UpdateChannelConversationSettingsOptions as aK, type UpdateChannelConversationSettingsResponse as aL, type CompositionSection as aM, type CompositionSectionID as aN, type CompositionSectionLocation as aO, type CreateCompositionSectionPayload as aP, type CreateCompositionSectionOptions as aQ, type CreateCompositionSectionResponse as aR, type GetCompositionSectionOptions as aS, type GetCompositionSectionResponse as aT, type ListCompositionSectionsOptions as aU, type ListCompositionSectionsResponse as aV, type UpdateCompositionSectionPayload as aW, type UpdateCompositionSectionOptions as aX, type UpdateCompositionSectionResponse as aY, type Escalation as aZ, type CreateEscalationPayload as a_, type BoilerplateCategory as aa, type BoilerplateCategoryID as ab, type CreateBoilerplateCategoryPayload as ac, type CreateBoilerplateCategoryOptions as ad, type CreateBoilerplateCategoryResponse as ae, type GetBoilerplateCategoryOptions as af, type GetBoilerplateCategoryResponse as ag, type ListBoilerplateCategoriesIncludeOptions as ah, type ListBoilerplateCategoriesOptions as ai, type ListBoilerplateCategoriesResponse as aj, type UpdateBoilerplateCategoryPayload as ak, type UpdateBoilerplateCategoryOptions as al, type UpdateBoilerplateCategoryResponse as am, type Channel as an, type ChannelID as ao, type ChannelStatus as ap, type CustomChannelCustomMetadata as aq, type CreateChannelPayload as ar, type CreateChannelOptions as as, type CreateChannelResponse as at, type DeleteChannelOptions as au, type DeleteChannelResponse as av, type GetChannelOptions as aw, type GetChannelResponse as ax, type ListChannelsOptions as ay, type ListChannelsResponse as az, type ResponseMeta as b, type CreateLabelResponse as b$, type CreateEscalationResponse as b0, type GetEscalationOptions as b1, type GetEscalationResponse as b2, type ListEscalationsOptions as b3, type ListEscalationsResponse as b4, type DeleteEscalationOptions as b5, type DeleteEscalationResponse as b6, type Contact as b7, type ContactID as b8, type ContactType as b9, type DeleteConversationResponse as bA, type GetConversationIncludeOptions as bB, type GetConversationOptions as bC, type GetConversationResponse as bD, type ListConversationsIncludeOptions as bE, type ListConversationsFilterOptions as bF, type ListConversationOptions as bG, type ListConversationsResponse as bH, type UpdateConversationPayload as bI, type UpdateConversationOptions as bJ, type UpdateConversationResponse as bK, type TriggerResponseConversationOptions as bL, type TriggerResponseConversationResponse as bM, type ConversationSettings as bN, type ConversationFeedback as bO, type CreateConversationFeedbackPayload as bP, type CreateConversationFeedbackOptions as bQ, type CreateConversationFeedbackResponse as bR, type DeleteConversationFeedbackOptions as bS, type DeleteConversationFeedbackResponse as bT, type GetConversationFeedbackOptions as bU, type GetConversationFeedbackResponse as bV, type ListConversationFeedbackOptions as bW, type ListConversationFeedbackResponse as bX, type Label as bY, type CreateLabelPayload as bZ, type CreateLabelOptions as b_, type ContactStatus as ba, type ContactCustomMetadata as bb, type CreateContactPayload as bc, type CreateContactOptions as bd, type CreateContactResponse as be, type DeleteContactOptions as bf, type DeleteContactResponse as bg, type GetContactIncludeOptions as bh, type GetContactOptions as bi, type GetContactResponse as bj, type GetContactVCFOptions as bk, type ListContactsOptions as bl, type ListContactsResponse as bm, type UpdateContactPayload as bn, type UpdateContactOptions as bo, type UpdateContactResponse as bp, type Conversation as bq, type ConversationID as br, type ConversationCustomMetadata as bs, type ActiveConversationStatus as bt, type ConcludedConversationStatus as bu, type ConversationStatus as bv, type CreateConversationPayload as bw, type CreateConversationOptions as bx, type CreateConversationResponse as by, type DeleteConversationOptions as bz, type ResponseTimestamp as c, type WhatsappTemplateQualityScore as c$, type DeleteLabelOptions as c0, type DeleteLabelResponse as c1, type GetLabelOptions as c2, type GetLabelResponse as c3, type LabelID as c4, type ListLabelsIncludeOptions as c5, type ListLabelsOptions as c6, type ListLabelsResponse as c7, type UpdateLabelPayload as c8, type UpdateLabelOptions as c9, type WhatsappPhoneNumber as cA, type GetWhatsappPhoneNumberIncludeOptions as cB, type GetWhatsappPhoneNumberOptions as cC, type GetWhatsappPhoneNumberResponse as cD, type ListWhatsappPhoneNumbersOptions as cE, type ListWhatsappPhoneNumbersResponse as cF, type DeleteWhatsappAccountTemplateOptions as cG, type DeleteWhatsappAccountTemplateResponse as cH, type GetWhatsappAccountTemplateOptions as cI, type GetWhatsappAccountTemplateResponse as cJ, type ListWhatsappAccountTemplatesOptions as cK, type ListWhatsappAccountTemplatesResponse as cL, WHATSAPP_TEMPLATE_STATUSES as cM, type WhatsappTemplateStatus as cN, WHATSAPP_TEMPLATE_LANGUAGES as cO, type WhatsappTemplateLanguage as cP, WHATSAPP_TEMPLATE_CATEGORIES as cQ, type WhatsappTemplateCategory as cR, WHATSAPP_TEMPLATE_SUBCATEGORIES as cS, type WhatsappTemplateSubcategory as cT, WHATSAPP_TEMPLATE_INDUSTRIES as cU, type WhatsappTemplateIndustry as cV, WHATSAPP_TEMPLATE_TOPICS as cW, type WhatsappTemplateTopic as cX, WHATSAPP_TEMPLATE_USECASES as cY, type WhatsappTemplateUseCase as cZ, WHATSAPP_TEMPLATE_QUALITY_SCORES as c_, type UpdateLabelResponse as ca, type Import as cb, type CreateImportPayload as cc, type CreateImportOptions as cd, type CreateImportResponse as ce, type GetImportOptions as cf, type GetImportResponse as cg, type ListImportsOptions as ch, type ListImportsResponse as ci, type ImportID as cj, type ImportType as ck, type ImportStatus as cl, type WhatsappAccount as cm, type WhatsappAccountDetail as cn, type GetWhatsappAccountIncludeOptions as co, type GetWhatsappAccountOptions as cp, type GetWhatsappAccountResponse as cq, type ListWhatsappAccountsOptions as cr, type ListWhatsappAccountsResponse as cs, WHATSAPP_BUSINESS_PROFILE_VERTICAL as ct, type WhatsappBusinessProfileDetail as cu, type GetWhatsappBusinessProfileOptions as cv, type GetWhatsappBusinessProfileResponse as cw, type UpdateWhatsappBusinessProfilePayload as cx, type UpdateWhatsappBusinessProfileOptions as cy, type UpdateWhatsappBusinessProfileResponse as cz, type CursorResponsePagination as d, type NoteID as d$, type WhatsappTemplateRejectionReason as d0, type WhatsappTemplateParameterFormat as d1, type WhatsappTemplateButton as d2, type WhatsappAccountTemplate as d3, type WhatsappLibraryTemplate as d4, type Message as d5, type LexicalDirection as d6, type LexicalIndent as d7, type LexicalTextNode as d8, type LexicalLinkNode as d9, type ModelConfig as dA, type CreateModelConfigPayload as dB, type CreateModelConfigOptions as dC, type CreateModelConfigResponse as dD, type DeleteModelConfigOptions as dE, type DeleteModelConfigResponse as dF, type UpdateModelConfigPayload as dG, type UpdateModelConfigOptions as dH, type UpdateModelConfigResponse as dI, type GetModelConfigOptions as dJ, type GetModelConfigResponse as dK, type ListModelConfigsOptions as dL, type ListModelConfigsResponse as dM, type ModelInterface as dN, type GetModelInterfaceOptions as dO, type GetModelInterfaceResponse as dP, type ListModelInterfacesOptions as dQ, type ListModelInterfacesResponse as dR, type ModelInterfaceID as dS, type Note as dT, type CreateNotePayload as dU, type CreateNoteOptions as dV, type CreateNoteResponse as dW, type GetNoteOptions as dX, type GetNoteResponse as dY, type ListNotesOptions as dZ, type ListNotesResponse as d_, type LexicalQuoteNode as da, type LexicalHeadingNode as db, type LexicalParagraphNode as dc, type LexicalListItemNode as dd, type LexicalListNode as de, type LexicalHorizontalRuleNode as df, type LexicalUploadNode as dg, type LexicalRootNode as dh, type CreateMessagePayload as di, type CreateMessageOptions as dj, type CreateMessageResponse as dk, type DeleteMessageOptions as dl, type DeleteMessageResponse as dm, type GetMessageOptions as dn, type GetMessageResponse as dp, type ListMessagesIncludeOptions as dq, type ListMessagesOptions as dr, type ListMessagesResponse as ds, type MessageID as dt, type MessageRole as du, type MessageType as dv, type MessageStatus as dw, type MessageVisibility as dx, type MessageEventType as dy, type MessageCustomMetadata as dz, type CountResponsePagination as e, type UpdateNotePayload as e0, type UpdateNoteOptions as e1, type UpdateNoteResponse as e2, type NotificationEvent as e3, type Source as e4, type GetSourceOptions as e5, type GetSourceResponse as e6, type ListSourcesOptions as e7, type ListSourcesResponse as e8, type SourceID as e9, type WebhookResponse as eA, type WebhookSubscription as eB, type CreateWebhookSubscriptionPayload as eC, type CreateWebhookSubscriptionOptions as eD, type CreateWebhookSubscriptionResponse as eE, type DeleteWebhookSubscriptionOptions as eF, type DeleteWebhookSubscriptionResponse as eG, type GetWebhookSubscriptionOptions as eH, type GetWebhookSubscriptionResponse as eI, type ListWebhookSubscriptionsOptions as eJ, type ListWebhookSubscriptionsResponse as eK, type TestWebhookSubscriptionOptions as eL, type TestWebhookSubscriptionResponse as eM, type WebhookSubscriptionID as eN, type SourceAdornment as ea, type Upload as eb, type CreateUploadIncludeOptions as ec, type CreateUploadOptions as ed, type CreateUploadResponse as ee, type DeleteUploadOptions as ef, type DeleteUploadResponse as eg, type GetUploadIncludeOptions as eh, type GetUploadOptions as ei, type GetUploadResponse as ej, type ListUploadsIncludeOptions as ek, type ListUploadsOptions as el, type ListUploadsResponse as em, type UploadID as en, type EventWebhookOptions as eo, eventWebhookSchema as ep, type WebhookEventType as eq, type AccountWebhookWebhookEventType as er, type AccountAccessTokenWebhookEventType as es, type AccountNotificationEventEventType as et, type ContactWebhookEventType as eu, type ConversationWebhookEventType as ev, type MessageWebhookEventType as ew, type ImportWebhookEventType as ex, type WebhookSubscriptionWebhookEventType as ey, type WebhookEventPayload as ez, type CurrentAccountID as f, type AccountStatus as g, type AccountID as h, type CreateAccountPayload as i, type CreateAccountOptions as j, type CreateAccountResponse as k, type GetAccountResponse as l, type UpdateAccountOptions as m, type UpdateAccountResponse as n, type ListAccountsResponse as o, type AccountAccessToken as p, type AccountAccessTokenID as q, type CreateAccountAccessTokenPayload as r, type CreateAccountAccessTokenOptions as s, type CreateAccountAccessTokenResponse as t, type DeleteAccountAccessTokenOptions as u, type DeleteAccountAccessTokenResponse as v, type GetAccountAccessTokenOptions as w, type GetAccountAccessTokenResponse as x, type ListAccountAccessTokensOptions as y, type ListAccountAccessTokensResponse as z };
|
|
4379
|
+
export { type GetActionResponse as $, type Account as A, type AccountConversationSettings as B, Client as C, type DeleteAccountAccessTokenPayload as D, type GetAccountConversationSettingsOptions as E, type GetAccountConversationSettingsResponse as F, type GetAccountOptions as G, type UpdateAccountConversationSettingsPayload as H, type UpdateAccountConversationSettingsOptions as I, type UpdateAccountConversationSettingsResponse as J, type AccountNotificationEvent as K, type ListAccountsOptions as L, type GetAccountNotificationEventOptions as M, type GetAccountNotificationEventResponse as N, type Options as O, type ListAccountNotificationEventsFilterOptions as P, type ListAccountNotificationEventsOptions as Q, type ResponseData as R, type ListAccountNotificationEventsResponse as S, type Action as T, type UpdateAccountPayload as U, type ActionID as V, type ActionStatus as W, type SortOptions as X, type ListActionsOptions as Y, type ListActionsResponse as Z, type GetActionOptions as _, type Options$4 as a, type Escalation as a$, type BoilerplateContent as a0, type BoilerplateContentID as a1, type CreateBoilerplateContentPayload as a2, type CreateBoilerplateContentOptions as a3, type CreateBoilerplateContentResponse as a4, type GetBoilerplateContentOptions as a5, type GetBoilerplateContentResponse as a6, type ListBoilerplateContentsOptions as a7, type ListBoilerplateContentsResponse as a8, type UpdateBoilerplateContentPayload as a9, type ListChannelsOptions as aA, type ListChannelsResponse as aB, type SendChannelSyncPayload as aC, type SendgridChannelSyncOptions as aD, type SendgridChannelSyncResponse as aE, type UpdateChannelPayload as aF, type UpdateChannelOptions as aG, type UpdateChannelResponse as aH, type ChannelConversationSettings as aI, type GetChannelConversationSettingsOptions as aJ, type GetChannelConversationSettingsResponse as aK, type UpdateChannelConversationSettingsPayload as aL, type UpdateChannelConversationSettingsOptions as aM, type UpdateChannelConversationSettingsResponse as aN, type CompositionSection as aO, type CompositionSectionID as aP, type CompositionSectionLocation as aQ, type CreateCompositionSectionPayload as aR, type CreateCompositionSectionOptions as aS, type CreateCompositionSectionResponse as aT, type GetCompositionSectionOptions as aU, type GetCompositionSectionResponse as aV, type ListCompositionSectionsOptions as aW, type ListCompositionSectionsResponse as aX, type UpdateCompositionSectionPayload as aY, type UpdateCompositionSectionOptions as aZ, type UpdateCompositionSectionResponse as a_, type UpdateBoilerplateContentOptions as aa, type UpdateBoilerplateContentResponse as ab, type BoilerplateCategory as ac, type BoilerplateCategoryID as ad, type CreateBoilerplateCategoryPayload as ae, type CreateBoilerplateCategoryOptions as af, type CreateBoilerplateCategoryResponse as ag, type GetBoilerplateCategoryOptions as ah, type GetBoilerplateCategoryResponse as ai, type ListBoilerplateCategoriesIncludeOptions as aj, type ListBoilerplateCategoriesOptions as ak, type ListBoilerplateCategoriesResponse as al, type UpdateBoilerplateCategoryPayload as am, type UpdateBoilerplateCategoryOptions as an, type UpdateBoilerplateCategoryResponse as ao, type Channel as ap, type ChannelID as aq, type ChannelStatus as ar, type CustomChannelCustomMetadata as as, type CreateChannelPayload as at, type CreateChannelOptions as au, type CreateChannelResponse as av, type DeleteChannelOptions as aw, type DeleteChannelResponse as ax, type GetChannelOptions as ay, type GetChannelResponse as az, type ResponseMeta as b, type CreateLabelPayload as b$, type CreateEscalationPayload as b0, type CreateEscalationOptions as b1, type CreateEscalationResponse as b2, type GetEscalationOptions as b3, type GetEscalationResponse as b4, type ListEscalationsOptions as b5, type ListEscalationsResponse as b6, type DeleteEscalationOptions as b7, type DeleteEscalationResponse as b8, type Contact as b9, type CreateConversationResponse as bA, type DeleteConversationOptions as bB, type DeleteConversationResponse as bC, type GetConversationIncludeOptions as bD, type GetConversationOptions as bE, type GetConversationResponse as bF, type ListConversationsIncludeOptions as bG, type ListConversationsFilterOptions as bH, type ListConversationOptions as bI, type ListConversationsResponse as bJ, type UpdateConversationPayload as bK, type UpdateConversationOptions as bL, type UpdateConversationResponse as bM, type TriggerResponseConversationOptions as bN, type TriggerResponseConversationResponse as bO, type ConversationSettings as bP, type ConversationFeedback as bQ, type CreateConversationFeedbackPayload as bR, type CreateConversationFeedbackOptions as bS, type CreateConversationFeedbackResponse as bT, type DeleteConversationFeedbackOptions as bU, type DeleteConversationFeedbackResponse as bV, type GetConversationFeedbackOptions as bW, type GetConversationFeedbackResponse as bX, type ListConversationFeedbackOptions as bY, type ListConversationFeedbackResponse as bZ, type Label as b_, type ContactID as ba, type ContactType as bb, type ContactStatus as bc, type ContactCustomMetadata as bd, type CreateContactPayload as be, type CreateContactOptions as bf, type CreateContactResponse as bg, type DeleteContactOptions as bh, type DeleteContactResponse as bi, type GetContactIncludeOptions as bj, type GetContactOptions as bk, type GetContactResponse as bl, type GetContactVCFOptions as bm, type ListContactsOptions as bn, type ListContactsResponse as bo, type UpdateContactPayload as bp, type UpdateContactOptions as bq, type UpdateContactResponse as br, type Conversation as bs, type ConversationID as bt, type ConversationCustomMetadata as bu, type ActiveConversationStatus as bv, type ConcludedConversationStatus as bw, type ConversationStatus as bx, type CreateConversationPayload as by, type CreateConversationOptions as bz, type ResponseTimestamp as c, type WhatsappTemplateUseCase as c$, type CreateLabelOptions as c0, type CreateLabelResponse as c1, type DeleteLabelOptions as c2, type DeleteLabelResponse as c3, type GetLabelOptions as c4, type GetLabelResponse as c5, type LabelID as c6, type ListLabelsIncludeOptions as c7, type ListLabelsOptions as c8, type ListLabelsResponse as c9, type UpdateWhatsappBusinessProfileOptions as cA, type UpdateWhatsappBusinessProfileResponse as cB, type WhatsappPhoneNumber as cC, type GetWhatsappPhoneNumberIncludeOptions as cD, type GetWhatsappPhoneNumberOptions as cE, type GetWhatsappPhoneNumberResponse as cF, type ListWhatsappPhoneNumbersOptions as cG, type ListWhatsappPhoneNumbersResponse as cH, type DeleteWhatsappAccountTemplateOptions as cI, type DeleteWhatsappAccountTemplateResponse as cJ, type GetWhatsappAccountTemplateOptions as cK, type GetWhatsappAccountTemplateResponse as cL, type ListWhatsappAccountTemplatesOptions as cM, type ListWhatsappAccountTemplatesResponse as cN, WHATSAPP_TEMPLATE_STATUSES as cO, type WhatsappTemplateStatus as cP, WHATSAPP_TEMPLATE_LANGUAGES as cQ, type WhatsappTemplateLanguage as cR, WHATSAPP_TEMPLATE_CATEGORIES as cS, type WhatsappTemplateCategory as cT, WHATSAPP_TEMPLATE_SUBCATEGORIES as cU, type WhatsappTemplateSubcategory as cV, WHATSAPP_TEMPLATE_INDUSTRIES as cW, type WhatsappTemplateIndustry as cX, WHATSAPP_TEMPLATE_TOPICS as cY, type WhatsappTemplateTopic as cZ, WHATSAPP_TEMPLATE_USECASES as c_, type UpdateLabelPayload as ca, type UpdateLabelOptions as cb, type UpdateLabelResponse as cc, type Import as cd, type CreateImportPayload as ce, type CreateImportOptions as cf, type CreateImportResponse as cg, type GetImportOptions as ch, type GetImportResponse as ci, type ListImportsOptions as cj, type ListImportsResponse as ck, type ImportID as cl, type ImportType as cm, type ImportStatus as cn, type WhatsappAccount as co, type WhatsappAccountDetail as cp, type GetWhatsappAccountIncludeOptions as cq, type GetWhatsappAccountOptions as cr, type GetWhatsappAccountResponse as cs, type ListWhatsappAccountsOptions as ct, type ListWhatsappAccountsResponse as cu, WHATSAPP_BUSINESS_PROFILE_VERTICAL as cv, type WhatsappBusinessProfileDetail as cw, type GetWhatsappBusinessProfileOptions as cx, type GetWhatsappBusinessProfileResponse as cy, type UpdateWhatsappBusinessProfilePayload as cz, type CursorResponsePagination as d, type ListNotesOptions as d$, WHATSAPP_TEMPLATE_QUALITY_SCORES as d0, type WhatsappTemplateQualityScore as d1, type WhatsappTemplateRejectionReason as d2, type WhatsappTemplateParameterFormat as d3, type WhatsappTemplateButton as d4, type WhatsappAccountTemplate as d5, type WhatsappLibraryTemplate as d6, type Message as d7, type LexicalDirection as d8, type LexicalIndent as d9, type MessageEventType as dA, type MessageCustomMetadata as dB, type ModelConfig as dC, type CreateModelConfigPayload as dD, type CreateModelConfigOptions as dE, type CreateModelConfigResponse as dF, type DeleteModelConfigOptions as dG, type DeleteModelConfigResponse as dH, type UpdateModelConfigPayload as dI, type UpdateModelConfigOptions as dJ, type UpdateModelConfigResponse as dK, type GetModelConfigOptions as dL, type GetModelConfigResponse as dM, type ListModelConfigsOptions as dN, type ListModelConfigsResponse as dO, type ModelInterface as dP, type GetModelInterfaceOptions as dQ, type GetModelInterfaceResponse as dR, type ListModelInterfacesOptions as dS, type ListModelInterfacesResponse as dT, type ModelInterfaceID as dU, type Note as dV, type CreateNotePayload as dW, type CreateNoteOptions as dX, type CreateNoteResponse as dY, type GetNoteOptions as dZ, type GetNoteResponse as d_, type LexicalTextNode as da, type LexicalLinkNode as db, type LexicalQuoteNode as dc, type LexicalHeadingNode as dd, type LexicalParagraphNode as de, type LexicalListItemNode as df, type LexicalListNode as dg, type LexicalHorizontalRuleNode as dh, type LexicalUploadNode as di, type LexicalRootNode as dj, type CreateMessagePayload as dk, type CreateMessageOptions as dl, type CreateMessageResponse as dm, type DeleteMessageOptions as dn, type DeleteMessageResponse as dp, type GetMessageOptions as dq, type GetMessageResponse as dr, type ListMessagesIncludeOptions as ds, type ListMessagesOptions as dt, type ListMessagesResponse as du, type MessageID as dv, type MessageRole as dw, type MessageType as dx, type MessageStatus as dy, type MessageVisibility as dz, type CountResponsePagination as e, type ListNotesResponse as e0, type NoteID as e1, type UpdateNotePayload as e2, type UpdateNoteOptions as e3, type UpdateNoteResponse as e4, type NotificationEvent as e5, type Source as e6, type GetSourceOptions as e7, type GetSourceResponse as e8, type ListSourcesOptions as e9, type WebhookSubscriptionWebhookEventType as eA, type WebhookEventPayload as eB, type WebhookResponse as eC, type WebhookSubscription as eD, type CreateWebhookSubscriptionPayload as eE, type CreateWebhookSubscriptionOptions as eF, type CreateWebhookSubscriptionResponse as eG, type DeleteWebhookSubscriptionOptions as eH, type DeleteWebhookSubscriptionResponse as eI, type GetWebhookSubscriptionOptions as eJ, type GetWebhookSubscriptionResponse as eK, type ListWebhookSubscriptionsOptions as eL, type ListWebhookSubscriptionsResponse as eM, type TestWebhookSubscriptionOptions as eN, type TestWebhookSubscriptionResponse as eO, type WebhookSubscriptionID as eP, type ListSourcesResponse as ea, type SourceID as eb, type SourceAdornment as ec, type Upload as ed, type CreateUploadIncludeOptions as ee, type CreateUploadOptions as ef, type CreateUploadResponse as eg, type DeleteUploadOptions as eh, type DeleteUploadResponse as ei, type GetUploadIncludeOptions as ej, type GetUploadOptions as ek, type GetUploadResponse as el, type ListUploadsIncludeOptions as em, type ListUploadsOptions as en, type ListUploadsResponse as eo, type UploadID as ep, type EventWebhookOptions as eq, eventWebhookSchema as er, type WebhookEventType as es, type AccountWebhookWebhookEventType as et, type AccountAccessTokenWebhookEventType as eu, type AccountNotificationEventEventType as ev, type ContactWebhookEventType as ew, type ConversationWebhookEventType as ex, type MessageWebhookEventType as ey, type ImportWebhookEventType as ez, type CurrentAccountID as f, type AccountStatus as g, type AccountID as h, type CreateAccountPayload as i, type CreateAccountOptions as j, type CreateAccountResponse as k, type GetAccountResponse as l, type UpdateAccountOptions as m, type UpdateAccountResponse as n, type ListAccountsResponse as o, type AccountAccessToken as p, type AccountAccessTokenID as q, type CreateAccountAccessTokenPayload as r, type CreateAccountAccessTokenOptions as s, type CreateAccountAccessTokenResponse as t, type DeleteAccountAccessTokenOptions as u, type DeleteAccountAccessTokenResponse as v, type GetAccountAccessTokenOptions as w, type GetAccountAccessTokenResponse as x, type ListAccountAccessTokensOptions as y, type ListAccountAccessTokensResponse as z };
|
|
@@ -943,6 +943,22 @@ type Action = {
|
|
|
943
943
|
endedAt?: string;
|
|
944
944
|
} & ResponseTimestamp;
|
|
945
945
|
|
|
946
|
+
/**
|
|
947
|
+
* Great Detail Support System.
|
|
948
|
+
*
|
|
949
|
+
* @copyright 2025 Great Detail Ltd
|
|
950
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
951
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
952
|
+
* @see https://greatdetail.com
|
|
953
|
+
*/
|
|
954
|
+
|
|
955
|
+
interface GetActionOptions {
|
|
956
|
+
request?: SendOptions;
|
|
957
|
+
}
|
|
958
|
+
type GetActionResponse = ResponseData<{
|
|
959
|
+
action: Action;
|
|
960
|
+
}>;
|
|
961
|
+
|
|
946
962
|
/**
|
|
947
963
|
* Great Detail Support System.
|
|
948
964
|
*
|
|
@@ -971,6 +987,11 @@ type ListActionsResponse = ResponseMeta<{
|
|
|
971
987
|
declare class ActionAPI {
|
|
972
988
|
protected _transport: FetchTransport;
|
|
973
989
|
constructor(_transport: FetchTransport);
|
|
990
|
+
get(id: ActionID, { request }?: GetActionOptions): {
|
|
991
|
+
requestID: string;
|
|
992
|
+
response: () => Promise<ky.KyResponse<GetActionResponse>>;
|
|
993
|
+
json: () => Promise<GetActionResponse>;
|
|
994
|
+
};
|
|
974
995
|
list({ filter, sort, pagination, request }?: ListActionsOptions): {
|
|
975
996
|
requestID: string;
|
|
976
997
|
response: () => Promise<ky.KyResponse<ListActionsResponse>>;
|
|
@@ -4355,4 +4376,4 @@ declare class Client {
|
|
|
4355
4376
|
};
|
|
4356
4377
|
}
|
|
4357
4378
|
|
|
4358
|
-
export { type BoilerplateContentID as $, type Account as A, type AccountConversationSettings as B, Client as C, type DeleteAccountAccessTokenPayload as D, type GetAccountConversationSettingsOptions as E, type GetAccountConversationSettingsResponse as F, type GetAccountOptions as G, type UpdateAccountConversationSettingsPayload as H, type UpdateAccountConversationSettingsOptions as I, type UpdateAccountConversationSettingsResponse as J, type AccountNotificationEvent as K, type ListAccountsOptions as L, type GetAccountNotificationEventOptions as M, type GetAccountNotificationEventResponse as N, type Options as O, type ListAccountNotificationEventsFilterOptions as P, type ListAccountNotificationEventsOptions as Q, type ResponseData as R, type ListAccountNotificationEventsResponse as S, type Action as T, type UpdateAccountPayload as U, type ActionID as V, type ActionStatus as W, type SortOptions as X, type ListActionsOptions as Y, type ListActionsResponse as Z, type BoilerplateContent as _, type Options$4 as a, type CreateEscalationOptions as a$, type CreateBoilerplateContentPayload as a0, type CreateBoilerplateContentOptions as a1, type CreateBoilerplateContentResponse as a2, type GetBoilerplateContentOptions as a3, type GetBoilerplateContentResponse as a4, type ListBoilerplateContentsOptions as a5, type ListBoilerplateContentsResponse as a6, type UpdateBoilerplateContentPayload as a7, type UpdateBoilerplateContentOptions as a8, type UpdateBoilerplateContentResponse as a9, type SendChannelSyncPayload as aA, type SendgridChannelSyncOptions as aB, type SendgridChannelSyncResponse as aC, type UpdateChannelPayload as aD, type UpdateChannelOptions as aE, type UpdateChannelResponse as aF, type ChannelConversationSettings as aG, type GetChannelConversationSettingsOptions as aH, type GetChannelConversationSettingsResponse as aI, type UpdateChannelConversationSettingsPayload as aJ, type UpdateChannelConversationSettingsOptions as aK, type UpdateChannelConversationSettingsResponse as aL, type CompositionSection as aM, type CompositionSectionID as aN, type CompositionSectionLocation as aO, type CreateCompositionSectionPayload as aP, type CreateCompositionSectionOptions as aQ, type CreateCompositionSectionResponse as aR, type GetCompositionSectionOptions as aS, type GetCompositionSectionResponse as aT, type ListCompositionSectionsOptions as aU, type ListCompositionSectionsResponse as aV, type UpdateCompositionSectionPayload as aW, type UpdateCompositionSectionOptions as aX, type UpdateCompositionSectionResponse as aY, type Escalation as aZ, type CreateEscalationPayload as a_, type BoilerplateCategory as aa, type BoilerplateCategoryID as ab, type CreateBoilerplateCategoryPayload as ac, type CreateBoilerplateCategoryOptions as ad, type CreateBoilerplateCategoryResponse as ae, type GetBoilerplateCategoryOptions as af, type GetBoilerplateCategoryResponse as ag, type ListBoilerplateCategoriesIncludeOptions as ah, type ListBoilerplateCategoriesOptions as ai, type ListBoilerplateCategoriesResponse as aj, type UpdateBoilerplateCategoryPayload as ak, type UpdateBoilerplateCategoryOptions as al, type UpdateBoilerplateCategoryResponse as am, type Channel as an, type ChannelID as ao, type ChannelStatus as ap, type CustomChannelCustomMetadata as aq, type CreateChannelPayload as ar, type CreateChannelOptions as as, type CreateChannelResponse as at, type DeleteChannelOptions as au, type DeleteChannelResponse as av, type GetChannelOptions as aw, type GetChannelResponse as ax, type ListChannelsOptions as ay, type ListChannelsResponse as az, type ResponseMeta as b, type CreateLabelResponse as b$, type CreateEscalationResponse as b0, type GetEscalationOptions as b1, type GetEscalationResponse as b2, type ListEscalationsOptions as b3, type ListEscalationsResponse as b4, type DeleteEscalationOptions as b5, type DeleteEscalationResponse as b6, type Contact as b7, type ContactID as b8, type ContactType as b9, type DeleteConversationResponse as bA, type GetConversationIncludeOptions as bB, type GetConversationOptions as bC, type GetConversationResponse as bD, type ListConversationsIncludeOptions as bE, type ListConversationsFilterOptions as bF, type ListConversationOptions as bG, type ListConversationsResponse as bH, type UpdateConversationPayload as bI, type UpdateConversationOptions as bJ, type UpdateConversationResponse as bK, type TriggerResponseConversationOptions as bL, type TriggerResponseConversationResponse as bM, type ConversationSettings as bN, type ConversationFeedback as bO, type CreateConversationFeedbackPayload as bP, type CreateConversationFeedbackOptions as bQ, type CreateConversationFeedbackResponse as bR, type DeleteConversationFeedbackOptions as bS, type DeleteConversationFeedbackResponse as bT, type GetConversationFeedbackOptions as bU, type GetConversationFeedbackResponse as bV, type ListConversationFeedbackOptions as bW, type ListConversationFeedbackResponse as bX, type Label as bY, type CreateLabelPayload as bZ, type CreateLabelOptions as b_, type ContactStatus as ba, type ContactCustomMetadata as bb, type CreateContactPayload as bc, type CreateContactOptions as bd, type CreateContactResponse as be, type DeleteContactOptions as bf, type DeleteContactResponse as bg, type GetContactIncludeOptions as bh, type GetContactOptions as bi, type GetContactResponse as bj, type GetContactVCFOptions as bk, type ListContactsOptions as bl, type ListContactsResponse as bm, type UpdateContactPayload as bn, type UpdateContactOptions as bo, type UpdateContactResponse as bp, type Conversation as bq, type ConversationID as br, type ConversationCustomMetadata as bs, type ActiveConversationStatus as bt, type ConcludedConversationStatus as bu, type ConversationStatus as bv, type CreateConversationPayload as bw, type CreateConversationOptions as bx, type CreateConversationResponse as by, type DeleteConversationOptions as bz, type ResponseTimestamp as c, type WhatsappTemplateQualityScore as c$, type DeleteLabelOptions as c0, type DeleteLabelResponse as c1, type GetLabelOptions as c2, type GetLabelResponse as c3, type LabelID as c4, type ListLabelsIncludeOptions as c5, type ListLabelsOptions as c6, type ListLabelsResponse as c7, type UpdateLabelPayload as c8, type UpdateLabelOptions as c9, type WhatsappPhoneNumber as cA, type GetWhatsappPhoneNumberIncludeOptions as cB, type GetWhatsappPhoneNumberOptions as cC, type GetWhatsappPhoneNumberResponse as cD, type ListWhatsappPhoneNumbersOptions as cE, type ListWhatsappPhoneNumbersResponse as cF, type DeleteWhatsappAccountTemplateOptions as cG, type DeleteWhatsappAccountTemplateResponse as cH, type GetWhatsappAccountTemplateOptions as cI, type GetWhatsappAccountTemplateResponse as cJ, type ListWhatsappAccountTemplatesOptions as cK, type ListWhatsappAccountTemplatesResponse as cL, WHATSAPP_TEMPLATE_STATUSES as cM, type WhatsappTemplateStatus as cN, WHATSAPP_TEMPLATE_LANGUAGES as cO, type WhatsappTemplateLanguage as cP, WHATSAPP_TEMPLATE_CATEGORIES as cQ, type WhatsappTemplateCategory as cR, WHATSAPP_TEMPLATE_SUBCATEGORIES as cS, type WhatsappTemplateSubcategory as cT, WHATSAPP_TEMPLATE_INDUSTRIES as cU, type WhatsappTemplateIndustry as cV, WHATSAPP_TEMPLATE_TOPICS as cW, type WhatsappTemplateTopic as cX, WHATSAPP_TEMPLATE_USECASES as cY, type WhatsappTemplateUseCase as cZ, WHATSAPP_TEMPLATE_QUALITY_SCORES as c_, type UpdateLabelResponse as ca, type Import as cb, type CreateImportPayload as cc, type CreateImportOptions as cd, type CreateImportResponse as ce, type GetImportOptions as cf, type GetImportResponse as cg, type ListImportsOptions as ch, type ListImportsResponse as ci, type ImportID as cj, type ImportType as ck, type ImportStatus as cl, type WhatsappAccount as cm, type WhatsappAccountDetail as cn, type GetWhatsappAccountIncludeOptions as co, type GetWhatsappAccountOptions as cp, type GetWhatsappAccountResponse as cq, type ListWhatsappAccountsOptions as cr, type ListWhatsappAccountsResponse as cs, WHATSAPP_BUSINESS_PROFILE_VERTICAL as ct, type WhatsappBusinessProfileDetail as cu, type GetWhatsappBusinessProfileOptions as cv, type GetWhatsappBusinessProfileResponse as cw, type UpdateWhatsappBusinessProfilePayload as cx, type UpdateWhatsappBusinessProfileOptions as cy, type UpdateWhatsappBusinessProfileResponse as cz, type CursorResponsePagination as d, type NoteID as d$, type WhatsappTemplateRejectionReason as d0, type WhatsappTemplateParameterFormat as d1, type WhatsappTemplateButton as d2, type WhatsappAccountTemplate as d3, type WhatsappLibraryTemplate as d4, type Message as d5, type LexicalDirection as d6, type LexicalIndent as d7, type LexicalTextNode as d8, type LexicalLinkNode as d9, type ModelConfig as dA, type CreateModelConfigPayload as dB, type CreateModelConfigOptions as dC, type CreateModelConfigResponse as dD, type DeleteModelConfigOptions as dE, type DeleteModelConfigResponse as dF, type UpdateModelConfigPayload as dG, type UpdateModelConfigOptions as dH, type UpdateModelConfigResponse as dI, type GetModelConfigOptions as dJ, type GetModelConfigResponse as dK, type ListModelConfigsOptions as dL, type ListModelConfigsResponse as dM, type ModelInterface as dN, type GetModelInterfaceOptions as dO, type GetModelInterfaceResponse as dP, type ListModelInterfacesOptions as dQ, type ListModelInterfacesResponse as dR, type ModelInterfaceID as dS, type Note as dT, type CreateNotePayload as dU, type CreateNoteOptions as dV, type CreateNoteResponse as dW, type GetNoteOptions as dX, type GetNoteResponse as dY, type ListNotesOptions as dZ, type ListNotesResponse as d_, type LexicalQuoteNode as da, type LexicalHeadingNode as db, type LexicalParagraphNode as dc, type LexicalListItemNode as dd, type LexicalListNode as de, type LexicalHorizontalRuleNode as df, type LexicalUploadNode as dg, type LexicalRootNode as dh, type CreateMessagePayload as di, type CreateMessageOptions as dj, type CreateMessageResponse as dk, type DeleteMessageOptions as dl, type DeleteMessageResponse as dm, type GetMessageOptions as dn, type GetMessageResponse as dp, type ListMessagesIncludeOptions as dq, type ListMessagesOptions as dr, type ListMessagesResponse as ds, type MessageID as dt, type MessageRole as du, type MessageType as dv, type MessageStatus as dw, type MessageVisibility as dx, type MessageEventType as dy, type MessageCustomMetadata as dz, type CountResponsePagination as e, type UpdateNotePayload as e0, type UpdateNoteOptions as e1, type UpdateNoteResponse as e2, type NotificationEvent as e3, type Source as e4, type GetSourceOptions as e5, type GetSourceResponse as e6, type ListSourcesOptions as e7, type ListSourcesResponse as e8, type SourceID as e9, type WebhookResponse as eA, type WebhookSubscription as eB, type CreateWebhookSubscriptionPayload as eC, type CreateWebhookSubscriptionOptions as eD, type CreateWebhookSubscriptionResponse as eE, type DeleteWebhookSubscriptionOptions as eF, type DeleteWebhookSubscriptionResponse as eG, type GetWebhookSubscriptionOptions as eH, type GetWebhookSubscriptionResponse as eI, type ListWebhookSubscriptionsOptions as eJ, type ListWebhookSubscriptionsResponse as eK, type TestWebhookSubscriptionOptions as eL, type TestWebhookSubscriptionResponse as eM, type WebhookSubscriptionID as eN, type SourceAdornment as ea, type Upload as eb, type CreateUploadIncludeOptions as ec, type CreateUploadOptions as ed, type CreateUploadResponse as ee, type DeleteUploadOptions as ef, type DeleteUploadResponse as eg, type GetUploadIncludeOptions as eh, type GetUploadOptions as ei, type GetUploadResponse as ej, type ListUploadsIncludeOptions as ek, type ListUploadsOptions as el, type ListUploadsResponse as em, type UploadID as en, type EventWebhookOptions as eo, eventWebhookSchema as ep, type WebhookEventType as eq, type AccountWebhookWebhookEventType as er, type AccountAccessTokenWebhookEventType as es, type AccountNotificationEventEventType as et, type ContactWebhookEventType as eu, type ConversationWebhookEventType as ev, type MessageWebhookEventType as ew, type ImportWebhookEventType as ex, type WebhookSubscriptionWebhookEventType as ey, type WebhookEventPayload as ez, type CurrentAccountID as f, type AccountStatus as g, type AccountID as h, type CreateAccountPayload as i, type CreateAccountOptions as j, type CreateAccountResponse as k, type GetAccountResponse as l, type UpdateAccountOptions as m, type UpdateAccountResponse as n, type ListAccountsResponse as o, type AccountAccessToken as p, type AccountAccessTokenID as q, type CreateAccountAccessTokenPayload as r, type CreateAccountAccessTokenOptions as s, type CreateAccountAccessTokenResponse as t, type DeleteAccountAccessTokenOptions as u, type DeleteAccountAccessTokenResponse as v, type GetAccountAccessTokenOptions as w, type GetAccountAccessTokenResponse as x, type ListAccountAccessTokensOptions as y, type ListAccountAccessTokensResponse as z };
|
|
4379
|
+
export { type GetActionResponse as $, type Account as A, type AccountConversationSettings as B, Client as C, type DeleteAccountAccessTokenPayload as D, type GetAccountConversationSettingsOptions as E, type GetAccountConversationSettingsResponse as F, type GetAccountOptions as G, type UpdateAccountConversationSettingsPayload as H, type UpdateAccountConversationSettingsOptions as I, type UpdateAccountConversationSettingsResponse as J, type AccountNotificationEvent as K, type ListAccountsOptions as L, type GetAccountNotificationEventOptions as M, type GetAccountNotificationEventResponse as N, type Options as O, type ListAccountNotificationEventsFilterOptions as P, type ListAccountNotificationEventsOptions as Q, type ResponseData as R, type ListAccountNotificationEventsResponse as S, type Action as T, type UpdateAccountPayload as U, type ActionID as V, type ActionStatus as W, type SortOptions as X, type ListActionsOptions as Y, type ListActionsResponse as Z, type GetActionOptions as _, type Options$4 as a, type Escalation as a$, type BoilerplateContent as a0, type BoilerplateContentID as a1, type CreateBoilerplateContentPayload as a2, type CreateBoilerplateContentOptions as a3, type CreateBoilerplateContentResponse as a4, type GetBoilerplateContentOptions as a5, type GetBoilerplateContentResponse as a6, type ListBoilerplateContentsOptions as a7, type ListBoilerplateContentsResponse as a8, type UpdateBoilerplateContentPayload as a9, type ListChannelsOptions as aA, type ListChannelsResponse as aB, type SendChannelSyncPayload as aC, type SendgridChannelSyncOptions as aD, type SendgridChannelSyncResponse as aE, type UpdateChannelPayload as aF, type UpdateChannelOptions as aG, type UpdateChannelResponse as aH, type ChannelConversationSettings as aI, type GetChannelConversationSettingsOptions as aJ, type GetChannelConversationSettingsResponse as aK, type UpdateChannelConversationSettingsPayload as aL, type UpdateChannelConversationSettingsOptions as aM, type UpdateChannelConversationSettingsResponse as aN, type CompositionSection as aO, type CompositionSectionID as aP, type CompositionSectionLocation as aQ, type CreateCompositionSectionPayload as aR, type CreateCompositionSectionOptions as aS, type CreateCompositionSectionResponse as aT, type GetCompositionSectionOptions as aU, type GetCompositionSectionResponse as aV, type ListCompositionSectionsOptions as aW, type ListCompositionSectionsResponse as aX, type UpdateCompositionSectionPayload as aY, type UpdateCompositionSectionOptions as aZ, type UpdateCompositionSectionResponse as a_, type UpdateBoilerplateContentOptions as aa, type UpdateBoilerplateContentResponse as ab, type BoilerplateCategory as ac, type BoilerplateCategoryID as ad, type CreateBoilerplateCategoryPayload as ae, type CreateBoilerplateCategoryOptions as af, type CreateBoilerplateCategoryResponse as ag, type GetBoilerplateCategoryOptions as ah, type GetBoilerplateCategoryResponse as ai, type ListBoilerplateCategoriesIncludeOptions as aj, type ListBoilerplateCategoriesOptions as ak, type ListBoilerplateCategoriesResponse as al, type UpdateBoilerplateCategoryPayload as am, type UpdateBoilerplateCategoryOptions as an, type UpdateBoilerplateCategoryResponse as ao, type Channel as ap, type ChannelID as aq, type ChannelStatus as ar, type CustomChannelCustomMetadata as as, type CreateChannelPayload as at, type CreateChannelOptions as au, type CreateChannelResponse as av, type DeleteChannelOptions as aw, type DeleteChannelResponse as ax, type GetChannelOptions as ay, type GetChannelResponse as az, type ResponseMeta as b, type CreateLabelPayload as b$, type CreateEscalationPayload as b0, type CreateEscalationOptions as b1, type CreateEscalationResponse as b2, type GetEscalationOptions as b3, type GetEscalationResponse as b4, type ListEscalationsOptions as b5, type ListEscalationsResponse as b6, type DeleteEscalationOptions as b7, type DeleteEscalationResponse as b8, type Contact as b9, type CreateConversationResponse as bA, type DeleteConversationOptions as bB, type DeleteConversationResponse as bC, type GetConversationIncludeOptions as bD, type GetConversationOptions as bE, type GetConversationResponse as bF, type ListConversationsIncludeOptions as bG, type ListConversationsFilterOptions as bH, type ListConversationOptions as bI, type ListConversationsResponse as bJ, type UpdateConversationPayload as bK, type UpdateConversationOptions as bL, type UpdateConversationResponse as bM, type TriggerResponseConversationOptions as bN, type TriggerResponseConversationResponse as bO, type ConversationSettings as bP, type ConversationFeedback as bQ, type CreateConversationFeedbackPayload as bR, type CreateConversationFeedbackOptions as bS, type CreateConversationFeedbackResponse as bT, type DeleteConversationFeedbackOptions as bU, type DeleteConversationFeedbackResponse as bV, type GetConversationFeedbackOptions as bW, type GetConversationFeedbackResponse as bX, type ListConversationFeedbackOptions as bY, type ListConversationFeedbackResponse as bZ, type Label as b_, type ContactID as ba, type ContactType as bb, type ContactStatus as bc, type ContactCustomMetadata as bd, type CreateContactPayload as be, type CreateContactOptions as bf, type CreateContactResponse as bg, type DeleteContactOptions as bh, type DeleteContactResponse as bi, type GetContactIncludeOptions as bj, type GetContactOptions as bk, type GetContactResponse as bl, type GetContactVCFOptions as bm, type ListContactsOptions as bn, type ListContactsResponse as bo, type UpdateContactPayload as bp, type UpdateContactOptions as bq, type UpdateContactResponse as br, type Conversation as bs, type ConversationID as bt, type ConversationCustomMetadata as bu, type ActiveConversationStatus as bv, type ConcludedConversationStatus as bw, type ConversationStatus as bx, type CreateConversationPayload as by, type CreateConversationOptions as bz, type ResponseTimestamp as c, type WhatsappTemplateUseCase as c$, type CreateLabelOptions as c0, type CreateLabelResponse as c1, type DeleteLabelOptions as c2, type DeleteLabelResponse as c3, type GetLabelOptions as c4, type GetLabelResponse as c5, type LabelID as c6, type ListLabelsIncludeOptions as c7, type ListLabelsOptions as c8, type ListLabelsResponse as c9, type UpdateWhatsappBusinessProfileOptions as cA, type UpdateWhatsappBusinessProfileResponse as cB, type WhatsappPhoneNumber as cC, type GetWhatsappPhoneNumberIncludeOptions as cD, type GetWhatsappPhoneNumberOptions as cE, type GetWhatsappPhoneNumberResponse as cF, type ListWhatsappPhoneNumbersOptions as cG, type ListWhatsappPhoneNumbersResponse as cH, type DeleteWhatsappAccountTemplateOptions as cI, type DeleteWhatsappAccountTemplateResponse as cJ, type GetWhatsappAccountTemplateOptions as cK, type GetWhatsappAccountTemplateResponse as cL, type ListWhatsappAccountTemplatesOptions as cM, type ListWhatsappAccountTemplatesResponse as cN, WHATSAPP_TEMPLATE_STATUSES as cO, type WhatsappTemplateStatus as cP, WHATSAPP_TEMPLATE_LANGUAGES as cQ, type WhatsappTemplateLanguage as cR, WHATSAPP_TEMPLATE_CATEGORIES as cS, type WhatsappTemplateCategory as cT, WHATSAPP_TEMPLATE_SUBCATEGORIES as cU, type WhatsappTemplateSubcategory as cV, WHATSAPP_TEMPLATE_INDUSTRIES as cW, type WhatsappTemplateIndustry as cX, WHATSAPP_TEMPLATE_TOPICS as cY, type WhatsappTemplateTopic as cZ, WHATSAPP_TEMPLATE_USECASES as c_, type UpdateLabelPayload as ca, type UpdateLabelOptions as cb, type UpdateLabelResponse as cc, type Import as cd, type CreateImportPayload as ce, type CreateImportOptions as cf, type CreateImportResponse as cg, type GetImportOptions as ch, type GetImportResponse as ci, type ListImportsOptions as cj, type ListImportsResponse as ck, type ImportID as cl, type ImportType as cm, type ImportStatus as cn, type WhatsappAccount as co, type WhatsappAccountDetail as cp, type GetWhatsappAccountIncludeOptions as cq, type GetWhatsappAccountOptions as cr, type GetWhatsappAccountResponse as cs, type ListWhatsappAccountsOptions as ct, type ListWhatsappAccountsResponse as cu, WHATSAPP_BUSINESS_PROFILE_VERTICAL as cv, type WhatsappBusinessProfileDetail as cw, type GetWhatsappBusinessProfileOptions as cx, type GetWhatsappBusinessProfileResponse as cy, type UpdateWhatsappBusinessProfilePayload as cz, type CursorResponsePagination as d, type ListNotesOptions as d$, WHATSAPP_TEMPLATE_QUALITY_SCORES as d0, type WhatsappTemplateQualityScore as d1, type WhatsappTemplateRejectionReason as d2, type WhatsappTemplateParameterFormat as d3, type WhatsappTemplateButton as d4, type WhatsappAccountTemplate as d5, type WhatsappLibraryTemplate as d6, type Message as d7, type LexicalDirection as d8, type LexicalIndent as d9, type MessageEventType as dA, type MessageCustomMetadata as dB, type ModelConfig as dC, type CreateModelConfigPayload as dD, type CreateModelConfigOptions as dE, type CreateModelConfigResponse as dF, type DeleteModelConfigOptions as dG, type DeleteModelConfigResponse as dH, type UpdateModelConfigPayload as dI, type UpdateModelConfigOptions as dJ, type UpdateModelConfigResponse as dK, type GetModelConfigOptions as dL, type GetModelConfigResponse as dM, type ListModelConfigsOptions as dN, type ListModelConfigsResponse as dO, type ModelInterface as dP, type GetModelInterfaceOptions as dQ, type GetModelInterfaceResponse as dR, type ListModelInterfacesOptions as dS, type ListModelInterfacesResponse as dT, type ModelInterfaceID as dU, type Note as dV, type CreateNotePayload as dW, type CreateNoteOptions as dX, type CreateNoteResponse as dY, type GetNoteOptions as dZ, type GetNoteResponse as d_, type LexicalTextNode as da, type LexicalLinkNode as db, type LexicalQuoteNode as dc, type LexicalHeadingNode as dd, type LexicalParagraphNode as de, type LexicalListItemNode as df, type LexicalListNode as dg, type LexicalHorizontalRuleNode as dh, type LexicalUploadNode as di, type LexicalRootNode as dj, type CreateMessagePayload as dk, type CreateMessageOptions as dl, type CreateMessageResponse as dm, type DeleteMessageOptions as dn, type DeleteMessageResponse as dp, type GetMessageOptions as dq, type GetMessageResponse as dr, type ListMessagesIncludeOptions as ds, type ListMessagesOptions as dt, type ListMessagesResponse as du, type MessageID as dv, type MessageRole as dw, type MessageType as dx, type MessageStatus as dy, type MessageVisibility as dz, type CountResponsePagination as e, type ListNotesResponse as e0, type NoteID as e1, type UpdateNotePayload as e2, type UpdateNoteOptions as e3, type UpdateNoteResponse as e4, type NotificationEvent as e5, type Source as e6, type GetSourceOptions as e7, type GetSourceResponse as e8, type ListSourcesOptions as e9, type WebhookSubscriptionWebhookEventType as eA, type WebhookEventPayload as eB, type WebhookResponse as eC, type WebhookSubscription as eD, type CreateWebhookSubscriptionPayload as eE, type CreateWebhookSubscriptionOptions as eF, type CreateWebhookSubscriptionResponse as eG, type DeleteWebhookSubscriptionOptions as eH, type DeleteWebhookSubscriptionResponse as eI, type GetWebhookSubscriptionOptions as eJ, type GetWebhookSubscriptionResponse as eK, type ListWebhookSubscriptionsOptions as eL, type ListWebhookSubscriptionsResponse as eM, type TestWebhookSubscriptionOptions as eN, type TestWebhookSubscriptionResponse as eO, type WebhookSubscriptionID as eP, type ListSourcesResponse as ea, type SourceID as eb, type SourceAdornment as ec, type Upload as ed, type CreateUploadIncludeOptions as ee, type CreateUploadOptions as ef, type CreateUploadResponse as eg, type DeleteUploadOptions as eh, type DeleteUploadResponse as ei, type GetUploadIncludeOptions as ej, type GetUploadOptions as ek, type GetUploadResponse as el, type ListUploadsIncludeOptions as em, type ListUploadsOptions as en, type ListUploadsResponse as eo, type UploadID as ep, type EventWebhookOptions as eq, eventWebhookSchema as er, type WebhookEventType as es, type AccountWebhookWebhookEventType as et, type AccountAccessTokenWebhookEventType as eu, type AccountNotificationEventEventType as ev, type ContactWebhookEventType as ew, type ConversationWebhookEventType as ex, type MessageWebhookEventType as ey, type ImportWebhookEventType as ez, type CurrentAccountID as f, type AccountStatus as g, type AccountID as h, type CreateAccountPayload as i, type CreateAccountOptions as j, type CreateAccountResponse as k, type GetAccountResponse as l, type UpdateAccountOptions as m, type UpdateAccountResponse as n, type ListAccountsResponse as o, type AccountAccessToken as p, type AccountAccessTokenID as q, type CreateAccountAccessTokenPayload as r, type CreateAccountAccessTokenOptions as s, type CreateAccountAccessTokenResponse as t, type DeleteAccountAccessTokenOptions as u, type DeleteAccountAccessTokenResponse as v, type GetAccountAccessTokenOptions as w, type GetAccountAccessTokenResponse as x, type ListAccountAccessTokensOptions as y, type ListAccountAccessTokensResponse as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var et=Object.defineProperty;var st=(s,t)=>{for(var e in t)et(s,e,{get:t[e],enumerable:!0})};var m=class{getHeaders(){return{}}};var z="SUPPORT_ACCESS_TOKEN",Y="SUPPORT_KEY_NAME",Q="SUPPORT_KEY_PASSWORD",H="SUPPORT_SIGNING_KEY",J="SUPPORT_BASE_URL";var u=class{name;#t;constructor({name:t=process.env[Y],password:e=process.env[Q]}={}){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 d=class{#t;constructor({token:t=process.env[z]}={}){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 X="https://api.support.greatdetail.com",Z={"x-powered-by":"GDS/JavaScript"};var V=class extends Error{constructor(e,o,{requestID:n,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=n}requestID};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 l=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})}};var h=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 C=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 g=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 b=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})}};var R=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})}};var v=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 T=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",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 A=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:r={}}={}){return this._transport.send("v1/conversations",{...r,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 _=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 E=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 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 G=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 U=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 D=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:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:n,category:r,language:i}})})}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 k=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 P=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 F=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 x=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 W=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 w=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 i of r)n.push(["category",i])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var N=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 ot,{HTTPError as nt}from"ky";function c(s){return typeof s=="function"&&(s=s()),typeof s.toString=="function"?s.toString():typeof s=="string"?s:String(s)}var M=class s{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:n,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>s._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(n??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+c(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}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,c(n)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let n=[];if(t===void 0&&e===void 0)return n;let r=t?{dir:"before",value:c(t)}:void 0,i=e?{dir:"after",value:c(e)}:void 0,p=o==="after"?i||r:r||i;return p&&n.push([`page[${p.dir}]`,p.value]),n}};var B=class{client;options;query=M;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=ot.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,r=>r.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,i=this.client.extend({headers:{...n.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof nt?new V(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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 r of t)n.append("file",r);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"})}};var j=class{constructor(t){this._transport=t}async event({key:t=process.env[H],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."+H);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}=tt.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 $=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 K=class s{static DEFAULT_BASE_URL=X;static PublicAuthentication=m;static BasicAuthentication=u;static BearerAuthentication=d;_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,{baseURL:e,...o}={}){this._transport=new B({authentication:t,...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new h(this._transport),this.accountConversationSettings=new C(this._transport),this.accountNotificationEvent=new f(this._transport),this.action=new g(this._transport),this.boilerplateCategory=new b(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new T(this._transport),this.contact=new I(this._transport),this.conversation=new A(this._transport),this.conversationContext=new _(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new y(this._transport),this.label=new k(this._transport),this.import=new S(this._transport),this.integration={whatsapp:{account:new G(this._transport),phoneNumber:new D(this._transport),businessProfile:new U(this._transport),template:new L(this._transport)}},this.message=new P(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new x(this._transport),this.note=new W(this._transport),this.source=new w(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new j(this._transport),this.webhookSubscription=new $(this._transport)}static getBaseURL(){return process.env[J]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};export{st as a,m as b,X as c,V as d,tt as e,K as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as O,f as g}from"./chunk-
|
|
1
|
+
import{b as O,f as g}from"./chunk-RTRINZVE.js";import{Command as j}from"commander";import{Command as w}from"commander";function i({client:t}){let o=new w("actions").description("Actions");return o.addCommand(new w("list").description("List actions").action(async()=>{let n=await t.action.list().json();console.log(n)})),o}import{Command as y}from"commander";function m({client:t}){let o=new y("channels").description("Channels");return o.addCommand(new y("list").description("List channels").action(async()=>{let n=await t.channel.list().json();console.log(n)})),o}import{Command as e}from"commander";function c({client:t}){let o=new e("contacts").description("Contacts");return o.addCommand(new e("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let s=await t.contact.get(n).json();console.log(s)})),o.addCommand(new e("list").description("List contacts").action(async()=>{let n=await t.contact.list().json();console.log(n)})),o.addCommand(new e("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async n=>{let s=await t.contact.getVCF(n).response();console.log(s)})),o}import{Command as r}from"commander";function d({client:t}){let o=new r("conversations").description("Conversations");return o.addCommand(new r("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let s=await t.conversation.get(n).json();console.log(s)})),o.addCommand(new r("list").description("List conversations").action(async()=>{let n=await t.conversation.list().json();console.log(n)})),o}import{Command as p}from"commander";function l({client:t}){let o=new p("labels").description("Labels");return o.addCommand(new p("get").description("Find label").argument("<label>","Label ID").action(async n=>{let s=await t.label.get(n).json();console.log(s)})),o.addCommand(new p("list").description("List labels").action(async()=>{let n=await t.label.list().json();console.log(n)})),o}import{Command as x}from"commander";function u({client:t}){let o=new x("messages").description("Messages");return o.addCommand(new x("list").description("List messages").action(async()=>{let n=await t.message.list().json();console.log(n)})),o}import{Command as C}from"commander";function f({client:t}){let o=new C("sources").description("Sources");return o.addCommand(new C("get").description("Find source").argument("<source>","Source ID").action(async n=>{let s=await t.source.get(n).json();console.log(s)})),o.addCommand(new C("list").description("List sources").action(async()=>{let n=await t.source.list().json();console.log(n)})),o}var a={client:new g(new O)},b=new j("gds").description("Great Detail Support System").addCommand(i(a)).addCommand(m(a)).addCommand(c(a)).addCommand(d(a)).addCommand(l(a)).addCommand(u(a)).addCommand(f(a)),U=b;export{U as a};
|
package/dist/cli/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Rt=Object.create;var z=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var It=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var _t=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},dt=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!At.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(o=vt(t,s))||o.enumerable});return n};var yt=(n,t,e)=>(e=n!=null?Rt(It(n)):{},dt(t||!n||!n.__esModule?z(e,"default",{value:n,enumerable:!0}):e,n)),Et=n=>dt(z({},"__esModule",{value:!0}),n);var Gt={};_t(Gt,{default:()=>Ut});module.exports=Et(Gt);var Ot=require("commander");var c=class{getHeaders(){return{}}};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})}};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:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...s,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...s,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:s={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...s,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 f=class{constructor(t){this._transport=t}list({filter:t,sort:e,pagination:o,request:s={}}={}){return this._transport.send("v1/actions",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var ut="SUPPORT_ACCESS_TOKEN",lt="SUPPORT_KEY_NAME",ht="SUPPORT_KEY_PASSWORD",tt="SUPPORT_SIGNING_KEY",Ct="SUPPORT_BASE_URL";var g=class{name;#t;constructor({name:t=process.env[lt],password:e=process.env[ht]}={}){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 b=class{#t;constructor({token:t=process.env[ut]}={}){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 O=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:s={}}={}){return this._transport.send("v1/boilerplates/categories",{...s,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})}};var R=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})}};var v=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 T=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 I=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 ft="https://api.support.greatdetail.com",gt={"x-powered-by":"GDS/JavaScript"};var A=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",s=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(s)}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:s={}}={}){return this._transport.send("v1/contacts",{...s,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 _=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:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:s})})}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 y=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 E=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 S=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 U=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 G=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 L=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 k=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:s,category:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:s,category:r,language:i}})})}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:s={}}={}){return this._transport.send("v1/labels",{...s,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 x=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:s={}}={}){return this._transport.send("v1/messages",{...s,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 F=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 W=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 s=[];if(e){let r=Array.isArray(e)?e:[e];for(let i of r)s.push(["category",i])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var N=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 Q=yt(require("ky"),1);var Y=class extends Error{constructor(e,o,{requestID:s,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=s}requestID};function d(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var B=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:s,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>n._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(s??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+d(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let s of Array.isArray(e)?e:[e])o.push([t,d(s)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let s=[];if(t===void 0&&e===void 0)return s;let r=t?{dir:"before",value:d(t)}:void 0,i=e?{dir:"after",value:d(e)}:void 0,p=o==="after"?i||r:r||i;return p&&s.push([`page[${p.dir}]`,p.value]),s}};var j=class{client;options;query=B;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=Q.default.create({prefixUrl:this.options.baseURL,headers:gt,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 s=new Uint8Array(21);return globalThis.crypto.getRandomValues(s),t+Array.from(s,r=>r.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(),s=e.authentication??this.options.authentication,i=this.client.extend({headers:{...s.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof Q.HTTPError?new Y(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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:s={}}={}){return this._transport.send("v1/uploads",{...s,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let s=new FormData;for(let r of t)s.append("file",r);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),bt=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 $=class{constructor(t){this._transport=t}async event({key:t=process.env[tt],maxSignatures:e=3,request:o}){let s=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+tt);if(!s)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(s)?s.slice(0,e):[s]))throw new Error("Untrusted signature")}let{data:r}=bt.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let s=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",s,new TextEncoder().encode(atob(r)),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 H=class n{static DEFAULT_BASE_URL=ft;static PublicAuthentication=c;static BasicAuthentication=g;static BearerAuthentication=b;_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,{baseURL:e,...o}={}){this._transport=new j({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new f(this._transport),this.boilerplateCategory=new O(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new T(this._transport),this.compositionSection=new I(this._transport),this.contact=new A(this._transport),this.conversation=new _(this._transport),this.conversationContext=new y(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new S(this._transport),this.label=new P(this._transport),this.import=new U(this._transport),this.integration={whatsapp:{account:new G(this._transport),phoneNumber:new L(this._transport),businessProfile:new D(this._transport),template:new k(this._transport)}},this.message=new x(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new w(this._transport),this.note=new W(this._transport),this.source=new M(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new $(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[Ct]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var et=require("commander");function ot({client:n}){let t=new et.Command("actions").description("Actions");return t.addCommand(new et.Command("list").description("List actions").action(async()=>{let e=await n.action.list().json();console.log(e)})),t}var nt=require("commander");function st({client:n}){let t=new nt.Command("channels").description("Channels");return t.addCommand(new nt.Command("list").description("List channels").action(async()=>{let e=await n.channel.list().json();console.log(e)})),t}var K=require("commander");function rt({client:n}){let t=new K.Command("contacts").description("Contacts");return t.addCommand(new K.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.get(e).json();console.log(o)})),t.addCommand(new K.Command("list").description("List contacts").action(async()=>{let e=await n.contact.list().json();console.log(e)})),t.addCommand(new K.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.getVCF(e).response();console.log(o)})),t}var J=require("commander");function it({client:n}){let t=new J.Command("conversations").description("Conversations");return t.addCommand(new J.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async e=>{let o=await n.conversation.get(e).json();console.log(o)})),t.addCommand(new J.Command("list").description("List conversations").action(async()=>{let e=await n.conversation.list().json();console.log(e)})),t}var X=require("commander");function pt({client:n}){let t=new X.Command("labels").description("Labels");return t.addCommand(new X.Command("get").description("Find label").argument("<label>","Label ID").action(async e=>{let o=await n.label.get(e).json();console.log(o)})),t.addCommand(new X.Command("list").description("List labels").action(async()=>{let e=await n.label.list().json();console.log(e)})),t}var at=require("commander");function ct({client:n}){let t=new at.Command("messages").description("Messages");return t.addCommand(new at.Command("list").description("List messages").action(async()=>{let e=await n.message.list().json();console.log(e)})),t}var Z=require("commander");function mt({client:n}){let t=new Z.Command("sources").description("Sources");return t.addCommand(new Z.Command("get").description("Find source").argument("<source>","Source ID").action(async e=>{let o=await n.source.get(e).json();console.log(o)})),t.addCommand(new Z.Command("list").description("List sources").action(async()=>{let e=await n.source.list().json();console.log(e)})),t}var m={client:new H(new c)},St=new Ot.Command("gds").description("Great Detail Support System").addCommand(ot(m)).addCommand(st(m)).addCommand(rt(m)).addCommand(it(m)).addCommand(pt(m)).addCommand(ct(m)).addCommand(mt(m)),Ut=St;
|
|
1
|
+
"use strict";var Rt=Object.create;var z=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Tt=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var _t=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},dt=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of It(t))!At.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(o=vt(t,s))||o.enumerable});return n};var yt=(n,t,e)=>(e=n!=null?Rt(Tt(n)):{},dt(t||!n||!n.__esModule?z(e,"default",{value:n,enumerable:!0}):e,n)),Et=n=>dt(z({},"__esModule",{value:!0}),n);var Ut={};_t(Ut,{default:()=>Gt});module.exports=Et(Ut);var Ot=require("commander");var c=class{getHeaders(){return{}}};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})}};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:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...s,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...s,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:s={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...s,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 f=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:s={}}={}){return this._transport.send("v1/actions",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var ut="SUPPORT_ACCESS_TOKEN",lt="SUPPORT_KEY_NAME",ht="SUPPORT_KEY_PASSWORD",tt="SUPPORT_SIGNING_KEY",Ct="SUPPORT_BASE_URL";var g=class{name;#t;constructor({name:t=process.env[lt],password:e=process.env[ht]}={}){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 b=class{#t;constructor({token:t=process.env[ut]}={}){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 O=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:s={}}={}){return this._transport.send("v1/boilerplates/categories",{...s,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})}};var R=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})}};var v=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 I=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 T=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 ft="https://api.support.greatdetail.com",gt={"x-powered-by":"GDS/JavaScript"};var A=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",s=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(s)}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:s={}}={}){return this._transport.send("v1/contacts",{...s,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 _=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:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:s})})}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 y=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 E=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 S=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 G=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 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 L=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 k=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:s,category:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:s,category:r,language:i}})})}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:s={}}={}){return this._transport.send("v1/labels",{...s,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 x=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:s={}}={}){return this._transport.send("v1/messages",{...s,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 F=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 W=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 s=[];if(e){let r=Array.isArray(e)?e:[e];for(let i of r)s.push(["category",i])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var N=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 Q=yt(require("ky"),1);var Y=class extends Error{constructor(e,o,{requestID:s,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=s}requestID};function d(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var B=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:s,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>n._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(s??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+d(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let s of Array.isArray(e)?e:[e])o.push([t,d(s)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let s=[];if(t===void 0&&e===void 0)return s;let r=t?{dir:"before",value:d(t)}:void 0,i=e?{dir:"after",value:d(e)}:void 0,p=o==="after"?i||r:r||i;return p&&s.push([`page[${p.dir}]`,p.value]),s}};var j=class{client;options;query=B;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=Q.default.create({prefixUrl:this.options.baseURL,headers:gt,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 s=new Uint8Array(21);return globalThis.crypto.getRandomValues(s),t+Array.from(s,r=>r.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(),s=e.authentication??this.options.authentication,i=this.client.extend({headers:{...s.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof Q.HTTPError?new Y(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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:s={}}={}){return this._transport.send("v1/uploads",{...s,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let s=new FormData;for(let r of t)s.append("file",r);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),bt=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 $=class{constructor(t){this._transport=t}async event({key:t=process.env[tt],maxSignatures:e=3,request:o}){let s=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+tt);if(!s)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(s)?s.slice(0,e):[s]))throw new Error("Untrusted signature")}let{data:r}=bt.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let s=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",s,new TextEncoder().encode(atob(r)),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 H=class n{static DEFAULT_BASE_URL=ft;static PublicAuthentication=c;static BasicAuthentication=g;static BearerAuthentication=b;_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,{baseURL:e,...o}={}){this._transport=new j({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new f(this._transport),this.boilerplateCategory=new O(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new I(this._transport),this.compositionSection=new T(this._transport),this.contact=new A(this._transport),this.conversation=new _(this._transport),this.conversationContext=new y(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new S(this._transport),this.label=new P(this._transport),this.import=new G(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new L(this._transport),businessProfile:new D(this._transport),template:new k(this._transport)}},this.message=new x(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new w(this._transport),this.note=new W(this._transport),this.source=new M(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new $(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[Ct]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var et=require("commander");function ot({client:n}){let t=new et.Command("actions").description("Actions");return t.addCommand(new et.Command("list").description("List actions").action(async()=>{let e=await n.action.list().json();console.log(e)})),t}var nt=require("commander");function st({client:n}){let t=new nt.Command("channels").description("Channels");return t.addCommand(new nt.Command("list").description("List channels").action(async()=>{let e=await n.channel.list().json();console.log(e)})),t}var K=require("commander");function rt({client:n}){let t=new K.Command("contacts").description("Contacts");return t.addCommand(new K.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.get(e).json();console.log(o)})),t.addCommand(new K.Command("list").description("List contacts").action(async()=>{let e=await n.contact.list().json();console.log(e)})),t.addCommand(new K.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.getVCF(e).response();console.log(o)})),t}var J=require("commander");function it({client:n}){let t=new J.Command("conversations").description("Conversations");return t.addCommand(new J.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async e=>{let o=await n.conversation.get(e).json();console.log(o)})),t.addCommand(new J.Command("list").description("List conversations").action(async()=>{let e=await n.conversation.list().json();console.log(e)})),t}var X=require("commander");function pt({client:n}){let t=new X.Command("labels").description("Labels");return t.addCommand(new X.Command("get").description("Find label").argument("<label>","Label ID").action(async e=>{let o=await n.label.get(e).json();console.log(o)})),t.addCommand(new X.Command("list").description("List labels").action(async()=>{let e=await n.label.list().json();console.log(e)})),t}var at=require("commander");function ct({client:n}){let t=new at.Command("messages").description("Messages");return t.addCommand(new at.Command("list").description("List messages").action(async()=>{let e=await n.message.list().json();console.log(e)})),t}var Z=require("commander");function mt({client:n}){let t=new Z.Command("sources").description("Sources");return t.addCommand(new Z.Command("get").description("Find source").argument("<source>","Source ID").action(async e=>{let o=await n.source.get(e).json();console.log(o)})),t.addCommand(new Z.Command("list").description("List sources").action(async()=>{let e=await n.source.list().json();console.log(e)})),t}var m={client:new H(new c)},St=new Ot.Command("gds").description("Great Detail Support System").addCommand(ot(m)).addCommand(st(m)).addCommand(rt(m)).addCommand(it(m)).addCommand(pt(m)).addCommand(ct(m)).addCommand(mt(m)),Gt=St;
|
package/dist/cli/index.d.cts
CHANGED
package/dist/cli/index.d.ts
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YQRKO6KD.js";import"../chunk-RTRINZVE.js";export{a as default};
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Rt=Object.create;var mt=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var It=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var _t=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!At.call(n,s)&&s!==e&&mt(n,s,{get:()=>t[s],enumerable:!(o=vt(t,s))||o.enumerable});return n};var yt=(n,t,e)=>(e=n!=null?Rt(It(n)):{},_t(t||!n||!n.__esModule?mt(e,"default",{value:n,enumerable:!0}):e,n));var bt=require("commander");var c=class{getHeaders(){return{}}};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})}};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:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...s,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...s,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:s={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...s,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 f=class{constructor(t){this._transport=t}list({filter:t,sort:e,pagination:o,request:s={}}={}){return this._transport.send("v1/actions",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var dt="SUPPORT_ACCESS_TOKEN",ut="SUPPORT_KEY_NAME",lt="SUPPORT_KEY_PASSWORD",Z="SUPPORT_SIGNING_KEY",ht="SUPPORT_BASE_URL";var g=class{name;#t;constructor({name:t=process.env[ut],password:e=process.env[lt]}={}){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 b=class{#t;constructor({token:t=process.env[dt]}={}){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 O=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:s={}}={}){return this._transport.send("v1/boilerplates/categories",{...s,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})}};var R=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})}};var v=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 T=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 I=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 Ct="https://api.support.greatdetail.com",ft={"x-powered-by":"GDS/JavaScript"};var A=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",s=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(s)}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:s={}}={}){return this._transport.send("v1/contacts",{...s,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 _=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:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:s})})}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 y=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 E=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 S=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 U=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 G=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 L=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 k=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:s,category:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:s,category:r,language:i}})})}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:s={}}={}){return this._transport.send("v1/labels",{...s,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 x=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:s={}}={}){return this._transport.send("v1/messages",{...s,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 F=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 W=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 s=[];if(e){let r=Array.isArray(e)?e:[e];for(let i of r)s.push(["category",i])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var N=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 Y=yt(require("ky"),1);var z=class extends Error{constructor(e,o,{requestID:s,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=s}requestID};function d(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var B=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:s,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>n._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(s??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+d(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let s of Array.isArray(e)?e:[e])o.push([t,d(s)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let s=[];if(t===void 0&&e===void 0)return s;let r=t?{dir:"before",value:d(t)}:void 0,i=e?{dir:"after",value:d(e)}:void 0,p=o==="after"?i||r:r||i;return p&&s.push([`page[${p.dir}]`,p.value]),s}};var j=class{client;options;query=B;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=Y.default.create({prefixUrl:this.options.baseURL,headers:ft,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 s=new Uint8Array(21);return globalThis.crypto.getRandomValues(s),t+Array.from(s,r=>r.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(),s=e.authentication??this.options.authentication,i=this.client.extend({headers:{...s.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof Y.HTTPError?new z(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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:s={}}={}){return this._transport.send("v1/uploads",{...s,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let s=new FormData;for(let r of t)s.append("file",r);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),gt=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 $=class{constructor(t){this._transport=t}async event({key:t=process.env[Z],maxSignatures:e=3,request:o}){let s=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+Z);if(!s)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(s)?s.slice(0,e):[s]))throw new Error("Untrusted signature")}let{data:r}=gt.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let s=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",s,new TextEncoder().encode(atob(r)),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 H=class n{static DEFAULT_BASE_URL=Ct;static PublicAuthentication=c;static BasicAuthentication=g;static BearerAuthentication=b;_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,{baseURL:e,...o}={}){this._transport=new j({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new f(this._transport),this.boilerplateCategory=new O(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new T(this._transport),this.compositionSection=new I(this._transport),this.contact=new A(this._transport),this.conversation=new _(this._transport),this.conversationContext=new y(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new S(this._transport),this.label=new P(this._transport),this.import=new U(this._transport),this.integration={whatsapp:{account:new G(this._transport),phoneNumber:new L(this._transport),businessProfile:new D(this._transport),template:new k(this._transport)}},this.message=new x(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new w(this._transport),this.note=new W(this._transport),this.source=new M(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new $(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[ht]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var tt=require("commander");function et({client:n}){let t=new tt.Command("actions").description("Actions");return t.addCommand(new tt.Command("list").description("List actions").action(async()=>{let e=await n.action.list().json();console.log(e)})),t}var ot=require("commander");function nt({client:n}){let t=new ot.Command("channels").description("Channels");return t.addCommand(new ot.Command("list").description("List channels").action(async()=>{let e=await n.channel.list().json();console.log(e)})),t}var K=require("commander");function st({client:n}){let t=new K.Command("contacts").description("Contacts");return t.addCommand(new K.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.get(e).json();console.log(o)})),t.addCommand(new K.Command("list").description("List contacts").action(async()=>{let e=await n.contact.list().json();console.log(e)})),t.addCommand(new K.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.getVCF(e).response();console.log(o)})),t}var Q=require("commander");function rt({client:n}){let t=new Q.Command("conversations").description("Conversations");return t.addCommand(new Q.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async e=>{let o=await n.conversation.get(e).json();console.log(o)})),t.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let e=await n.conversation.list().json();console.log(e)})),t}var J=require("commander");function it({client:n}){let t=new J.Command("labels").description("Labels");return t.addCommand(new J.Command("get").description("Find label").argument("<label>","Label ID").action(async e=>{let o=await n.label.get(e).json();console.log(o)})),t.addCommand(new J.Command("list").description("List labels").action(async()=>{let e=await n.label.list().json();console.log(e)})),t}var pt=require("commander");function at({client:n}){let t=new pt.Command("messages").description("Messages");return t.addCommand(new pt.Command("list").description("List messages").action(async()=>{let e=await n.message.list().json();console.log(e)})),t}var X=require("commander");function ct({client:n}){let t=new X.Command("sources").description("Sources");return t.addCommand(new X.Command("get").description("Find source").argument("<source>","Source ID").action(async e=>{let o=await n.source.get(e).json();console.log(o)})),t.addCommand(new X.Command("list").description("List sources").action(async()=>{let e=await n.source.list().json();console.log(e)})),t}var m={client:new H(new c)},Et=new bt.Command("gds").description("Great Detail Support System").addCommand(et(m)).addCommand(nt(m)).addCommand(st(m)).addCommand(rt(m)).addCommand(it(m)).addCommand(at(m)).addCommand(ct(m)),Ot=Et;Ot.parseAsync(process.argv);
|
|
2
|
+
"use strict";var Rt=Object.create;var mt=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Tt=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var _t=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of It(t))!At.call(n,s)&&s!==e&&mt(n,s,{get:()=>t[s],enumerable:!(o=vt(t,s))||o.enumerable});return n};var yt=(n,t,e)=>(e=n!=null?Rt(Tt(n)):{},_t(t||!n||!n.__esModule?mt(e,"default",{value:n,enumerable:!0}):e,n));var bt=require("commander");var c=class{getHeaders(){return{}}};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})}};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:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...s,method:"GET",searchParams:this._transport.query.build({pagination:o,filter:e})})}delete(t,e,{body:o,request:s={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...s,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:s={}}={}){return this._transport.send(`v1/accounts/${encodeURIComponent(t)}/notifications/events`,{...s,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 f=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:s={}}={}){return this._transport.send("v1/actions",{...s,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t})})}};var dt="SUPPORT_ACCESS_TOKEN",ut="SUPPORT_KEY_NAME",lt="SUPPORT_KEY_PASSWORD",Z="SUPPORT_SIGNING_KEY",ht="SUPPORT_BASE_URL";var g=class{name;#t;constructor({name:t=process.env[ut],password:e=process.env[lt]}={}){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 b=class{#t;constructor({token:t=process.env[dt]}={}){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 O=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:s={}}={}){return this._transport.send("v1/boilerplates/categories",{...s,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})}};var R=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})}};var v=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 I=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 T=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 Ct="https://api.support.greatdetail.com",ft={"x-powered-by":"GDS/JavaScript"};var A=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",s=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(s)}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:s={}}={}){return this._transport.send("v1/contacts",{...s,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 _=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:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:this._transport.query.build({sort:e,pagination:o,filter:t,include:s})})}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 y=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 E=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 S=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 G=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 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 L=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 k=class{constructor(t){this._transport=t}listByAccount(t,{search:e,status:o,quality:s,category:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:s,category:r,language:i}})})}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:s={}}={}){return this._transport.send("v1/labels",{...s,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 x=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:s={}}={}){return this._transport.send("v1/messages",{...s,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 F=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 W=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 s=[];if(e){let r=Array.isArray(e)?e:[e];for(let i of r)s.push(["category",i])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var N=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 Y=yt(require("ky"),1);var z=class extends Error{constructor(e,o,{requestID:s,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=s}requestID};function d(n){return typeof n=="function"&&(n=n()),typeof n.toString=="function"?n.toString():typeof n=="string"?n:String(n)}var B=class n{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:s,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>n._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(s??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+d(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}static query(t,e){let o=[];if(e===void 0)return o;if(e===null)return[...o,[t,"null"]];for(let s of Array.isArray(e)?e:[e])o.push([t,d(s)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let s=[];if(t===void 0&&e===void 0)return s;let r=t?{dir:"before",value:d(t)}:void 0,i=e?{dir:"after",value:d(e)}:void 0,p=o==="after"?i||r:r||i;return p&&s.push([`page[${p.dir}]`,p.value]),s}};var j=class{client;options;query=B;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=Y.default.create({prefixUrl:this.options.baseURL,headers:ft,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 s=new Uint8Array(21);return globalThis.crypto.getRandomValues(s),t+Array.from(s,r=>r.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(),s=e.authentication??this.options.authentication,i=this.client.extend({headers:{...s.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof Y.HTTPError?new z(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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:s={}}={}){return this._transport.send("v1/uploads",{...s,method:"GET",searchParams:this._transport.query.build({filter:t,include:e,pagination:o})})}create({files:t,include:e,request:o={}}){let s=new FormData;for(let r of t)s.append("file",r);return this._transport.send("v1/uploads",{...o,method:"POST",searchParams:this._transport.query.build({include:e}),body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var a=require("zod"),gt=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 $=class{constructor(t){this._transport=t}async event({key:t=process.env[Z],maxSignatures:e=3,request:o}){let s=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+Z);if(!s)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(s)?s.slice(0,e):[s]))throw new Error("Untrusted signature")}let{data:r}=gt.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let s=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",s,new TextEncoder().encode(atob(r)),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 H=class n{static DEFAULT_BASE_URL=Ct;static PublicAuthentication=c;static BasicAuthentication=g;static BearerAuthentication=b;_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,{baseURL:e,...o}={}){this._transport=new j({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new u(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new h(this._transport),this.accountNotificationEvent=new C(this._transport),this.action=new f(this._transport),this.boilerplateCategory=new O(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new I(this._transport),this.compositionSection=new T(this._transport),this.contact=new A(this._transport),this.conversation=new _(this._transport),this.conversationContext=new y(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new S(this._transport),this.label=new P(this._transport),this.import=new G(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new L(this._transport),businessProfile:new D(this._transport),template:new k(this._transport)}},this.message=new x(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new w(this._transport),this.note=new W(this._transport),this.source=new M(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new $(this._transport),this.webhookSubscription=new V(this._transport)}static getBaseURL(){return process.env[ht]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};var tt=require("commander");function et({client:n}){let t=new tt.Command("actions").description("Actions");return t.addCommand(new tt.Command("list").description("List actions").action(async()=>{let e=await n.action.list().json();console.log(e)})),t}var ot=require("commander");function nt({client:n}){let t=new ot.Command("channels").description("Channels");return t.addCommand(new ot.Command("list").description("List channels").action(async()=>{let e=await n.channel.list().json();console.log(e)})),t}var K=require("commander");function st({client:n}){let t=new K.Command("contacts").description("Contacts");return t.addCommand(new K.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.get(e).json();console.log(o)})),t.addCommand(new K.Command("list").description("List contacts").action(async()=>{let e=await n.contact.list().json();console.log(e)})),t.addCommand(new K.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async e=>{let o=await n.contact.getVCF(e).response();console.log(o)})),t}var Q=require("commander");function rt({client:n}){let t=new Q.Command("conversations").description("Conversations");return t.addCommand(new Q.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async e=>{let o=await n.conversation.get(e).json();console.log(o)})),t.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let e=await n.conversation.list().json();console.log(e)})),t}var J=require("commander");function it({client:n}){let t=new J.Command("labels").description("Labels");return t.addCommand(new J.Command("get").description("Find label").argument("<label>","Label ID").action(async e=>{let o=await n.label.get(e).json();console.log(o)})),t.addCommand(new J.Command("list").description("List labels").action(async()=>{let e=await n.label.list().json();console.log(e)})),t}var pt=require("commander");function at({client:n}){let t=new pt.Command("messages").description("Messages");return t.addCommand(new pt.Command("list").description("List messages").action(async()=>{let e=await n.message.list().json();console.log(e)})),t}var X=require("commander");function ct({client:n}){let t=new X.Command("sources").description("Sources");return t.addCommand(new X.Command("get").description("Find source").argument("<source>","Source ID").action(async e=>{let o=await n.source.get(e).json();console.log(o)})),t.addCommand(new X.Command("list").description("List sources").action(async()=>{let e=await n.source.list().json();console.log(e)})),t}var m={client:new H(new c)},Et=new bt.Command("gds").description("Great Detail Support System").addCommand(et(m)).addCommand(nt(m)).addCommand(st(m)).addCommand(rt(m)).addCommand(it(m)).addCommand(at(m)).addCommand(ct(m)),Ot=Et;Ot.parseAsync(process.argv);
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-YQRKO6KD.js";import"./chunk-RTRINZVE.js";r.parseAsync(process.argv);
|
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 gt={};Z(gt,{Client:()=>u,DEFAULT_SUPPORT_BASE_URL:()=>K,Error:()=>X,SupportError:()=>c,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:()=>u,eventWebhookSchema:()=>J});module.exports=lt(gt);var K="https://api.support.greatdetail.com",et={"x-powered-by":"GDS/JavaScript"};var l=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})}};var d=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 f=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 h=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 C=class{constructor(t){this._transport=t}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 T=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})}};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})}};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 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.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 I=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 P=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 D=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 w=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 B=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 c=class extends Error{constructor(e,o,{requestID:r,body:s,cause:p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,{cause:p});this.response=e;this.request=o;this.requestID=r}requestID};function m(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"?"-":"")+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 r of Array.isArray(e)?e:[e])o.push([t,m(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:m(t)}:void 0,p=e?{dir:"after",value:m(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 c(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 u=class n{static DEFAULT_BASE_URL=K;static PublicAuthentication=E;static BasicAuthentication=T;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,{baseURL:e,...o}={}){this._transport=new q({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new f(this._transport),this.accountNotificationEvent=new h(this._transport),this.action=new C(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 x(this._transport),this.conversation=new I(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 P(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new D(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 w(this._transport),this.statistics=new B(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:()=>c});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"];0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,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:()=>u,DEFAULT_SUPPORT_BASE_URL:()=>K,Error:()=>X,SDK_VERSION:()=>gt,SupportError:()=>c,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:()=>u,eventWebhookSchema:()=>J});module.exports=lt(Ot);var K="https://api.support.greatdetail.com",et={"x-powered-by":"GDS/JavaScript"};var l=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})}};var d=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 f=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 h=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 C=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 T=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})}};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})}};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 U=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 P=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 D=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 w=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 B=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 c=class extends Error{constructor(e,o,{requestID:r,body:s,cause:p}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${s?" - "+s:""}`,{cause:p});this.response=e;this.request=o;this.requestID=r}requestID};function m(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"?"-":"")+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 r of Array.isArray(e)?e:[e])o.push([t,m(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:m(t)}:void 0,p=e?{dir:"after",value:m(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 c(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 u=class n{static DEFAULT_BASE_URL=K;static PublicAuthentication=E;static BasicAuthentication=T;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,{baseURL:e,...o}={}){this._transport=new q({authentication:t,...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new f(this._transport),this.accountNotificationEvent=new h(this._transport),this.action=new C(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 U(this._transport),this.integration={whatsapp:{account:new P(this._transport),phoneNumber:new D(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 w(this._transport),this.statistics=new B(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:()=>c});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.25.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Account, p as AccountAccessToken, q as AccountAccessTokenID, es as AccountAccessTokenWebhookEventType, B as AccountConversationSettings, h as AccountID, K as AccountNotificationEvent, et as AccountNotificationEventEventType, g as AccountStatus, er as AccountWebhookWebhookEventType, T as Action, V as ActionID, W as ActionStatus, bt as ActiveConversationStatus, aa as BoilerplateCategory, ab as BoilerplateCategoryID, _ as BoilerplateContent, $ as BoilerplateContentID, an as Channel, aG as ChannelConversationSettings, ao as ChannelID, ap as ChannelStatus, C as Client, aM as CompositionSection, aN as CompositionSectionID, aO as CompositionSectionLocation, bu as ConcludedConversationStatus, b7 as Contact, bb as ContactCustomMetadata, b8 as ContactID, ba as ContactStatus, b9 as ContactType, eu as ContactWebhookEventType, bq as Conversation, bs as ConversationCustomMetadata, bO as ConversationFeedback, br as ConversationID, bN as ConversationSettings, bv as ConversationStatus, ev as ConversationWebhookEventType, e as CountResponsePagination, s as CreateAccountAccessTokenOptions, r as CreateAccountAccessTokenPayload, t as CreateAccountAccessTokenResponse, j as CreateAccountOptions, i as CreateAccountPayload, k as CreateAccountResponse, ad as CreateBoilerplateCategoryOptions, ac as CreateBoilerplateCategoryPayload, ae as CreateBoilerplateCategoryResponse, a1 as CreateBoilerplateContentOptions, a0 as CreateBoilerplateContentPayload, a2 as CreateBoilerplateContentResponse, as as CreateChannelOptions, ar as CreateChannelPayload, at as CreateChannelResponse, aQ as CreateCompositionSectionOptions, aP as CreateCompositionSectionPayload, aR as CreateCompositionSectionResponse, bd as CreateContactOptions, bc as CreateContactPayload, be as CreateContactResponse, bQ as CreateConversationFeedbackOptions, bP as CreateConversationFeedbackPayload, bR as CreateConversationFeedbackResponse, bx as CreateConversationOptions, bw as CreateConversationPayload, by as CreateConversationResponse, a$ as CreateEscalationOptions, a_ as CreateEscalationPayload, b0 as CreateEscalationResponse, cd as CreateImportOptions, cc as CreateImportPayload, ce as CreateImportResponse, b_ as CreateLabelOptions, bZ as CreateLabelPayload, b$ as CreateLabelResponse, dj as CreateMessageOptions, di as CreateMessagePayload, dk as CreateMessageResponse, dC as CreateModelConfigOptions, dB as CreateModelConfigPayload, dD as CreateModelConfigResponse, dV as CreateNoteOptions, dU as CreateNotePayload, dW as CreateNoteResponse, ec as CreateUploadIncludeOptions, ed as CreateUploadOptions, ee as CreateUploadResponse, eD as CreateWebhookSubscriptionOptions, eC as CreateWebhookSubscriptionPayload, eE as CreateWebhookSubscriptionResponse, f as CurrentAccountID, d as CursorResponsePagination, aq as CustomChannelCustomMetadata, u as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, v as DeleteAccountAccessTokenResponse, au as DeleteChannelOptions, av as DeleteChannelResponse, bf as DeleteContactOptions, bg as DeleteContactResponse, bS as DeleteConversationFeedbackOptions, bT as DeleteConversationFeedbackResponse, bz as DeleteConversationOptions, bA as DeleteConversationResponse, b5 as DeleteEscalationOptions, b6 as DeleteEscalationResponse, c0 as DeleteLabelOptions, c1 as DeleteLabelResponse, dl as DeleteMessageOptions, dm as DeleteMessageResponse, dE as DeleteModelConfigOptions, dF as DeleteModelConfigResponse, ef as DeleteUploadOptions, eg as DeleteUploadResponse, eF as DeleteWebhookSubscriptionOptions, eG as DeleteWebhookSubscriptionResponse, cG as DeleteWhatsappAccountTemplateOptions, cH as DeleteWhatsappAccountTemplateResponse, aZ as Escalation, eo as EventWebhookOptions, w as GetAccountAccessTokenOptions, x as GetAccountAccessTokenResponse, E as GetAccountConversationSettingsOptions, F as GetAccountConversationSettingsResponse, M as GetAccountNotificationEventOptions, N as GetAccountNotificationEventResponse, G as GetAccountOptions, l as GetAccountResponse, af as GetBoilerplateCategoryOptions, ag as GetBoilerplateCategoryResponse, a3 as GetBoilerplateContentOptions, a4 as GetBoilerplateContentResponse, aH as GetChannelConversationSettingsOptions, aI as GetChannelConversationSettingsResponse, aw as GetChannelOptions, ax as GetChannelResponse, aS as GetCompositionSectionOptions, aT as GetCompositionSectionResponse, bh as GetContactIncludeOptions, bi as GetContactOptions, bj as GetContactResponse, bk as GetContactVCFOptions, bU as GetConversationFeedbackOptions, bV as GetConversationFeedbackResponse, bB as GetConversationIncludeOptions, bC as GetConversationOptions, bD as GetConversationResponse, b1 as GetEscalationOptions, b2 as GetEscalationResponse, cf as GetImportOptions, cg as GetImportResponse, c2 as GetLabelOptions, c3 as GetLabelResponse, dn as GetMessageOptions, dp as GetMessageResponse, dJ as GetModelConfigOptions, dK as GetModelConfigResponse, dO as GetModelInterfaceOptions, dP as GetModelInterfaceResponse, dX as GetNoteOptions, dY as GetNoteResponse, e5 as GetSourceOptions, e6 as GetSourceResponse, eh as GetUploadIncludeOptions, ei as GetUploadOptions, ej as GetUploadResponse, eH as GetWebhookSubscriptionOptions, eI as GetWebhookSubscriptionResponse, co as GetWhatsappAccountIncludeOptions, cp as GetWhatsappAccountOptions, cq as GetWhatsappAccountResponse, cI as GetWhatsappAccountTemplateOptions, cJ as GetWhatsappAccountTemplateResponse, cv as GetWhatsappBusinessProfileOptions, cw as GetWhatsappBusinessProfileResponse, cB as GetWhatsappPhoneNumberIncludeOptions, cC as GetWhatsappPhoneNumberOptions, cD as GetWhatsappPhoneNumberResponse, cb as Import, cj as ImportID, cl as ImportStatus, ck as ImportType, ex as ImportWebhookEventType, bY as Label, c4 as LabelID, d6 as LexicalDirection, db as LexicalHeadingNode, df as LexicalHorizontalRuleNode, d7 as LexicalIndent, d9 as LexicalLinkNode, dd as LexicalListItemNode, de as LexicalListNode, dc as LexicalParagraphNode, da as LexicalQuoteNode, dh as LexicalRootNode, d8 as LexicalTextNode, dg as LexicalUploadNode, y as ListAccountAccessTokensOptions, z as ListAccountAccessTokensResponse, P as ListAccountNotificationEventsFilterOptions, Q as ListAccountNotificationEventsOptions, S as ListAccountNotificationEventsResponse, L as ListAccountsOptions, o as ListAccountsResponse, Y as ListActionsOptions, Z as ListActionsResponse, ah as ListBoilerplateCategoriesIncludeOptions, ai as ListBoilerplateCategoriesOptions, aj as ListBoilerplateCategoriesResponse, a5 as ListBoilerplateContentsOptions, a6 as ListBoilerplateContentsResponse, ay as ListChannelsOptions, az as ListChannelsResponse, aU as ListCompositionSectionsOptions, aV as ListCompositionSectionsResponse, bl as ListContactsOptions, bm as ListContactsResponse, bW as ListConversationFeedbackOptions, bX as ListConversationFeedbackResponse, bG as ListConversationOptions, bF as ListConversationsFilterOptions, bE as ListConversationsIncludeOptions, bH as ListConversationsResponse, b3 as ListEscalationsOptions, b4 as ListEscalationsResponse, ch as ListImportsOptions, ci as ListImportsResponse, c5 as ListLabelsIncludeOptions, c6 as ListLabelsOptions, c7 as ListLabelsResponse, dq as ListMessagesIncludeOptions, dr as ListMessagesOptions, ds as ListMessagesResponse, dL as ListModelConfigsOptions, dM as ListModelConfigsResponse, dQ as ListModelInterfacesOptions, dR as ListModelInterfacesResponse, dZ as ListNotesOptions, d_ as ListNotesResponse, e7 as ListSourcesOptions, e8 as ListSourcesResponse, ek as ListUploadsIncludeOptions, el as ListUploadsOptions, em as ListUploadsResponse, eJ as ListWebhookSubscriptionsOptions, eK as ListWebhookSubscriptionsResponse, cK as ListWhatsappAccountTemplatesOptions, cL as ListWhatsappAccountTemplatesResponse, cr as ListWhatsappAccountsOptions, cs as ListWhatsappAccountsResponse, cE as ListWhatsappPhoneNumbersOptions, cF as ListWhatsappPhoneNumbersResponse, d5 as Message, dz as MessageCustomMetadata, dy as MessageEventType, dt as MessageID, du as MessageRole, dw as MessageStatus, dv as MessageType, dx as MessageVisibility, ew as MessageWebhookEventType, dA as ModelConfig, dN as ModelInterface, dS as ModelInterfaceID, dT as Note, d$ as NoteID, e3 as NotificationEvent, O as Options, R as ResponseData, b as ResponseMeta, c as ResponseTimestamp, aA as SendChannelSyncPayload, aB as SendgridChannelSyncOptions, aC as SendgridChannelSyncResponse, X as SortOptions, e4 as Source, ea as SourceAdornment, e9 as SourceID, eL as TestWebhookSubscriptionOptions, eM as TestWebhookSubscriptionResponse, a as TransportOptions, bL as TriggerResponseConversationOptions, bM as TriggerResponseConversationResponse, I as UpdateAccountConversationSettingsOptions, H as UpdateAccountConversationSettingsPayload, J as UpdateAccountConversationSettingsResponse, m as UpdateAccountOptions, U as UpdateAccountPayload, n as UpdateAccountResponse, al as UpdateBoilerplateCategoryOptions, ak as UpdateBoilerplateCategoryPayload, am as UpdateBoilerplateCategoryResponse, a8 as UpdateBoilerplateContentOptions, a7 as UpdateBoilerplateContentPayload, a9 as UpdateBoilerplateContentResponse, aK as UpdateChannelConversationSettingsOptions, aJ as UpdateChannelConversationSettingsPayload, aL as UpdateChannelConversationSettingsResponse, aE as UpdateChannelOptions, aD as UpdateChannelPayload, aF as UpdateChannelResponse, aX as UpdateCompositionSectionOptions, aW as UpdateCompositionSectionPayload, aY as UpdateCompositionSectionResponse, bo as UpdateContactOptions, bn as UpdateContactPayload, bp as UpdateContactResponse, bJ as UpdateConversationOptions, bI as UpdateConversationPayload, bK as UpdateConversationResponse, c9 as UpdateLabelOptions, c8 as UpdateLabelPayload, ca as UpdateLabelResponse, dH as UpdateModelConfigOptions, dG as UpdateModelConfigPayload, dI as UpdateModelConfigResponse, e1 as UpdateNoteOptions, e0 as UpdateNotePayload, e2 as UpdateNoteResponse, cy as UpdateWhatsappBusinessProfileOptions, cx as UpdateWhatsappBusinessProfilePayload, cz as UpdateWhatsappBusinessProfileResponse, eb as Upload, en as UploadID, ct as WHATSAPP_BUSINESS_PROFILE_VERTICAL, cQ as WHATSAPP_TEMPLATE_CATEGORIES, cU as WHATSAPP_TEMPLATE_INDUSTRIES, cO as WHATSAPP_TEMPLATE_LANGUAGES, c_ as WHATSAPP_TEMPLATE_QUALITY_SCORES, cM as WHATSAPP_TEMPLATE_STATUSES, cS as WHATSAPP_TEMPLATE_SUBCATEGORIES, cW as WHATSAPP_TEMPLATE_TOPICS, cY as WHATSAPP_TEMPLATE_USECASES, ez as WebhookEventPayload, eq as WebhookEventType, eA as WebhookResponse, eB as WebhookSubscription, eN as WebhookSubscriptionID, ey as WebhookSubscriptionWebhookEventType, cm as WhatsappAccount, cn as WhatsappAccountDetail, d3 as WhatsappAccountTemplate, cu as WhatsappBusinessProfileDetail, d4 as WhatsappLibraryTemplate, cA as WhatsappPhoneNumber, d2 as WhatsappTemplateButton, cR as WhatsappTemplateCategory, cV as WhatsappTemplateIndustry, cP as WhatsappTemplateLanguage, d1 as WhatsappTemplateParameterFormat, c$ as WhatsappTemplateQualityScore, d0 as WhatsappTemplateRejectionReason, cN as WhatsappTemplateStatus, cT as WhatsappTemplateSubcategory, cX as WhatsappTemplateTopic, cZ as WhatsappTemplateUseCase, C as default, ep as eventWebhookSchema } from './Client-CZ3Y0jmo.cjs';
|
|
1
|
+
export { A as Account, p as AccountAccessToken, q as AccountAccessTokenID, eu as AccountAccessTokenWebhookEventType, B as AccountConversationSettings, h as AccountID, K as AccountNotificationEvent, ev as AccountNotificationEventEventType, g as AccountStatus, et as AccountWebhookWebhookEventType, T as Action, V as ActionID, W as ActionStatus, bv as ActiveConversationStatus, ac as BoilerplateCategory, ad as BoilerplateCategoryID, a0 as BoilerplateContent, a1 as BoilerplateContentID, ap as Channel, aI as ChannelConversationSettings, aq as ChannelID, ar as ChannelStatus, C as Client, aO as CompositionSection, aP as CompositionSectionID, aQ as CompositionSectionLocation, bw as ConcludedConversationStatus, b9 as Contact, bd as ContactCustomMetadata, ba as ContactID, bc as ContactStatus, bb as ContactType, ew as ContactWebhookEventType, bs as Conversation, bu as ConversationCustomMetadata, bQ as ConversationFeedback, bt as ConversationID, bP as ConversationSettings, bx as ConversationStatus, ex as ConversationWebhookEventType, e as CountResponsePagination, s as CreateAccountAccessTokenOptions, r as CreateAccountAccessTokenPayload, t as CreateAccountAccessTokenResponse, j as CreateAccountOptions, i as CreateAccountPayload, k as CreateAccountResponse, af as CreateBoilerplateCategoryOptions, ae as CreateBoilerplateCategoryPayload, ag as CreateBoilerplateCategoryResponse, a3 as CreateBoilerplateContentOptions, a2 as CreateBoilerplateContentPayload, a4 as CreateBoilerplateContentResponse, au as CreateChannelOptions, at as CreateChannelPayload, av as CreateChannelResponse, aS as CreateCompositionSectionOptions, aR as CreateCompositionSectionPayload, aT as CreateCompositionSectionResponse, bf as CreateContactOptions, be as CreateContactPayload, bg as CreateContactResponse, bS as CreateConversationFeedbackOptions, bR as CreateConversationFeedbackPayload, bT as CreateConversationFeedbackResponse, bz as CreateConversationOptions, by as CreateConversationPayload, bA as CreateConversationResponse, b1 as CreateEscalationOptions, b0 as CreateEscalationPayload, b2 as CreateEscalationResponse, cf as CreateImportOptions, ce as CreateImportPayload, cg as CreateImportResponse, c0 as CreateLabelOptions, b$ as CreateLabelPayload, c1 as CreateLabelResponse, dl as CreateMessageOptions, dk as CreateMessagePayload, dm as CreateMessageResponse, dE as CreateModelConfigOptions, dD as CreateModelConfigPayload, dF as CreateModelConfigResponse, dX as CreateNoteOptions, dW as CreateNotePayload, dY as CreateNoteResponse, ee as CreateUploadIncludeOptions, ef as CreateUploadOptions, eg as CreateUploadResponse, eF as CreateWebhookSubscriptionOptions, eE as CreateWebhookSubscriptionPayload, eG as CreateWebhookSubscriptionResponse, f as CurrentAccountID, d as CursorResponsePagination, as as CustomChannelCustomMetadata, u as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, v as DeleteAccountAccessTokenResponse, aw as DeleteChannelOptions, ax as DeleteChannelResponse, bh as DeleteContactOptions, bi as DeleteContactResponse, bU as DeleteConversationFeedbackOptions, bV as DeleteConversationFeedbackResponse, bB as DeleteConversationOptions, bC as DeleteConversationResponse, b7 as DeleteEscalationOptions, b8 as DeleteEscalationResponse, c2 as DeleteLabelOptions, c3 as DeleteLabelResponse, dn as DeleteMessageOptions, dp as DeleteMessageResponse, dG as DeleteModelConfigOptions, dH as DeleteModelConfigResponse, eh as DeleteUploadOptions, ei as DeleteUploadResponse, eH as DeleteWebhookSubscriptionOptions, eI as DeleteWebhookSubscriptionResponse, cI as DeleteWhatsappAccountTemplateOptions, cJ as DeleteWhatsappAccountTemplateResponse, a$ as Escalation, eq as EventWebhookOptions, w as GetAccountAccessTokenOptions, x as GetAccountAccessTokenResponse, E as GetAccountConversationSettingsOptions, F as GetAccountConversationSettingsResponse, M as GetAccountNotificationEventOptions, N as GetAccountNotificationEventResponse, G as GetAccountOptions, l as GetAccountResponse, _ as GetActionOptions, $ as GetActionResponse, ah as GetBoilerplateCategoryOptions, ai as GetBoilerplateCategoryResponse, a5 as GetBoilerplateContentOptions, a6 as GetBoilerplateContentResponse, aJ as GetChannelConversationSettingsOptions, aK as GetChannelConversationSettingsResponse, ay as GetChannelOptions, az as GetChannelResponse, aU as GetCompositionSectionOptions, aV as GetCompositionSectionResponse, bj as GetContactIncludeOptions, bk as GetContactOptions, bl as GetContactResponse, bm as GetContactVCFOptions, bW as GetConversationFeedbackOptions, bX as GetConversationFeedbackResponse, bD as GetConversationIncludeOptions, bE as GetConversationOptions, bF as GetConversationResponse, b3 as GetEscalationOptions, b4 as GetEscalationResponse, ch as GetImportOptions, ci as GetImportResponse, c4 as GetLabelOptions, c5 as GetLabelResponse, dq as GetMessageOptions, dr as GetMessageResponse, dL as GetModelConfigOptions, dM as GetModelConfigResponse, dQ as GetModelInterfaceOptions, dR as GetModelInterfaceResponse, dZ as GetNoteOptions, d_ as GetNoteResponse, e7 as GetSourceOptions, e8 as GetSourceResponse, ej as GetUploadIncludeOptions, ek as GetUploadOptions, el as GetUploadResponse, eJ as GetWebhookSubscriptionOptions, eK as GetWebhookSubscriptionResponse, cq as GetWhatsappAccountIncludeOptions, cr as GetWhatsappAccountOptions, cs as GetWhatsappAccountResponse, cK as GetWhatsappAccountTemplateOptions, cL as GetWhatsappAccountTemplateResponse, cx as GetWhatsappBusinessProfileOptions, cy as GetWhatsappBusinessProfileResponse, cD as GetWhatsappPhoneNumberIncludeOptions, cE as GetWhatsappPhoneNumberOptions, cF as GetWhatsappPhoneNumberResponse, cd as Import, cl as ImportID, cn as ImportStatus, cm as ImportType, ez as ImportWebhookEventType, b_ as Label, c6 as LabelID, d8 as LexicalDirection, dd as LexicalHeadingNode, dh as LexicalHorizontalRuleNode, d9 as LexicalIndent, db as LexicalLinkNode, df as LexicalListItemNode, dg as LexicalListNode, de as LexicalParagraphNode, dc as LexicalQuoteNode, dj as LexicalRootNode, da as LexicalTextNode, di as LexicalUploadNode, y as ListAccountAccessTokensOptions, z as ListAccountAccessTokensResponse, P as ListAccountNotificationEventsFilterOptions, Q as ListAccountNotificationEventsOptions, S as ListAccountNotificationEventsResponse, L as ListAccountsOptions, o as ListAccountsResponse, Y as ListActionsOptions, Z as ListActionsResponse, aj as ListBoilerplateCategoriesIncludeOptions, ak as ListBoilerplateCategoriesOptions, al as ListBoilerplateCategoriesResponse, a7 as ListBoilerplateContentsOptions, a8 as ListBoilerplateContentsResponse, aA as ListChannelsOptions, aB as ListChannelsResponse, aW as ListCompositionSectionsOptions, aX as ListCompositionSectionsResponse, bn as ListContactsOptions, bo as ListContactsResponse, bY as ListConversationFeedbackOptions, bZ as ListConversationFeedbackResponse, bI as ListConversationOptions, bH as ListConversationsFilterOptions, bG as ListConversationsIncludeOptions, bJ as ListConversationsResponse, b5 as ListEscalationsOptions, b6 as ListEscalationsResponse, cj as ListImportsOptions, ck as ListImportsResponse, c7 as ListLabelsIncludeOptions, c8 as ListLabelsOptions, c9 as ListLabelsResponse, ds as ListMessagesIncludeOptions, dt as ListMessagesOptions, du as ListMessagesResponse, dN as ListModelConfigsOptions, dO as ListModelConfigsResponse, dS as ListModelInterfacesOptions, dT as ListModelInterfacesResponse, d$ as ListNotesOptions, e0 as ListNotesResponse, e9 as ListSourcesOptions, ea as ListSourcesResponse, em as ListUploadsIncludeOptions, en as ListUploadsOptions, eo as ListUploadsResponse, eL as ListWebhookSubscriptionsOptions, eM as ListWebhookSubscriptionsResponse, cM as ListWhatsappAccountTemplatesOptions, cN as ListWhatsappAccountTemplatesResponse, ct as ListWhatsappAccountsOptions, cu as ListWhatsappAccountsResponse, cG as ListWhatsappPhoneNumbersOptions, cH as ListWhatsappPhoneNumbersResponse, d7 as Message, dB as MessageCustomMetadata, dA as MessageEventType, dv as MessageID, dw as MessageRole, dy as MessageStatus, dx as MessageType, dz as MessageVisibility, ey as MessageWebhookEventType, dC as ModelConfig, dP as ModelInterface, dU as ModelInterfaceID, dV as Note, e1 as NoteID, e5 as NotificationEvent, O as Options, R as ResponseData, b as ResponseMeta, c as ResponseTimestamp, aC as SendChannelSyncPayload, aD as SendgridChannelSyncOptions, aE as SendgridChannelSyncResponse, X as SortOptions, e6 as Source, ec as SourceAdornment, eb as SourceID, eN as TestWebhookSubscriptionOptions, eO as TestWebhookSubscriptionResponse, a as TransportOptions, bN as TriggerResponseConversationOptions, bO as TriggerResponseConversationResponse, I as UpdateAccountConversationSettingsOptions, H as UpdateAccountConversationSettingsPayload, J as UpdateAccountConversationSettingsResponse, m as UpdateAccountOptions, U as UpdateAccountPayload, n as UpdateAccountResponse, an as UpdateBoilerplateCategoryOptions, am as UpdateBoilerplateCategoryPayload, ao as UpdateBoilerplateCategoryResponse, aa as UpdateBoilerplateContentOptions, a9 as UpdateBoilerplateContentPayload, ab as UpdateBoilerplateContentResponse, aM as UpdateChannelConversationSettingsOptions, aL as UpdateChannelConversationSettingsPayload, aN as UpdateChannelConversationSettingsResponse, aG as UpdateChannelOptions, aF as UpdateChannelPayload, aH as UpdateChannelResponse, aZ as UpdateCompositionSectionOptions, aY as UpdateCompositionSectionPayload, a_ as UpdateCompositionSectionResponse, bq as UpdateContactOptions, bp as UpdateContactPayload, br as UpdateContactResponse, bL as UpdateConversationOptions, bK as UpdateConversationPayload, bM as UpdateConversationResponse, cb as UpdateLabelOptions, ca as UpdateLabelPayload, cc as UpdateLabelResponse, dJ as UpdateModelConfigOptions, dI as UpdateModelConfigPayload, dK as UpdateModelConfigResponse, e3 as UpdateNoteOptions, e2 as UpdateNotePayload, e4 as UpdateNoteResponse, cA as UpdateWhatsappBusinessProfileOptions, cz as UpdateWhatsappBusinessProfilePayload, cB as UpdateWhatsappBusinessProfileResponse, ed as Upload, ep as UploadID, cv as WHATSAPP_BUSINESS_PROFILE_VERTICAL, cS as WHATSAPP_TEMPLATE_CATEGORIES, cW as WHATSAPP_TEMPLATE_INDUSTRIES, cQ as WHATSAPP_TEMPLATE_LANGUAGES, d0 as WHATSAPP_TEMPLATE_QUALITY_SCORES, cO as WHATSAPP_TEMPLATE_STATUSES, cU as WHATSAPP_TEMPLATE_SUBCATEGORIES, cY as WHATSAPP_TEMPLATE_TOPICS, c_ as WHATSAPP_TEMPLATE_USECASES, eB as WebhookEventPayload, es as WebhookEventType, eC as WebhookResponse, eD as WebhookSubscription, eP as WebhookSubscriptionID, eA as WebhookSubscriptionWebhookEventType, co as WhatsappAccount, cp as WhatsappAccountDetail, d5 as WhatsappAccountTemplate, cw as WhatsappBusinessProfileDetail, d6 as WhatsappLibraryTemplate, cC as WhatsappPhoneNumber, d4 as WhatsappTemplateButton, cT as WhatsappTemplateCategory, cX as WhatsappTemplateIndustry, cR as WhatsappTemplateLanguage, d3 as WhatsappTemplateParameterFormat, d1 as WhatsappTemplateQualityScore, d2 as WhatsappTemplateRejectionReason, cP as WhatsappTemplateStatus, cV as WhatsappTemplateSubcategory, cZ as WhatsappTemplateTopic, c$ as WhatsappTemplateUseCase, C as default, er as eventWebhookSchema } from './Client-DE_bNRkN.cjs';
|
|
2
2
|
import { KyResponse, KyRequest } from 'ky';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
@@ -69,4 +69,7 @@ declare namespace index {
|
|
|
69
69
|
export { type index_ErrorResponse as ErrorResponse, type index_ErrorSourcePath as ErrorSourcePath, type index_ErrorSourcePrefix as ErrorSourcePrefix, type index_ErrorType as ErrorType, index_SupportError as SupportError };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
/** SDK Version */
|
|
73
|
+
declare const SDK_VERSION = "0.25.0";
|
|
74
|
+
|
|
75
|
+
export { DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ErrorSourcePath, type ErrorSourcePrefix, type ErrorType, SDK_VERSION, SupportError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Account, p as AccountAccessToken, q as AccountAccessTokenID, es as AccountAccessTokenWebhookEventType, B as AccountConversationSettings, h as AccountID, K as AccountNotificationEvent, et as AccountNotificationEventEventType, g as AccountStatus, er as AccountWebhookWebhookEventType, T as Action, V as ActionID, W as ActionStatus, bt as ActiveConversationStatus, aa as BoilerplateCategory, ab as BoilerplateCategoryID, _ as BoilerplateContent, $ as BoilerplateContentID, an as Channel, aG as ChannelConversationSettings, ao as ChannelID, ap as ChannelStatus, C as Client, aM as CompositionSection, aN as CompositionSectionID, aO as CompositionSectionLocation, bu as ConcludedConversationStatus, b7 as Contact, bb as ContactCustomMetadata, b8 as ContactID, ba as ContactStatus, b9 as ContactType, eu as ContactWebhookEventType, bq as Conversation, bs as ConversationCustomMetadata, bO as ConversationFeedback, br as ConversationID, bN as ConversationSettings, bv as ConversationStatus, ev as ConversationWebhookEventType, e as CountResponsePagination, s as CreateAccountAccessTokenOptions, r as CreateAccountAccessTokenPayload, t as CreateAccountAccessTokenResponse, j as CreateAccountOptions, i as CreateAccountPayload, k as CreateAccountResponse, ad as CreateBoilerplateCategoryOptions, ac as CreateBoilerplateCategoryPayload, ae as CreateBoilerplateCategoryResponse, a1 as CreateBoilerplateContentOptions, a0 as CreateBoilerplateContentPayload, a2 as CreateBoilerplateContentResponse, as as CreateChannelOptions, ar as CreateChannelPayload, at as CreateChannelResponse, aQ as CreateCompositionSectionOptions, aP as CreateCompositionSectionPayload, aR as CreateCompositionSectionResponse, bd as CreateContactOptions, bc as CreateContactPayload, be as CreateContactResponse, bQ as CreateConversationFeedbackOptions, bP as CreateConversationFeedbackPayload, bR as CreateConversationFeedbackResponse, bx as CreateConversationOptions, bw as CreateConversationPayload, by as CreateConversationResponse, a$ as CreateEscalationOptions, a_ as CreateEscalationPayload, b0 as CreateEscalationResponse, cd as CreateImportOptions, cc as CreateImportPayload, ce as CreateImportResponse, b_ as CreateLabelOptions, bZ as CreateLabelPayload, b$ as CreateLabelResponse, dj as CreateMessageOptions, di as CreateMessagePayload, dk as CreateMessageResponse, dC as CreateModelConfigOptions, dB as CreateModelConfigPayload, dD as CreateModelConfigResponse, dV as CreateNoteOptions, dU as CreateNotePayload, dW as CreateNoteResponse, ec as CreateUploadIncludeOptions, ed as CreateUploadOptions, ee as CreateUploadResponse, eD as CreateWebhookSubscriptionOptions, eC as CreateWebhookSubscriptionPayload, eE as CreateWebhookSubscriptionResponse, f as CurrentAccountID, d as CursorResponsePagination, aq as CustomChannelCustomMetadata, u as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, v as DeleteAccountAccessTokenResponse, au as DeleteChannelOptions, av as DeleteChannelResponse, bf as DeleteContactOptions, bg as DeleteContactResponse, bS as DeleteConversationFeedbackOptions, bT as DeleteConversationFeedbackResponse, bz as DeleteConversationOptions, bA as DeleteConversationResponse, b5 as DeleteEscalationOptions, b6 as DeleteEscalationResponse, c0 as DeleteLabelOptions, c1 as DeleteLabelResponse, dl as DeleteMessageOptions, dm as DeleteMessageResponse, dE as DeleteModelConfigOptions, dF as DeleteModelConfigResponse, ef as DeleteUploadOptions, eg as DeleteUploadResponse, eF as DeleteWebhookSubscriptionOptions, eG as DeleteWebhookSubscriptionResponse, cG as DeleteWhatsappAccountTemplateOptions, cH as DeleteWhatsappAccountTemplateResponse, aZ as Escalation, eo as EventWebhookOptions, w as GetAccountAccessTokenOptions, x as GetAccountAccessTokenResponse, E as GetAccountConversationSettingsOptions, F as GetAccountConversationSettingsResponse, M as GetAccountNotificationEventOptions, N as GetAccountNotificationEventResponse, G as GetAccountOptions, l as GetAccountResponse, af as GetBoilerplateCategoryOptions, ag as GetBoilerplateCategoryResponse, a3 as GetBoilerplateContentOptions, a4 as GetBoilerplateContentResponse, aH as GetChannelConversationSettingsOptions, aI as GetChannelConversationSettingsResponse, aw as GetChannelOptions, ax as GetChannelResponse, aS as GetCompositionSectionOptions, aT as GetCompositionSectionResponse, bh as GetContactIncludeOptions, bi as GetContactOptions, bj as GetContactResponse, bk as GetContactVCFOptions, bU as GetConversationFeedbackOptions, bV as GetConversationFeedbackResponse, bB as GetConversationIncludeOptions, bC as GetConversationOptions, bD as GetConversationResponse, b1 as GetEscalationOptions, b2 as GetEscalationResponse, cf as GetImportOptions, cg as GetImportResponse, c2 as GetLabelOptions, c3 as GetLabelResponse, dn as GetMessageOptions, dp as GetMessageResponse, dJ as GetModelConfigOptions, dK as GetModelConfigResponse, dO as GetModelInterfaceOptions, dP as GetModelInterfaceResponse, dX as GetNoteOptions, dY as GetNoteResponse, e5 as GetSourceOptions, e6 as GetSourceResponse, eh as GetUploadIncludeOptions, ei as GetUploadOptions, ej as GetUploadResponse, eH as GetWebhookSubscriptionOptions, eI as GetWebhookSubscriptionResponse, co as GetWhatsappAccountIncludeOptions, cp as GetWhatsappAccountOptions, cq as GetWhatsappAccountResponse, cI as GetWhatsappAccountTemplateOptions, cJ as GetWhatsappAccountTemplateResponse, cv as GetWhatsappBusinessProfileOptions, cw as GetWhatsappBusinessProfileResponse, cB as GetWhatsappPhoneNumberIncludeOptions, cC as GetWhatsappPhoneNumberOptions, cD as GetWhatsappPhoneNumberResponse, cb as Import, cj as ImportID, cl as ImportStatus, ck as ImportType, ex as ImportWebhookEventType, bY as Label, c4 as LabelID, d6 as LexicalDirection, db as LexicalHeadingNode, df as LexicalHorizontalRuleNode, d7 as LexicalIndent, d9 as LexicalLinkNode, dd as LexicalListItemNode, de as LexicalListNode, dc as LexicalParagraphNode, da as LexicalQuoteNode, dh as LexicalRootNode, d8 as LexicalTextNode, dg as LexicalUploadNode, y as ListAccountAccessTokensOptions, z as ListAccountAccessTokensResponse, P as ListAccountNotificationEventsFilterOptions, Q as ListAccountNotificationEventsOptions, S as ListAccountNotificationEventsResponse, L as ListAccountsOptions, o as ListAccountsResponse, Y as ListActionsOptions, Z as ListActionsResponse, ah as ListBoilerplateCategoriesIncludeOptions, ai as ListBoilerplateCategoriesOptions, aj as ListBoilerplateCategoriesResponse, a5 as ListBoilerplateContentsOptions, a6 as ListBoilerplateContentsResponse, ay as ListChannelsOptions, az as ListChannelsResponse, aU as ListCompositionSectionsOptions, aV as ListCompositionSectionsResponse, bl as ListContactsOptions, bm as ListContactsResponse, bW as ListConversationFeedbackOptions, bX as ListConversationFeedbackResponse, bG as ListConversationOptions, bF as ListConversationsFilterOptions, bE as ListConversationsIncludeOptions, bH as ListConversationsResponse, b3 as ListEscalationsOptions, b4 as ListEscalationsResponse, ch as ListImportsOptions, ci as ListImportsResponse, c5 as ListLabelsIncludeOptions, c6 as ListLabelsOptions, c7 as ListLabelsResponse, dq as ListMessagesIncludeOptions, dr as ListMessagesOptions, ds as ListMessagesResponse, dL as ListModelConfigsOptions, dM as ListModelConfigsResponse, dQ as ListModelInterfacesOptions, dR as ListModelInterfacesResponse, dZ as ListNotesOptions, d_ as ListNotesResponse, e7 as ListSourcesOptions, e8 as ListSourcesResponse, ek as ListUploadsIncludeOptions, el as ListUploadsOptions, em as ListUploadsResponse, eJ as ListWebhookSubscriptionsOptions, eK as ListWebhookSubscriptionsResponse, cK as ListWhatsappAccountTemplatesOptions, cL as ListWhatsappAccountTemplatesResponse, cr as ListWhatsappAccountsOptions, cs as ListWhatsappAccountsResponse, cE as ListWhatsappPhoneNumbersOptions, cF as ListWhatsappPhoneNumbersResponse, d5 as Message, dz as MessageCustomMetadata, dy as MessageEventType, dt as MessageID, du as MessageRole, dw as MessageStatus, dv as MessageType, dx as MessageVisibility, ew as MessageWebhookEventType, dA as ModelConfig, dN as ModelInterface, dS as ModelInterfaceID, dT as Note, d$ as NoteID, e3 as NotificationEvent, O as Options, R as ResponseData, b as ResponseMeta, c as ResponseTimestamp, aA as SendChannelSyncPayload, aB as SendgridChannelSyncOptions, aC as SendgridChannelSyncResponse, X as SortOptions, e4 as Source, ea as SourceAdornment, e9 as SourceID, eL as TestWebhookSubscriptionOptions, eM as TestWebhookSubscriptionResponse, a as TransportOptions, bL as TriggerResponseConversationOptions, bM as TriggerResponseConversationResponse, I as UpdateAccountConversationSettingsOptions, H as UpdateAccountConversationSettingsPayload, J as UpdateAccountConversationSettingsResponse, m as UpdateAccountOptions, U as UpdateAccountPayload, n as UpdateAccountResponse, al as UpdateBoilerplateCategoryOptions, ak as UpdateBoilerplateCategoryPayload, am as UpdateBoilerplateCategoryResponse, a8 as UpdateBoilerplateContentOptions, a7 as UpdateBoilerplateContentPayload, a9 as UpdateBoilerplateContentResponse, aK as UpdateChannelConversationSettingsOptions, aJ as UpdateChannelConversationSettingsPayload, aL as UpdateChannelConversationSettingsResponse, aE as UpdateChannelOptions, aD as UpdateChannelPayload, aF as UpdateChannelResponse, aX as UpdateCompositionSectionOptions, aW as UpdateCompositionSectionPayload, aY as UpdateCompositionSectionResponse, bo as UpdateContactOptions, bn as UpdateContactPayload, bp as UpdateContactResponse, bJ as UpdateConversationOptions, bI as UpdateConversationPayload, bK as UpdateConversationResponse, c9 as UpdateLabelOptions, c8 as UpdateLabelPayload, ca as UpdateLabelResponse, dH as UpdateModelConfigOptions, dG as UpdateModelConfigPayload, dI as UpdateModelConfigResponse, e1 as UpdateNoteOptions, e0 as UpdateNotePayload, e2 as UpdateNoteResponse, cy as UpdateWhatsappBusinessProfileOptions, cx as UpdateWhatsappBusinessProfilePayload, cz as UpdateWhatsappBusinessProfileResponse, eb as Upload, en as UploadID, ct as WHATSAPP_BUSINESS_PROFILE_VERTICAL, cQ as WHATSAPP_TEMPLATE_CATEGORIES, cU as WHATSAPP_TEMPLATE_INDUSTRIES, cO as WHATSAPP_TEMPLATE_LANGUAGES, c_ as WHATSAPP_TEMPLATE_QUALITY_SCORES, cM as WHATSAPP_TEMPLATE_STATUSES, cS as WHATSAPP_TEMPLATE_SUBCATEGORIES, cW as WHATSAPP_TEMPLATE_TOPICS, cY as WHATSAPP_TEMPLATE_USECASES, ez as WebhookEventPayload, eq as WebhookEventType, eA as WebhookResponse, eB as WebhookSubscription, eN as WebhookSubscriptionID, ey as WebhookSubscriptionWebhookEventType, cm as WhatsappAccount, cn as WhatsappAccountDetail, d3 as WhatsappAccountTemplate, cu as WhatsappBusinessProfileDetail, d4 as WhatsappLibraryTemplate, cA as WhatsappPhoneNumber, d2 as WhatsappTemplateButton, cR as WhatsappTemplateCategory, cV as WhatsappTemplateIndustry, cP as WhatsappTemplateLanguage, d1 as WhatsappTemplateParameterFormat, c$ as WhatsappTemplateQualityScore, d0 as WhatsappTemplateRejectionReason, cN as WhatsappTemplateStatus, cT as WhatsappTemplateSubcategory, cX as WhatsappTemplateTopic, cZ as WhatsappTemplateUseCase, C as default, ep as eventWebhookSchema } from './Client-CZ3Y0jmo.js';
|
|
1
|
+
export { A as Account, p as AccountAccessToken, q as AccountAccessTokenID, eu as AccountAccessTokenWebhookEventType, B as AccountConversationSettings, h as AccountID, K as AccountNotificationEvent, ev as AccountNotificationEventEventType, g as AccountStatus, et as AccountWebhookWebhookEventType, T as Action, V as ActionID, W as ActionStatus, bv as ActiveConversationStatus, ac as BoilerplateCategory, ad as BoilerplateCategoryID, a0 as BoilerplateContent, a1 as BoilerplateContentID, ap as Channel, aI as ChannelConversationSettings, aq as ChannelID, ar as ChannelStatus, C as Client, aO as CompositionSection, aP as CompositionSectionID, aQ as CompositionSectionLocation, bw as ConcludedConversationStatus, b9 as Contact, bd as ContactCustomMetadata, ba as ContactID, bc as ContactStatus, bb as ContactType, ew as ContactWebhookEventType, bs as Conversation, bu as ConversationCustomMetadata, bQ as ConversationFeedback, bt as ConversationID, bP as ConversationSettings, bx as ConversationStatus, ex as ConversationWebhookEventType, e as CountResponsePagination, s as CreateAccountAccessTokenOptions, r as CreateAccountAccessTokenPayload, t as CreateAccountAccessTokenResponse, j as CreateAccountOptions, i as CreateAccountPayload, k as CreateAccountResponse, af as CreateBoilerplateCategoryOptions, ae as CreateBoilerplateCategoryPayload, ag as CreateBoilerplateCategoryResponse, a3 as CreateBoilerplateContentOptions, a2 as CreateBoilerplateContentPayload, a4 as CreateBoilerplateContentResponse, au as CreateChannelOptions, at as CreateChannelPayload, av as CreateChannelResponse, aS as CreateCompositionSectionOptions, aR as CreateCompositionSectionPayload, aT as CreateCompositionSectionResponse, bf as CreateContactOptions, be as CreateContactPayload, bg as CreateContactResponse, bS as CreateConversationFeedbackOptions, bR as CreateConversationFeedbackPayload, bT as CreateConversationFeedbackResponse, bz as CreateConversationOptions, by as CreateConversationPayload, bA as CreateConversationResponse, b1 as CreateEscalationOptions, b0 as CreateEscalationPayload, b2 as CreateEscalationResponse, cf as CreateImportOptions, ce as CreateImportPayload, cg as CreateImportResponse, c0 as CreateLabelOptions, b$ as CreateLabelPayload, c1 as CreateLabelResponse, dl as CreateMessageOptions, dk as CreateMessagePayload, dm as CreateMessageResponse, dE as CreateModelConfigOptions, dD as CreateModelConfigPayload, dF as CreateModelConfigResponse, dX as CreateNoteOptions, dW as CreateNotePayload, dY as CreateNoteResponse, ee as CreateUploadIncludeOptions, ef as CreateUploadOptions, eg as CreateUploadResponse, eF as CreateWebhookSubscriptionOptions, eE as CreateWebhookSubscriptionPayload, eG as CreateWebhookSubscriptionResponse, f as CurrentAccountID, d as CursorResponsePagination, as as CustomChannelCustomMetadata, u as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, v as DeleteAccountAccessTokenResponse, aw as DeleteChannelOptions, ax as DeleteChannelResponse, bh as DeleteContactOptions, bi as DeleteContactResponse, bU as DeleteConversationFeedbackOptions, bV as DeleteConversationFeedbackResponse, bB as DeleteConversationOptions, bC as DeleteConversationResponse, b7 as DeleteEscalationOptions, b8 as DeleteEscalationResponse, c2 as DeleteLabelOptions, c3 as DeleteLabelResponse, dn as DeleteMessageOptions, dp as DeleteMessageResponse, dG as DeleteModelConfigOptions, dH as DeleteModelConfigResponse, eh as DeleteUploadOptions, ei as DeleteUploadResponse, eH as DeleteWebhookSubscriptionOptions, eI as DeleteWebhookSubscriptionResponse, cI as DeleteWhatsappAccountTemplateOptions, cJ as DeleteWhatsappAccountTemplateResponse, a$ as Escalation, eq as EventWebhookOptions, w as GetAccountAccessTokenOptions, x as GetAccountAccessTokenResponse, E as GetAccountConversationSettingsOptions, F as GetAccountConversationSettingsResponse, M as GetAccountNotificationEventOptions, N as GetAccountNotificationEventResponse, G as GetAccountOptions, l as GetAccountResponse, _ as GetActionOptions, $ as GetActionResponse, ah as GetBoilerplateCategoryOptions, ai as GetBoilerplateCategoryResponse, a5 as GetBoilerplateContentOptions, a6 as GetBoilerplateContentResponse, aJ as GetChannelConversationSettingsOptions, aK as GetChannelConversationSettingsResponse, ay as GetChannelOptions, az as GetChannelResponse, aU as GetCompositionSectionOptions, aV as GetCompositionSectionResponse, bj as GetContactIncludeOptions, bk as GetContactOptions, bl as GetContactResponse, bm as GetContactVCFOptions, bW as GetConversationFeedbackOptions, bX as GetConversationFeedbackResponse, bD as GetConversationIncludeOptions, bE as GetConversationOptions, bF as GetConversationResponse, b3 as GetEscalationOptions, b4 as GetEscalationResponse, ch as GetImportOptions, ci as GetImportResponse, c4 as GetLabelOptions, c5 as GetLabelResponse, dq as GetMessageOptions, dr as GetMessageResponse, dL as GetModelConfigOptions, dM as GetModelConfigResponse, dQ as GetModelInterfaceOptions, dR as GetModelInterfaceResponse, dZ as GetNoteOptions, d_ as GetNoteResponse, e7 as GetSourceOptions, e8 as GetSourceResponse, ej as GetUploadIncludeOptions, ek as GetUploadOptions, el as GetUploadResponse, eJ as GetWebhookSubscriptionOptions, eK as GetWebhookSubscriptionResponse, cq as GetWhatsappAccountIncludeOptions, cr as GetWhatsappAccountOptions, cs as GetWhatsappAccountResponse, cK as GetWhatsappAccountTemplateOptions, cL as GetWhatsappAccountTemplateResponse, cx as GetWhatsappBusinessProfileOptions, cy as GetWhatsappBusinessProfileResponse, cD as GetWhatsappPhoneNumberIncludeOptions, cE as GetWhatsappPhoneNumberOptions, cF as GetWhatsappPhoneNumberResponse, cd as Import, cl as ImportID, cn as ImportStatus, cm as ImportType, ez as ImportWebhookEventType, b_ as Label, c6 as LabelID, d8 as LexicalDirection, dd as LexicalHeadingNode, dh as LexicalHorizontalRuleNode, d9 as LexicalIndent, db as LexicalLinkNode, df as LexicalListItemNode, dg as LexicalListNode, de as LexicalParagraphNode, dc as LexicalQuoteNode, dj as LexicalRootNode, da as LexicalTextNode, di as LexicalUploadNode, y as ListAccountAccessTokensOptions, z as ListAccountAccessTokensResponse, P as ListAccountNotificationEventsFilterOptions, Q as ListAccountNotificationEventsOptions, S as ListAccountNotificationEventsResponse, L as ListAccountsOptions, o as ListAccountsResponse, Y as ListActionsOptions, Z as ListActionsResponse, aj as ListBoilerplateCategoriesIncludeOptions, ak as ListBoilerplateCategoriesOptions, al as ListBoilerplateCategoriesResponse, a7 as ListBoilerplateContentsOptions, a8 as ListBoilerplateContentsResponse, aA as ListChannelsOptions, aB as ListChannelsResponse, aW as ListCompositionSectionsOptions, aX as ListCompositionSectionsResponse, bn as ListContactsOptions, bo as ListContactsResponse, bY as ListConversationFeedbackOptions, bZ as ListConversationFeedbackResponse, bI as ListConversationOptions, bH as ListConversationsFilterOptions, bG as ListConversationsIncludeOptions, bJ as ListConversationsResponse, b5 as ListEscalationsOptions, b6 as ListEscalationsResponse, cj as ListImportsOptions, ck as ListImportsResponse, c7 as ListLabelsIncludeOptions, c8 as ListLabelsOptions, c9 as ListLabelsResponse, ds as ListMessagesIncludeOptions, dt as ListMessagesOptions, du as ListMessagesResponse, dN as ListModelConfigsOptions, dO as ListModelConfigsResponse, dS as ListModelInterfacesOptions, dT as ListModelInterfacesResponse, d$ as ListNotesOptions, e0 as ListNotesResponse, e9 as ListSourcesOptions, ea as ListSourcesResponse, em as ListUploadsIncludeOptions, en as ListUploadsOptions, eo as ListUploadsResponse, eL as ListWebhookSubscriptionsOptions, eM as ListWebhookSubscriptionsResponse, cM as ListWhatsappAccountTemplatesOptions, cN as ListWhatsappAccountTemplatesResponse, ct as ListWhatsappAccountsOptions, cu as ListWhatsappAccountsResponse, cG as ListWhatsappPhoneNumbersOptions, cH as ListWhatsappPhoneNumbersResponse, d7 as Message, dB as MessageCustomMetadata, dA as MessageEventType, dv as MessageID, dw as MessageRole, dy as MessageStatus, dx as MessageType, dz as MessageVisibility, ey as MessageWebhookEventType, dC as ModelConfig, dP as ModelInterface, dU as ModelInterfaceID, dV as Note, e1 as NoteID, e5 as NotificationEvent, O as Options, R as ResponseData, b as ResponseMeta, c as ResponseTimestamp, aC as SendChannelSyncPayload, aD as SendgridChannelSyncOptions, aE as SendgridChannelSyncResponse, X as SortOptions, e6 as Source, ec as SourceAdornment, eb as SourceID, eN as TestWebhookSubscriptionOptions, eO as TestWebhookSubscriptionResponse, a as TransportOptions, bN as TriggerResponseConversationOptions, bO as TriggerResponseConversationResponse, I as UpdateAccountConversationSettingsOptions, H as UpdateAccountConversationSettingsPayload, J as UpdateAccountConversationSettingsResponse, m as UpdateAccountOptions, U as UpdateAccountPayload, n as UpdateAccountResponse, an as UpdateBoilerplateCategoryOptions, am as UpdateBoilerplateCategoryPayload, ao as UpdateBoilerplateCategoryResponse, aa as UpdateBoilerplateContentOptions, a9 as UpdateBoilerplateContentPayload, ab as UpdateBoilerplateContentResponse, aM as UpdateChannelConversationSettingsOptions, aL as UpdateChannelConversationSettingsPayload, aN as UpdateChannelConversationSettingsResponse, aG as UpdateChannelOptions, aF as UpdateChannelPayload, aH as UpdateChannelResponse, aZ as UpdateCompositionSectionOptions, aY as UpdateCompositionSectionPayload, a_ as UpdateCompositionSectionResponse, bq as UpdateContactOptions, bp as UpdateContactPayload, br as UpdateContactResponse, bL as UpdateConversationOptions, bK as UpdateConversationPayload, bM as UpdateConversationResponse, cb as UpdateLabelOptions, ca as UpdateLabelPayload, cc as UpdateLabelResponse, dJ as UpdateModelConfigOptions, dI as UpdateModelConfigPayload, dK as UpdateModelConfigResponse, e3 as UpdateNoteOptions, e2 as UpdateNotePayload, e4 as UpdateNoteResponse, cA as UpdateWhatsappBusinessProfileOptions, cz as UpdateWhatsappBusinessProfilePayload, cB as UpdateWhatsappBusinessProfileResponse, ed as Upload, ep as UploadID, cv as WHATSAPP_BUSINESS_PROFILE_VERTICAL, cS as WHATSAPP_TEMPLATE_CATEGORIES, cW as WHATSAPP_TEMPLATE_INDUSTRIES, cQ as WHATSAPP_TEMPLATE_LANGUAGES, d0 as WHATSAPP_TEMPLATE_QUALITY_SCORES, cO as WHATSAPP_TEMPLATE_STATUSES, cU as WHATSAPP_TEMPLATE_SUBCATEGORIES, cY as WHATSAPP_TEMPLATE_TOPICS, c_ as WHATSAPP_TEMPLATE_USECASES, eB as WebhookEventPayload, es as WebhookEventType, eC as WebhookResponse, eD as WebhookSubscription, eP as WebhookSubscriptionID, eA as WebhookSubscriptionWebhookEventType, co as WhatsappAccount, cp as WhatsappAccountDetail, d5 as WhatsappAccountTemplate, cw as WhatsappBusinessProfileDetail, d6 as WhatsappLibraryTemplate, cC as WhatsappPhoneNumber, d4 as WhatsappTemplateButton, cT as WhatsappTemplateCategory, cX as WhatsappTemplateIndustry, cR as WhatsappTemplateLanguage, d3 as WhatsappTemplateParameterFormat, d1 as WhatsappTemplateQualityScore, d2 as WhatsappTemplateRejectionReason, cP as WhatsappTemplateStatus, cV as WhatsappTemplateSubcategory, cZ as WhatsappTemplateTopic, c$ as WhatsappTemplateUseCase, C as default, er as eventWebhookSchema } from './Client-DE_bNRkN.js';
|
|
2
2
|
import { KyResponse, KyRequest } from 'ky';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
@@ -69,4 +69,7 @@ declare namespace index {
|
|
|
69
69
|
export { type index_ErrorResponse as ErrorResponse, type index_ErrorSourcePath as ErrorSourcePath, type index_ErrorSourcePrefix as ErrorSourcePrefix, type index_ErrorType as ErrorType, index_SupportError as SupportError };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
/** SDK Version */
|
|
73
|
+
declare const SDK_VERSION = "0.25.0";
|
|
74
|
+
|
|
75
|
+
export { DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ErrorSourcePath, type ErrorSourcePrefix, type ErrorType, SDK_VERSION, SupportError };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,c as t,d as p,e as m,f as r}from"./chunk-
|
|
1
|
+
import{a as o,c as t,d as p,e as m,f as r}from"./chunk-RTRINZVE.js";var e={};o(e,{SupportError:()=>p});var Xr=["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 pe=["PENDING","APPROVED","REJECTED","IN_APPEAL","PAUSED","PENDING_DELETION","DELETED","DISABLED","LIMIT_EXCEEDED"],me=["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"],ae=["AUTHENTICATION","MARKETING","UTILITY"],fe=["ORDER_DETAILS","ORDER_STATUS"],xe=["E_COMMERCE","FINANCIAL_SERVICES"],Ee=["ACCOUNT_UPDATES","CUSTOMER_FEEDBACK","EVENT_REMINDER","FIXED_TEMPLATE_PRICE_TEST","IDENTITY_VERIFICATION","ORDER_MANAGEMENT","PAYMENTS"],se=["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"],Te=["GREEN","YELLOW","RED","UNKNOWN"];var No="0.25.0";export{r as Client,t as DEFAULT_SUPPORT_BASE_URL,e as Error,No as SDK_VERSION,p as SupportError,Xr as WHATSAPP_BUSINESS_PROFILE_VERTICAL,ae as WHATSAPP_TEMPLATE_CATEGORIES,xe as WHATSAPP_TEMPLATE_INDUSTRIES,me as WHATSAPP_TEMPLATE_LANGUAGES,Te as WHATSAPP_TEMPLATE_QUALITY_SCORES,pe as WHATSAPP_TEMPLATE_STATUSES,fe as WHATSAPP_TEMPLATE_SUBCATEGORIES,Ee as WHATSAPP_TEMPLATE_TOPICS,se as WHATSAPP_TEMPLATE_USECASES,r as default,m as eventWebhookSchema};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@great-detail/support-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JavaScript SDK for the Great Detail Support System",
|
|
6
6
|
"author": "Great Detail Ltd <info@greatdetail.com>",
|
|
@@ -69,6 +69,8 @@
|
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsup --entry src/index.ts --entry src/cli.ts --entry src/cli/index.ts --format cjs,esm --minify --dts",
|
|
71
71
|
"changeset": "changeset",
|
|
72
|
+
"gen": "pnpm run --parallel /^gen:.*/",
|
|
73
|
+
"gen:static": "tsx gen-static.ts",
|
|
72
74
|
"fix": "npm-run-all fix:*",
|
|
73
75
|
"fix:eslint": "eslint . --fix",
|
|
74
76
|
"fix:prettier": "prettier --write .",
|
package/dist/chunk-N2FWKT3O.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var et=Object.defineProperty;var st=(s,t)=>{for(var e in t)et(s,e,{get:t[e],enumerable:!0})};var m=class{getHeaders(){return{}}};var z="SUPPORT_ACCESS_TOKEN",Y="SUPPORT_KEY_NAME",Q="SUPPORT_KEY_PASSWORD",H="SUPPORT_SIGNING_KEY",J="SUPPORT_BASE_URL";var u=class{name;#t;constructor({name:t=process.env[Y],password:e=process.env[Q]}={}){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 d=class{#t;constructor({token:t=process.env[z]}={}){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 X="https://api.support.greatdetail.com",Z={"x-powered-by":"GDS/JavaScript"};var V=class extends Error{constructor(e,o,{requestID:n,body:r,cause:i}){super(`GDS(ERR): [${e.status}] ${o.method}:${e.url}${r?" - "+r:""}`,{cause:i});this.response=e;this.request=o;this.requestID=n}requestID};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 l=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})}};var h=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 C=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 g=class{constructor(t){this._transport=t}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 b=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})}};var R=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})}};var v=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 T=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",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 A=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:r={}}={}){return this._transport.send("v1/conversations",{...r,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 _=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 E=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 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 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 G=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 D=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:r,language:i,request:p={}}={}){return this._transport.send(`v1/integrations/whatsapp/accounts/${t}/templates`,{...p,method:"GET",searchParams:this._transport.query.build({filter:{search:e,status:o,quality:n,category:r,language:i}})})}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 k=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 P=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 F=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 x=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 W=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 w=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 i of r)n.push(["category",i])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var N=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 ot,{HTTPError as nt}from"ky";function c(s){return typeof s=="function"&&(s=s()),typeof s.toString=="function"?s.toString():typeof s=="string"?s:String(s)}var M=class s{static _filterExemptColumns=["filter"];static build({sort:t,pagination:e,filter:o,include:n,custom:r}){return[...Object.entries(o??{}).flatMap(([i,p])=>s._filterExemptColumns.includes(i)?[]:this.query(`filter[${i}]`,p)),...this.query("filter",o?.filter),...Object.entries(n??{}).flatMap(([i,p])=>p?this.query("include",i):[]),...Object.entries(t??{}).flatMap(([i,p])=>p===void 0?[]:this.query("sort",(p==="desc"?"-":"")+c(i))),...this.paginationCursor(e),...this.query("page[size]",e?.size),...Object.entries(r??{}).flatMap(([i,p])=>this.query(i,p))]}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,c(n)]);return o}static paginationCursor({before:t,after:e,preferred:o="after"}={}){let n=[];if(t===void 0&&e===void 0)return n;let r=t?{dir:"before",value:c(t)}:void 0,i=e?{dir:"after",value:c(e)}:void 0,p=o==="after"?i||r:r||i;return p&&n.push([`page[${p.dir}]`,p.value]),n}};var B=class{client;options;query=M;constructor({baseURL:t,authentication:e,...o}){this.options={authentication:e,baseURL:t},this.client=ot.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,r=>r.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,i=this.client.extend({headers:{...n.getHeaders(),"x-request-id":o}})(t,e).catch(async p=>{throw p instanceof nt?new V(p.response,p.request,{requestID:o,body:await p.response.text(),cause:p}):p});return{requestID:o,response:()=>i,json:async()=>(await i).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 r of t)n.append("file",r);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"})}};var j=class{constructor(t){this._transport=t}async event({key:t=process.env[H],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."+H);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}=tt.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 $=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 K=class s{static DEFAULT_BASE_URL=X;static PublicAuthentication=m;static BasicAuthentication=u;static BearerAuthentication=d;_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,{baseURL:e,...o}={}){this._transport=new B({authentication:t,...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new h(this._transport),this.accountConversationSettings=new C(this._transport),this.accountNotificationEvent=new f(this._transport),this.action=new g(this._transport),this.boilerplateCategory=new b(this._transport),this.boilerplateContent=new R(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new T(this._transport),this.contact=new I(this._transport),this.conversation=new A(this._transport),this.conversationContext=new _(this._transport),this.conversationFeedback=new E(this._transport),this.escalation=new y(this._transport),this.label=new k(this._transport),this.import=new S(this._transport),this.integration={whatsapp:{account:new U(this._transport),phoneNumber:new D(this._transport),businessProfile:new G(this._transport),template:new L(this._transport)}},this.message=new P(this._transport),this.modelConfig=new F(this._transport),this.modelInterface=new x(this._transport),this.note=new W(this._transport),this.source=new w(this._transport),this.statistics=new N(this._transport),this.upload=new q(this._transport),this.webhook=new j(this._transport),this.webhookSubscription=new $(this._transport)}static getBaseURL(){return process.env[J]??this.DEFAULT_BASE_URL}$request(t,e){return this._transport.send(t,e)}};export{st as a,m as b,X as c,V as d,tt as e,K as f};
|