@great-detail/support-sdk 0.18.18 → 0.18.20

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.
@@ -512,6 +512,7 @@ type Conversation = {
512
512
 
513
513
  type MessageID = `msg${string}` | (string & NonNullable<unknown>);
514
514
  type MessageRole = "user" | "assistant";
515
+ type MessageType = "text" | "media" | "richtext";
515
516
  type MessageStatus = "PotentialMessageStatus" | "SendingMessageStatus" | "SentMessageStatus" | "ReceivedMessageStatus" | "FailedMessageStatus";
516
517
  type MessageEventType = "ReadMessageEventType" | "ReceivedMessageEventType" | "SentMessageEventType";
517
518
  type Message = {
@@ -2331,6 +2332,7 @@ interface ListChannelMessagesIncludeOptions {
2331
2332
  }
2332
2333
  interface ListChannelMessagesOptions<C extends ListChannelMessagesIncludeOptions> {
2333
2334
  limit?: number;
2335
+ type?: MessageType;
2334
2336
  include?: C;
2335
2337
  request?: SendOptions;
2336
2338
  }
@@ -2358,6 +2360,7 @@ interface ListConversationMessagesIncludeOptions {
2358
2360
  }
2359
2361
  interface ListConversationMessagesOptions<C extends ListConversationMessagesIncludeOptions> {
2360
2362
  limit?: number;
2363
+ type?: MessageType;
2361
2364
  include?: C;
2362
2365
  request?: SendOptions;
2363
2366
  }
@@ -2385,6 +2388,7 @@ interface ListMessagesIncludeOptions {
2385
2388
  }
2386
2389
  interface ListMessagesOptions<C extends ListMessagesIncludeOptions> {
2387
2390
  limit?: number;
2391
+ type?: MessageType;
2388
2392
  include?: C;
2389
2393
  request?: SendOptions;
2390
2394
  }
@@ -2404,15 +2408,15 @@ declare class MessageAPI {
2404
2408
  response: () => Promise<ky.KyResponse<GetMessageResponse>>;
2405
2409
  json: () => Promise<GetMessageResponse>;
2406
2410
  };
2407
- list<C extends ListMessagesIncludeOptions>({ limit, include, request, }?: ListMessagesOptions<C>): {
2411
+ list<C extends ListMessagesIncludeOptions>({ limit, include, type, request, }?: ListMessagesOptions<C>): {
2408
2412
  response: () => Promise<ky.KyResponse<ListMessagesResponse<C>>>;
2409
2413
  json: () => Promise<ListMessagesResponse<C>>;
2410
2414
  };
2411
- listByConversation<C extends ListConversationMessagesIncludeOptions>(id: ConversationID, { limit, include, request }?: ListConversationMessagesOptions<C>): {
2415
+ listByConversation<C extends ListConversationMessagesIncludeOptions>(id: ConversationID, { limit, include, type, request, }?: ListConversationMessagesOptions<C>): {
2412
2416
  response: () => Promise<ky.KyResponse<ListConversationMessagesResponse<C>>>;
2413
2417
  json: () => Promise<ListConversationMessagesResponse<C>>;
2414
2418
  };
2415
- listByChannel<C extends ListChannelMessagesIncludeOptions>(id: ChannelID, { limit, include, request }?: ListChannelMessagesOptions<C>): {
2419
+ listByChannel<C extends ListChannelMessagesIncludeOptions>(id: ChannelID, { limit, include, type, request }?: ListChannelMessagesOptions<C>): {
2416
2420
  response: () => Promise<ky.KyResponse<ListChannelMessagesResponse<C>>>;
2417
2421
  json: () => Promise<ListChannelMessagesResponse<C>>;
2418
2422
  };
@@ -2868,12 +2872,23 @@ type Upload = {
2868
2872
  * @see https://greatdetail.com
2869
2873
  */
2870
2874
 
2871
- interface CreateUploadOptions {
2875
+ interface CreateUploadIncludeOptions {
2876
+ url?: boolean;
2877
+ [key: string]: boolean | undefined;
2878
+ }
2879
+ interface CreateUploadOptions<C extends CreateUploadIncludeOptions> {
2872
2880
  files: File[];
2881
+ include?: C;
2873
2882
  request?: SendOptions;
2874
2883
  }
2875
- type CreateUploadResponse = {
2884
+ type CreateUploadResponse<C extends CreateUploadIncludeOptions> = {
2876
2885
  data: {
2886
+ url?: C extends {
2887
+ url: true;
2888
+ } ? string : never;
2889
+ expiresAt?: C extends {
2890
+ url: true;
2891
+ } ? string : never;
2877
2892
  upload: Upload;
2878
2893
  };
2879
2894
  };
@@ -2943,9 +2958,9 @@ declare class UploadAPI {
2943
2958
  response: () => Promise<ky.KyResponse<ListUploadsResponse>>;
2944
2959
  json: () => Promise<ListUploadsResponse>;
2945
2960
  };
2946
- create({ files, request }: CreateUploadOptions): {
2947
- response: () => Promise<ky.KyResponse<CreateUploadResponse>>;
2948
- json: () => Promise<CreateUploadResponse>;
2961
+ create<C extends CreateUploadIncludeOptions>({ files, include, request, }: CreateUploadOptions<C>): {
2962
+ response: () => Promise<ky.KyResponse<CreateUploadResponse<C>>>;
2963
+ json: () => Promise<CreateUploadResponse<C>>;
2949
2964
  };
2950
2965
  delete(id: UploadID, { request }?: DeleteUploadOptions): {
2951
2966
  response: () => Promise<ky.KyResponse<DeleteUploadResponse>>;
@@ -3461,4 +3476,4 @@ declare class Client {
3461
3476
  static getBaseURL(): string;
3462
3477
  }
3463
3478
 
3464
- export { type BoilerplateCategoryID as $, type Account as A, type ActionID as B, Client as C, type DeleteAccountAccessTokenPayload as D, type ListActionsOptions as E, type ListActionsResponse as F, type GetAccountOptions as G, type BoilerplateContent as H, type BoilerplateContentID as I, type CreateBoilerplateContentPayload as J, type CreateBoilerplateContentOptions as K, type ListAccountAccessTokensOptions as L, type CreateBoilerplateContentResponse as M, type GetBoilerplateContentOptions as N, type Options as O, type GetBoilerplateContentResponse as P, type ListBoilerplateCategoryBoilerplateContentsOptions as Q, type RequestFilterable as R, type SortOptions as S, type ListBoilerplateCategoryBoilerplateContentsResponse as T, type UpdateAccountPayload as U, type ListBoilerplateContentsOptions as V, type ListBoilerplateContentsResponse as W, type UpdateBoilerplateContentPayload as X, type UpdateBoilerplateContentOptions as Y, type UpdateBoilerplateContentResponse as Z, type BoilerplateCategory as _, type Options$4 as a, type CreateContactPayload as a$, type CreateBoilerplateCategoryPayload as a0, type CreateBoilerplateCategoryOptions as a1, type CreateBoilerplateCategoryResponse as a2, type GetBoilerplateCategoryOptions as a3, type GetBoilerplateCategoryResponse as a4, type ListBoilerplateCategoriesIncludeOptions as a5, type ListBoilerplateCategoriesOptions as a6, type ListBoilerplateCategoriesResponse as a7, type UpdateBoilerplateCategoryPayload as a8, type UpdateBoilerplateCategoryOptions as a9, type CreateCompositionSectionPayload as aA, type CreateCompositionSectionOptions as aB, type CreateCompositionSectionResponse as aC, type GetCompositionSectionOptions as aD, type GetCompositionSectionResponse as aE, type ListChannelCompositionSectionsOptions as aF, type ListChannelCompositionSectionsResponse as aG, type ListCompositionSectionsOptions as aH, type ListCompositionSectionsResponse as aI, type UpdateCompositionSectionPayload as aJ, type UpdateCompositionSectionOptions as aK, type UpdateCompositionSectionResponse as aL, type Escalation as aM, type CreateEscalationPayload as aN, type CreateEscalationOptions as aO, type CreateEscalationResponse as aP, type GetEscalationOptions as aQ, type GetEscalationResponse as aR, type ListConversationEscalationsOptions as aS, type ListConversationEscalationsResponse as aT, type ListEscalationsOptions as aU, type ListEscalationsResponse as aV, type Contact as aW, type ContactID as aX, type ContactType as aY, type ContactStatus as aZ, type ContactCustomMetadata as a_, type UpdateBoilerplateCategoryResponse as aa, type Channel as ab, type ChannelID as ac, type CreateChannelPayload as ad, type CreateChannelOptions as ae, type CreateChannelResponse as af, type GetChannelOptions as ag, type GetChannelResponse as ah, type ListChannelsOptions as ai, type ListChannelsResponse as aj, type MetaWhatsappChannelGetBusinessProfileOptions as ak, type MetaWhatsappChannelGetBusinessProfileResponse as al, type TwilioSendChannelSyncPayload as am, type TwilioSendgridChannelSyncOptions as an, type TwilioSendgridChannelSyncResponse as ao, type UpdateChannelPayload as ap, type UpdateChannelOptions as aq, type UpdateChannelResponse as ar, type ChannelConversationSettings as as, type GetChannelConversationSettingsOptions as at, type GetChannelConversationSettingsResponse as au, type UpdateChannelConversationSettingsPayload as av, type UpdateChannelConversationSettingsOptions as aw, type UpdateChannelConversationSettingsResponse as ax, type CompositionSection as ay, type CompositionSectionID as az, type CurrentAccountID as b, type LabelID as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListConversationsResponse as bA, type ListLabelConversationsOptions as bB, type ListLabelConversationsResponse as bC, type UpdateConversationPayload as bD, type UpdateConversationOptions as bE, type UpdateConversationResponse as bF, type ConversationSettings as bG, type ConversationFeedback as bH, type CreateConversationFeedbackPayload as bI, type CreateConversationFeedbackOptions as bJ, type CreateConversationFeedbackResponse as bK, type DeleteConversationFeedbackOptions as bL, type DeleteConversationFeedbackResponse as bM, type GetConversationFeedbackOptions as bN, type GetConversationFeedbackResponse as bO, type ListConversationConversationFeedbackOptions as bP, type ListConversationConversationFeedbackResponse as bQ, type ListConversationFeedbackOptions as bR, type ListConversationFeedbackResponse as bS, type Label as bT, type CreateLabelPayload as bU, type CreateLabelOptions as bV, type CreateLabelResponse as bW, type DeleteLabelOptions as bX, type DeleteLabelResponse as bY, type GetLabelOptions as bZ, type GetLabelResponse as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationID as bg, type ConversationCustomMetadata as bh, type ActiveConversationStatus as bi, type ConcludedConversationStatus as bj, type ConversationStatus as bk, type CreateConversationPayload as bl, type CreateConversationOptions as bm, type CreateConversationResponse as bn, type DeleteConversationOptions as bo, type DeleteConversationResponse as bp, type GetConversationIncludeOptions as bq, type GetConversationOptions as br, type GetConversationResponse as bs, type ListChannelConversationsOptions as bt, type ListChannelConversationsResponse as bu, type ListContactConversationsOptions as bv, type ListContactConversationsResponse as bw, type ListConversationsIncludeOptions as bx, type ListConversationsFilterOptions as by, type ListConversationOptions as bz, type AccountID as c, type Upload as c$, type ListContactLabelsOptions as c0, type ListContactLabelsResponse as c1, type ListConversationLabelsOptions as c2, type ListConversationLabelsResponse as c3, type ListLabelsIncludeOptions as c4, type ListLabelsOptions as c5, type ListLabelsResponse as c6, type UpdateLabelPayload as c7, type UpdateLabelOptions as c8, type UpdateLabelResponse as c9, type CreateResponseModelOptions as cA, type CreateResponseResponse as cB, type GetModelOptions as cC, type GetModelResponse as cD, type ListModelsOptions as cE, type ListModelsResponse as cF, type ModelID as cG, type Note as cH, type CreateNotePayload as cI, type CreateNoteOptions as cJ, type CreateNoteResponse as cK, type GetNoteOptions as cL, type GetNoteResponse as cM, type ListContactNotesOptions as cN, type ListContactNotesResponse as cO, type ListConversationNotesOptions as cP, type ListConversationNotesResponse as cQ, type NoteID as cR, type UpdateNotePayload as cS, type UpdateNoteOptions as cT, type UpdateNoteResponse as cU, type Source as cV, type GetSourceOptions as cW, type GetSourceResponse as cX, type ListSourcesOptions as cY, type ListSourcesResponse as cZ, type SourceID as c_, type Message as ca, type CreateMessagePayload as cb, type CreateMessageOptions as cc, type CreateMessageResponse as cd, type DeleteMessageOptions as ce, type DeleteMessageResponse as cf, type GetMessageOptions as cg, type GetMessageResponse as ch, type ListChannelMessagesIncludeOptions as ci, type ListChannelMessagesOptions as cj, type ListChannelMessagesResponse as ck, type ListConversationMessagesIncludeOptions as cl, type ListConversationMessagesOptions as cm, type ListConversationMessagesResponse as cn, type ListMessagesIncludeOptions as co, type ListMessagesOptions as cp, type ListMessagesResponse as cq, type MessageID as cr, type MessageRole as cs, type MessageStatus as ct, type MessageEventType as cu, type Model as cv, type CreateCorrectionModelPayload as cw, type CreateCorrectionModelOptions as cx, type CreateCorrectionResponse as cy, type CreateResponseModelPayload as cz, type CreateAccountPayload as d, type CreateUploadOptions as d0, type CreateUploadResponse as d1, type DeleteUploadOptions as d2, type DeleteUploadResponse as d3, type GetUploadOptions as d4, type GetUploadResponse as d5, type ListUploadsOptions as d6, type ListUploadsResponse as d7, type UploadID as d8, type User as d9, type TestWebhookSubscriptionResponse as dA, type WebhookSubscriptionID as dB, type GetUserOptions as da, type GetUserResponse as db, type UserID as dc, type EventWebhookOptions as dd, eventWebhookSchema as de, type WebhookEventType as df, type AccountWebhookWebhookEventType as dg, type AccountAccessTokenWebhookEventType as dh, type ContactWebhookEventType as di, type ConversationWebhookEventType as dj, type MessageWebhookEventType as dk, type WebhookSubscriptionWebhookEventType as dl, type WebhookEventPayload as dm, type WebhookResponse as dn, type WebhookSubscription as dp, type CreateWebhookSubscriptionPayload as dq, type CreateWebhookSubscriptionOptions as dr, type CreateWebhookSubscriptionResponse as ds, type DeleteWebhookSubscriptionOptions as dt, type DeleteWebhookSubscriptionResponse as du, type GetWebhookSubscriptionOptions as dv, type GetWebhookSubscriptionResponse as dw, type ListWebhookSubscriptionsOptions as dx, type ListWebhookSubscriptionsResponse as dy, type TestWebhookSubscriptionOptions as dz, type CreateAccountOptions as e, type CreateAccountResponse as f, type GetAccountResponse as g, type UpdateAccountOptions as h, type UpdateAccountResponse as i, type AccountAccessToken as j, type AccountAccessTokenID as k, type CreateAccountAccessTokenPayload as l, type CreateAccountAccessTokenOptions as m, type CreateAccountAccessTokenResponse as n, type DeleteAccountAccessTokenOptions as o, type DeleteAccountAccessTokenResponse as p, type GetAccountAccessTokenOptions as q, type GetAccountAccessTokenResponse as r, type ListAccountAccessTokensResponse as s, type AccountConversationSettings as t, type GetAccountConversationSettingsOptions as u, type GetAccountConversationSettingsResponse as v, type UpdateAccountConversationSettingsPayload as w, type UpdateAccountConversationSettingsOptions as x, type UpdateAccountConversationSettingsResponse as y, type Action as z };
3479
+ export { type BoilerplateCategoryID as $, type Account as A, type ActionID as B, Client as C, type DeleteAccountAccessTokenPayload as D, type ListActionsOptions as E, type ListActionsResponse as F, type GetAccountOptions as G, type BoilerplateContent as H, type BoilerplateContentID as I, type CreateBoilerplateContentPayload as J, type CreateBoilerplateContentOptions as K, type ListAccountAccessTokensOptions as L, type CreateBoilerplateContentResponse as M, type GetBoilerplateContentOptions as N, type Options as O, type GetBoilerplateContentResponse as P, type ListBoilerplateCategoryBoilerplateContentsOptions as Q, type RequestFilterable as R, type SortOptions as S, type ListBoilerplateCategoryBoilerplateContentsResponse as T, type UpdateAccountPayload as U, type ListBoilerplateContentsOptions as V, type ListBoilerplateContentsResponse as W, type UpdateBoilerplateContentPayload as X, type UpdateBoilerplateContentOptions as Y, type UpdateBoilerplateContentResponse as Z, type BoilerplateCategory as _, type Options$4 as a, type CreateContactPayload as a$, type CreateBoilerplateCategoryPayload as a0, type CreateBoilerplateCategoryOptions as a1, type CreateBoilerplateCategoryResponse as a2, type GetBoilerplateCategoryOptions as a3, type GetBoilerplateCategoryResponse as a4, type ListBoilerplateCategoriesIncludeOptions as a5, type ListBoilerplateCategoriesOptions as a6, type ListBoilerplateCategoriesResponse as a7, type UpdateBoilerplateCategoryPayload as a8, type UpdateBoilerplateCategoryOptions as a9, type CreateCompositionSectionPayload as aA, type CreateCompositionSectionOptions as aB, type CreateCompositionSectionResponse as aC, type GetCompositionSectionOptions as aD, type GetCompositionSectionResponse as aE, type ListChannelCompositionSectionsOptions as aF, type ListChannelCompositionSectionsResponse as aG, type ListCompositionSectionsOptions as aH, type ListCompositionSectionsResponse as aI, type UpdateCompositionSectionPayload as aJ, type UpdateCompositionSectionOptions as aK, type UpdateCompositionSectionResponse as aL, type Escalation as aM, type CreateEscalationPayload as aN, type CreateEscalationOptions as aO, type CreateEscalationResponse as aP, type GetEscalationOptions as aQ, type GetEscalationResponse as aR, type ListConversationEscalationsOptions as aS, type ListConversationEscalationsResponse as aT, type ListEscalationsOptions as aU, type ListEscalationsResponse as aV, type Contact as aW, type ContactID as aX, type ContactType as aY, type ContactStatus as aZ, type ContactCustomMetadata as a_, type UpdateBoilerplateCategoryResponse as aa, type Channel as ab, type ChannelID as ac, type CreateChannelPayload as ad, type CreateChannelOptions as ae, type CreateChannelResponse as af, type GetChannelOptions as ag, type GetChannelResponse as ah, type ListChannelsOptions as ai, type ListChannelsResponse as aj, type MetaWhatsappChannelGetBusinessProfileOptions as ak, type MetaWhatsappChannelGetBusinessProfileResponse as al, type TwilioSendChannelSyncPayload as am, type TwilioSendgridChannelSyncOptions as an, type TwilioSendgridChannelSyncResponse as ao, type UpdateChannelPayload as ap, type UpdateChannelOptions as aq, type UpdateChannelResponse as ar, type ChannelConversationSettings as as, type GetChannelConversationSettingsOptions as at, type GetChannelConversationSettingsResponse as au, type UpdateChannelConversationSettingsPayload as av, type UpdateChannelConversationSettingsOptions as aw, type UpdateChannelConversationSettingsResponse as ax, type CompositionSection as ay, type CompositionSectionID as az, type CurrentAccountID as b, type LabelID as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListConversationsResponse as bA, type ListLabelConversationsOptions as bB, type ListLabelConversationsResponse as bC, type UpdateConversationPayload as bD, type UpdateConversationOptions as bE, type UpdateConversationResponse as bF, type ConversationSettings as bG, type ConversationFeedback as bH, type CreateConversationFeedbackPayload as bI, type CreateConversationFeedbackOptions as bJ, type CreateConversationFeedbackResponse as bK, type DeleteConversationFeedbackOptions as bL, type DeleteConversationFeedbackResponse as bM, type GetConversationFeedbackOptions as bN, type GetConversationFeedbackResponse as bO, type ListConversationConversationFeedbackOptions as bP, type ListConversationConversationFeedbackResponse as bQ, type ListConversationFeedbackOptions as bR, type ListConversationFeedbackResponse as bS, type Label as bT, type CreateLabelPayload as bU, type CreateLabelOptions as bV, type CreateLabelResponse as bW, type DeleteLabelOptions as bX, type DeleteLabelResponse as bY, type GetLabelOptions as bZ, type GetLabelResponse as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationID as bg, type ConversationCustomMetadata as bh, type ActiveConversationStatus as bi, type ConcludedConversationStatus as bj, type ConversationStatus as bk, type CreateConversationPayload as bl, type CreateConversationOptions as bm, type CreateConversationResponse as bn, type DeleteConversationOptions as bo, type DeleteConversationResponse as bp, type GetConversationIncludeOptions as bq, type GetConversationOptions as br, type GetConversationResponse as bs, type ListChannelConversationsOptions as bt, type ListChannelConversationsResponse as bu, type ListContactConversationsOptions as bv, type ListContactConversationsResponse as bw, type ListConversationsIncludeOptions as bx, type ListConversationsFilterOptions as by, type ListConversationOptions as bz, type AccountID as c, type SourceID as c$, type ListContactLabelsOptions as c0, type ListContactLabelsResponse as c1, type ListConversationLabelsOptions as c2, type ListConversationLabelsResponse as c3, type ListLabelsIncludeOptions as c4, type ListLabelsOptions as c5, type ListLabelsResponse as c6, type UpdateLabelPayload as c7, type UpdateLabelOptions as c8, type UpdateLabelResponse as c9, type CreateResponseModelPayload as cA, type CreateResponseModelOptions as cB, type CreateResponseResponse as cC, type GetModelOptions as cD, type GetModelResponse as cE, type ListModelsOptions as cF, type ListModelsResponse as cG, type ModelID as cH, type Note as cI, type CreateNotePayload as cJ, type CreateNoteOptions as cK, type CreateNoteResponse as cL, type GetNoteOptions as cM, type GetNoteResponse as cN, type ListContactNotesOptions as cO, type ListContactNotesResponse as cP, type ListConversationNotesOptions as cQ, type ListConversationNotesResponse as cR, type NoteID as cS, type UpdateNotePayload as cT, type UpdateNoteOptions as cU, type UpdateNoteResponse as cV, type Source as cW, type GetSourceOptions as cX, type GetSourceResponse as cY, type ListSourcesOptions as cZ, type ListSourcesResponse as c_, type Message as ca, type CreateMessagePayload as cb, type CreateMessageOptions as cc, type CreateMessageResponse as cd, type DeleteMessageOptions as ce, type DeleteMessageResponse as cf, type GetMessageOptions as cg, type GetMessageResponse as ch, type ListChannelMessagesIncludeOptions as ci, type ListChannelMessagesOptions as cj, type ListChannelMessagesResponse as ck, type ListConversationMessagesIncludeOptions as cl, type ListConversationMessagesOptions as cm, type ListConversationMessagesResponse as cn, type ListMessagesIncludeOptions as co, type ListMessagesOptions as cp, type ListMessagesResponse as cq, type MessageID as cr, type MessageRole as cs, type MessageType as ct, type MessageStatus as cu, type MessageEventType as cv, type Model as cw, type CreateCorrectionModelPayload as cx, type CreateCorrectionModelOptions as cy, type CreateCorrectionResponse as cz, type CreateAccountPayload as d, type Upload as d0, type CreateUploadIncludeOptions as d1, type CreateUploadOptions as d2, type CreateUploadResponse as d3, type DeleteUploadOptions as d4, type DeleteUploadResponse as d5, type GetUploadOptions as d6, type GetUploadResponse as d7, type ListUploadsOptions as d8, type ListUploadsResponse as d9, type ListWebhookSubscriptionsResponse as dA, type TestWebhookSubscriptionOptions as dB, type TestWebhookSubscriptionResponse as dC, type WebhookSubscriptionID as dD, type UploadID as da, type User as db, type GetUserOptions as dc, type GetUserResponse as dd, type UserID as de, type EventWebhookOptions as df, eventWebhookSchema as dg, type WebhookEventType as dh, type AccountWebhookWebhookEventType as di, type AccountAccessTokenWebhookEventType as dj, type ContactWebhookEventType as dk, type ConversationWebhookEventType as dl, type MessageWebhookEventType as dm, type WebhookSubscriptionWebhookEventType as dn, type WebhookEventPayload as dp, type WebhookResponse as dq, type WebhookSubscription as dr, type CreateWebhookSubscriptionPayload as ds, type CreateWebhookSubscriptionOptions as dt, type CreateWebhookSubscriptionResponse as du, type DeleteWebhookSubscriptionOptions as dv, type DeleteWebhookSubscriptionResponse as dw, type GetWebhookSubscriptionOptions as dx, type GetWebhookSubscriptionResponse as dy, type ListWebhookSubscriptionsOptions as dz, type CreateAccountOptions as e, type CreateAccountResponse as f, type GetAccountResponse as g, type UpdateAccountOptions as h, type UpdateAccountResponse as i, type AccountAccessToken as j, type AccountAccessTokenID as k, type CreateAccountAccessTokenPayload as l, type CreateAccountAccessTokenOptions as m, type CreateAccountAccessTokenResponse as n, type DeleteAccountAccessTokenOptions as o, type DeleteAccountAccessTokenResponse as p, type GetAccountAccessTokenOptions as q, type GetAccountAccessTokenResponse as r, type ListAccountAccessTokensResponse as s, type AccountConversationSettings as t, type GetAccountConversationSettingsOptions as u, type GetAccountConversationSettingsResponse as v, type UpdateAccountConversationSettingsPayload as w, type UpdateAccountConversationSettingsOptions as x, type UpdateAccountConversationSettingsResponse as y, type Action as z };
@@ -512,6 +512,7 @@ type Conversation = {
512
512
 
513
513
  type MessageID = `msg${string}` | (string & NonNullable<unknown>);
514
514
  type MessageRole = "user" | "assistant";
515
+ type MessageType = "text" | "media" | "richtext";
515
516
  type MessageStatus = "PotentialMessageStatus" | "SendingMessageStatus" | "SentMessageStatus" | "ReceivedMessageStatus" | "FailedMessageStatus";
516
517
  type MessageEventType = "ReadMessageEventType" | "ReceivedMessageEventType" | "SentMessageEventType";
517
518
  type Message = {
@@ -2331,6 +2332,7 @@ interface ListChannelMessagesIncludeOptions {
2331
2332
  }
2332
2333
  interface ListChannelMessagesOptions<C extends ListChannelMessagesIncludeOptions> {
2333
2334
  limit?: number;
2335
+ type?: MessageType;
2334
2336
  include?: C;
2335
2337
  request?: SendOptions;
2336
2338
  }
@@ -2358,6 +2360,7 @@ interface ListConversationMessagesIncludeOptions {
2358
2360
  }
2359
2361
  interface ListConversationMessagesOptions<C extends ListConversationMessagesIncludeOptions> {
2360
2362
  limit?: number;
2363
+ type?: MessageType;
2361
2364
  include?: C;
2362
2365
  request?: SendOptions;
2363
2366
  }
@@ -2385,6 +2388,7 @@ interface ListMessagesIncludeOptions {
2385
2388
  }
2386
2389
  interface ListMessagesOptions<C extends ListMessagesIncludeOptions> {
2387
2390
  limit?: number;
2391
+ type?: MessageType;
2388
2392
  include?: C;
2389
2393
  request?: SendOptions;
2390
2394
  }
@@ -2404,15 +2408,15 @@ declare class MessageAPI {
2404
2408
  response: () => Promise<ky.KyResponse<GetMessageResponse>>;
2405
2409
  json: () => Promise<GetMessageResponse>;
2406
2410
  };
2407
- list<C extends ListMessagesIncludeOptions>({ limit, include, request, }?: ListMessagesOptions<C>): {
2411
+ list<C extends ListMessagesIncludeOptions>({ limit, include, type, request, }?: ListMessagesOptions<C>): {
2408
2412
  response: () => Promise<ky.KyResponse<ListMessagesResponse<C>>>;
2409
2413
  json: () => Promise<ListMessagesResponse<C>>;
2410
2414
  };
2411
- listByConversation<C extends ListConversationMessagesIncludeOptions>(id: ConversationID, { limit, include, request }?: ListConversationMessagesOptions<C>): {
2415
+ listByConversation<C extends ListConversationMessagesIncludeOptions>(id: ConversationID, { limit, include, type, request, }?: ListConversationMessagesOptions<C>): {
2412
2416
  response: () => Promise<ky.KyResponse<ListConversationMessagesResponse<C>>>;
2413
2417
  json: () => Promise<ListConversationMessagesResponse<C>>;
2414
2418
  };
2415
- listByChannel<C extends ListChannelMessagesIncludeOptions>(id: ChannelID, { limit, include, request }?: ListChannelMessagesOptions<C>): {
2419
+ listByChannel<C extends ListChannelMessagesIncludeOptions>(id: ChannelID, { limit, include, type, request }?: ListChannelMessagesOptions<C>): {
2416
2420
  response: () => Promise<ky.KyResponse<ListChannelMessagesResponse<C>>>;
2417
2421
  json: () => Promise<ListChannelMessagesResponse<C>>;
2418
2422
  };
@@ -2868,12 +2872,23 @@ type Upload = {
2868
2872
  * @see https://greatdetail.com
2869
2873
  */
2870
2874
 
2871
- interface CreateUploadOptions {
2875
+ interface CreateUploadIncludeOptions {
2876
+ url?: boolean;
2877
+ [key: string]: boolean | undefined;
2878
+ }
2879
+ interface CreateUploadOptions<C extends CreateUploadIncludeOptions> {
2872
2880
  files: File[];
2881
+ include?: C;
2873
2882
  request?: SendOptions;
2874
2883
  }
2875
- type CreateUploadResponse = {
2884
+ type CreateUploadResponse<C extends CreateUploadIncludeOptions> = {
2876
2885
  data: {
2886
+ url?: C extends {
2887
+ url: true;
2888
+ } ? string : never;
2889
+ expiresAt?: C extends {
2890
+ url: true;
2891
+ } ? string : never;
2877
2892
  upload: Upload;
2878
2893
  };
2879
2894
  };
@@ -2943,9 +2958,9 @@ declare class UploadAPI {
2943
2958
  response: () => Promise<ky.KyResponse<ListUploadsResponse>>;
2944
2959
  json: () => Promise<ListUploadsResponse>;
2945
2960
  };
2946
- create({ files, request }: CreateUploadOptions): {
2947
- response: () => Promise<ky.KyResponse<CreateUploadResponse>>;
2948
- json: () => Promise<CreateUploadResponse>;
2961
+ create<C extends CreateUploadIncludeOptions>({ files, include, request, }: CreateUploadOptions<C>): {
2962
+ response: () => Promise<ky.KyResponse<CreateUploadResponse<C>>>;
2963
+ json: () => Promise<CreateUploadResponse<C>>;
2949
2964
  };
2950
2965
  delete(id: UploadID, { request }?: DeleteUploadOptions): {
2951
2966
  response: () => Promise<ky.KyResponse<DeleteUploadResponse>>;
@@ -3461,4 +3476,4 @@ declare class Client {
3461
3476
  static getBaseURL(): string;
3462
3477
  }
3463
3478
 
3464
- export { type BoilerplateCategoryID as $, type Account as A, type ActionID as B, Client as C, type DeleteAccountAccessTokenPayload as D, type ListActionsOptions as E, type ListActionsResponse as F, type GetAccountOptions as G, type BoilerplateContent as H, type BoilerplateContentID as I, type CreateBoilerplateContentPayload as J, type CreateBoilerplateContentOptions as K, type ListAccountAccessTokensOptions as L, type CreateBoilerplateContentResponse as M, type GetBoilerplateContentOptions as N, type Options as O, type GetBoilerplateContentResponse as P, type ListBoilerplateCategoryBoilerplateContentsOptions as Q, type RequestFilterable as R, type SortOptions as S, type ListBoilerplateCategoryBoilerplateContentsResponse as T, type UpdateAccountPayload as U, type ListBoilerplateContentsOptions as V, type ListBoilerplateContentsResponse as W, type UpdateBoilerplateContentPayload as X, type UpdateBoilerplateContentOptions as Y, type UpdateBoilerplateContentResponse as Z, type BoilerplateCategory as _, type Options$4 as a, type CreateContactPayload as a$, type CreateBoilerplateCategoryPayload as a0, type CreateBoilerplateCategoryOptions as a1, type CreateBoilerplateCategoryResponse as a2, type GetBoilerplateCategoryOptions as a3, type GetBoilerplateCategoryResponse as a4, type ListBoilerplateCategoriesIncludeOptions as a5, type ListBoilerplateCategoriesOptions as a6, type ListBoilerplateCategoriesResponse as a7, type UpdateBoilerplateCategoryPayload as a8, type UpdateBoilerplateCategoryOptions as a9, type CreateCompositionSectionPayload as aA, type CreateCompositionSectionOptions as aB, type CreateCompositionSectionResponse as aC, type GetCompositionSectionOptions as aD, type GetCompositionSectionResponse as aE, type ListChannelCompositionSectionsOptions as aF, type ListChannelCompositionSectionsResponse as aG, type ListCompositionSectionsOptions as aH, type ListCompositionSectionsResponse as aI, type UpdateCompositionSectionPayload as aJ, type UpdateCompositionSectionOptions as aK, type UpdateCompositionSectionResponse as aL, type Escalation as aM, type CreateEscalationPayload as aN, type CreateEscalationOptions as aO, type CreateEscalationResponse as aP, type GetEscalationOptions as aQ, type GetEscalationResponse as aR, type ListConversationEscalationsOptions as aS, type ListConversationEscalationsResponse as aT, type ListEscalationsOptions as aU, type ListEscalationsResponse as aV, type Contact as aW, type ContactID as aX, type ContactType as aY, type ContactStatus as aZ, type ContactCustomMetadata as a_, type UpdateBoilerplateCategoryResponse as aa, type Channel as ab, type ChannelID as ac, type CreateChannelPayload as ad, type CreateChannelOptions as ae, type CreateChannelResponse as af, type GetChannelOptions as ag, type GetChannelResponse as ah, type ListChannelsOptions as ai, type ListChannelsResponse as aj, type MetaWhatsappChannelGetBusinessProfileOptions as ak, type MetaWhatsappChannelGetBusinessProfileResponse as al, type TwilioSendChannelSyncPayload as am, type TwilioSendgridChannelSyncOptions as an, type TwilioSendgridChannelSyncResponse as ao, type UpdateChannelPayload as ap, type UpdateChannelOptions as aq, type UpdateChannelResponse as ar, type ChannelConversationSettings as as, type GetChannelConversationSettingsOptions as at, type GetChannelConversationSettingsResponse as au, type UpdateChannelConversationSettingsPayload as av, type UpdateChannelConversationSettingsOptions as aw, type UpdateChannelConversationSettingsResponse as ax, type CompositionSection as ay, type CompositionSectionID as az, type CurrentAccountID as b, type LabelID as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListConversationsResponse as bA, type ListLabelConversationsOptions as bB, type ListLabelConversationsResponse as bC, type UpdateConversationPayload as bD, type UpdateConversationOptions as bE, type UpdateConversationResponse as bF, type ConversationSettings as bG, type ConversationFeedback as bH, type CreateConversationFeedbackPayload as bI, type CreateConversationFeedbackOptions as bJ, type CreateConversationFeedbackResponse as bK, type DeleteConversationFeedbackOptions as bL, type DeleteConversationFeedbackResponse as bM, type GetConversationFeedbackOptions as bN, type GetConversationFeedbackResponse as bO, type ListConversationConversationFeedbackOptions as bP, type ListConversationConversationFeedbackResponse as bQ, type ListConversationFeedbackOptions as bR, type ListConversationFeedbackResponse as bS, type Label as bT, type CreateLabelPayload as bU, type CreateLabelOptions as bV, type CreateLabelResponse as bW, type DeleteLabelOptions as bX, type DeleteLabelResponse as bY, type GetLabelOptions as bZ, type GetLabelResponse as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationID as bg, type ConversationCustomMetadata as bh, type ActiveConversationStatus as bi, type ConcludedConversationStatus as bj, type ConversationStatus as bk, type CreateConversationPayload as bl, type CreateConversationOptions as bm, type CreateConversationResponse as bn, type DeleteConversationOptions as bo, type DeleteConversationResponse as bp, type GetConversationIncludeOptions as bq, type GetConversationOptions as br, type GetConversationResponse as bs, type ListChannelConversationsOptions as bt, type ListChannelConversationsResponse as bu, type ListContactConversationsOptions as bv, type ListContactConversationsResponse as bw, type ListConversationsIncludeOptions as bx, type ListConversationsFilterOptions as by, type ListConversationOptions as bz, type AccountID as c, type Upload as c$, type ListContactLabelsOptions as c0, type ListContactLabelsResponse as c1, type ListConversationLabelsOptions as c2, type ListConversationLabelsResponse as c3, type ListLabelsIncludeOptions as c4, type ListLabelsOptions as c5, type ListLabelsResponse as c6, type UpdateLabelPayload as c7, type UpdateLabelOptions as c8, type UpdateLabelResponse as c9, type CreateResponseModelOptions as cA, type CreateResponseResponse as cB, type GetModelOptions as cC, type GetModelResponse as cD, type ListModelsOptions as cE, type ListModelsResponse as cF, type ModelID as cG, type Note as cH, type CreateNotePayload as cI, type CreateNoteOptions as cJ, type CreateNoteResponse as cK, type GetNoteOptions as cL, type GetNoteResponse as cM, type ListContactNotesOptions as cN, type ListContactNotesResponse as cO, type ListConversationNotesOptions as cP, type ListConversationNotesResponse as cQ, type NoteID as cR, type UpdateNotePayload as cS, type UpdateNoteOptions as cT, type UpdateNoteResponse as cU, type Source as cV, type GetSourceOptions as cW, type GetSourceResponse as cX, type ListSourcesOptions as cY, type ListSourcesResponse as cZ, type SourceID as c_, type Message as ca, type CreateMessagePayload as cb, type CreateMessageOptions as cc, type CreateMessageResponse as cd, type DeleteMessageOptions as ce, type DeleteMessageResponse as cf, type GetMessageOptions as cg, type GetMessageResponse as ch, type ListChannelMessagesIncludeOptions as ci, type ListChannelMessagesOptions as cj, type ListChannelMessagesResponse as ck, type ListConversationMessagesIncludeOptions as cl, type ListConversationMessagesOptions as cm, type ListConversationMessagesResponse as cn, type ListMessagesIncludeOptions as co, type ListMessagesOptions as cp, type ListMessagesResponse as cq, type MessageID as cr, type MessageRole as cs, type MessageStatus as ct, type MessageEventType as cu, type Model as cv, type CreateCorrectionModelPayload as cw, type CreateCorrectionModelOptions as cx, type CreateCorrectionResponse as cy, type CreateResponseModelPayload as cz, type CreateAccountPayload as d, type CreateUploadOptions as d0, type CreateUploadResponse as d1, type DeleteUploadOptions as d2, type DeleteUploadResponse as d3, type GetUploadOptions as d4, type GetUploadResponse as d5, type ListUploadsOptions as d6, type ListUploadsResponse as d7, type UploadID as d8, type User as d9, type TestWebhookSubscriptionResponse as dA, type WebhookSubscriptionID as dB, type GetUserOptions as da, type GetUserResponse as db, type UserID as dc, type EventWebhookOptions as dd, eventWebhookSchema as de, type WebhookEventType as df, type AccountWebhookWebhookEventType as dg, type AccountAccessTokenWebhookEventType as dh, type ContactWebhookEventType as di, type ConversationWebhookEventType as dj, type MessageWebhookEventType as dk, type WebhookSubscriptionWebhookEventType as dl, type WebhookEventPayload as dm, type WebhookResponse as dn, type WebhookSubscription as dp, type CreateWebhookSubscriptionPayload as dq, type CreateWebhookSubscriptionOptions as dr, type CreateWebhookSubscriptionResponse as ds, type DeleteWebhookSubscriptionOptions as dt, type DeleteWebhookSubscriptionResponse as du, type GetWebhookSubscriptionOptions as dv, type GetWebhookSubscriptionResponse as dw, type ListWebhookSubscriptionsOptions as dx, type ListWebhookSubscriptionsResponse as dy, type TestWebhookSubscriptionOptions as dz, type CreateAccountOptions as e, type CreateAccountResponse as f, type GetAccountResponse as g, type UpdateAccountOptions as h, type UpdateAccountResponse as i, type AccountAccessToken as j, type AccountAccessTokenID as k, type CreateAccountAccessTokenPayload as l, type CreateAccountAccessTokenOptions as m, type CreateAccountAccessTokenResponse as n, type DeleteAccountAccessTokenOptions as o, type DeleteAccountAccessTokenResponse as p, type GetAccountAccessTokenOptions as q, type GetAccountAccessTokenResponse as r, type ListAccountAccessTokensResponse as s, type AccountConversationSettings as t, type GetAccountConversationSettingsOptions as u, type GetAccountConversationSettingsResponse as v, type UpdateAccountConversationSettingsPayload as w, type UpdateAccountConversationSettingsOptions as x, type UpdateAccountConversationSettingsResponse as y, type Action as z };
3479
+ export { type BoilerplateCategoryID as $, type Account as A, type ActionID as B, Client as C, type DeleteAccountAccessTokenPayload as D, type ListActionsOptions as E, type ListActionsResponse as F, type GetAccountOptions as G, type BoilerplateContent as H, type BoilerplateContentID as I, type CreateBoilerplateContentPayload as J, type CreateBoilerplateContentOptions as K, type ListAccountAccessTokensOptions as L, type CreateBoilerplateContentResponse as M, type GetBoilerplateContentOptions as N, type Options as O, type GetBoilerplateContentResponse as P, type ListBoilerplateCategoryBoilerplateContentsOptions as Q, type RequestFilterable as R, type SortOptions as S, type ListBoilerplateCategoryBoilerplateContentsResponse as T, type UpdateAccountPayload as U, type ListBoilerplateContentsOptions as V, type ListBoilerplateContentsResponse as W, type UpdateBoilerplateContentPayload as X, type UpdateBoilerplateContentOptions as Y, type UpdateBoilerplateContentResponse as Z, type BoilerplateCategory as _, type Options$4 as a, type CreateContactPayload as a$, type CreateBoilerplateCategoryPayload as a0, type CreateBoilerplateCategoryOptions as a1, type CreateBoilerplateCategoryResponse as a2, type GetBoilerplateCategoryOptions as a3, type GetBoilerplateCategoryResponse as a4, type ListBoilerplateCategoriesIncludeOptions as a5, type ListBoilerplateCategoriesOptions as a6, type ListBoilerplateCategoriesResponse as a7, type UpdateBoilerplateCategoryPayload as a8, type UpdateBoilerplateCategoryOptions as a9, type CreateCompositionSectionPayload as aA, type CreateCompositionSectionOptions as aB, type CreateCompositionSectionResponse as aC, type GetCompositionSectionOptions as aD, type GetCompositionSectionResponse as aE, type ListChannelCompositionSectionsOptions as aF, type ListChannelCompositionSectionsResponse as aG, type ListCompositionSectionsOptions as aH, type ListCompositionSectionsResponse as aI, type UpdateCompositionSectionPayload as aJ, type UpdateCompositionSectionOptions as aK, type UpdateCompositionSectionResponse as aL, type Escalation as aM, type CreateEscalationPayload as aN, type CreateEscalationOptions as aO, type CreateEscalationResponse as aP, type GetEscalationOptions as aQ, type GetEscalationResponse as aR, type ListConversationEscalationsOptions as aS, type ListConversationEscalationsResponse as aT, type ListEscalationsOptions as aU, type ListEscalationsResponse as aV, type Contact as aW, type ContactID as aX, type ContactType as aY, type ContactStatus as aZ, type ContactCustomMetadata as a_, type UpdateBoilerplateCategoryResponse as aa, type Channel as ab, type ChannelID as ac, type CreateChannelPayload as ad, type CreateChannelOptions as ae, type CreateChannelResponse as af, type GetChannelOptions as ag, type GetChannelResponse as ah, type ListChannelsOptions as ai, type ListChannelsResponse as aj, type MetaWhatsappChannelGetBusinessProfileOptions as ak, type MetaWhatsappChannelGetBusinessProfileResponse as al, type TwilioSendChannelSyncPayload as am, type TwilioSendgridChannelSyncOptions as an, type TwilioSendgridChannelSyncResponse as ao, type UpdateChannelPayload as ap, type UpdateChannelOptions as aq, type UpdateChannelResponse as ar, type ChannelConversationSettings as as, type GetChannelConversationSettingsOptions as at, type GetChannelConversationSettingsResponse as au, type UpdateChannelConversationSettingsPayload as av, type UpdateChannelConversationSettingsOptions as aw, type UpdateChannelConversationSettingsResponse as ax, type CompositionSection as ay, type CompositionSectionID as az, type CurrentAccountID as b, type LabelID as b$, type CreateContactOptions as b0, type CreateContactResponse as b1, type DeleteContactOptions as b2, type DeleteContactResponse as b3, type GetContactIncludeOptions as b4, type GetContactOptions as b5, type GetContactResponse as b6, type GetContactVCFOptions as b7, type ListContactsOptions as b8, type ListContactsResponse as b9, type ListConversationsResponse as bA, type ListLabelConversationsOptions as bB, type ListLabelConversationsResponse as bC, type UpdateConversationPayload as bD, type UpdateConversationOptions as bE, type UpdateConversationResponse as bF, type ConversationSettings as bG, type ConversationFeedback as bH, type CreateConversationFeedbackPayload as bI, type CreateConversationFeedbackOptions as bJ, type CreateConversationFeedbackResponse as bK, type DeleteConversationFeedbackOptions as bL, type DeleteConversationFeedbackResponse as bM, type GetConversationFeedbackOptions as bN, type GetConversationFeedbackResponse as bO, type ListConversationConversationFeedbackOptions as bP, type ListConversationConversationFeedbackResponse as bQ, type ListConversationFeedbackOptions as bR, type ListConversationFeedbackResponse as bS, type Label as bT, type CreateLabelPayload as bU, type CreateLabelOptions as bV, type CreateLabelResponse as bW, type DeleteLabelOptions as bX, type DeleteLabelResponse as bY, type GetLabelOptions as bZ, type GetLabelResponse as b_, type ListLabelContactsOptions as ba, type ListLabelContactsResponse as bb, type UpdateContactPayload as bc, type UpdateContactOptions as bd, type UpdateContactResponse as be, type Conversation as bf, type ConversationID as bg, type ConversationCustomMetadata as bh, type ActiveConversationStatus as bi, type ConcludedConversationStatus as bj, type ConversationStatus as bk, type CreateConversationPayload as bl, type CreateConversationOptions as bm, type CreateConversationResponse as bn, type DeleteConversationOptions as bo, type DeleteConversationResponse as bp, type GetConversationIncludeOptions as bq, type GetConversationOptions as br, type GetConversationResponse as bs, type ListChannelConversationsOptions as bt, type ListChannelConversationsResponse as bu, type ListContactConversationsOptions as bv, type ListContactConversationsResponse as bw, type ListConversationsIncludeOptions as bx, type ListConversationsFilterOptions as by, type ListConversationOptions as bz, type AccountID as c, type SourceID as c$, type ListContactLabelsOptions as c0, type ListContactLabelsResponse as c1, type ListConversationLabelsOptions as c2, type ListConversationLabelsResponse as c3, type ListLabelsIncludeOptions as c4, type ListLabelsOptions as c5, type ListLabelsResponse as c6, type UpdateLabelPayload as c7, type UpdateLabelOptions as c8, type UpdateLabelResponse as c9, type CreateResponseModelPayload as cA, type CreateResponseModelOptions as cB, type CreateResponseResponse as cC, type GetModelOptions as cD, type GetModelResponse as cE, type ListModelsOptions as cF, type ListModelsResponse as cG, type ModelID as cH, type Note as cI, type CreateNotePayload as cJ, type CreateNoteOptions as cK, type CreateNoteResponse as cL, type GetNoteOptions as cM, type GetNoteResponse as cN, type ListContactNotesOptions as cO, type ListContactNotesResponse as cP, type ListConversationNotesOptions as cQ, type ListConversationNotesResponse as cR, type NoteID as cS, type UpdateNotePayload as cT, type UpdateNoteOptions as cU, type UpdateNoteResponse as cV, type Source as cW, type GetSourceOptions as cX, type GetSourceResponse as cY, type ListSourcesOptions as cZ, type ListSourcesResponse as c_, type Message as ca, type CreateMessagePayload as cb, type CreateMessageOptions as cc, type CreateMessageResponse as cd, type DeleteMessageOptions as ce, type DeleteMessageResponse as cf, type GetMessageOptions as cg, type GetMessageResponse as ch, type ListChannelMessagesIncludeOptions as ci, type ListChannelMessagesOptions as cj, type ListChannelMessagesResponse as ck, type ListConversationMessagesIncludeOptions as cl, type ListConversationMessagesOptions as cm, type ListConversationMessagesResponse as cn, type ListMessagesIncludeOptions as co, type ListMessagesOptions as cp, type ListMessagesResponse as cq, type MessageID as cr, type MessageRole as cs, type MessageType as ct, type MessageStatus as cu, type MessageEventType as cv, type Model as cw, type CreateCorrectionModelPayload as cx, type CreateCorrectionModelOptions as cy, type CreateCorrectionResponse as cz, type CreateAccountPayload as d, type Upload as d0, type CreateUploadIncludeOptions as d1, type CreateUploadOptions as d2, type CreateUploadResponse as d3, type DeleteUploadOptions as d4, type DeleteUploadResponse as d5, type GetUploadOptions as d6, type GetUploadResponse as d7, type ListUploadsOptions as d8, type ListUploadsResponse as d9, type ListWebhookSubscriptionsResponse as dA, type TestWebhookSubscriptionOptions as dB, type TestWebhookSubscriptionResponse as dC, type WebhookSubscriptionID as dD, type UploadID as da, type User as db, type GetUserOptions as dc, type GetUserResponse as dd, type UserID as de, type EventWebhookOptions as df, eventWebhookSchema as dg, type WebhookEventType as dh, type AccountWebhookWebhookEventType as di, type AccountAccessTokenWebhookEventType as dj, type ContactWebhookEventType as dk, type ConversationWebhookEventType as dl, type MessageWebhookEventType as dm, type WebhookSubscriptionWebhookEventType as dn, type WebhookEventPayload as dp, type WebhookResponse as dq, type WebhookSubscription as dr, type CreateWebhookSubscriptionPayload as ds, type CreateWebhookSubscriptionOptions as dt, type CreateWebhookSubscriptionResponse as du, type DeleteWebhookSubscriptionOptions as dv, type DeleteWebhookSubscriptionResponse as dw, type GetWebhookSubscriptionOptions as dx, type GetWebhookSubscriptionResponse as dy, type ListWebhookSubscriptionsOptions as dz, type CreateAccountOptions as e, type CreateAccountResponse as f, type GetAccountResponse as g, type UpdateAccountOptions as h, type UpdateAccountResponse as i, type AccountAccessToken as j, type AccountAccessTokenID as k, type CreateAccountAccessTokenPayload as l, type CreateAccountAccessTokenOptions as m, type CreateAccountAccessTokenResponse as n, type DeleteAccountAccessTokenOptions as o, type DeleteAccountAccessTokenResponse as p, type GetAccountAccessTokenOptions as q, type GetAccountAccessTokenResponse as r, type ListAccountAccessTokensResponse as s, type AccountConversationSettings as t, type GetAccountConversationSettingsOptions as u, type GetAccountConversationSettingsResponse as v, type UpdateAccountConversationSettingsPayload as w, type UpdateAccountConversationSettingsOptions as x, type UpdateAccountConversationSettingsResponse as y, type Action as z };
@@ -1 +1 @@
1
- var K=Object.defineProperty;var $=(n,t)=>{for(var e in t)K(n,e,{get:t[e],enumerable:!0})};var p=class{getHeaders(){return{}}};var x="SUPPORT_ACCESS_TOKEN",W="SUPPORT_KEY_NAME",N="SUPPORT_KEY_PASSWORD",w="SUPPORT_SIGNING_KEY",Q="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[W],password:e=process.env[N]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var m=class{#t;constructor({token:t=process.env[x]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var j="https://api.support.greatdetail.com",H={"X-Powered-By":"GDSupport/JavaScript"};var B=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};import{z as i}from"zod";var V=i.object({data:i.object({event:i.object({id:i.string(),type:i.string(),payload:i.record(i.string()),createdAt:i.string().datetime()})})});var l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 u=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}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var C=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var b=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 v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var U=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=H;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let s=[];if(e){let r=Array.isArray(e)?e:[e];for(let a of r)s.push(["category",a])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var E=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};import Y from"is-network-error";import z,{HTTPError as J}from"ky";var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=z.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[a,q]of Object.entries(r))o.headers.has(a)||o.headers.set(a,q)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw Y(s)?new Error("A network error occurred",{cause:s}):s instanceof J?new B(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let s of t)o.append("file",s);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var F=class{constructor(t){this._transport=t}async event({key:t=process.env[w],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."+w);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}=V.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 P=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var M=class n{static DEFAULT_BASE_URL=j;static PublicAuthentication=p;static BasicAuthentication=c;static BearerAuthentication=m;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new U,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new u(this._transport),this.action=new h(this._transport),this.boilerplateCategory=new C(this._transport),this.boilerplateContent=new f(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new b(this._transport),this.compositionSection=new v(this._transport),this.contact=new g(this._transport),this.conversation=new O(this._transport),this.conversationFeedback=new _(this._transport),this.escalation=new I(this._transport),this.label=new T(this._transport),this.message=new L(this._transport),this.model=new y(this._transport),this.note=new A(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new F(this._transport),this.webhookSubscription=new P(this._transport)}static getBaseURL(){return process.env[Q]??this.DEFAULT_BASE_URL}};export{$ as a,p as b,j as c,B as d,V as e,M as f};
1
+ var K=Object.defineProperty;var $=(n,t)=>{for(var e in t)K(n,e,{get:t[e],enumerable:!0})};var p=class{getHeaders(){return{}}};var x="SUPPORT_ACCESS_TOKEN",W="SUPPORT_KEY_NAME",N="SUPPORT_KEY_PASSWORD",w="SUPPORT_SIGNING_KEY",Q="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[W],password:e=process.env[N]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var m=class{#t;constructor({token:t=process.env[x]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var j="https://api.support.greatdetail.com",H={"X-Powered-By":"GDSupport/JavaScript"};var B=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};import{z as i}from"zod";var V=i.object({data:i.object({event:i.object({id:i.string(),type:i.string(),payload:i.record(i.string()),createdAt:i.string().datetime()})})});var l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 u=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}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var C=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var b=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 v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var g=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,type:o,request:s={}}={}){return this._transport.send("v1/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{}),...this._transport.filterQuery("type",o)]})}listByConversation(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{}),...this._transport.filterQuery("type",s)]})}listByChannel(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o),...this._transport.filterQuery("type",s)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var U=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=H;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let s=[];if(e){let r=Array.isArray(e)?e:[e];for(let a of r)s.push(["category",a])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var E=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};import Y from"is-network-error";import z,{HTTPError as J}from"ky";var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=z.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[a,q]of Object.entries(r))o.headers.has(a)||o.headers.set(a,q)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw Y(s)?new Error("A network error occurred",{cause:s}):s instanceof J?new B(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,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.includeQuery(e??{})],body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var F=class{constructor(t){this._transport=t}async event({key:t=process.env[w],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."+w);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}=V.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 P=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var M=class n{static DEFAULT_BASE_URL=j;static PublicAuthentication=p;static BasicAuthentication=c;static BearerAuthentication=m;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new U,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new l(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new u(this._transport),this.action=new h(this._transport),this.boilerplateCategory=new C(this._transport),this.boilerplateContent=new f(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new b(this._transport),this.compositionSection=new v(this._transport),this.contact=new O(this._transport),this.conversation=new g(this._transport),this.conversationFeedback=new _(this._transport),this.escalation=new I(this._transport),this.label=new T(this._transport),this.message=new y(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new F(this._transport),this.webhookSubscription=new P(this._transport)}static getBaseURL(){return process.env[Q]??this.DEFAULT_BASE_URL}};export{$ as a,p as b,j as c,B as d,V as e,M as f};
@@ -1 +1 @@
1
- import{b as j,f as F}from"./chunk-Z2KV5TJQ.js";import{Command as A}from"commander";import{Command as b}from"commander";import{oraPromise as I}from"ora";function r({client:t,ora:s}){let o=new b("actions").description("Actions");return o.addCommand(new b("list").description("List actions").action(async()=>{let n=await I(()=>t.action.list().json(),{...s,text:"Finding actions"});console.log(n)})),o}import{Command as v}from"commander";import{oraPromise as S}from"ora";function c({client:t,ora:s}){let o=new v("channels").description("Channels");return o.addCommand(new v("list").description("List channels").action(async()=>{let n=await S(()=>t.channel.list().json(),{...s,text:"Finding channels"});console.log(n)})),o}import{Command as a}from"commander";import{oraPromise as d}from"ora";function p({client:t,ora:s}){let o=new a("contacts").description("Contacts");return o.addCommand(new a("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let i=await d(()=>t.contact.get(n).json(),{...s,text:"Finding contact"});console.log(i)})),o.addCommand(new a("list").description("List contacts").action(async()=>{let n=await d(()=>t.contact.list().json(),{...s,text:"Finding contacts"});console.log(n)})),o.addCommand(new a("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async n=>{let i=await d(()=>t.contact.getVCF(n).response(),{...s,text:"Exporting contact"});console.log(i)})),o}import{Command as l}from"commander";import{oraPromise as L}from"ora";function u({client:t,ora:s}){let o=new l("conversations").description("Conversations");return o.addCommand(new l("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let i=await L(()=>t.conversation.get(n).json(),{...s,text:"Finding conversation"});console.log(i)})),o.addCommand(new l("list").description("List conversations").action(async()=>{let n=await L(()=>t.conversation.list().json(),{...s,text:"Finding conversations"});console.log(n)})),o}import{Command as m}from"commander";import{oraPromise as C}from"ora";function g({client:t,ora:s}){let o=new m("labels").description("Labels");return o.addCommand(new m("get").description("Find label").argument("<label>","Label ID").action(async n=>{let i=await C(()=>t.label.get(n).json(),{...s,text:"Finding label"});console.log(i)})),o.addCommand(new m("list").description("List labels").action(async()=>{let n=await C(()=>t.label.list().json(),{...s,text:"Finding labels"});console.log(n)})),o.addCommand(new m("conversations").description("Find label conversations").argument("<label>","Label ID").action(async n=>{let i=await C(()=>t.conversation.listByLabel(n).json(),{...s,text:"Finding conversations"});console.log(i)})),o}import{Command as D}from"commander";import{oraPromise as M}from"ora";function f({client:t,ora:s}){let o=new D("messages").description("Messages");return o.addCommand(new D("list").description("List messages").action(async()=>{let n=await M(()=>t.message.list().json(),{...s,text:"Finding messages"});console.log(n)})),o}import{Command as O}from"commander";import{oraPromise as P}from"ora";function x({client:t,ora:s}){let o=new O("models").description("Models");return o.addCommand(new O("get").description("Find model").argument("<model>","Model ID").action(async n=>{let i=await P(()=>t.model.get(n).json(),{...s,text:"Finding model"});console.log(i)})),o.addCommand(new O("list").description("List models").action(async()=>{let n=await P(()=>t.model.list().json(),{...s,text:"Finding models"});console.log(n)})),o}import{Command as w}from"commander";import{oraPromise as h}from"ora";function y({client:t,ora:s}){let o=new w("sources").description("Sources");return o.addCommand(new w("get").description("Find source").argument("<source>","Source ID").action(async n=>{let i=await h(()=>t.source.get(n).json(),{...s,text:"Finding source"});console.log(i)})),o.addCommand(new w("list").description("List sources").action(async()=>{let n=await h(()=>t.source.list().json(),{...s,text:"Finding sources"});console.log(n)})),o}var e={ora:{spinner:"simpleDotsScrolling"},client:new F(new j)},E=new A("gds").description("Great Detail Support System").addCommand(r(e)).addCommand(c(e)).addCommand(p(e)).addCommand(u(e)).addCommand(g(e)).addCommand(f(e)).addCommand(x(e)).addCommand(y(e)),fo=E;export{fo as a};
1
+ import{b as j,f as F}from"./chunk-E275HCOS.js";import{Command as A}from"commander";import{Command as b}from"commander";import{oraPromise as I}from"ora";function r({client:t,ora:s}){let o=new b("actions").description("Actions");return o.addCommand(new b("list").description("List actions").action(async()=>{let n=await I(()=>t.action.list().json(),{...s,text:"Finding actions"});console.log(n)})),o}import{Command as v}from"commander";import{oraPromise as S}from"ora";function c({client:t,ora:s}){let o=new v("channels").description("Channels");return o.addCommand(new v("list").description("List channels").action(async()=>{let n=await S(()=>t.channel.list().json(),{...s,text:"Finding channels"});console.log(n)})),o}import{Command as a}from"commander";import{oraPromise as d}from"ora";function p({client:t,ora:s}){let o=new a("contacts").description("Contacts");return o.addCommand(new a("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let i=await d(()=>t.contact.get(n).json(),{...s,text:"Finding contact"});console.log(i)})),o.addCommand(new a("list").description("List contacts").action(async()=>{let n=await d(()=>t.contact.list().json(),{...s,text:"Finding contacts"});console.log(n)})),o.addCommand(new a("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async n=>{let i=await d(()=>t.contact.getVCF(n).response(),{...s,text:"Exporting contact"});console.log(i)})),o}import{Command as l}from"commander";import{oraPromise as L}from"ora";function u({client:t,ora:s}){let o=new l("conversations").description("Conversations");return o.addCommand(new l("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let i=await L(()=>t.conversation.get(n).json(),{...s,text:"Finding conversation"});console.log(i)})),o.addCommand(new l("list").description("List conversations").action(async()=>{let n=await L(()=>t.conversation.list().json(),{...s,text:"Finding conversations"});console.log(n)})),o}import{Command as m}from"commander";import{oraPromise as C}from"ora";function g({client:t,ora:s}){let o=new m("labels").description("Labels");return o.addCommand(new m("get").description("Find label").argument("<label>","Label ID").action(async n=>{let i=await C(()=>t.label.get(n).json(),{...s,text:"Finding label"});console.log(i)})),o.addCommand(new m("list").description("List labels").action(async()=>{let n=await C(()=>t.label.list().json(),{...s,text:"Finding labels"});console.log(n)})),o.addCommand(new m("conversations").description("Find label conversations").argument("<label>","Label ID").action(async n=>{let i=await C(()=>t.conversation.listByLabel(n).json(),{...s,text:"Finding conversations"});console.log(i)})),o}import{Command as D}from"commander";import{oraPromise as M}from"ora";function f({client:t,ora:s}){let o=new D("messages").description("Messages");return o.addCommand(new D("list").description("List messages").action(async()=>{let n=await M(()=>t.message.list().json(),{...s,text:"Finding messages"});console.log(n)})),o}import{Command as O}from"commander";import{oraPromise as P}from"ora";function x({client:t,ora:s}){let o=new O("models").description("Models");return o.addCommand(new O("get").description("Find model").argument("<model>","Model ID").action(async n=>{let i=await P(()=>t.model.get(n).json(),{...s,text:"Finding model"});console.log(i)})),o.addCommand(new O("list").description("List models").action(async()=>{let n=await P(()=>t.model.list().json(),{...s,text:"Finding models"});console.log(n)})),o}import{Command as w}from"commander";import{oraPromise as h}from"ora";function y({client:t,ora:s}){let o=new w("sources").description("Sources");return o.addCommand(new w("get").description("Find source").argument("<source>","Source ID").action(async n=>{let i=await h(()=>t.source.get(n).json(),{...s,text:"Finding source"});console.log(i)})),o.addCommand(new w("list").description("List sources").action(async()=>{let n=await h(()=>t.source.list().json(),{...s,text:"Finding sources"});console.log(n)})),o}var e={ora:{spinner:"simpleDotsScrolling"},client:new F(new j)},E=new A("gds").description("Great Detail Support System").addCommand(r(e)).addCommand(c(e)).addCommand(p(e)).addCommand(u(e)).addCommand(g(e)).addCommand(f(e)).addCommand(x(e)).addCommand(y(e)),fo=E;export{fo as a};
@@ -1 +1 @@
1
- "use strict";var _t=Object.create;var W=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var St=(n,t)=>{for(var e in t)W(n,e,{get:t[e],enumerable:!0})},ct=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!Ut.call(n,s)&&s!==e&&W(n,s,{get:()=>t[s],enumerable:!(o=Lt(t,s))||o.enumerable});return n};var mt=(n,t,e)=>(e=n!=null?_t(At(n)):{},ct(t||!n||!n.__esModule?W(e,"default",{value:n,enumerable:!0}):e,n)),Et=n=>ct(W({},"__esModule",{value:!0}),n);var kt={};St(kt,{default:()=>Gt});module.exports=Et(kt);var yt=require("commander");var p=class{getHeaders(){return{}}};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var dt="SUPPORT_ACCESS_TOKEN",lt="SUPPORT_KEY_NAME",ut="SUPPORT_KEY_PASSWORD",Y="SUPPORT_SIGNING_KEY",Ct="SUPPORT_BASE_URL";var C=class{name;#t;constructor({name:t=process.env[lt],password:e=process.env[ut]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var h=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}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var ht="https://api.support.greatdetail.com",ft={"X-Powered-By":"GDSupport/JavaScript"};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ft;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=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 c of r)s.push(["category",c])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var D=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 bt=mt(require("is-network-error"),1),N=mt(require("ky"),1);var j=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=N.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[c,It]of Object.entries(r))o.headers.has(c)||o.headers.set(c,It)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw(0,bt.default)(s)?new Error("A network error occurred",{cause:s}):s instanceof N.HTTPError?new j(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let s of t)o.append("file",s);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),vt=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var w=class{constructor(t){this._transport=t}async event({key:t=process.env[Y],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."+Y);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}=vt.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 x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var P=class n{static DEFAULT_BASE_URL=ht;static PublicAuthentication=p;static BasicAuthentication=C;static BearerAuthentication=h;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new l(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new f(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new R(this._transport),this.contact=new O(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new I(this._transport),this.escalation=new _(this._transport),this.label=new L(this._transport),this.message=new T(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new w(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[Ct]??this.DEFAULT_BASE_URL}};var z=require("commander"),gt=require("ora");function J({client:n,ora:t}){let e=new z.Command("actions").description("Actions");return e.addCommand(new z.Command("list").description("List actions").action(async()=>{let o=await(0,gt.oraPromise)(()=>n.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var $=require("commander"),Rt=require("ora");function X({client:n,ora:t}){let e=new $.Command("channels").description("Channels");return e.addCommand(new $.Command("list").description("List channels").action(async()=>{let o=await(0,Rt.oraPromise)(()=>n.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),Q=require("ora");function Z({client:n,ora:t}){let e=new B.Command("contacts").description("Contacts");return e.addCommand(new B.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let s=await(0,Q.oraPromise)(()=>n.contact.get(o).json(),{...t,text:"Finding contact"});console.log(s)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,Q.oraPromise)(()=>n.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new B.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let s=await(0,Q.oraPromise)(()=>n.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(s)})),e}var H=require("commander"),tt=require("ora");function et({client:n,ora:t}){let e=new H.Command("conversations").description("Conversations");return e.addCommand(new H.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async o=>{let s=await(0,tt.oraPromise)(()=>n.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(s)})),e.addCommand(new H.Command("list").description("List conversations").action(async()=>{let o=await(0,tt.oraPromise)(()=>n.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),V=require("ora");function ot({client:n,ora:t}){let e=new M.Command("labels").description("Labels");return e.addCommand(new M.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let s=await(0,V.oraPromise)(()=>n.label.get(o).json(),{...t,text:"Finding label"});console.log(s)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,V.oraPromise)(()=>n.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new M.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let s=await(0,V.oraPromise)(()=>n.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(s)})),e}var nt=require("commander"),Ot=require("ora");function st({client:n,ora:t}){let e=new nt.Command("messages").description("Messages");return e.addCommand(new nt.Command("list").description("List messages").action(async()=>{let o=await(0,Ot.oraPromise)(()=>n.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var q=require("commander"),rt=require("ora");function it({client:n,ora:t}){let e=new q.Command("models").description("Models");return e.addCommand(new q.Command("get").description("Find model").argument("<model>","Model ID").action(async o=>{let s=await(0,rt.oraPromise)(()=>n.model.get(o).json(),{...t,text:"Finding model"});console.log(s)})),e.addCommand(new q.Command("list").description("List models").action(async()=>{let o=await(0,rt.oraPromise)(()=>n.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var K=require("commander"),at=require("ora");function pt({client:n,ora:t}){let e=new K.Command("sources").description("Sources");return e.addCommand(new K.Command("get").description("Find source").argument("<source>","Source ID").action(async o=>{let s=await(0,at.oraPromise)(()=>n.source.get(o).json(),{...t,text:"Finding source"});console.log(s)})),e.addCommand(new K.Command("list").description("List sources").action(async()=>{let o=await(0,at.oraPromise)(()=>n.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Dt=new yt.Command("gds").description("Great Detail Support System").addCommand(J(a)).addCommand(X(a)).addCommand(Z(a)).addCommand(et(a)).addCommand(ot(a)).addCommand(st(a)).addCommand(it(a)).addCommand(pt(a)),Gt=Dt;
1
+ "use strict";var _t=Object.create;var W=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var St=(n,t)=>{for(var e in t)W(n,e,{get:t[e],enumerable:!0})},ct=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!Ut.call(n,s)&&s!==e&&W(n,s,{get:()=>t[s],enumerable:!(o=Lt(t,s))||o.enumerable});return n};var mt=(n,t,e)=>(e=n!=null?_t(At(n)):{},ct(t||!n||!n.__esModule?W(e,"default",{value:n,enumerable:!0}):e,n)),Et=n=>ct(W({},"__esModule",{value:!0}),n);var kt={};St(kt,{default:()=>Gt});module.exports=Et(kt);var yt=require("commander");var p=class{getHeaders(){return{}}};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var dt="SUPPORT_ACCESS_TOKEN",lt="SUPPORT_KEY_NAME",ut="SUPPORT_KEY_PASSWORD",Y="SUPPORT_SIGNING_KEY",Ct="SUPPORT_BASE_URL";var C=class{name;#t;constructor({name:t=process.env[lt],password:e=process.env[ut]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var h=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}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var ht="https://api.support.greatdetail.com",ft={"X-Powered-By":"GDSupport/JavaScript"};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,type:o,request:s={}}={}){return this._transport.send("v1/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{}),...this._transport.filterQuery("type",o)]})}listByConversation(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{}),...this._transport.filterQuery("type",s)]})}listByChannel(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o),...this._transport.filterQuery("type",s)]})}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 A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ft;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=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 c of r)s.push(["category",c])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var D=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 bt=mt(require("is-network-error"),1),N=mt(require("ky"),1);var j=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=N.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[c,It]of Object.entries(r))o.headers.has(c)||o.headers.set(c,It)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw(0,bt.default)(s)?new Error("A network error occurred",{cause:s}):s instanceof N.HTTPError?new j(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,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.includeQuery(e??{})],body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),vt=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var w=class{constructor(t){this._transport=t}async event({key:t=process.env[Y],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."+Y);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}=vt.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 x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var P=class n{static DEFAULT_BASE_URL=ht;static PublicAuthentication=p;static BasicAuthentication=C;static BearerAuthentication=h;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new l(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new f(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new R(this._transport),this.contact=new O(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new I(this._transport),this.escalation=new _(this._transport),this.label=new L(this._transport),this.message=new T(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new w(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[Ct]??this.DEFAULT_BASE_URL}};var z=require("commander"),gt=require("ora");function J({client:n,ora:t}){let e=new z.Command("actions").description("Actions");return e.addCommand(new z.Command("list").description("List actions").action(async()=>{let o=await(0,gt.oraPromise)(()=>n.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var $=require("commander"),Rt=require("ora");function X({client:n,ora:t}){let e=new $.Command("channels").description("Channels");return e.addCommand(new $.Command("list").description("List channels").action(async()=>{let o=await(0,Rt.oraPromise)(()=>n.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),Q=require("ora");function Z({client:n,ora:t}){let e=new B.Command("contacts").description("Contacts");return e.addCommand(new B.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let s=await(0,Q.oraPromise)(()=>n.contact.get(o).json(),{...t,text:"Finding contact"});console.log(s)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,Q.oraPromise)(()=>n.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new B.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let s=await(0,Q.oraPromise)(()=>n.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(s)})),e}var H=require("commander"),tt=require("ora");function et({client:n,ora:t}){let e=new H.Command("conversations").description("Conversations");return e.addCommand(new H.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async o=>{let s=await(0,tt.oraPromise)(()=>n.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(s)})),e.addCommand(new H.Command("list").description("List conversations").action(async()=>{let o=await(0,tt.oraPromise)(()=>n.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),V=require("ora");function ot({client:n,ora:t}){let e=new M.Command("labels").description("Labels");return e.addCommand(new M.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let s=await(0,V.oraPromise)(()=>n.label.get(o).json(),{...t,text:"Finding label"});console.log(s)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,V.oraPromise)(()=>n.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new M.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let s=await(0,V.oraPromise)(()=>n.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(s)})),e}var nt=require("commander"),Ot=require("ora");function st({client:n,ora:t}){let e=new nt.Command("messages").description("Messages");return e.addCommand(new nt.Command("list").description("List messages").action(async()=>{let o=await(0,Ot.oraPromise)(()=>n.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var q=require("commander"),rt=require("ora");function it({client:n,ora:t}){let e=new q.Command("models").description("Models");return e.addCommand(new q.Command("get").description("Find model").argument("<model>","Model ID").action(async o=>{let s=await(0,rt.oraPromise)(()=>n.model.get(o).json(),{...t,text:"Finding model"});console.log(s)})),e.addCommand(new q.Command("list").description("List models").action(async()=>{let o=await(0,rt.oraPromise)(()=>n.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var K=require("commander"),at=require("ora");function pt({client:n,ora:t}){let e=new K.Command("sources").description("Sources");return e.addCommand(new K.Command("get").description("Find source").argument("<source>","Source ID").action(async o=>{let s=await(0,at.oraPromise)(()=>n.source.get(o).json(),{...t,text:"Finding source"});console.log(s)})),e.addCommand(new K.Command("list").description("List sources").action(async()=>{let o=await(0,at.oraPromise)(()=>n.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Dt=new yt.Command("gds").description("Great Detail Support System").addCommand(J(a)).addCommand(X(a)).addCommand(Z(a)).addCommand(et(a)).addCommand(ot(a)).addCommand(st(a)).addCommand(it(a)).addCommand(pt(a)),Gt=Dt;
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { C as Client } from '../Client-Bi8CV356.cjs';
2
+ import { C as Client } from '../Client-DOgxwQ_-.cjs';
3
3
  import { Options as Options$1 } from 'ora';
4
4
  import 'ky';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { C as Client } from '../Client-Bi8CV356.js';
2
+ import { C as Client } from '../Client-DOgxwQ_-.js';
3
3
  import { Options as Options$1 } from 'ora';
4
4
  import 'ky';
5
5
  import 'zod';
package/dist/cli/index.js CHANGED
@@ -1 +1 @@
1
- import{a}from"../chunk-YN4K7F6B.js";import"../chunk-Z2KV5TJQ.js";export{a as default};
1
+ import{a}from"../chunk-P4ARLZSL.js";import"../chunk-E275HCOS.js";export{a as default};
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _t=Object.create;var pt=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var St=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!Ut.call(n,s)&&s!==e&&pt(n,s,{get:()=>t[s],enumerable:!(o=Lt(t,s))||o.enumerable});return n};var ct=(n,t,e)=>(e=n!=null?_t(At(n)):{},St(t||!n||!n.__esModule?pt(e,"default",{value:n,enumerable:!0}):e,n));var Ot=require("commander");var p=class{getHeaders(){return{}}};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var mt="SUPPORT_ACCESS_TOKEN",dt="SUPPORT_KEY_NAME",lt="SUPPORT_KEY_PASSWORD",K="SUPPORT_SIGNING_KEY",ut="SUPPORT_BASE_URL";var C=class{name;#t;constructor({name:t=process.env[dt],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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var h=class{#t;constructor({token:t=process.env[mt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var Ct="https://api.support.greatdetail.com",ht={"X-Powered-By":"GDSupport/JavaScript"};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:s={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ht;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=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 c of r)s.push(["category",c])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var D=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 ft=ct(require("is-network-error"),1),j=ct(require("ky"),1);var W=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=j.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[c,It]of Object.entries(r))o.headers.has(c)||o.headers.set(c,It)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw(0,ft.default)(s)?new Error("A network error occurred",{cause:s}):s instanceof j.HTTPError?new W(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let s of t)o.append("file",s);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),vt=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var w=class{constructor(t){this._transport=t}async event({key:t=process.env[K],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."+K);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}=vt.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 x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var P=class n{static DEFAULT_BASE_URL=Ct;static PublicAuthentication=p;static BasicAuthentication=C;static BearerAuthentication=h;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new l(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new f(this._transport),this.boilerplateContent=new v(this._transport),this.channel=new b(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new R(this._transport),this.contact=new O(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new I(this._transport),this.escalation=new _(this._transport),this.label=new L(this._transport),this.message=new T(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new w(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[ut]??this.DEFAULT_BASE_URL}};var Y=require("commander"),bt=require("ora");function z({client:n,ora:t}){let e=new Y.Command("actions").description("Actions");return e.addCommand(new Y.Command("list").description("List actions").action(async()=>{let o=await(0,bt.oraPromise)(()=>n.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var J=require("commander"),gt=require("ora");function $({client:n,ora:t}){let e=new J.Command("channels").description("Channels");return e.addCommand(new J.Command("list").description("List channels").action(async()=>{let o=await(0,gt.oraPromise)(()=>n.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),N=require("ora");function X({client:n,ora:t}){let e=new B.Command("contacts").description("Contacts");return e.addCommand(new B.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let s=await(0,N.oraPromise)(()=>n.contact.get(o).json(),{...t,text:"Finding contact"});console.log(s)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,N.oraPromise)(()=>n.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new B.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let s=await(0,N.oraPromise)(()=>n.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(s)})),e}var Q=require("commander"),Z=require("ora");function tt({client:n,ora:t}){let e=new Q.Command("conversations").description("Conversations");return e.addCommand(new Q.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async o=>{let s=await(0,Z.oraPromise)(()=>n.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(s)})),e.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let o=await(0,Z.oraPromise)(()=>n.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),H=require("ora");function et({client:n,ora:t}){let e=new M.Command("labels").description("Labels");return e.addCommand(new M.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let s=await(0,H.oraPromise)(()=>n.label.get(o).json(),{...t,text:"Finding label"});console.log(s)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,H.oraPromise)(()=>n.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new M.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let s=await(0,H.oraPromise)(()=>n.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(s)})),e}var ot=require("commander"),Rt=require("ora");function nt({client:n,ora:t}){let e=new ot.Command("messages").description("Messages");return e.addCommand(new ot.Command("list").description("List messages").action(async()=>{let o=await(0,Rt.oraPromise)(()=>n.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var V=require("commander"),st=require("ora");function rt({client:n,ora:t}){let e=new V.Command("models").description("Models");return e.addCommand(new V.Command("get").description("Find model").argument("<model>","Model ID").action(async o=>{let s=await(0,st.oraPromise)(()=>n.model.get(o).json(),{...t,text:"Finding model"});console.log(s)})),e.addCommand(new V.Command("list").description("List models").action(async()=>{let o=await(0,st.oraPromise)(()=>n.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var q=require("commander"),it=require("ora");function at({client:n,ora:t}){let e=new q.Command("sources").description("Sources");return e.addCommand(new q.Command("get").description("Find source").argument("<source>","Source ID").action(async o=>{let s=await(0,it.oraPromise)(()=>n.source.get(o).json(),{...t,text:"Finding source"});console.log(s)})),e.addCommand(new q.Command("list").description("List sources").action(async()=>{let o=await(0,it.oraPromise)(()=>n.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Et=new Ot.Command("gds").description("Great Detail Support System").addCommand(z(a)).addCommand($(a)).addCommand(X(a)).addCommand(tt(a)).addCommand(et(a)).addCommand(nt(a)).addCommand(rt(a)).addCommand(at(a)),yt=Et;yt.parseAsync(process.argv);
2
+ "use strict";var _t=Object.create;var pt=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var St=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!Ut.call(n,s)&&s!==e&&pt(n,s,{get:()=>t[s],enumerable:!(o=Lt(t,s))||o.enumerable});return n};var ct=(n,t,e)=>(e=n!=null?_t(At(n)):{},St(t||!n||!n.__esModule?pt(e,"default",{value:n,enumerable:!0}):e,n));var Ot=require("commander");var p=class{getHeaders(){return{}}};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var 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,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}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 l=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var mt="SUPPORT_ACCESS_TOKEN",dt="SUPPORT_KEY_NAME",lt="SUPPORT_KEY_PASSWORD",K="SUPPORT_SIGNING_KEY",ut="SUPPORT_BASE_URL";var C=class{name;#t;constructor({name:t=process.env[dt],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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var h=class{#t;constructor({token:t=process.env[mt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var Ct="https://api.support.greatdetail.com",ht={"X-Powered-By":"GDSupport/JavaScript"};var O=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,type:o,request:s={}}={}){return this._transport.send("v1/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{}),...this._transport.filterQuery("type",o)]})}listByConversation(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{}),...this._transport.filterQuery("type",s)]})}listByChannel(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o),...this._transport.filterQuery("type",s)]})}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 A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ht;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=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 c of r)s.push(["category",c])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var D=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 ft=ct(require("is-network-error"),1),j=ct(require("ky"),1);var W=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=j.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[c,It]of Object.entries(r))o.headers.has(c)||o.headers.set(c,It)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw(0,ft.default)(s)?new Error("A network error occurred",{cause:s}):s instanceof j.HTTPError?new W(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,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.includeQuery(e??{})],body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),vt=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var w=class{constructor(t){this._transport=t}async event({key:t=process.env[K],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."+K);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}=vt.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 x=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var P=class n{static DEFAULT_BASE_URL=Ct;static PublicAuthentication=p;static BasicAuthentication=C;static BearerAuthentication=h;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new d(this._transport),this.accountConversationSettings=new l(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new f(this._transport),this.boilerplateContent=new v(this._transport),this.channel=new b(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new R(this._transport),this.contact=new O(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new I(this._transport),this.escalation=new _(this._transport),this.label=new L(this._transport),this.message=new T(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new w(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[ut]??this.DEFAULT_BASE_URL}};var Y=require("commander"),bt=require("ora");function z({client:n,ora:t}){let e=new Y.Command("actions").description("Actions");return e.addCommand(new Y.Command("list").description("List actions").action(async()=>{let o=await(0,bt.oraPromise)(()=>n.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var J=require("commander"),gt=require("ora");function $({client:n,ora:t}){let e=new J.Command("channels").description("Channels");return e.addCommand(new J.Command("list").description("List channels").action(async()=>{let o=await(0,gt.oraPromise)(()=>n.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),N=require("ora");function X({client:n,ora:t}){let e=new B.Command("contacts").description("Contacts");return e.addCommand(new B.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let s=await(0,N.oraPromise)(()=>n.contact.get(o).json(),{...t,text:"Finding contact"});console.log(s)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,N.oraPromise)(()=>n.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new B.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let s=await(0,N.oraPromise)(()=>n.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(s)})),e}var Q=require("commander"),Z=require("ora");function tt({client:n,ora:t}){let e=new Q.Command("conversations").description("Conversations");return e.addCommand(new Q.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async o=>{let s=await(0,Z.oraPromise)(()=>n.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(s)})),e.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let o=await(0,Z.oraPromise)(()=>n.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),H=require("ora");function et({client:n,ora:t}){let e=new M.Command("labels").description("Labels");return e.addCommand(new M.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let s=await(0,H.oraPromise)(()=>n.label.get(o).json(),{...t,text:"Finding label"});console.log(s)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,H.oraPromise)(()=>n.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new M.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let s=await(0,H.oraPromise)(()=>n.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(s)})),e}var ot=require("commander"),Rt=require("ora");function nt({client:n,ora:t}){let e=new ot.Command("messages").description("Messages");return e.addCommand(new ot.Command("list").description("List messages").action(async()=>{let o=await(0,Rt.oraPromise)(()=>n.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var V=require("commander"),st=require("ora");function rt({client:n,ora:t}){let e=new V.Command("models").description("Models");return e.addCommand(new V.Command("get").description("Find model").argument("<model>","Model ID").action(async o=>{let s=await(0,st.oraPromise)(()=>n.model.get(o).json(),{...t,text:"Finding model"});console.log(s)})),e.addCommand(new V.Command("list").description("List models").action(async()=>{let o=await(0,st.oraPromise)(()=>n.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var q=require("commander"),it=require("ora");function at({client:n,ora:t}){let e=new q.Command("sources").description("Sources");return e.addCommand(new q.Command("get").description("Find source").argument("<source>","Source ID").action(async o=>{let s=await(0,it.oraPromise)(()=>n.source.get(o).json(),{...t,text:"Finding source"});console.log(s)})),e.addCommand(new q.Command("list").description("List sources").action(async()=>{let o=await(0,it.oraPromise)(()=>n.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Et=new Ot.Command("gds").description("Great Detail Support System").addCommand(z(a)).addCommand($(a)).addCommand(X(a)).addCommand(tt(a)).addCommand(et(a)).addCommand(nt(a)).addCommand(rt(a)).addCommand(at(a)),yt=Et;yt.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-YN4K7F6B.js";import"./chunk-Z2KV5TJQ.js";r.parseAsync(process.argv);
2
+ import{a as r}from"./chunk-P4ARLZSL.js";import"./chunk-E275HCOS.js";r.parseAsync(process.argv);
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var tt=Object.create;var w=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var H=(s,t)=>{for(var e in t)w(s,e,{get:t[e],enumerable:!0})},V=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ot(t))!nt.call(s,n)&&n!==e&&w(s,n,{get:()=>t[n],enumerable:!(o=et(t,n))||o.enumerable});return s};var q=(s,t,e)=>(e=s!=null?tt(st(s)):{},V(t||!s||!s.__esModule?w(e,"default",{value:s,enumerable:!0}):e,s)),rt=s=>V(w({},"__esModule",{value:!0}),s);var it={};H(it,{Client:()=>c,DEFAULT_SUPPORT_BASE_URL:()=>M,Error:()=>j,SupportError:()=>a,default:()=>c,eventWebhookSchema:()=>Q});module.exports=rt(it);var M="https://api.support.greatdetail.com",K={"X-Powered-By":"GDSupport/JavaScript"};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var l=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}delete(t,e,{body:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...n,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var d=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var Y="SUPPORT_ACCESS_TOKEN",z="SUPPORT_KEY_NAME",J="SUPPORT_KEY_PASSWORD",N="SUPPORT_SIGNING_KEY",$="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[z],password:e=process.env[J]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var C=class{#t;constructor({token:t=process.env[Y]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,type:o,request:n={}}={}){return this._transport.send("v1/contacts",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=K;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let n=[];if(e){let r=Array.isArray(e)?e:[e];for(let p of r)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var D=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 X=q(require("is-network-error"),1),W=q(require("ky"),1);var a=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=W.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let n of this.options.requestFilterables){let r=await Promise.resolve(n.getHeaders());for(let[p,Z]of Object.entries(r))o.headers.has(p)||o.headers.set(p,Z)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,X.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof W.HTTPError?new a(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),Q=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var P=class{constructor(t){this._transport=t}async event({key:t=process.env[N],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."+N);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}=Q.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let n=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let r of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(r)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var c=class s{static DEFAULT_BASE_URL=M;static PublicAuthentication=f;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new O(this._transport),this.contact=new x(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new _(this._transport),this.escalation=new T(this._transport),this.label=new I(this._transport),this.message=new L(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[$]??this.DEFAULT_BASE_URL}};var j={};H(j,{SupportError:()=>a});0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SupportError,eventWebhookSchema});
1
+ "use strict";var tt=Object.create;var w=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var H=(n,t)=>{for(var e in t)w(n,e,{get:t[e],enumerable:!0})},V=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ot(t))!nt.call(n,s)&&s!==e&&w(n,s,{get:()=>t[s],enumerable:!(o=et(t,s))||o.enumerable});return n};var q=(n,t,e)=>(e=n!=null?tt(st(n)):{},V(t||!n||!n.__esModule?w(e,"default",{value:n,enumerable:!0}):e,n)),rt=n=>V(w({},"__esModule",{value:!0}),n);var it={};H(it,{Client:()=>c,DEFAULT_SUPPORT_BASE_URL:()=>M,Error:()=>j,SupportError:()=>a,default:()=>c,eventWebhookSchema:()=>Q});module.exports=rt(it);var M="https://api.support.greatdetail.com",K={"X-Powered-By":"GDSupport/JavaScript"};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var l=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}delete(t,e,{body:o,request: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 d=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var Y="SUPPORT_ACCESS_TOKEN",z="SUPPORT_KEY_NAME",J="SUPPORT_KEY_PASSWORD",N="SUPPORT_SIGNING_KEY",$="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[z],password:e=process.env[J]}={}){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}async getHeaders(){let t=typeof this.name=="function"?await Promise.resolve(this.name()):this.name,e=typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t;return{Authorization:`Basic ${btoa(t+":"+e)}`}}};var C=class{#t;constructor({token:t=process.env[Y]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async getHeaders(){return{Authorization:`Bearer ${typeof this.#t=="function"?await Promise.resolve(this.#t()):this.#t}`}}};var f=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var 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 g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",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({limit:t,query:e,type:o,request:s={}}={}){return this._transport.send("v1/contacts",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.filterQuery("type",o)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:s,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...this._transport.filterQuery("filter",o),...this._transport.includeQuery(s??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/feedback/conversation/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/feedback/conversation",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}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 I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/escalations",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var T=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:s={}}={}){return this._transport.send("v1/labels",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,type:o,request:s={}}={}){return this._transport.send("v1/messages",{...s,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{}),...this._transport.filterQuery("type",o)]})}listByConversation(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{}),...this._transport.filterQuery("type",s)]})}listByChannel(t,{limit:e,include:o,type:s,request:r={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...r,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o),...this._transport.filterQuery("type",s)]})}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 A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var U=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=K;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var E=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 p of r)s.push(["category",p])}return t!==void 0&&s.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:s})}};var D=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 X=q(require("is-network-error"),1),W=q(require("ky"),1);var a=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var G=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=W.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[async o=>{for(let s of this.options.requestFilterables){let r=await Promise.resolve(s.getHeaders());for(let[p,Z]of Object.entries(r))o.headers.has(p)||o.headers.set(p,Z)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,s]of Object.entries(t))s!==void 0&&e.push(["sort",s+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}filterQuery(t,e){let o=[];return e===void 0||o.push([t,e]),o}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw(0,X.default)(s)?new Error("A network error occurred",{cause:s}):s instanceof W.HTTPError?new a(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,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.includeQuery(e??{})],body:s})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var F=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),Q=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var P=class{constructor(t){this._transport=t}async event({key:t=process.env[N],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."+N);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}=Q.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 B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var c=class n{static DEFAULT_BASE_URL=M;static PublicAuthentication=f;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;conversationFeedback;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new G({requestFilterables:[new S,t],...o,baseURL:e?.toString()??n.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new g(this._transport),this.contact=new x(this._transport),this.conversation=new y(this._transport),this.conversationFeedback=new _(this._transport),this.escalation=new I(this._transport),this.label=new T(this._transport),this.message=new L(this._transport),this.model=new A(this._transport),this.note=new U(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new F(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[$]??this.DEFAULT_BASE_URL}};var j={};H(j,{SupportError:()=>a});0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SupportError,eventWebhookSchema});
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, dh as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, dg as AccountWebhookWebhookEventType, z as Action, B as ActionID, bi as ActiveConversationStatus, _ as BoilerplateCategory, $ as BoilerplateCategoryID, H as BoilerplateContent, I as BoilerplateContentID, ab as Channel, as as ChannelConversationSettings, ac as ChannelID, C as Client, ay as CompositionSection, az as CompositionSectionID, bj as ConcludedConversationStatus, aW as Contact, a_ as ContactCustomMetadata, aX as ContactID, aZ as ContactStatus, aY as ContactType, di as ContactWebhookEventType, bf as Conversation, bh as ConversationCustomMetadata, bH as ConversationFeedback, bg as ConversationID, bG as ConversationSettings, bk as ConversationStatus, dj as ConversationWebhookEventType, m as CreateAccountAccessTokenOptions, l as CreateAccountAccessTokenPayload, n as CreateAccountAccessTokenResponse, e as CreateAccountOptions, d as CreateAccountPayload, f as CreateAccountResponse, a1 as CreateBoilerplateCategoryOptions, a0 as CreateBoilerplateCategoryPayload, a2 as CreateBoilerplateCategoryResponse, K as CreateBoilerplateContentOptions, J as CreateBoilerplateContentPayload, M as CreateBoilerplateContentResponse, ae as CreateChannelOptions, ad as CreateChannelPayload, af as CreateChannelResponse, aB as CreateCompositionSectionOptions, aA as CreateCompositionSectionPayload, aC as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bJ as CreateConversationFeedbackOptions, bI as CreateConversationFeedbackPayload, bK as CreateConversationFeedbackResponse, bm as CreateConversationOptions, bl as CreateConversationPayload, bn as CreateConversationResponse, cx as CreateCorrectionModelOptions, cw as CreateCorrectionModelPayload, cy as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bV as CreateLabelOptions, bU as CreateLabelPayload, bW as CreateLabelResponse, cc as CreateMessageOptions, cb as CreateMessagePayload, cd as CreateMessageResponse, cJ as CreateNoteOptions, cI as CreateNotePayload, cK as CreateNoteResponse, cA as CreateResponseModelOptions, cz as CreateResponseModelPayload, cB as CreateResponseResponse, d0 as CreateUploadOptions, d1 as CreateUploadResponse, dr as CreateWebhookSubscriptionOptions, dq as CreateWebhookSubscriptionPayload, ds as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bL as DeleteConversationFeedbackOptions, bM as DeleteConversationFeedbackResponse, bo as DeleteConversationOptions, bp as DeleteConversationResponse, bX as DeleteLabelOptions, bY as DeleteLabelResponse, ce as DeleteMessageOptions, cf as DeleteMessageResponse, d2 as DeleteUploadOptions, d3 as DeleteUploadResponse, dt as DeleteWebhookSubscriptionOptions, du as DeleteWebhookSubscriptionResponse, aM as Escalation, dd as EventWebhookOptions, q as GetAccountAccessTokenOptions, r as GetAccountAccessTokenResponse, u as GetAccountConversationSettingsOptions, v as GetAccountConversationSettingsResponse, G as GetAccountOptions, g as GetAccountResponse, a3 as GetBoilerplateCategoryOptions, a4 as GetBoilerplateCategoryResponse, N as GetBoilerplateContentOptions, P as GetBoilerplateContentResponse, at as GetChannelConversationSettingsOptions, au as GetChannelConversationSettingsResponse, ag as GetChannelOptions, ah as GetChannelResponse, aD as GetCompositionSectionOptions, aE as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bN as GetConversationFeedbackOptions, bO as GetConversationFeedbackResponse, bq as GetConversationIncludeOptions, br as GetConversationOptions, bs as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bZ as GetLabelOptions, b_ as GetLabelResponse, cg as GetMessageOptions, ch as GetMessageResponse, cC as GetModelOptions, cD as GetModelResponse, cL as GetNoteOptions, cM as GetNoteResponse, cW as GetSourceOptions, cX as GetSourceResponse, d4 as GetUploadOptions, d5 as GetUploadResponse, da as GetUserOptions, db as GetUserResponse, dv as GetWebhookSubscriptionOptions, dw as GetWebhookSubscriptionResponse, bT as Label, b$ as LabelID, L as ListAccountAccessTokensOptions, s as ListAccountAccessTokensResponse, E as ListActionsOptions, F as ListActionsResponse, a5 as ListBoilerplateCategoriesIncludeOptions, a6 as ListBoilerplateCategoriesOptions, a7 as ListBoilerplateCategoriesResponse, Q as ListBoilerplateCategoryBoilerplateContentsOptions, T as ListBoilerplateCategoryBoilerplateContentsResponse, V as ListBoilerplateContentsOptions, W as ListBoilerplateContentsResponse, aF as ListChannelCompositionSectionsOptions, aG as ListChannelCompositionSectionsResponse, bt as ListChannelConversationsOptions, bu as ListChannelConversationsResponse, ci as ListChannelMessagesIncludeOptions, cj as ListChannelMessagesOptions, ck as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, bv as ListContactConversationsOptions, bw as ListContactConversationsResponse, c0 as ListContactLabelsOptions, c1 as ListContactLabelsResponse, cN as ListContactNotesOptions, cO as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bP as ListConversationConversationFeedbackOptions, bQ as ListConversationConversationFeedbackResponse, aS as ListConversationEscalationsOptions, aT as ListConversationEscalationsResponse, bR as ListConversationFeedbackOptions, bS as ListConversationFeedbackResponse, c2 as ListConversationLabelsOptions, c3 as ListConversationLabelsResponse, cl as ListConversationMessagesIncludeOptions, cm as ListConversationMessagesOptions, cn as ListConversationMessagesResponse, cP as ListConversationNotesOptions, cQ as ListConversationNotesResponse, bz as ListConversationOptions, by as ListConversationsFilterOptions, bx as ListConversationsIncludeOptions, bA as ListConversationsResponse, aU as ListEscalationsOptions, aV as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bB as ListLabelConversationsOptions, bC as ListLabelConversationsResponse, c4 as ListLabelsIncludeOptions, c5 as ListLabelsOptions, c6 as ListLabelsResponse, co as ListMessagesIncludeOptions, cp as ListMessagesOptions, cq as ListMessagesResponse, cE as ListModelsOptions, cF as ListModelsResponse, cY as ListSourcesOptions, cZ as ListSourcesResponse, d6 as ListUploadsOptions, d7 as ListUploadsResponse, dx as ListWebhookSubscriptionsOptions, dy as ListWebhookSubscriptionsResponse, ca as Message, cu as MessageEventType, cr as MessageID, cs as MessageRole, ct as MessageStatus, dk as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cv as Model, cG as ModelID, cH as Note, cR as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cV as Source, c_ as SourceID, dz as TestWebhookSubscriptionOptions, dA as TestWebhookSubscriptionResponse, a as TransportOptions, am as TwilioSendChannelSyncPayload, an as TwilioSendgridChannelSyncOptions, ao as TwilioSendgridChannelSyncResponse, x as UpdateAccountConversationSettingsOptions, w as UpdateAccountConversationSettingsPayload, y as UpdateAccountConversationSettingsResponse, h as UpdateAccountOptions, U as UpdateAccountPayload, i as UpdateAccountResponse, a9 as UpdateBoilerplateCategoryOptions, a8 as UpdateBoilerplateCategoryPayload, aa as UpdateBoilerplateCategoryResponse, Y as UpdateBoilerplateContentOptions, X as UpdateBoilerplateContentPayload, Z as UpdateBoilerplateContentResponse, aw as UpdateChannelConversationSettingsOptions, av as UpdateChannelConversationSettingsPayload, ax as UpdateChannelConversationSettingsResponse, aq as UpdateChannelOptions, ap as UpdateChannelPayload, ar as UpdateChannelResponse, aK as UpdateCompositionSectionOptions, aJ as UpdateCompositionSectionPayload, aL as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bE as UpdateConversationOptions, bD as UpdateConversationPayload, bF as UpdateConversationResponse, c8 as UpdateLabelOptions, c7 as UpdateLabelPayload, c9 as UpdateLabelResponse, cT as UpdateNoteOptions, cS as UpdateNotePayload, cU as UpdateNoteResponse, c$ as Upload, d8 as UploadID, d9 as User, dc as UserID, dm as WebhookEventPayload, df as WebhookEventType, dn as WebhookResponse, dp as WebhookSubscription, dB as WebhookSubscriptionID, dl as WebhookSubscriptionWebhookEventType, C as default, de as eventWebhookSchema } from './Client-Bi8CV356.cjs';
1
+ export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, dj as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, di as AccountWebhookWebhookEventType, z as Action, B as ActionID, bi as ActiveConversationStatus, _ as BoilerplateCategory, $ as BoilerplateCategoryID, H as BoilerplateContent, I as BoilerplateContentID, ab as Channel, as as ChannelConversationSettings, ac as ChannelID, C as Client, ay as CompositionSection, az as CompositionSectionID, bj as ConcludedConversationStatus, aW as Contact, a_ as ContactCustomMetadata, aX as ContactID, aZ as ContactStatus, aY as ContactType, dk as ContactWebhookEventType, bf as Conversation, bh as ConversationCustomMetadata, bH as ConversationFeedback, bg as ConversationID, bG as ConversationSettings, bk as ConversationStatus, dl as ConversationWebhookEventType, m as CreateAccountAccessTokenOptions, l as CreateAccountAccessTokenPayload, n as CreateAccountAccessTokenResponse, e as CreateAccountOptions, d as CreateAccountPayload, f as CreateAccountResponse, a1 as CreateBoilerplateCategoryOptions, a0 as CreateBoilerplateCategoryPayload, a2 as CreateBoilerplateCategoryResponse, K as CreateBoilerplateContentOptions, J as CreateBoilerplateContentPayload, M as CreateBoilerplateContentResponse, ae as CreateChannelOptions, ad as CreateChannelPayload, af as CreateChannelResponse, aB as CreateCompositionSectionOptions, aA as CreateCompositionSectionPayload, aC as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bJ as CreateConversationFeedbackOptions, bI as CreateConversationFeedbackPayload, bK as CreateConversationFeedbackResponse, bm as CreateConversationOptions, bl as CreateConversationPayload, bn as CreateConversationResponse, cy as CreateCorrectionModelOptions, cx as CreateCorrectionModelPayload, cz as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bV as CreateLabelOptions, bU as CreateLabelPayload, bW as CreateLabelResponse, cc as CreateMessageOptions, cb as CreateMessagePayload, cd as CreateMessageResponse, cK as CreateNoteOptions, cJ as CreateNotePayload, cL as CreateNoteResponse, cB as CreateResponseModelOptions, cA as CreateResponseModelPayload, cC as CreateResponseResponse, d1 as CreateUploadIncludeOptions, d2 as CreateUploadOptions, d3 as CreateUploadResponse, dt as CreateWebhookSubscriptionOptions, ds as CreateWebhookSubscriptionPayload, du as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bL as DeleteConversationFeedbackOptions, bM as DeleteConversationFeedbackResponse, bo as DeleteConversationOptions, bp as DeleteConversationResponse, bX as DeleteLabelOptions, bY as DeleteLabelResponse, ce as DeleteMessageOptions, cf as DeleteMessageResponse, d4 as DeleteUploadOptions, d5 as DeleteUploadResponse, dv as DeleteWebhookSubscriptionOptions, dw as DeleteWebhookSubscriptionResponse, aM as Escalation, df as EventWebhookOptions, q as GetAccountAccessTokenOptions, r as GetAccountAccessTokenResponse, u as GetAccountConversationSettingsOptions, v as GetAccountConversationSettingsResponse, G as GetAccountOptions, g as GetAccountResponse, a3 as GetBoilerplateCategoryOptions, a4 as GetBoilerplateCategoryResponse, N as GetBoilerplateContentOptions, P as GetBoilerplateContentResponse, at as GetChannelConversationSettingsOptions, au as GetChannelConversationSettingsResponse, ag as GetChannelOptions, ah as GetChannelResponse, aD as GetCompositionSectionOptions, aE as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bN as GetConversationFeedbackOptions, bO as GetConversationFeedbackResponse, bq as GetConversationIncludeOptions, br as GetConversationOptions, bs as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bZ as GetLabelOptions, b_ as GetLabelResponse, cg as GetMessageOptions, ch as GetMessageResponse, cD as GetModelOptions, cE as GetModelResponse, cM as GetNoteOptions, cN as GetNoteResponse, cX as GetSourceOptions, cY as GetSourceResponse, d6 as GetUploadOptions, d7 as GetUploadResponse, dc as GetUserOptions, dd as GetUserResponse, dx as GetWebhookSubscriptionOptions, dy as GetWebhookSubscriptionResponse, bT as Label, b$ as LabelID, L as ListAccountAccessTokensOptions, s as ListAccountAccessTokensResponse, E as ListActionsOptions, F as ListActionsResponse, a5 as ListBoilerplateCategoriesIncludeOptions, a6 as ListBoilerplateCategoriesOptions, a7 as ListBoilerplateCategoriesResponse, Q as ListBoilerplateCategoryBoilerplateContentsOptions, T as ListBoilerplateCategoryBoilerplateContentsResponse, V as ListBoilerplateContentsOptions, W as ListBoilerplateContentsResponse, aF as ListChannelCompositionSectionsOptions, aG as ListChannelCompositionSectionsResponse, bt as ListChannelConversationsOptions, bu as ListChannelConversationsResponse, ci as ListChannelMessagesIncludeOptions, cj as ListChannelMessagesOptions, ck as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, bv as ListContactConversationsOptions, bw as ListContactConversationsResponse, c0 as ListContactLabelsOptions, c1 as ListContactLabelsResponse, cO as ListContactNotesOptions, cP as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bP as ListConversationConversationFeedbackOptions, bQ as ListConversationConversationFeedbackResponse, aS as ListConversationEscalationsOptions, aT as ListConversationEscalationsResponse, bR as ListConversationFeedbackOptions, bS as ListConversationFeedbackResponse, c2 as ListConversationLabelsOptions, c3 as ListConversationLabelsResponse, cl as ListConversationMessagesIncludeOptions, cm as ListConversationMessagesOptions, cn as ListConversationMessagesResponse, cQ as ListConversationNotesOptions, cR as ListConversationNotesResponse, bz as ListConversationOptions, by as ListConversationsFilterOptions, bx as ListConversationsIncludeOptions, bA as ListConversationsResponse, aU as ListEscalationsOptions, aV as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bB as ListLabelConversationsOptions, bC as ListLabelConversationsResponse, c4 as ListLabelsIncludeOptions, c5 as ListLabelsOptions, c6 as ListLabelsResponse, co as ListMessagesIncludeOptions, cp as ListMessagesOptions, cq as ListMessagesResponse, cF as ListModelsOptions, cG as ListModelsResponse, cZ as ListSourcesOptions, c_ as ListSourcesResponse, d8 as ListUploadsOptions, d9 as ListUploadsResponse, dz as ListWebhookSubscriptionsOptions, dA as ListWebhookSubscriptionsResponse, ca as Message, cv as MessageEventType, cr as MessageID, cs as MessageRole, cu as MessageStatus, ct as MessageType, dm as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cw as Model, cH as ModelID, cI as Note, cS as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cW as Source, c$ as SourceID, dB as TestWebhookSubscriptionOptions, dC as TestWebhookSubscriptionResponse, a as TransportOptions, am as TwilioSendChannelSyncPayload, an as TwilioSendgridChannelSyncOptions, ao as TwilioSendgridChannelSyncResponse, x as UpdateAccountConversationSettingsOptions, w as UpdateAccountConversationSettingsPayload, y as UpdateAccountConversationSettingsResponse, h as UpdateAccountOptions, U as UpdateAccountPayload, i as UpdateAccountResponse, a9 as UpdateBoilerplateCategoryOptions, a8 as UpdateBoilerplateCategoryPayload, aa as UpdateBoilerplateCategoryResponse, Y as UpdateBoilerplateContentOptions, X as UpdateBoilerplateContentPayload, Z as UpdateBoilerplateContentResponse, aw as UpdateChannelConversationSettingsOptions, av as UpdateChannelConversationSettingsPayload, ax as UpdateChannelConversationSettingsResponse, aq as UpdateChannelOptions, ap as UpdateChannelPayload, ar as UpdateChannelResponse, aK as UpdateCompositionSectionOptions, aJ as UpdateCompositionSectionPayload, aL as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bE as UpdateConversationOptions, bD as UpdateConversationPayload, bF as UpdateConversationResponse, c8 as UpdateLabelOptions, c7 as UpdateLabelPayload, c9 as UpdateLabelResponse, cU as UpdateNoteOptions, cT as UpdateNotePayload, cV as UpdateNoteResponse, d0 as Upload, da as UploadID, db as User, de as UserID, dp as WebhookEventPayload, dh as WebhookEventType, dq as WebhookResponse, dr as WebhookSubscription, dD as WebhookSubscriptionID, dn as WebhookSubscriptionWebhookEventType, C as default, dg as eventWebhookSchema } from './Client-DOgxwQ_-.cjs';
2
2
  import { KyResponse } from 'ky';
3
3
  import 'zod';
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, dh as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, dg as AccountWebhookWebhookEventType, z as Action, B as ActionID, bi as ActiveConversationStatus, _ as BoilerplateCategory, $ as BoilerplateCategoryID, H as BoilerplateContent, I as BoilerplateContentID, ab as Channel, as as ChannelConversationSettings, ac as ChannelID, C as Client, ay as CompositionSection, az as CompositionSectionID, bj as ConcludedConversationStatus, aW as Contact, a_ as ContactCustomMetadata, aX as ContactID, aZ as ContactStatus, aY as ContactType, di as ContactWebhookEventType, bf as Conversation, bh as ConversationCustomMetadata, bH as ConversationFeedback, bg as ConversationID, bG as ConversationSettings, bk as ConversationStatus, dj as ConversationWebhookEventType, m as CreateAccountAccessTokenOptions, l as CreateAccountAccessTokenPayload, n as CreateAccountAccessTokenResponse, e as CreateAccountOptions, d as CreateAccountPayload, f as CreateAccountResponse, a1 as CreateBoilerplateCategoryOptions, a0 as CreateBoilerplateCategoryPayload, a2 as CreateBoilerplateCategoryResponse, K as CreateBoilerplateContentOptions, J as CreateBoilerplateContentPayload, M as CreateBoilerplateContentResponse, ae as CreateChannelOptions, ad as CreateChannelPayload, af as CreateChannelResponse, aB as CreateCompositionSectionOptions, aA as CreateCompositionSectionPayload, aC as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bJ as CreateConversationFeedbackOptions, bI as CreateConversationFeedbackPayload, bK as CreateConversationFeedbackResponse, bm as CreateConversationOptions, bl as CreateConversationPayload, bn as CreateConversationResponse, cx as CreateCorrectionModelOptions, cw as CreateCorrectionModelPayload, cy as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bV as CreateLabelOptions, bU as CreateLabelPayload, bW as CreateLabelResponse, cc as CreateMessageOptions, cb as CreateMessagePayload, cd as CreateMessageResponse, cJ as CreateNoteOptions, cI as CreateNotePayload, cK as CreateNoteResponse, cA as CreateResponseModelOptions, cz as CreateResponseModelPayload, cB as CreateResponseResponse, d0 as CreateUploadOptions, d1 as CreateUploadResponse, dr as CreateWebhookSubscriptionOptions, dq as CreateWebhookSubscriptionPayload, ds as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bL as DeleteConversationFeedbackOptions, bM as DeleteConversationFeedbackResponse, bo as DeleteConversationOptions, bp as DeleteConversationResponse, bX as DeleteLabelOptions, bY as DeleteLabelResponse, ce as DeleteMessageOptions, cf as DeleteMessageResponse, d2 as DeleteUploadOptions, d3 as DeleteUploadResponse, dt as DeleteWebhookSubscriptionOptions, du as DeleteWebhookSubscriptionResponse, aM as Escalation, dd as EventWebhookOptions, q as GetAccountAccessTokenOptions, r as GetAccountAccessTokenResponse, u as GetAccountConversationSettingsOptions, v as GetAccountConversationSettingsResponse, G as GetAccountOptions, g as GetAccountResponse, a3 as GetBoilerplateCategoryOptions, a4 as GetBoilerplateCategoryResponse, N as GetBoilerplateContentOptions, P as GetBoilerplateContentResponse, at as GetChannelConversationSettingsOptions, au as GetChannelConversationSettingsResponse, ag as GetChannelOptions, ah as GetChannelResponse, aD as GetCompositionSectionOptions, aE as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bN as GetConversationFeedbackOptions, bO as GetConversationFeedbackResponse, bq as GetConversationIncludeOptions, br as GetConversationOptions, bs as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bZ as GetLabelOptions, b_ as GetLabelResponse, cg as GetMessageOptions, ch as GetMessageResponse, cC as GetModelOptions, cD as GetModelResponse, cL as GetNoteOptions, cM as GetNoteResponse, cW as GetSourceOptions, cX as GetSourceResponse, d4 as GetUploadOptions, d5 as GetUploadResponse, da as GetUserOptions, db as GetUserResponse, dv as GetWebhookSubscriptionOptions, dw as GetWebhookSubscriptionResponse, bT as Label, b$ as LabelID, L as ListAccountAccessTokensOptions, s as ListAccountAccessTokensResponse, E as ListActionsOptions, F as ListActionsResponse, a5 as ListBoilerplateCategoriesIncludeOptions, a6 as ListBoilerplateCategoriesOptions, a7 as ListBoilerplateCategoriesResponse, Q as ListBoilerplateCategoryBoilerplateContentsOptions, T as ListBoilerplateCategoryBoilerplateContentsResponse, V as ListBoilerplateContentsOptions, W as ListBoilerplateContentsResponse, aF as ListChannelCompositionSectionsOptions, aG as ListChannelCompositionSectionsResponse, bt as ListChannelConversationsOptions, bu as ListChannelConversationsResponse, ci as ListChannelMessagesIncludeOptions, cj as ListChannelMessagesOptions, ck as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, bv as ListContactConversationsOptions, bw as ListContactConversationsResponse, c0 as ListContactLabelsOptions, c1 as ListContactLabelsResponse, cN as ListContactNotesOptions, cO as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bP as ListConversationConversationFeedbackOptions, bQ as ListConversationConversationFeedbackResponse, aS as ListConversationEscalationsOptions, aT as ListConversationEscalationsResponse, bR as ListConversationFeedbackOptions, bS as ListConversationFeedbackResponse, c2 as ListConversationLabelsOptions, c3 as ListConversationLabelsResponse, cl as ListConversationMessagesIncludeOptions, cm as ListConversationMessagesOptions, cn as ListConversationMessagesResponse, cP as ListConversationNotesOptions, cQ as ListConversationNotesResponse, bz as ListConversationOptions, by as ListConversationsFilterOptions, bx as ListConversationsIncludeOptions, bA as ListConversationsResponse, aU as ListEscalationsOptions, aV as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bB as ListLabelConversationsOptions, bC as ListLabelConversationsResponse, c4 as ListLabelsIncludeOptions, c5 as ListLabelsOptions, c6 as ListLabelsResponse, co as ListMessagesIncludeOptions, cp as ListMessagesOptions, cq as ListMessagesResponse, cE as ListModelsOptions, cF as ListModelsResponse, cY as ListSourcesOptions, cZ as ListSourcesResponse, d6 as ListUploadsOptions, d7 as ListUploadsResponse, dx as ListWebhookSubscriptionsOptions, dy as ListWebhookSubscriptionsResponse, ca as Message, cu as MessageEventType, cr as MessageID, cs as MessageRole, ct as MessageStatus, dk as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cv as Model, cG as ModelID, cH as Note, cR as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cV as Source, c_ as SourceID, dz as TestWebhookSubscriptionOptions, dA as TestWebhookSubscriptionResponse, a as TransportOptions, am as TwilioSendChannelSyncPayload, an as TwilioSendgridChannelSyncOptions, ao as TwilioSendgridChannelSyncResponse, x as UpdateAccountConversationSettingsOptions, w as UpdateAccountConversationSettingsPayload, y as UpdateAccountConversationSettingsResponse, h as UpdateAccountOptions, U as UpdateAccountPayload, i as UpdateAccountResponse, a9 as UpdateBoilerplateCategoryOptions, a8 as UpdateBoilerplateCategoryPayload, aa as UpdateBoilerplateCategoryResponse, Y as UpdateBoilerplateContentOptions, X as UpdateBoilerplateContentPayload, Z as UpdateBoilerplateContentResponse, aw as UpdateChannelConversationSettingsOptions, av as UpdateChannelConversationSettingsPayload, ax as UpdateChannelConversationSettingsResponse, aq as UpdateChannelOptions, ap as UpdateChannelPayload, ar as UpdateChannelResponse, aK as UpdateCompositionSectionOptions, aJ as UpdateCompositionSectionPayload, aL as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bE as UpdateConversationOptions, bD as UpdateConversationPayload, bF as UpdateConversationResponse, c8 as UpdateLabelOptions, c7 as UpdateLabelPayload, c9 as UpdateLabelResponse, cT as UpdateNoteOptions, cS as UpdateNotePayload, cU as UpdateNoteResponse, c$ as Upload, d8 as UploadID, d9 as User, dc as UserID, dm as WebhookEventPayload, df as WebhookEventType, dn as WebhookResponse, dp as WebhookSubscription, dB as WebhookSubscriptionID, dl as WebhookSubscriptionWebhookEventType, C as default, de as eventWebhookSchema } from './Client-Bi8CV356.js';
1
+ export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, dj as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, di as AccountWebhookWebhookEventType, z as Action, B as ActionID, bi as ActiveConversationStatus, _ as BoilerplateCategory, $ as BoilerplateCategoryID, H as BoilerplateContent, I as BoilerplateContentID, ab as Channel, as as ChannelConversationSettings, ac as ChannelID, C as Client, ay as CompositionSection, az as CompositionSectionID, bj as ConcludedConversationStatus, aW as Contact, a_ as ContactCustomMetadata, aX as ContactID, aZ as ContactStatus, aY as ContactType, dk as ContactWebhookEventType, bf as Conversation, bh as ConversationCustomMetadata, bH as ConversationFeedback, bg as ConversationID, bG as ConversationSettings, bk as ConversationStatus, dl as ConversationWebhookEventType, m as CreateAccountAccessTokenOptions, l as CreateAccountAccessTokenPayload, n as CreateAccountAccessTokenResponse, e as CreateAccountOptions, d as CreateAccountPayload, f as CreateAccountResponse, a1 as CreateBoilerplateCategoryOptions, a0 as CreateBoilerplateCategoryPayload, a2 as CreateBoilerplateCategoryResponse, K as CreateBoilerplateContentOptions, J as CreateBoilerplateContentPayload, M as CreateBoilerplateContentResponse, ae as CreateChannelOptions, ad as CreateChannelPayload, af as CreateChannelResponse, aB as CreateCompositionSectionOptions, aA as CreateCompositionSectionPayload, aC as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bJ as CreateConversationFeedbackOptions, bI as CreateConversationFeedbackPayload, bK as CreateConversationFeedbackResponse, bm as CreateConversationOptions, bl as CreateConversationPayload, bn as CreateConversationResponse, cy as CreateCorrectionModelOptions, cx as CreateCorrectionModelPayload, cz as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bV as CreateLabelOptions, bU as CreateLabelPayload, bW as CreateLabelResponse, cc as CreateMessageOptions, cb as CreateMessagePayload, cd as CreateMessageResponse, cK as CreateNoteOptions, cJ as CreateNotePayload, cL as CreateNoteResponse, cB as CreateResponseModelOptions, cA as CreateResponseModelPayload, cC as CreateResponseResponse, d1 as CreateUploadIncludeOptions, d2 as CreateUploadOptions, d3 as CreateUploadResponse, dt as CreateWebhookSubscriptionOptions, ds as CreateWebhookSubscriptionPayload, du as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bL as DeleteConversationFeedbackOptions, bM as DeleteConversationFeedbackResponse, bo as DeleteConversationOptions, bp as DeleteConversationResponse, bX as DeleteLabelOptions, bY as DeleteLabelResponse, ce as DeleteMessageOptions, cf as DeleteMessageResponse, d4 as DeleteUploadOptions, d5 as DeleteUploadResponse, dv as DeleteWebhookSubscriptionOptions, dw as DeleteWebhookSubscriptionResponse, aM as Escalation, df as EventWebhookOptions, q as GetAccountAccessTokenOptions, r as GetAccountAccessTokenResponse, u as GetAccountConversationSettingsOptions, v as GetAccountConversationSettingsResponse, G as GetAccountOptions, g as GetAccountResponse, a3 as GetBoilerplateCategoryOptions, a4 as GetBoilerplateCategoryResponse, N as GetBoilerplateContentOptions, P as GetBoilerplateContentResponse, at as GetChannelConversationSettingsOptions, au as GetChannelConversationSettingsResponse, ag as GetChannelOptions, ah as GetChannelResponse, aD as GetCompositionSectionOptions, aE as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bN as GetConversationFeedbackOptions, bO as GetConversationFeedbackResponse, bq as GetConversationIncludeOptions, br as GetConversationOptions, bs as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bZ as GetLabelOptions, b_ as GetLabelResponse, cg as GetMessageOptions, ch as GetMessageResponse, cD as GetModelOptions, cE as GetModelResponse, cM as GetNoteOptions, cN as GetNoteResponse, cX as GetSourceOptions, cY as GetSourceResponse, d6 as GetUploadOptions, d7 as GetUploadResponse, dc as GetUserOptions, dd as GetUserResponse, dx as GetWebhookSubscriptionOptions, dy as GetWebhookSubscriptionResponse, bT as Label, b$ as LabelID, L as ListAccountAccessTokensOptions, s as ListAccountAccessTokensResponse, E as ListActionsOptions, F as ListActionsResponse, a5 as ListBoilerplateCategoriesIncludeOptions, a6 as ListBoilerplateCategoriesOptions, a7 as ListBoilerplateCategoriesResponse, Q as ListBoilerplateCategoryBoilerplateContentsOptions, T as ListBoilerplateCategoryBoilerplateContentsResponse, V as ListBoilerplateContentsOptions, W as ListBoilerplateContentsResponse, aF as ListChannelCompositionSectionsOptions, aG as ListChannelCompositionSectionsResponse, bt as ListChannelConversationsOptions, bu as ListChannelConversationsResponse, ci as ListChannelMessagesIncludeOptions, cj as ListChannelMessagesOptions, ck as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, bv as ListContactConversationsOptions, bw as ListContactConversationsResponse, c0 as ListContactLabelsOptions, c1 as ListContactLabelsResponse, cO as ListContactNotesOptions, cP as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bP as ListConversationConversationFeedbackOptions, bQ as ListConversationConversationFeedbackResponse, aS as ListConversationEscalationsOptions, aT as ListConversationEscalationsResponse, bR as ListConversationFeedbackOptions, bS as ListConversationFeedbackResponse, c2 as ListConversationLabelsOptions, c3 as ListConversationLabelsResponse, cl as ListConversationMessagesIncludeOptions, cm as ListConversationMessagesOptions, cn as ListConversationMessagesResponse, cQ as ListConversationNotesOptions, cR as ListConversationNotesResponse, bz as ListConversationOptions, by as ListConversationsFilterOptions, bx as ListConversationsIncludeOptions, bA as ListConversationsResponse, aU as ListEscalationsOptions, aV as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bB as ListLabelConversationsOptions, bC as ListLabelConversationsResponse, c4 as ListLabelsIncludeOptions, c5 as ListLabelsOptions, c6 as ListLabelsResponse, co as ListMessagesIncludeOptions, cp as ListMessagesOptions, cq as ListMessagesResponse, cF as ListModelsOptions, cG as ListModelsResponse, cZ as ListSourcesOptions, c_ as ListSourcesResponse, d8 as ListUploadsOptions, d9 as ListUploadsResponse, dz as ListWebhookSubscriptionsOptions, dA as ListWebhookSubscriptionsResponse, ca as Message, cv as MessageEventType, cr as MessageID, cs as MessageRole, cu as MessageStatus, ct as MessageType, dm as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cw as Model, cH as ModelID, cI as Note, cS as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cW as Source, c$ as SourceID, dB as TestWebhookSubscriptionOptions, dC as TestWebhookSubscriptionResponse, a as TransportOptions, am as TwilioSendChannelSyncPayload, an as TwilioSendgridChannelSyncOptions, ao as TwilioSendgridChannelSyncResponse, x as UpdateAccountConversationSettingsOptions, w as UpdateAccountConversationSettingsPayload, y as UpdateAccountConversationSettingsResponse, h as UpdateAccountOptions, U as UpdateAccountPayload, i as UpdateAccountResponse, a9 as UpdateBoilerplateCategoryOptions, a8 as UpdateBoilerplateCategoryPayload, aa as UpdateBoilerplateCategoryResponse, Y as UpdateBoilerplateContentOptions, X as UpdateBoilerplateContentPayload, Z as UpdateBoilerplateContentResponse, aw as UpdateChannelConversationSettingsOptions, av as UpdateChannelConversationSettingsPayload, ax as UpdateChannelConversationSettingsResponse, aq as UpdateChannelOptions, ap as UpdateChannelPayload, ar as UpdateChannelResponse, aK as UpdateCompositionSectionOptions, aJ as UpdateCompositionSectionPayload, aL as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bE as UpdateConversationOptions, bD as UpdateConversationPayload, bF as UpdateConversationResponse, c8 as UpdateLabelOptions, c7 as UpdateLabelPayload, c9 as UpdateLabelResponse, cU as UpdateNoteOptions, cT as UpdateNotePayload, cV as UpdateNoteResponse, d0 as Upload, da as UploadID, db as User, de as UserID, dp as WebhookEventPayload, dh as WebhookEventType, dq as WebhookResponse, dr as WebhookSubscription, dD as WebhookSubscriptionID, dn as WebhookSubscriptionWebhookEventType, C as default, dg as eventWebhookSchema } from './Client-DOgxwQ_-.js';
2
2
  import { KyResponse } from 'ky';
3
3
  import 'zod';
4
4
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as p,e as f,f as o}from"./chunk-Z2KV5TJQ.js";var r={};e(r,{SupportError:()=>p});export{o as Client,t as DEFAULT_SUPPORT_BASE_URL,r as Error,p as SupportError,o as default,f as eventWebhookSchema};
1
+ import{a as e,c as t,d as p,e as f,f as o}from"./chunk-E275HCOS.js";var r={};e(r,{SupportError:()=>p});export{o as Client,t as DEFAULT_SUPPORT_BASE_URL,r as Error,p as SupportError,o as default,f as eventWebhookSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-detail/support-sdk",
3
- "version": "0.18.18",
3
+ "version": "0.18.20",
4
4
  "type": "module",
5
5
  "description": "JavaScript SDK for the Great Detail Support System",
6
6
  "author": "Great Detail Ltd <info@greatdetail.com>",