@great-detail/support-sdk 0.18.6 → 0.18.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Client-Dznu1ulG.d.cts → Client-C3JKZRlU.d.cts} +78 -1
- package/dist/{Client-Dznu1ulG.d.ts → Client-C3JKZRlU.d.ts} +78 -1
- package/dist/chunk-OICZ42ZN.js +1 -0
- package/dist/{chunk-BL4D3OLL.js → chunk-XUY343WC.js} +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -66
- package/dist/index.d.ts +2 -66
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BORTTUUM.js +0 -1
|
@@ -1798,6 +1798,82 @@ declare class ConversationAPI {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
1800
1800
|
|
|
1801
|
+
/**
|
|
1802
|
+
* Great Detail Support System.
|
|
1803
|
+
*
|
|
1804
|
+
* @copyright 2025 Great Detail Ltd
|
|
1805
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1806
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1807
|
+
* @see https://greatdetail.com
|
|
1808
|
+
*/
|
|
1809
|
+
|
|
1810
|
+
type ConversationFeedbackID = string;
|
|
1811
|
+
type ConversationFeedback = {
|
|
1812
|
+
id: ConversationFeedbackID;
|
|
1813
|
+
conversation: ConversationID;
|
|
1814
|
+
feedback: {
|
|
1815
|
+
id: string;
|
|
1816
|
+
rating: number;
|
|
1817
|
+
content?: Nullable<string>;
|
|
1818
|
+
} & ResponseTimestamp;
|
|
1819
|
+
} & ResponseTimestamp;
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Great Detail Support System.
|
|
1823
|
+
*
|
|
1824
|
+
* @copyright 2025 Great Detail Ltd
|
|
1825
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1826
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1827
|
+
* @see https://greatdetail.com
|
|
1828
|
+
*/
|
|
1829
|
+
|
|
1830
|
+
type CreateConversationConversationFeedbackPayload = {
|
|
1831
|
+
feedback: {
|
|
1832
|
+
rating: number;
|
|
1833
|
+
content?: Nullable<string>;
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
interface CreateConversationConversationFeedbackOptions {
|
|
1837
|
+
body: CreateConversationConversationFeedbackPayload;
|
|
1838
|
+
request?: SendOptions;
|
|
1839
|
+
}
|
|
1840
|
+
type CreateConversationConversationFeedbackResponse = {
|
|
1841
|
+
data: {
|
|
1842
|
+
conversationFeedback: ConversationFeedback;
|
|
1843
|
+
};
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Great Detail Support System.
|
|
1848
|
+
*
|
|
1849
|
+
* @copyright 2025 Great Detail Ltd
|
|
1850
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1851
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1852
|
+
* @see https://greatdetail.com
|
|
1853
|
+
*/
|
|
1854
|
+
|
|
1855
|
+
interface ListConversationConversationFeedbackOptions {
|
|
1856
|
+
request?: SendOptions;
|
|
1857
|
+
}
|
|
1858
|
+
type ListConversationConversationFeedbackResponse = {
|
|
1859
|
+
data: {
|
|
1860
|
+
conversationFeedback: ConversationFeedback;
|
|
1861
|
+
}[];
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1864
|
+
declare class ConversationFeedbackAPI {
|
|
1865
|
+
protected _transport: FetchTransport;
|
|
1866
|
+
constructor(_transport: FetchTransport);
|
|
1867
|
+
list(conversation: ConversationID, { request }?: ListConversationConversationFeedbackOptions): {
|
|
1868
|
+
response: () => Promise<ky.KyResponse<ListConversationConversationFeedbackResponse>>;
|
|
1869
|
+
json: () => Promise<ListConversationConversationFeedbackResponse>;
|
|
1870
|
+
};
|
|
1871
|
+
create(conversation: ConversationID, { body, request }: CreateConversationConversationFeedbackOptions): {
|
|
1872
|
+
response: () => Promise<ky.KyResponse<CreateConversationConversationFeedbackResponse>>;
|
|
1873
|
+
json: () => Promise<CreateConversationConversationFeedbackResponse>;
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1801
1877
|
/**
|
|
1802
1878
|
* Great Detail Support System.
|
|
1803
1879
|
*
|
|
@@ -3267,6 +3343,7 @@ declare class Client {
|
|
|
3267
3343
|
compositionSection: CompositionSectionAPI;
|
|
3268
3344
|
contact: ContactAPI;
|
|
3269
3345
|
conversation: ConversationAPI;
|
|
3346
|
+
conversationFeedback: ConversationFeedbackAPI;
|
|
3270
3347
|
escalation: EscalationAPI;
|
|
3271
3348
|
label: LabelAPI;
|
|
3272
3349
|
message: MessageAPI;
|
|
@@ -3282,4 +3359,4 @@ declare class Client {
|
|
|
3282
3359
|
static getBaseURL(): string;
|
|
3283
3360
|
}
|
|
3284
3361
|
|
|
3285
|
-
export { type
|
|
3362
|
+
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 DeleteContactResponse 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 ListEscalationsOptions as aS, type ListEscalationsResponse as aT, type Contact as aU, type ContactID as aV, type ContactCustomMetadata as aW, type CreateContactPayload as aX, type CreateContactOptions as aY, type CreateContactResponse as aZ, type DeleteContactOptions 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 UpdateLabelResponse as b$, type GetContactIncludeOptions as b0, type GetContactOptions as b1, type GetContactResponse as b2, type GetContactVCFOptions as b3, type ListContactsOptions as b4, type ListContactsResponse as b5, type ListLabelContactsOptions as b6, type ListLabelContactsResponse as b7, type UpdateContactPayload as b8, type UpdateContactOptions as b9, type UpdateConversationOptions as bA, type UpdateConversationResponse as bB, type ConversationSettings as bC, type ConversationFeedback as bD, type CreateConversationConversationFeedbackPayload as bE, type CreateConversationConversationFeedbackOptions as bF, type CreateConversationConversationFeedbackResponse as bG, type ListConversationConversationFeedbackOptions as bH, type ListConversationConversationFeedbackResponse as bI, type Label as bJ, type CreateLabelPayload as bK, type CreateLabelOptions as bL, type CreateLabelResponse as bM, type DeleteLabelOptions as bN, type DeleteLabelResponse as bO, type GetLabelOptions as bP, type GetLabelResponse as bQ, type LabelID as bR, type ListContactLabelsOptions as bS, type ListContactLabelsResponse as bT, type ListConversationLabelsOptions as bU, type ListConversationLabelsResponse as bV, type ListLabelsIncludeOptions as bW, type ListLabelsOptions as bX, type ListLabelsResponse as bY, type UpdateLabelPayload as bZ, type UpdateLabelOptions as b_, type UpdateContactResponse as ba, type Conversation as bb, type ConversationID as bc, type ConversationCustomMetadata as bd, type ActiveConversationStatus as be, type ConcludedConversationStatus as bf, type ConversationStatus as bg, type CreateConversationPayload as bh, type CreateConversationOptions as bi, type CreateConversationResponse as bj, type DeleteConversationOptions as bk, type DeleteConversationResponse as bl, type GetConversationIncludeOptions as bm, type GetConversationOptions as bn, type GetConversationResponse as bo, type ListChannelConversationsOptions as bp, type ListChannelConversationsResponse as bq, type ListContactConversationsOptions as br, type ListContactConversationsResponse as bs, type ListConversationsIncludeOptions as bt, type FilterOptions as bu, type ListConversationOptions as bv, type ListConversationsResponse as bw, type ListLabelConversationsOptions as bx, type ListLabelConversationsResponse as by, type UpdateConversationPayload as bz, type AccountID as c, type User as c$, type Message as c0, type CreateMessagePayload as c1, type CreateMessageOptions as c2, type CreateMessageResponse as c3, type DeleteMessageOptions as c4, type DeleteMessageResponse as c5, type GetMessageOptions as c6, type GetMessageResponse as c7, type ListChannelMessagesIncludeOptions as c8, type ListChannelMessagesOptions as c9, type CreateNoteResponse as cA, type GetNoteOptions as cB, type GetNoteResponse as cC, type ListContactNotesOptions as cD, type ListContactNotesResponse as cE, type ListConversationNotesOptions as cF, type ListConversationNotesResponse as cG, type NoteID as cH, type UpdateNotePayload as cI, type UpdateNoteOptions as cJ, type UpdateNoteResponse as cK, type Source as cL, type GetSourceOptions as cM, type GetSourceResponse as cN, type ListSourcesOptions as cO, type ListSourcesResponse as cP, type SourceID as cQ, type Upload as cR, type CreateUploadOptions as cS, type CreateUploadResponse as cT, type DeleteUploadOptions as cU, type DeleteUploadResponse as cV, type GetUploadOptions as cW, type GetUploadResponse as cX, type ListUploadsOptions as cY, type ListUploadsResponse as cZ, type UploadID as c_, type ListChannelMessagesResponse as ca, type ListConversationMessagesIncludeOptions as cb, type ListConversationMessagesOptions as cc, type ListConversationMessagesResponse as cd, type ListMessagesIncludeOptions as ce, type ListMessagesOptions as cf, type ListMessagesResponse as cg, type MessageID as ch, type MessageRole as ci, type MessageStatus as cj, type MessageEventType as ck, type Model as cl, type CreateCorrectionModelPayload as cm, type CreateCorrectionModelOptions as cn, type CreateCorrectionResponse as co, type CreateResponseModelPayload as cp, type CreateResponseModelOptions as cq, type CreateResponseResponse as cr, type GetModelOptions as cs, type GetModelResponse as ct, type ListModelsOptions as cu, type ListModelsResponse as cv, type ModelID as cw, type Note as cx, type CreateNotePayload as cy, type CreateNoteOptions as cz, type CreateAccountPayload as d, type GetUserOptions as d0, type GetUserResponse as d1, type UserID as d2, type EventWebhookOptions as d3, eventWebhookSchema as d4, type WebhookEventType as d5, type AccountWebhookWebhookEventType as d6, type AccountAccessTokenWebhookEventType as d7, type ContactWebhookEventType as d8, type ConversationWebhookEventType as d9, type MessageWebhookEventType as da, type WebhookSubscriptionWebhookEventType as db, type WebhookEventPayload as dc, type WebhookResponse as dd, type WebhookSubscription as de, type CreateWebhookSubscriptionPayload as df, type CreateWebhookSubscriptionOptions as dg, type CreateWebhookSubscriptionResponse as dh, type DeleteWebhookSubscriptionOptions as di, type DeleteWebhookSubscriptionResponse as dj, type GetWebhookSubscriptionOptions as dk, type GetWebhookSubscriptionResponse as dl, type ListWebhookSubscriptionsOptions as dm, type ListWebhookSubscriptionsResponse as dn, type TestWebhookSubscriptionOptions as dp, type TestWebhookSubscriptionResponse as dq, type WebhookSubscriptionID as dr, 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 };
|
|
@@ -1798,6 +1798,82 @@ declare class ConversationAPI {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
1800
1800
|
|
|
1801
|
+
/**
|
|
1802
|
+
* Great Detail Support System.
|
|
1803
|
+
*
|
|
1804
|
+
* @copyright 2025 Great Detail Ltd
|
|
1805
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1806
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1807
|
+
* @see https://greatdetail.com
|
|
1808
|
+
*/
|
|
1809
|
+
|
|
1810
|
+
type ConversationFeedbackID = string;
|
|
1811
|
+
type ConversationFeedback = {
|
|
1812
|
+
id: ConversationFeedbackID;
|
|
1813
|
+
conversation: ConversationID;
|
|
1814
|
+
feedback: {
|
|
1815
|
+
id: string;
|
|
1816
|
+
rating: number;
|
|
1817
|
+
content?: Nullable<string>;
|
|
1818
|
+
} & ResponseTimestamp;
|
|
1819
|
+
} & ResponseTimestamp;
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Great Detail Support System.
|
|
1823
|
+
*
|
|
1824
|
+
* @copyright 2025 Great Detail Ltd
|
|
1825
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1826
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1827
|
+
* @see https://greatdetail.com
|
|
1828
|
+
*/
|
|
1829
|
+
|
|
1830
|
+
type CreateConversationConversationFeedbackPayload = {
|
|
1831
|
+
feedback: {
|
|
1832
|
+
rating: number;
|
|
1833
|
+
content?: Nullable<string>;
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
interface CreateConversationConversationFeedbackOptions {
|
|
1837
|
+
body: CreateConversationConversationFeedbackPayload;
|
|
1838
|
+
request?: SendOptions;
|
|
1839
|
+
}
|
|
1840
|
+
type CreateConversationConversationFeedbackResponse = {
|
|
1841
|
+
data: {
|
|
1842
|
+
conversationFeedback: ConversationFeedback;
|
|
1843
|
+
};
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Great Detail Support System.
|
|
1848
|
+
*
|
|
1849
|
+
* @copyright 2025 Great Detail Ltd
|
|
1850
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
1851
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
1852
|
+
* @see https://greatdetail.com
|
|
1853
|
+
*/
|
|
1854
|
+
|
|
1855
|
+
interface ListConversationConversationFeedbackOptions {
|
|
1856
|
+
request?: SendOptions;
|
|
1857
|
+
}
|
|
1858
|
+
type ListConversationConversationFeedbackResponse = {
|
|
1859
|
+
data: {
|
|
1860
|
+
conversationFeedback: ConversationFeedback;
|
|
1861
|
+
}[];
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1864
|
+
declare class ConversationFeedbackAPI {
|
|
1865
|
+
protected _transport: FetchTransport;
|
|
1866
|
+
constructor(_transport: FetchTransport);
|
|
1867
|
+
list(conversation: ConversationID, { request }?: ListConversationConversationFeedbackOptions): {
|
|
1868
|
+
response: () => Promise<ky.KyResponse<ListConversationConversationFeedbackResponse>>;
|
|
1869
|
+
json: () => Promise<ListConversationConversationFeedbackResponse>;
|
|
1870
|
+
};
|
|
1871
|
+
create(conversation: ConversationID, { body, request }: CreateConversationConversationFeedbackOptions): {
|
|
1872
|
+
response: () => Promise<ky.KyResponse<CreateConversationConversationFeedbackResponse>>;
|
|
1873
|
+
json: () => Promise<CreateConversationConversationFeedbackResponse>;
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1801
1877
|
/**
|
|
1802
1878
|
* Great Detail Support System.
|
|
1803
1879
|
*
|
|
@@ -3267,6 +3343,7 @@ declare class Client {
|
|
|
3267
3343
|
compositionSection: CompositionSectionAPI;
|
|
3268
3344
|
contact: ContactAPI;
|
|
3269
3345
|
conversation: ConversationAPI;
|
|
3346
|
+
conversationFeedback: ConversationFeedbackAPI;
|
|
3270
3347
|
escalation: EscalationAPI;
|
|
3271
3348
|
label: LabelAPI;
|
|
3272
3349
|
message: MessageAPI;
|
|
@@ -3282,4 +3359,4 @@ declare class Client {
|
|
|
3282
3359
|
static getBaseURL(): string;
|
|
3283
3360
|
}
|
|
3284
3361
|
|
|
3285
|
-
export { type
|
|
3362
|
+
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 DeleteContactResponse 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 ListEscalationsOptions as aS, type ListEscalationsResponse as aT, type Contact as aU, type ContactID as aV, type ContactCustomMetadata as aW, type CreateContactPayload as aX, type CreateContactOptions as aY, type CreateContactResponse as aZ, type DeleteContactOptions 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 UpdateLabelResponse as b$, type GetContactIncludeOptions as b0, type GetContactOptions as b1, type GetContactResponse as b2, type GetContactVCFOptions as b3, type ListContactsOptions as b4, type ListContactsResponse as b5, type ListLabelContactsOptions as b6, type ListLabelContactsResponse as b7, type UpdateContactPayload as b8, type UpdateContactOptions as b9, type UpdateConversationOptions as bA, type UpdateConversationResponse as bB, type ConversationSettings as bC, type ConversationFeedback as bD, type CreateConversationConversationFeedbackPayload as bE, type CreateConversationConversationFeedbackOptions as bF, type CreateConversationConversationFeedbackResponse as bG, type ListConversationConversationFeedbackOptions as bH, type ListConversationConversationFeedbackResponse as bI, type Label as bJ, type CreateLabelPayload as bK, type CreateLabelOptions as bL, type CreateLabelResponse as bM, type DeleteLabelOptions as bN, type DeleteLabelResponse as bO, type GetLabelOptions as bP, type GetLabelResponse as bQ, type LabelID as bR, type ListContactLabelsOptions as bS, type ListContactLabelsResponse as bT, type ListConversationLabelsOptions as bU, type ListConversationLabelsResponse as bV, type ListLabelsIncludeOptions as bW, type ListLabelsOptions as bX, type ListLabelsResponse as bY, type UpdateLabelPayload as bZ, type UpdateLabelOptions as b_, type UpdateContactResponse as ba, type Conversation as bb, type ConversationID as bc, type ConversationCustomMetadata as bd, type ActiveConversationStatus as be, type ConcludedConversationStatus as bf, type ConversationStatus as bg, type CreateConversationPayload as bh, type CreateConversationOptions as bi, type CreateConversationResponse as bj, type DeleteConversationOptions as bk, type DeleteConversationResponse as bl, type GetConversationIncludeOptions as bm, type GetConversationOptions as bn, type GetConversationResponse as bo, type ListChannelConversationsOptions as bp, type ListChannelConversationsResponse as bq, type ListContactConversationsOptions as br, type ListContactConversationsResponse as bs, type ListConversationsIncludeOptions as bt, type FilterOptions as bu, type ListConversationOptions as bv, type ListConversationsResponse as bw, type ListLabelConversationsOptions as bx, type ListLabelConversationsResponse as by, type UpdateConversationPayload as bz, type AccountID as c, type User as c$, type Message as c0, type CreateMessagePayload as c1, type CreateMessageOptions as c2, type CreateMessageResponse as c3, type DeleteMessageOptions as c4, type DeleteMessageResponse as c5, type GetMessageOptions as c6, type GetMessageResponse as c7, type ListChannelMessagesIncludeOptions as c8, type ListChannelMessagesOptions as c9, type CreateNoteResponse as cA, type GetNoteOptions as cB, type GetNoteResponse as cC, type ListContactNotesOptions as cD, type ListContactNotesResponse as cE, type ListConversationNotesOptions as cF, type ListConversationNotesResponse as cG, type NoteID as cH, type UpdateNotePayload as cI, type UpdateNoteOptions as cJ, type UpdateNoteResponse as cK, type Source as cL, type GetSourceOptions as cM, type GetSourceResponse as cN, type ListSourcesOptions as cO, type ListSourcesResponse as cP, type SourceID as cQ, type Upload as cR, type CreateUploadOptions as cS, type CreateUploadResponse as cT, type DeleteUploadOptions as cU, type DeleteUploadResponse as cV, type GetUploadOptions as cW, type GetUploadResponse as cX, type ListUploadsOptions as cY, type ListUploadsResponse as cZ, type UploadID as c_, type ListChannelMessagesResponse as ca, type ListConversationMessagesIncludeOptions as cb, type ListConversationMessagesOptions as cc, type ListConversationMessagesResponse as cd, type ListMessagesIncludeOptions as ce, type ListMessagesOptions as cf, type ListMessagesResponse as cg, type MessageID as ch, type MessageRole as ci, type MessageStatus as cj, type MessageEventType as ck, type Model as cl, type CreateCorrectionModelPayload as cm, type CreateCorrectionModelOptions as cn, type CreateCorrectionResponse as co, type CreateResponseModelPayload as cp, type CreateResponseModelOptions as cq, type CreateResponseResponse as cr, type GetModelOptions as cs, type GetModelResponse as ct, type ListModelsOptions as cu, type ListModelsResponse as cv, type ModelID as cw, type Note as cx, type CreateNotePayload as cy, type CreateNoteOptions as cz, type CreateAccountPayload as d, type GetUserOptions as d0, type GetUserResponse as d1, type UserID as d2, type EventWebhookOptions as d3, eventWebhookSchema as d4, type WebhookEventType as d5, type AccountWebhookWebhookEventType as d6, type AccountAccessTokenWebhookEventType as d7, type ContactWebhookEventType as d8, type ConversationWebhookEventType as d9, type MessageWebhookEventType as da, type WebhookSubscriptionWebhookEventType as db, type WebhookEventPayload as dc, type WebhookResponse as dd, type WebhookSubscription as de, type CreateWebhookSubscriptionPayload as df, type CreateWebhookSubscriptionOptions as dg, type CreateWebhookSubscriptionResponse as dh, type DeleteWebhookSubscriptionOptions as di, type DeleteWebhookSubscriptionResponse as dj, type GetWebhookSubscriptionOptions as dk, type GetWebhookSubscriptionResponse as dl, type ListWebhookSubscriptionsOptions as dm, type ListWebhookSubscriptionsResponse as dn, type TestWebhookSubscriptionOptions as dp, type TestWebhookSubscriptionResponse as dq, type WebhookSubscriptionID as dr, 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 };
|
|
@@ -0,0 +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}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};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}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var j="https://api.support.greatdetail.com",H={"X-Powered-By":"GDSupport/JavaScript"};var F=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,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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),...o?[["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}list(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}create(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...o,method:"POST",json:e})}};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"})}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 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 y=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:[o=>{for(let s of this.options.requestFilterables){let r=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}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 F(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 P=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 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 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 A(this._transport),this.note=new y(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[Q]??this.DEFAULT_BASE_URL}};export{$ as a,p as b,j as c,F as d,V as e,M as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as j,f as F}from"./chunk-
|
|
1
|
+
import{b as j,f as F}from"./chunk-OICZ42ZN.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};
|
package/dist/cli/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var It=Object.create;var M=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var St=(s,t)=>{for(var e in t)M(s,e,{get:t[e],enumerable:!0})},pt=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tt(t))!At.call(s,n)&&n!==e&&M(s,n,{get:()=>t[n],enumerable:!(o=_t(t,n))||o.enumerable});return s};var ct=(s,t,e)=>(e=s!=null?It(Lt(s)):{},pt(t||!s||!s.__esModule?M(e,"default",{value:s,enumerable:!0}):e,s)),Ut=s=>pt(M({},"__esModule",{value:!0}),s);var Gt={};St(Gt,{default:()=>Dt});module.exports=Ut(Gt);var vt=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: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 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 h=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}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var C=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}getHeaders(){return{Authorization:`Bearer ${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 g=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({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",Ct={"X-Powered-By":"GDSupport/JavaScript"};var v=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var _=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 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:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Ct;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var U=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 c of r)n.push(["category",c])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var E=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};var 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 D=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:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[c,yt]of Object.entries(r))o.headers.has(c)||o.headers.set(c,yt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,ft.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof j.HTTPError?new W(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var w=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"),gt=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 k=class{constructor(t){this._transport=t}async event({key:t=process.env[K],maxSignatures:e=3,request:o}){let n=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+K);if(!n)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(n)?n.slice(0,e):[n]))throw new Error("Untrusted signature")}let{data:r}=gt.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 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 s{static DEFAULT_BASE_URL=ht;static PublicAuthentication=p;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new S,t],...o,baseURL:e?.toString()??s.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 g(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new v(this._transport),this.conversation=new y(this._transport),this.escalation=new I(this._transport),this.label=new _(this._transport),this.message=new T(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new U(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new w(this._transport),this.webhook=new k(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[ut]??this.DEFAULT_BASE_URL}};var Y=require("commander"),Rt=require("ora");function z({client:s,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,Rt.oraPromise)(()=>s.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var J=require("commander"),Ot=require("ora");function $({client:s,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,Ot.oraPromise)(()=>s.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var F=require("commander"),N=require("ora");function X({client:s,ora:t}){let e=new F.Command("contacts").description("Contacts");return e.addCommand(new F.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let n=await(0,N.oraPromise)(()=>s.contact.get(o).json(),{...t,text:"Finding contact"});console.log(n)})),e.addCommand(new F.Command("list").description("List contacts").action(async()=>{let o=await(0,N.oraPromise)(()=>s.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new F.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let n=await(0,N.oraPromise)(()=>s.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(n)})),e}var Q=require("commander"),Z=require("ora");function tt({client:s,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 n=await(0,Z.oraPromise)(()=>s.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(n)})),e.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let o=await(0,Z.oraPromise)(()=>s.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var B=require("commander"),H=require("ora");function et({client:s,ora:t}){let e=new B.Command("labels").description("Labels");return e.addCommand(new B.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let n=await(0,H.oraPromise)(()=>s.label.get(o).json(),{...t,text:"Finding label"});console.log(n)})),e.addCommand(new B.Command("list").description("List labels").action(async()=>{let o=await(0,H.oraPromise)(()=>s.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new B.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let n=await(0,H.oraPromise)(()=>s.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(n)})),e}var ot=require("commander"),bt=require("ora");function st({client:s,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,bt.oraPromise)(()=>s.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var V=require("commander"),nt=require("ora");function rt({client:s,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 n=await(0,nt.oraPromise)(()=>s.model.get(o).json(),{...t,text:"Finding model"});console.log(n)})),e.addCommand(new V.Command("list").description("List models").action(async()=>{let o=await(0,nt.oraPromise)(()=>s.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var q=require("commander"),it=require("ora");function at({client:s,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 n=await(0,it.oraPromise)(()=>s.source.get(o).json(),{...t,text:"Finding source"});console.log(n)})),e.addCommand(new q.Command("list").description("List sources").action(async()=>{let o=await(0,it.oraPromise)(()=>s.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Et=new vt.Command("gds").description("Great Detail Support System").addCommand(z(a)).addCommand($(a)).addCommand(X(a)).addCommand(tt(a)).addCommand(et(a)).addCommand(st(a)).addCommand(rt(a)).addCommand(at(a)),Dt=Et;
|
|
1
|
+
"use strict";var _t=Object.create;var W=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var Ut=(s,t)=>{for(var e in t)W(s,e,{get:t[e],enumerable:!0})},ct=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Lt(t))!St.call(s,n)&&n!==e&&W(s,n,{get:()=>t[n],enumerable:!(o=Tt(t,n))||o.enumerable});return s};var mt=(s,t,e)=>(e=s!=null?_t(At(s)):{},ct(t||!s||!s.__esModule?W(e,"default",{value:s,enumerable:!0}):e,s)),Et=s=>ct(W({},"__esModule",{value:!0}),s);var kt={};Ut(kt,{default:()=>Gt});module.exports=Et(kt);var It=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: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 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}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};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}getHeaders(){return{Authorization:`Bearer ${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 g=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({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 v=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}list(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}create(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...o,method:"POST",json:e})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var 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: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 S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var U=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=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 n=[];if(e){let r=Array.isArray(e)?e:[e];for(let c of r)n.push(["category",c])}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 gt=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:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[c,yt]of Object.entries(r))o.headers.has(c)||o.headers.set(c,yt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,gt.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof N.HTTPError?new j(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 w=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"),Rt=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 x=class{constructor(t){this._transport=t}async event({key:t=process.env[Y],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."+Y);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}=Rt.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 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 F=class s{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 U,t],...o,baseURL:e?.toString()??s.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 g(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new v(this._transport),this.conversation=new I(this._transport),this.conversationFeedback=new y(this._transport),this.escalation=new _(this._transport),this.label=new T(this._transport),this.message=new L(this._transport),this.model=new A(this._transport),this.note=new S(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new w(this._transport),this.webhook=new x(this._transport),this.webhookSubscription=new P(this._transport)}static getBaseURL(){return process.env[Ct]??this.DEFAULT_BASE_URL}};var z=require("commander"),Ot=require("ora");function J({client:s,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,Ot.oraPromise)(()=>s.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var $=require("commander"),bt=require("ora");function X({client:s,ora:t}){let e=new $.Command("channels").description("Channels");return e.addCommand(new $.Command("list").description("List channels").action(async()=>{let o=await(0,bt.oraPromise)(()=>s.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),Q=require("ora");function Z({client:s,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 n=await(0,Q.oraPromise)(()=>s.contact.get(o).json(),{...t,text:"Finding contact"});console.log(n)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,Q.oraPromise)(()=>s.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 n=await(0,Q.oraPromise)(()=>s.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(n)})),e}var H=require("commander"),tt=require("ora");function et({client:s,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 n=await(0,tt.oraPromise)(()=>s.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(n)})),e.addCommand(new H.Command("list").description("List conversations").action(async()=>{let o=await(0,tt.oraPromise)(()=>s.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),V=require("ora");function ot({client:s,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 n=await(0,V.oraPromise)(()=>s.label.get(o).json(),{...t,text:"Finding label"});console.log(n)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,V.oraPromise)(()=>s.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 n=await(0,V.oraPromise)(()=>s.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(n)})),e}var st=require("commander"),vt=require("ora");function nt({client:s,ora:t}){let e=new st.Command("messages").description("Messages");return e.addCommand(new st.Command("list").description("List messages").action(async()=>{let o=await(0,vt.oraPromise)(()=>s.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var q=require("commander"),rt=require("ora");function it({client:s,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 n=await(0,rt.oraPromise)(()=>s.model.get(o).json(),{...t,text:"Finding model"});console.log(n)})),e.addCommand(new q.Command("list").description("List models").action(async()=>{let o=await(0,rt.oraPromise)(()=>s.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var K=require("commander"),at=require("ora");function pt({client:s,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 n=await(0,at.oraPromise)(()=>s.source.get(o).json(),{...t,text:"Finding source"});console.log(n)})),e.addCommand(new K.Command("list").description("List sources").action(async()=>{let o=await(0,at.oraPromise)(()=>s.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new F(new p)},Dt=new It.Command("gds").description("Great Detail Support System").addCommand(J(a)).addCommand(X(a)).addCommand(Z(a)).addCommand(et(a)).addCommand(ot(a)).addCommand(nt(a)).addCommand(it(a)).addCommand(pt(a)),Gt=Dt;
|
package/dist/cli/index.d.cts
CHANGED
package/dist/cli/index.d.ts
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-XUY343WC.js";import"../chunk-OICZ42ZN.js";export{a as default};
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var It=Object.create;var at=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var St=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tt(t))!At.call(s,n)&&n!==e&&at(s,n,{get:()=>t[n],enumerable:!(o=_t(t,n))||o.enumerable});return s};var pt=(s,t,e)=>(e=s!=null?It(Lt(s)):{},St(t||!s||!s.__esModule?at(e,"default",{value:s,enumerable:!0}):e,s));var bt=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: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 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 ct="SUPPORT_ACCESS_TOKEN",mt="SUPPORT_KEY_NAME",dt="SUPPORT_KEY_PASSWORD",q="SUPPORT_SIGNING_KEY",lt="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[mt],password:e=process.env[dt]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var C=class{#t;constructor({token:t=process.env[ct]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var f=class{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 g=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({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 ut="https://api.support.greatdetail.com",ht={"X-Powered-By":"GDSupport/JavaScript"};var v=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var _=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 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:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var S=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ht;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var U=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 c of r)n.push(["category",c])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var E=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};var Ct=pt(require("is-network-error"),1),W=pt(require("ky"),1);var M=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=W.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[c,yt]of Object.entries(r))o.headers.has(c)||o.headers.set(c,yt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,Ct.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof W.HTTPError?new M(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var w=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"),ft=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 k=class{constructor(t){this._transport=t}async event({key:t=process.env[q],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."+q);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}=ft.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 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 s{static DEFAULT_BASE_URL=ut;static PublicAuthentication=p;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new S,t],...o,baseURL:e?.toString()??s.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 g(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new v(this._transport),this.conversation=new y(this._transport),this.escalation=new I(this._transport),this.label=new _(this._transport),this.message=new T(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new U(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new w(this._transport),this.webhook=new k(this._transport),this.webhookSubscription=new x(this._transport)}static getBaseURL(){return process.env[lt]??this.DEFAULT_BASE_URL}};var K=require("commander"),gt=require("ora");function Y({client:s,ora:t}){let e=new K.Command("actions").description("Actions");return e.addCommand(new K.Command("list").description("List actions").action(async()=>{let o=await(0,gt.oraPromise)(()=>s.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var z=require("commander"),Rt=require("ora");function J({client:s,ora:t}){let e=new z.Command("channels").description("Channels");return e.addCommand(new z.Command("list").description("List channels").action(async()=>{let o=await(0,Rt.oraPromise)(()=>s.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var F=require("commander"),j=require("ora");function $({client:s,ora:t}){let e=new F.Command("contacts").description("Contacts");return e.addCommand(new F.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async o=>{let n=await(0,j.oraPromise)(()=>s.contact.get(o).json(),{...t,text:"Finding contact"});console.log(n)})),e.addCommand(new F.Command("list").description("List contacts").action(async()=>{let o=await(0,j.oraPromise)(()=>s.contact.list().json(),{...t,text:"Finding contacts"});console.log(o)})),e.addCommand(new F.Command("get-vcf").description("Export Contact as VCF").argument("<contact>","Contact ID").action(async o=>{let n=await(0,j.oraPromise)(()=>s.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(n)})),e}var N=require("commander"),X=require("ora");function Z({client:s,ora:t}){let e=new N.Command("conversations").description("Conversations");return e.addCommand(new N.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async o=>{let n=await(0,X.oraPromise)(()=>s.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(n)})),e.addCommand(new N.Command("list").description("List conversations").action(async()=>{let o=await(0,X.oraPromise)(()=>s.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var B=require("commander"),Q=require("ora");function tt({client:s,ora:t}){let e=new B.Command("labels").description("Labels");return e.addCommand(new B.Command("get").description("Find label").argument("<label>","Label ID").action(async o=>{let n=await(0,Q.oraPromise)(()=>s.label.get(o).json(),{...t,text:"Finding label"});console.log(n)})),e.addCommand(new B.Command("list").description("List labels").action(async()=>{let o=await(0,Q.oraPromise)(()=>s.label.list().json(),{...t,text:"Finding labels"});console.log(o)})),e.addCommand(new B.Command("conversations").description("Find label conversations").argument("<label>","Label ID").action(async o=>{let n=await(0,Q.oraPromise)(()=>s.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(n)})),e}var et=require("commander"),Ot=require("ora");function ot({client:s,ora:t}){let e=new et.Command("messages").description("Messages");return e.addCommand(new et.Command("list").description("List messages").action(async()=>{let o=await(0,Ot.oraPromise)(()=>s.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var H=require("commander"),st=require("ora");function nt({client:s,ora:t}){let e=new H.Command("models").description("Models");return e.addCommand(new H.Command("get").description("Find model").argument("<model>","Model ID").action(async o=>{let n=await(0,st.oraPromise)(()=>s.model.get(o).json(),{...t,text:"Finding model"});console.log(n)})),e.addCommand(new H.Command("list").description("List models").action(async()=>{let o=await(0,st.oraPromise)(()=>s.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var V=require("commander"),rt=require("ora");function it({client:s,ora:t}){let e=new V.Command("sources").description("Sources");return e.addCommand(new V.Command("get").description("Find source").argument("<source>","Source ID").action(async o=>{let n=await(0,rt.oraPromise)(()=>s.source.get(o).json(),{...t,text:"Finding source"});console.log(n)})),e.addCommand(new V.Command("list").description("List sources").action(async()=>{let o=await(0,rt.oraPromise)(()=>s.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new P(new p)},Ut=new bt.Command("gds").description("Great Detail Support System").addCommand(Y(a)).addCommand(J(a)).addCommand($(a)).addCommand(Z(a)).addCommand(tt(a)).addCommand(ot(a)).addCommand(nt(a)).addCommand(it(a)),vt=Ut;vt.parseAsync(process.argv);
|
|
2
|
+
"use strict";var _t=Object.create;var pt=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var Ut=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Lt(t))!St.call(s,n)&&n!==e&&pt(s,n,{get:()=>t[n],enumerable:!(o=Tt(t,n))||o.enumerable});return s};var ct=(s,t,e)=>(e=s!=null?_t(At(s)):{},Ut(t||!s||!s.__esModule?pt(e,"default",{value:s,enumerable:!0}):e,s));var vt=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: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 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}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};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}getHeaders(){return{Authorization:`Bearer ${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 g=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 O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({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 v=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var I=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}list(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}create(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...o,method:"POST",json:e})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var 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: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 S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var U=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=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 n=[];if(e){let r=Array.isArray(e)?e:[e];for(let c of r)n.push(["category",c])}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 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:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[c,yt]of Object.entries(r))o.headers.has(c)||o.headers.set(c,yt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,ft.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof j.HTTPError?new W(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 w=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"),gt=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 x=class{constructor(t){this._transport=t}async event({key:t=process.env[K],maxSignatures:e=3,request:o}){let n=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+K);if(!n)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(n)?n.slice(0,e):[n]))throw new Error("Untrusted signature")}let{data:r}=gt.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 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 F=class s{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 U,t],...o,baseURL:e?.toString()??s.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 g(this._transport),this.channel=new R(this._transport),this.channelConversationSettings=new O(this._transport),this.compositionSection=new b(this._transport),this.contact=new v(this._transport),this.conversation=new I(this._transport),this.conversationFeedback=new y(this._transport),this.escalation=new _(this._transport),this.label=new T(this._transport),this.message=new L(this._transport),this.model=new A(this._transport),this.note=new S(this._transport),this.source=new E(this._transport),this.statistics=new D(this._transport),this.upload=new k(this._transport),this.user=new w(this._transport),this.webhook=new x(this._transport),this.webhookSubscription=new P(this._transport)}static getBaseURL(){return process.env[ut]??this.DEFAULT_BASE_URL}};var Y=require("commander"),Rt=require("ora");function z({client:s,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,Rt.oraPromise)(()=>s.action.list().json(),{...t,text:"Finding actions"});console.log(o)})),e}var J=require("commander"),Ot=require("ora");function $({client:s,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,Ot.oraPromise)(()=>s.channel.list().json(),{...t,text:"Finding channels"});console.log(o)})),e}var B=require("commander"),N=require("ora");function X({client:s,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 n=await(0,N.oraPromise)(()=>s.contact.get(o).json(),{...t,text:"Finding contact"});console.log(n)})),e.addCommand(new B.Command("list").description("List contacts").action(async()=>{let o=await(0,N.oraPromise)(()=>s.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 n=await(0,N.oraPromise)(()=>s.contact.getVCF(o).response(),{...t,text:"Exporting contact"});console.log(n)})),e}var Q=require("commander"),Z=require("ora");function tt({client:s,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 n=await(0,Z.oraPromise)(()=>s.conversation.get(o).json(),{...t,text:"Finding conversation"});console.log(n)})),e.addCommand(new Q.Command("list").description("List conversations").action(async()=>{let o=await(0,Z.oraPromise)(()=>s.conversation.list().json(),{...t,text:"Finding conversations"});console.log(o)})),e}var M=require("commander"),H=require("ora");function et({client:s,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 n=await(0,H.oraPromise)(()=>s.label.get(o).json(),{...t,text:"Finding label"});console.log(n)})),e.addCommand(new M.Command("list").description("List labels").action(async()=>{let o=await(0,H.oraPromise)(()=>s.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 n=await(0,H.oraPromise)(()=>s.conversation.listByLabel(o).json(),{...t,text:"Finding conversations"});console.log(n)})),e}var ot=require("commander"),bt=require("ora");function st({client:s,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,bt.oraPromise)(()=>s.message.list().json(),{...t,text:"Finding messages"});console.log(o)})),e}var V=require("commander"),nt=require("ora");function rt({client:s,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 n=await(0,nt.oraPromise)(()=>s.model.get(o).json(),{...t,text:"Finding model"});console.log(n)})),e.addCommand(new V.Command("list").description("List models").action(async()=>{let o=await(0,nt.oraPromise)(()=>s.model.list().json(),{...t,text:"Finding models"});console.log(o)})),e}var q=require("commander"),it=require("ora");function at({client:s,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 n=await(0,it.oraPromise)(()=>s.source.get(o).json(),{...t,text:"Finding source"});console.log(n)})),e.addCommand(new q.Command("list").description("List sources").action(async()=>{let o=await(0,it.oraPromise)(()=>s.source.list().json(),{...t,text:"Finding sources"});console.log(o)})),e}var a={ora:{spinner:"simpleDotsScrolling"},client:new F(new p)},Et=new vt.Command("gds").description("Great Detail Support System").addCommand(z(a)).addCommand($(a)).addCommand(X(a)).addCommand(tt(a)).addCommand(et(a)).addCommand(st(a)).addCommand(rt(a)).addCommand(at(a)),It=Et;It.parseAsync(process.argv);
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-XUY343WC.js";import"./chunk-OICZ42ZN.js";r.parseAsync(process.argv);
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=Object.create;var F=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var j=(s,t)=>{for(var e in t)F(s,e,{get:t[e],enumerable:!0})},H=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of et(t))!st.call(s,n)&&n!==e&&F(s,n,{get:()=>t[n],enumerable:!(o=tt(t,n))||o.enumerable});return s};var V=(s,t,e)=>(e=s!=null?Z(ot(s)):{},H(t||!s||!s.__esModule?F(e,"default",{value:s,enumerable:!0}):e,s)),nt=s=>H(F({},"__esModule",{value:!0}),s);var rt={};j(rt,{Client:()=>c,DEFAULT_SUPPORT_BASE_URL:()=>w,Error:()=>Q,SupportError:()=>a,default:()=>c,eventWebhookSchema:()=>N});module.exports=nt(rt);var w="https://api.support.greatdetail.com",q={"X-Powered-By":"GDSupport/JavaScript"};var m=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/accounts",{...e,method:"POST",json:t})}};var l=class{constructor(t){this._transport=t}get(t,e,{request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...o,method:"GET"})}list(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...e,method:"GET"})}delete(t,e,{body:o,request:n={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens/"+encodeURIComponent(e),{...n,method:"DELETE",json:o})}create(t,{body:e={},request:o={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/access-tokens",{...o,method:"POST",json:e})}};var d=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/accounts/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var u=class{constructor(t){this._transport=t}list({limit:t,sort:e,request:o={}}={}){return this._transport.send("v1/actions",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.sortQuery(e)]})}};var K="SUPPORT_ACCESS_TOKEN",Y="SUPPORT_KEY_NAME",z="SUPPORT_KEY_PASSWORD",W="SUPPORT_SIGNING_KEY",J="SUPPORT_BASE_URL";var h=class{name;#t;constructor({name:t=process.env[Y],password:e=process.env[z]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var C=class{#t;constructor({token:t=process.env[K]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var f=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o??{})]})}listByChannel(t,{limit:e,include:o,request:n={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...n,method:"GET",searchParams:[...this._transport.limitQuery(e),...this._transport.includeQuery(o)]})}create({body:t,request:e={}}){return this._transport.send("v1/messages",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var L=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}createResponse(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...o,method:"POST",timeout:12e4,json:e})}createCorrection(t,{body:e,request:o={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...o,method:"POST",json:e})}};var A=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}listByContact(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}listByConversation(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/notes",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var U=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=q;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var S=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}list({featured:t,category:e,request:o={}}={}){let n=[];if(e){let r=Array.isArray(e)?e:[e];for(let p of r)n.push(["category",p])}return t!==void 0&&n.push(["featured",String(t)]),this._transport.send("v1/sources",{...o,method:"GET",searchParams:n})}};var E=class{constructor(t){this._transport=t}getMessageFrequency({request:t={}}={}){return this._transport.send("v1/statistics/message-frequency",{...t,method:"GET"})}getChannelMessageFrequency(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/statistics/message-frequency",{...e,method:"GET"})}getModelUsage({request:t={}}={}){return this._transport.send("v1/statistics/model-usage",{...t,method:"GET"})}};var $=V(require("is-network-error"),1),M=V(require("ky"),1);var a=class extends Error{constructor(e,o){super("Support Error",{cause:o});this.response=e}};var D=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=M.default.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[o=>{for(let n of this.options.requestFilterables){let r=n.getHeaders();for(let[p,X]of Object.entries(r))o.headers.has(p)||o.headers.set(p,X)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}sortQuery(t){let e=[];if(t===void 0)return e;for(let[o,n]of Object.entries(t))n!==void 0&&e.push(["sort",n+o]);return e}limitQuery(t){let e=[];return t===void 0||e.push(["limit",t.toString()]),e}includeQuery(t){let e=[];if(t===void 0)return e;for(let o of Object.keys(t))e.push(["include",o]);return e}queryQuery(t){let e=[];return t===void 0||e.push(["query",t]),e}send(t,e={}){let o=this.client(t,e).catch(async n=>{throw(0,$.default)(n)?new Error("A network error occurred",{cause:n}):n instanceof M.HTTPError?new a(n.response,n):n});return{response:()=>o,json:async()=>(await o).json()}}};var G=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/uploads",{...t,method:"GET"})}create({files:t,request:e={}}){let o=new FormData;for(let n of t)o.append("file",n);return this._transport.send("v1/uploads",{...e,method:"POST",body:o})}delete(t,{request:e={}}={}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var k=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/users/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var i=require("zod"),N=i.z.object({data:i.z.object({event:i.z.object({id:i.z.string(),type:i.z.string(),payload:i.z.record(i.z.string()),createdAt:i.z.string().datetime()})})});var P=class{constructor(t){this._transport=t}async event({key:t=process.env[W],maxSignatures:e=3,request:o}){let n=o.headers["gds-signature"];if(t!==!1){if(t===void 0)throw new Error("Missing webhook signing key in process.env."+W);if(!n)throw new Error("Missing signature header");if(!this._verifySignature(t,o.body,Array.isArray(n)?n.slice(0,e):[n]))throw new Error("Untrusted signature")}let{data:r}=N.parse(o.body);return{event:r.event}}async _verifySignature(t,e,o){let n=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);for(let r of o)if(await crypto.subtle.verify("HMAC",n,new TextEncoder().encode(atob(r)),new TextEncoder().encode(JSON.stringify(e))))return!0;return!1}};var B=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/webhooks/subscriptions",{...t,method:"GET"})}test(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t)+"/test",{...e,method:"POST"})}create({body:t,request:e={}}){return this._transport.send("v1/webhooks/subscriptions",{...e,method:"POST",json:t})}delete(t,{request:e={}}={}){return this._transport.send("v1/webhooks/subscriptions/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var c=class s{static DEFAULT_BASE_URL=w;static PublicAuthentication=f;static BasicAuthentication=h;static BearerAuthentication=C;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new D({requestFilterables:[new U,t],...o,baseURL:e?.toString()??s.getBaseURL()}),this.account=new m(this._transport),this.accountAccessToken=new l(this._transport),this.accountConversationSettings=new d(this._transport),this.action=new u(this._transport),this.boilerplateCategory=new R(this._transport),this.boilerplateContent=new b(this._transport),this.channel=new v(this._transport),this.channelConversationSettings=new g(this._transport),this.compositionSection=new O(this._transport),this.contact=new x(this._transport),this.conversation=new T(this._transport),this.escalation=new _(this._transport),this.label=new I(this._transport),this.message=new y(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new S(this._transport),this.statistics=new E(this._transport),this.upload=new G(this._transport),this.user=new k(this._transport),this.webhook=new P(this._transport),this.webhookSubscription=new B(this._transport)}static getBaseURL(){return process.env[J]??this.DEFAULT_BASE_URL}};var Q={};j(Q,{SupportError:()=>a});0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,SupportError,eventWebhookSchema});
|
|
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}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};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}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var f=class{getHeaders(){return{}}};var R=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/categories",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var b=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/boilerplates/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByCategory=this.listByBoilerplateCategory;listByBoilerplateCategory(t,{limit:e,request:o={}}={}){return this._transport.send("v1/boilerplates/categories/"+encodeURIComponent(t)+"/contents",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/boilerplates/contents",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/boilerplates/contents/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var v=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/channels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}create({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",json:t})}metaWhatsappGetBusinessProfile(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/meta-whatsapp/business-profile",{...e,method:"GET"})}twilioSendgridChannelSync(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/twilio-sendgrid/sync",{...o,method:"POST",json:e})}};var g=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...e,method:"GET"})}update(t,{body:e,request:o={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversation-settings",{...o,method:"PATCH",json:e})}};var O=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,request:e={}}={}){return this._transport.send("v1/composition-sections",{...e,method:"GET",searchParams:[...this._transport.limitQuery(t)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}};var x=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}getRelativeVCFURL(t,{vcf:e={}}={}){let o=e.variant??"vcard",n=e.format??(o==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(o)+"&format="+encodeURIComponent(n)}getVCFURL(t,e={}){return this._transport.getURL(this.getRelativeVCFURL(t,e))}getVCF(t,e={}){return this._transport.send(this.getVCFURL(t,e),{method:"GET"})}list({limit:t,query:e,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var T=class{constructor(t){this._transport=t}get(t,{include:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"GET",searchParams:[...this._transport.includeQuery(e??{})]})}list({query:t,limit:e,filter:o,include:n,request:r={}}={}){return this._transport.send("v1/conversations",{...r,method:"GET",searchParams:[...this._transport.queryQuery(t),...this._transport.limitQuery(e),...o?[["filter",o]]:[],...this._transport.includeQuery(n??{})]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByChannel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/conversations",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/conversations",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var _=class{constructor(t){this._transport=t}list(t,{request:e={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...e,method:"GET"})}create(t,{body:e,request:o={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/feedback",{...o,method:"POST",json:e})}};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"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var y=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,query:e,include:o,request:n={}}={}){return this._transport.send("v1/labels",{...n,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e),...this._transport.includeQuery(o??{})]})}listByContact(t,{limit:e,request:o={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}listByConversation(t,{limit:e,request:o={}}={}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/labels",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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:[o=>{for(let n of this.options.requestFilterables){let r=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}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 P=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 B=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 F=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 T(this._transport),this.conversationFeedback=new _(this._transport),this.escalation=new I(this._transport),this.label=new y(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 P(this._transport),this.webhook=new B(this._transport),this.webhookSubscription=new F(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,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { A as Account, l as AccountAccessToken, m as AccountAccessTokenID, d4 as AccountAccessTokenWebhookEventType, v as AccountConversationSettings, e as AccountID, d3 as AccountWebhookWebhookEventType, E as Action, F as ActionID, bh as ActiveConversationStatus, a2 as BoilerplateCategory, a3 as BoilerplateCategoryID, K as BoilerplateContent, M as BoilerplateContentID, af as Channel, aw as ChannelConversationSettings, ag as ChannelID, C as Client, aC as CompositionSection, aD as CompositionSectionID, bi as ConcludedConversationStatus, aY as Contact, a_ as ContactCustomMetadata, aZ as ContactID, d5 as ContactWebhookEventType, bf as Conversation, bg as ConversationCustomMetadata, bF as ConversationSettings, bj as ConversationStatus, d6 as ConversationWebhookEventType, o as CreateAccountAccessTokenOptions, n as CreateAccountAccessTokenPayload, p as CreateAccountAccessTokenResponse, g as CreateAccountOptions, f as CreateAccountPayload, h as CreateAccountResponse, a5 as CreateBoilerplateCategoryOptions, a4 as CreateBoilerplateCategoryPayload, a6 as CreateBoilerplateCategoryResponse, Q as CreateBoilerplateContentOptions, P as CreateBoilerplateContentPayload, T as CreateBoilerplateContentResponse, ai as CreateChannelOptions, ah as CreateChannelPayload, aj as CreateChannelResponse, aF as CreateCompositionSectionOptions, aE as CreateCompositionSectionPayload, aG as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bl as CreateConversationOptions, bk as CreateConversationPayload, bm as CreateConversationResponse, ck as CreateCorrectionModelOptions, cj as CreateCorrectionModelPayload, cl as CreateCorrectionResponse, aS as CreateEscalationOptions, aR as CreateEscalationPayload, aT as CreateEscalationResponse, bI as CreateLabelOptions, bH as CreateLabelPayload, bJ as CreateLabelResponse, b$ as CreateMessageOptions, b_ as CreateMessagePayload, c0 as CreateMessageResponse, cw as CreateNoteOptions, cv as CreateNotePayload, cx as CreateNoteResponse, cn as CreateResponseModelOptions, cm as CreateResponseModelPayload, co as CreateResponseResponse, cP as CreateUploadOptions, cQ as CreateUploadResponse, dd as CreateWebhookSubscriptionOptions, dc as CreateWebhookSubscriptionPayload, de as CreateWebhookSubscriptionResponse, d as CurrentAccountID, q as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, r as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bn as DeleteConversationOptions, bo as DeleteConversationResponse, bK as DeleteLabelOptions, bL as DeleteLabelResponse, c1 as DeleteMessageOptions, c2 as DeleteMessageResponse, cR as DeleteUploadOptions, cS as DeleteUploadResponse, df as DeleteWebhookSubscriptionOptions, dg as DeleteWebhookSubscriptionResponse, aQ as Escalation, d0 as EventWebhookOptions, bx as FilterOptions, s as GetAccountAccessTokenOptions, t as GetAccountAccessTokenResponse, w as GetAccountConversationSettingsOptions, x as GetAccountConversationSettingsResponse, G as GetAccountOptions, i as GetAccountResponse, a7 as GetBoilerplateCategoryOptions, a8 as GetBoilerplateCategoryResponse, V as GetBoilerplateContentOptions, W as GetBoilerplateContentResponse, ax as GetChannelConversationSettingsOptions, ay as GetChannelConversationSettingsResponse, ak as GetChannelOptions, al as GetChannelResponse, aH as GetCompositionSectionOptions, aI as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bp as GetConversationIncludeOptions, bq as GetConversationOptions, br as GetConversationResponse, aU as GetEscalationOptions, aV as GetEscalationResponse, bM as GetLabelOptions, bN as GetLabelResponse, c3 as GetMessageOptions, c4 as GetMessageResponse, cp as GetModelOptions, cq as GetModelResponse, cy as GetNoteOptions, cz as GetNoteResponse, cJ as GetSourceOptions, cK as GetSourceResponse, cT as GetUploadOptions, cU as GetUploadResponse, cZ as GetUserOptions, c_ as GetUserResponse, dh as GetWebhookSubscriptionOptions, di as GetWebhookSubscriptionResponse, bG as Label, bO as LabelID, L as ListAccountAccessTokensOptions, u as ListAccountAccessTokensResponse, I as ListActionsOptions, J as ListActionsResponse, a9 as ListBoilerplateCategoriesIncludeOptions, aa as ListBoilerplateCategoriesOptions, ab as ListBoilerplateCategoriesResponse, X as ListBoilerplateCategoryBoilerplateContentsOptions, Y as ListBoilerplateCategoryBoilerplateContentsResponse, Z as ListBoilerplateContentsOptions, _ as ListBoilerplateContentsResponse, aJ as ListChannelCompositionSectionsOptions, aK as ListChannelCompositionSectionsResponse, bs as ListChannelConversationsOptions, bt as ListChannelConversationsResponse, c5 as ListChannelMessagesIncludeOptions, c6 as ListChannelMessagesOptions, c7 as ListChannelMessagesResponse, am as ListChannelsOptions, an as ListChannelsResponse, aL as ListCompositionSectionsOptions, aM as ListCompositionSectionsResponse, bu as ListContactConversationsOptions, bv as ListContactConversationsResponse, bP as ListContactLabelsOptions, bQ as ListContactLabelsResponse, cA as ListContactNotesOptions, cB as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bR as ListConversationLabelsOptions, bS as ListConversationLabelsResponse, c8 as ListConversationMessagesIncludeOptions, c9 as ListConversationMessagesOptions, ca as ListConversationMessagesResponse, cC as ListConversationNotesOptions, cD as ListConversationNotesResponse, by as ListConversationOptions, bw as ListConversationsIncludeOptions, bz as ListConversationsResponse, aW as ListEscalationsOptions, aX as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bA as ListLabelConversationsOptions, bB as ListLabelConversationsResponse, bT as ListLabelsIncludeOptions, bU as ListLabelsOptions, bV as ListLabelsResponse, cb as ListMessagesIncludeOptions, cc as ListMessagesOptions, cd as ListMessagesResponse, cr as ListModelsOptions, cs as ListModelsResponse, cL as ListSourcesOptions, cM as ListSourcesResponse, cV as ListUploadsOptions, cW as ListUploadsResponse, dj as ListWebhookSubscriptionsOptions, dk as ListWebhookSubscriptionsResponse, bZ as Message, ch as MessageEventType, ce as MessageID, cf as MessageRole, cg as MessageStatus, d7 as MessageWebhookEventType, ao as MetaWhatsappChannelGetBusinessProfileOptions, ap as MetaWhatsappChannelGetBusinessProfileResponse, ci as Model, ct as ModelID, cu as Note, cE as NoteID, O as Options, b as RequestFilterable, H as SortOptions, cI as Source, cN as SourceID, dl as TestWebhookSubscriptionOptions, dm as TestWebhookSubscriptionResponse, c as TransportOptions, aq as TwilioSendChannelSyncPayload, ar as TwilioSendgridChannelSyncOptions, as as TwilioSendgridChannelSyncResponse, z as UpdateAccountConversationSettingsOptions, y as UpdateAccountConversationSettingsPayload, B as UpdateAccountConversationSettingsResponse, j as UpdateAccountOptions, U as UpdateAccountPayload, k as UpdateAccountResponse, ad as UpdateBoilerplateCategoryOptions, ac as UpdateBoilerplateCategoryPayload, ae as UpdateBoilerplateCategoryResponse, a0 as UpdateBoilerplateContentOptions, $ as UpdateBoilerplateContentPayload, a1 as UpdateBoilerplateContentResponse, aA as UpdateChannelConversationSettingsOptions, az as UpdateChannelConversationSettingsPayload, aB as UpdateChannelConversationSettingsResponse, au as UpdateChannelOptions, at as UpdateChannelPayload, av as UpdateChannelResponse, aO as UpdateCompositionSectionOptions, aN as UpdateCompositionSectionPayload, aP as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bD as UpdateConversationOptions, bC as UpdateConversationPayload, bE as UpdateConversationResponse, bX as UpdateLabelOptions, bW as UpdateLabelPayload, bY as UpdateLabelResponse, cG as UpdateNoteOptions, cF as UpdateNotePayload, cH as UpdateNoteResponse, cO as Upload, cX as UploadID, cY as User, c$ as UserID, d9 as WebhookEventPayload, d2 as WebhookEventType, da as WebhookResponse, db as WebhookSubscription, dn as WebhookSubscriptionID, d8 as WebhookSubscriptionWebhookEventType, C as default, d1 as eventWebhookSchema } from './Client-Dznu1ulG.cjs';
|
|
1
|
+
export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, d7 as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, d6 as AccountWebhookWebhookEventType, z as Action, B as ActionID, be 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, bf as ConcludedConversationStatus, aU as Contact, aW as ContactCustomMetadata, aV as ContactID, d8 as ContactWebhookEventType, bb as Conversation, bd as ConversationCustomMetadata, bD as ConversationFeedback, bc as ConversationID, bC as ConversationSettings, bg as ConversationStatus, d9 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, aY as CreateContactOptions, aX as CreateContactPayload, aZ as CreateContactResponse, bF as CreateConversationConversationFeedbackOptions, bE as CreateConversationConversationFeedbackPayload, bG as CreateConversationConversationFeedbackResponse, bi as CreateConversationOptions, bh as CreateConversationPayload, bj as CreateConversationResponse, cn as CreateCorrectionModelOptions, cm as CreateCorrectionModelPayload, co as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bL as CreateLabelOptions, bK as CreateLabelPayload, bM as CreateLabelResponse, c2 as CreateMessageOptions, c1 as CreateMessagePayload, c3 as CreateMessageResponse, cz as CreateNoteOptions, cy as CreateNotePayload, cA as CreateNoteResponse, cq as CreateResponseModelOptions, cp as CreateResponseModelPayload, cr as CreateResponseResponse, cS as CreateUploadOptions, cT as CreateUploadResponse, dg as CreateWebhookSubscriptionOptions, df as CreateWebhookSubscriptionPayload, dh as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, a_ as DeleteContactOptions, a$ as DeleteContactResponse, bk as DeleteConversationOptions, bl as DeleteConversationResponse, bN as DeleteLabelOptions, bO as DeleteLabelResponse, c4 as DeleteMessageOptions, c5 as DeleteMessageResponse, cU as DeleteUploadOptions, cV as DeleteUploadResponse, di as DeleteWebhookSubscriptionOptions, dj as DeleteWebhookSubscriptionResponse, aM as Escalation, d3 as EventWebhookOptions, bu as FilterOptions, 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, b0 as GetContactIncludeOptions, b1 as GetContactOptions, b2 as GetContactResponse, b3 as GetContactVCFOptions, bm as GetConversationIncludeOptions, bn as GetConversationOptions, bo as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bP as GetLabelOptions, bQ as GetLabelResponse, c6 as GetMessageOptions, c7 as GetMessageResponse, cs as GetModelOptions, ct as GetModelResponse, cB as GetNoteOptions, cC as GetNoteResponse, cM as GetSourceOptions, cN as GetSourceResponse, cW as GetUploadOptions, cX as GetUploadResponse, d0 as GetUserOptions, d1 as GetUserResponse, dk as GetWebhookSubscriptionOptions, dl as GetWebhookSubscriptionResponse, bJ as Label, bR 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, bp as ListChannelConversationsOptions, bq as ListChannelConversationsResponse, c8 as ListChannelMessagesIncludeOptions, c9 as ListChannelMessagesOptions, ca as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, br as ListContactConversationsOptions, bs as ListContactConversationsResponse, bS as ListContactLabelsOptions, bT as ListContactLabelsResponse, cD as ListContactNotesOptions, cE as ListContactNotesResponse, b4 as ListContactsOptions, b5 as ListContactsResponse, bH as ListConversationConversationFeedbackOptions, bI as ListConversationConversationFeedbackResponse, bU as ListConversationLabelsOptions, bV as ListConversationLabelsResponse, cb as ListConversationMessagesIncludeOptions, cc as ListConversationMessagesOptions, cd as ListConversationMessagesResponse, cF as ListConversationNotesOptions, cG as ListConversationNotesResponse, bv as ListConversationOptions, bt as ListConversationsIncludeOptions, bw as ListConversationsResponse, aS as ListEscalationsOptions, aT as ListEscalationsResponse, b6 as ListLabelContactsOptions, b7 as ListLabelContactsResponse, bx as ListLabelConversationsOptions, by as ListLabelConversationsResponse, bW as ListLabelsIncludeOptions, bX as ListLabelsOptions, bY as ListLabelsResponse, ce as ListMessagesIncludeOptions, cf as ListMessagesOptions, cg as ListMessagesResponse, cu as ListModelsOptions, cv as ListModelsResponse, cO as ListSourcesOptions, cP as ListSourcesResponse, cY as ListUploadsOptions, cZ as ListUploadsResponse, dm as ListWebhookSubscriptionsOptions, dn as ListWebhookSubscriptionsResponse, c0 as Message, ck as MessageEventType, ch as MessageID, ci as MessageRole, cj as MessageStatus, da as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cl as Model, cw as ModelID, cx as Note, cH as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cL as Source, cQ as SourceID, dp as TestWebhookSubscriptionOptions, dq 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, b9 as UpdateContactOptions, b8 as UpdateContactPayload, ba as UpdateContactResponse, bA as UpdateConversationOptions, bz as UpdateConversationPayload, bB as UpdateConversationResponse, b_ as UpdateLabelOptions, bZ as UpdateLabelPayload, b$ as UpdateLabelResponse, cJ as UpdateNoteOptions, cI as UpdateNotePayload, cK as UpdateNoteResponse, cR as Upload, c_ as UploadID, c$ as User, d2 as UserID, dc as WebhookEventPayload, d5 as WebhookEventType, dd as WebhookResponse, de as WebhookSubscription, dr as WebhookSubscriptionID, db as WebhookSubscriptionWebhookEventType, C as default, d4 as eventWebhookSchema } from './Client-C3JKZRlU.cjs';
|
|
3
2
|
import { KyResponse } from 'ky';
|
|
4
3
|
import 'zod';
|
|
5
4
|
|
|
@@ -57,67 +56,4 @@ declare namespace index {
|
|
|
57
56
|
export { type index_ErrorResponse as ErrorResponse, index_SupportError as SupportError };
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
* Great Detail Support System.
|
|
62
|
-
*
|
|
63
|
-
* @copyright 2025 Great Detail Ltd
|
|
64
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
65
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
66
|
-
* @see https://greatdetail.com
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
type ConversationFeedbackID = string;
|
|
70
|
-
type ConversationFeedback = {
|
|
71
|
-
id: ConversationFeedbackID;
|
|
72
|
-
conversation: ConversationID;
|
|
73
|
-
feedback: {
|
|
74
|
-
id: string;
|
|
75
|
-
rating: number;
|
|
76
|
-
content?: Nullable<string>;
|
|
77
|
-
} & ResponseTimestamp;
|
|
78
|
-
} & ResponseTimestamp;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Great Detail Support System.
|
|
82
|
-
*
|
|
83
|
-
* @copyright 2025 Great Detail Ltd
|
|
84
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
85
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
86
|
-
* @see https://greatdetail.com
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
type CreateConversationConversationFeedbackPayload = {
|
|
90
|
-
feedback: {
|
|
91
|
-
rating: number;
|
|
92
|
-
content?: Nullable<string>;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
interface CreateConversationConversationFeedbackOptions {
|
|
96
|
-
body: CreateConversationConversationFeedbackPayload;
|
|
97
|
-
request?: SendOptions;
|
|
98
|
-
}
|
|
99
|
-
type CreateConversationConversationFeedbackResponse = {
|
|
100
|
-
data: {
|
|
101
|
-
conversationFeedback: ConversationFeedback;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Great Detail Support System.
|
|
107
|
-
*
|
|
108
|
-
* @copyright 2025 Great Detail Ltd
|
|
109
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
110
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
111
|
-
* @see https://greatdetail.com
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
interface ListConversationConversationFeedbackOptions {
|
|
115
|
-
request?: SendOptions;
|
|
116
|
-
}
|
|
117
|
-
type ListConversationConversationFeedbackResponse = {
|
|
118
|
-
data: {
|
|
119
|
-
conversationFeedback: ConversationFeedback;
|
|
120
|
-
}[];
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export { type ConversationFeedback, ConversationID, type CreateConversationConversationFeedbackOptions, type CreateConversationConversationFeedbackPayload, type CreateConversationConversationFeedbackResponse, DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ListConversationConversationFeedbackOptions, type ListConversationConversationFeedbackResponse, SupportError };
|
|
59
|
+
export { DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, SupportError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { A as Account, l as AccountAccessToken, m as AccountAccessTokenID, d4 as AccountAccessTokenWebhookEventType, v as AccountConversationSettings, e as AccountID, d3 as AccountWebhookWebhookEventType, E as Action, F as ActionID, bh as ActiveConversationStatus, a2 as BoilerplateCategory, a3 as BoilerplateCategoryID, K as BoilerplateContent, M as BoilerplateContentID, af as Channel, aw as ChannelConversationSettings, ag as ChannelID, C as Client, aC as CompositionSection, aD as CompositionSectionID, bi as ConcludedConversationStatus, aY as Contact, a_ as ContactCustomMetadata, aZ as ContactID, d5 as ContactWebhookEventType, bf as Conversation, bg as ConversationCustomMetadata, bF as ConversationSettings, bj as ConversationStatus, d6 as ConversationWebhookEventType, o as CreateAccountAccessTokenOptions, n as CreateAccountAccessTokenPayload, p as CreateAccountAccessTokenResponse, g as CreateAccountOptions, f as CreateAccountPayload, h as CreateAccountResponse, a5 as CreateBoilerplateCategoryOptions, a4 as CreateBoilerplateCategoryPayload, a6 as CreateBoilerplateCategoryResponse, Q as CreateBoilerplateContentOptions, P as CreateBoilerplateContentPayload, T as CreateBoilerplateContentResponse, ai as CreateChannelOptions, ah as CreateChannelPayload, aj as CreateChannelResponse, aF as CreateCompositionSectionOptions, aE as CreateCompositionSectionPayload, aG as CreateCompositionSectionResponse, b0 as CreateContactOptions, a$ as CreateContactPayload, b1 as CreateContactResponse, bl as CreateConversationOptions, bk as CreateConversationPayload, bm as CreateConversationResponse, ck as CreateCorrectionModelOptions, cj as CreateCorrectionModelPayload, cl as CreateCorrectionResponse, aS as CreateEscalationOptions, aR as CreateEscalationPayload, aT as CreateEscalationResponse, bI as CreateLabelOptions, bH as CreateLabelPayload, bJ as CreateLabelResponse, b$ as CreateMessageOptions, b_ as CreateMessagePayload, c0 as CreateMessageResponse, cw as CreateNoteOptions, cv as CreateNotePayload, cx as CreateNoteResponse, cn as CreateResponseModelOptions, cm as CreateResponseModelPayload, co as CreateResponseResponse, cP as CreateUploadOptions, cQ as CreateUploadResponse, dd as CreateWebhookSubscriptionOptions, dc as CreateWebhookSubscriptionPayload, de as CreateWebhookSubscriptionResponse, d as CurrentAccountID, q as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, r as DeleteAccountAccessTokenResponse, b2 as DeleteContactOptions, b3 as DeleteContactResponse, bn as DeleteConversationOptions, bo as DeleteConversationResponse, bK as DeleteLabelOptions, bL as DeleteLabelResponse, c1 as DeleteMessageOptions, c2 as DeleteMessageResponse, cR as DeleteUploadOptions, cS as DeleteUploadResponse, df as DeleteWebhookSubscriptionOptions, dg as DeleteWebhookSubscriptionResponse, aQ as Escalation, d0 as EventWebhookOptions, bx as FilterOptions, s as GetAccountAccessTokenOptions, t as GetAccountAccessTokenResponse, w as GetAccountConversationSettingsOptions, x as GetAccountConversationSettingsResponse, G as GetAccountOptions, i as GetAccountResponse, a7 as GetBoilerplateCategoryOptions, a8 as GetBoilerplateCategoryResponse, V as GetBoilerplateContentOptions, W as GetBoilerplateContentResponse, ax as GetChannelConversationSettingsOptions, ay as GetChannelConversationSettingsResponse, ak as GetChannelOptions, al as GetChannelResponse, aH as GetCompositionSectionOptions, aI as GetCompositionSectionResponse, b4 as GetContactIncludeOptions, b5 as GetContactOptions, b6 as GetContactResponse, b7 as GetContactVCFOptions, bp as GetConversationIncludeOptions, bq as GetConversationOptions, br as GetConversationResponse, aU as GetEscalationOptions, aV as GetEscalationResponse, bM as GetLabelOptions, bN as GetLabelResponse, c3 as GetMessageOptions, c4 as GetMessageResponse, cp as GetModelOptions, cq as GetModelResponse, cy as GetNoteOptions, cz as GetNoteResponse, cJ as GetSourceOptions, cK as GetSourceResponse, cT as GetUploadOptions, cU as GetUploadResponse, cZ as GetUserOptions, c_ as GetUserResponse, dh as GetWebhookSubscriptionOptions, di as GetWebhookSubscriptionResponse, bG as Label, bO as LabelID, L as ListAccountAccessTokensOptions, u as ListAccountAccessTokensResponse, I as ListActionsOptions, J as ListActionsResponse, a9 as ListBoilerplateCategoriesIncludeOptions, aa as ListBoilerplateCategoriesOptions, ab as ListBoilerplateCategoriesResponse, X as ListBoilerplateCategoryBoilerplateContentsOptions, Y as ListBoilerplateCategoryBoilerplateContentsResponse, Z as ListBoilerplateContentsOptions, _ as ListBoilerplateContentsResponse, aJ as ListChannelCompositionSectionsOptions, aK as ListChannelCompositionSectionsResponse, bs as ListChannelConversationsOptions, bt as ListChannelConversationsResponse, c5 as ListChannelMessagesIncludeOptions, c6 as ListChannelMessagesOptions, c7 as ListChannelMessagesResponse, am as ListChannelsOptions, an as ListChannelsResponse, aL as ListCompositionSectionsOptions, aM as ListCompositionSectionsResponse, bu as ListContactConversationsOptions, bv as ListContactConversationsResponse, bP as ListContactLabelsOptions, bQ as ListContactLabelsResponse, cA as ListContactNotesOptions, cB as ListContactNotesResponse, b8 as ListContactsOptions, b9 as ListContactsResponse, bR as ListConversationLabelsOptions, bS as ListConversationLabelsResponse, c8 as ListConversationMessagesIncludeOptions, c9 as ListConversationMessagesOptions, ca as ListConversationMessagesResponse, cC as ListConversationNotesOptions, cD as ListConversationNotesResponse, by as ListConversationOptions, bw as ListConversationsIncludeOptions, bz as ListConversationsResponse, aW as ListEscalationsOptions, aX as ListEscalationsResponse, ba as ListLabelContactsOptions, bb as ListLabelContactsResponse, bA as ListLabelConversationsOptions, bB as ListLabelConversationsResponse, bT as ListLabelsIncludeOptions, bU as ListLabelsOptions, bV as ListLabelsResponse, cb as ListMessagesIncludeOptions, cc as ListMessagesOptions, cd as ListMessagesResponse, cr as ListModelsOptions, cs as ListModelsResponse, cL as ListSourcesOptions, cM as ListSourcesResponse, cV as ListUploadsOptions, cW as ListUploadsResponse, dj as ListWebhookSubscriptionsOptions, dk as ListWebhookSubscriptionsResponse, bZ as Message, ch as MessageEventType, ce as MessageID, cf as MessageRole, cg as MessageStatus, d7 as MessageWebhookEventType, ao as MetaWhatsappChannelGetBusinessProfileOptions, ap as MetaWhatsappChannelGetBusinessProfileResponse, ci as Model, ct as ModelID, cu as Note, cE as NoteID, O as Options, b as RequestFilterable, H as SortOptions, cI as Source, cN as SourceID, dl as TestWebhookSubscriptionOptions, dm as TestWebhookSubscriptionResponse, c as TransportOptions, aq as TwilioSendChannelSyncPayload, ar as TwilioSendgridChannelSyncOptions, as as TwilioSendgridChannelSyncResponse, z as UpdateAccountConversationSettingsOptions, y as UpdateAccountConversationSettingsPayload, B as UpdateAccountConversationSettingsResponse, j as UpdateAccountOptions, U as UpdateAccountPayload, k as UpdateAccountResponse, ad as UpdateBoilerplateCategoryOptions, ac as UpdateBoilerplateCategoryPayload, ae as UpdateBoilerplateCategoryResponse, a0 as UpdateBoilerplateContentOptions, $ as UpdateBoilerplateContentPayload, a1 as UpdateBoilerplateContentResponse, aA as UpdateChannelConversationSettingsOptions, az as UpdateChannelConversationSettingsPayload, aB as UpdateChannelConversationSettingsResponse, au as UpdateChannelOptions, at as UpdateChannelPayload, av as UpdateChannelResponse, aO as UpdateCompositionSectionOptions, aN as UpdateCompositionSectionPayload, aP as UpdateCompositionSectionResponse, bd as UpdateContactOptions, bc as UpdateContactPayload, be as UpdateContactResponse, bD as UpdateConversationOptions, bC as UpdateConversationPayload, bE as UpdateConversationResponse, bX as UpdateLabelOptions, bW as UpdateLabelPayload, bY as UpdateLabelResponse, cG as UpdateNoteOptions, cF as UpdateNotePayload, cH as UpdateNoteResponse, cO as Upload, cX as UploadID, cY as User, c$ as UserID, d9 as WebhookEventPayload, d2 as WebhookEventType, da as WebhookResponse, db as WebhookSubscription, dn as WebhookSubscriptionID, d8 as WebhookSubscriptionWebhookEventType, C as default, d1 as eventWebhookSchema } from './Client-Dznu1ulG.js';
|
|
1
|
+
export { A as Account, j as AccountAccessToken, k as AccountAccessTokenID, d7 as AccountAccessTokenWebhookEventType, t as AccountConversationSettings, c as AccountID, d6 as AccountWebhookWebhookEventType, z as Action, B as ActionID, be 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, bf as ConcludedConversationStatus, aU as Contact, aW as ContactCustomMetadata, aV as ContactID, d8 as ContactWebhookEventType, bb as Conversation, bd as ConversationCustomMetadata, bD as ConversationFeedback, bc as ConversationID, bC as ConversationSettings, bg as ConversationStatus, d9 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, aY as CreateContactOptions, aX as CreateContactPayload, aZ as CreateContactResponse, bF as CreateConversationConversationFeedbackOptions, bE as CreateConversationConversationFeedbackPayload, bG as CreateConversationConversationFeedbackResponse, bi as CreateConversationOptions, bh as CreateConversationPayload, bj as CreateConversationResponse, cn as CreateCorrectionModelOptions, cm as CreateCorrectionModelPayload, co as CreateCorrectionResponse, aO as CreateEscalationOptions, aN as CreateEscalationPayload, aP as CreateEscalationResponse, bL as CreateLabelOptions, bK as CreateLabelPayload, bM as CreateLabelResponse, c2 as CreateMessageOptions, c1 as CreateMessagePayload, c3 as CreateMessageResponse, cz as CreateNoteOptions, cy as CreateNotePayload, cA as CreateNoteResponse, cq as CreateResponseModelOptions, cp as CreateResponseModelPayload, cr as CreateResponseResponse, cS as CreateUploadOptions, cT as CreateUploadResponse, dg as CreateWebhookSubscriptionOptions, df as CreateWebhookSubscriptionPayload, dh as CreateWebhookSubscriptionResponse, b as CurrentAccountID, o as DeleteAccountAccessTokenOptions, D as DeleteAccountAccessTokenPayload, p as DeleteAccountAccessTokenResponse, a_ as DeleteContactOptions, a$ as DeleteContactResponse, bk as DeleteConversationOptions, bl as DeleteConversationResponse, bN as DeleteLabelOptions, bO as DeleteLabelResponse, c4 as DeleteMessageOptions, c5 as DeleteMessageResponse, cU as DeleteUploadOptions, cV as DeleteUploadResponse, di as DeleteWebhookSubscriptionOptions, dj as DeleteWebhookSubscriptionResponse, aM as Escalation, d3 as EventWebhookOptions, bu as FilterOptions, 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, b0 as GetContactIncludeOptions, b1 as GetContactOptions, b2 as GetContactResponse, b3 as GetContactVCFOptions, bm as GetConversationIncludeOptions, bn as GetConversationOptions, bo as GetConversationResponse, aQ as GetEscalationOptions, aR as GetEscalationResponse, bP as GetLabelOptions, bQ as GetLabelResponse, c6 as GetMessageOptions, c7 as GetMessageResponse, cs as GetModelOptions, ct as GetModelResponse, cB as GetNoteOptions, cC as GetNoteResponse, cM as GetSourceOptions, cN as GetSourceResponse, cW as GetUploadOptions, cX as GetUploadResponse, d0 as GetUserOptions, d1 as GetUserResponse, dk as GetWebhookSubscriptionOptions, dl as GetWebhookSubscriptionResponse, bJ as Label, bR 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, bp as ListChannelConversationsOptions, bq as ListChannelConversationsResponse, c8 as ListChannelMessagesIncludeOptions, c9 as ListChannelMessagesOptions, ca as ListChannelMessagesResponse, ai as ListChannelsOptions, aj as ListChannelsResponse, aH as ListCompositionSectionsOptions, aI as ListCompositionSectionsResponse, br as ListContactConversationsOptions, bs as ListContactConversationsResponse, bS as ListContactLabelsOptions, bT as ListContactLabelsResponse, cD as ListContactNotesOptions, cE as ListContactNotesResponse, b4 as ListContactsOptions, b5 as ListContactsResponse, bH as ListConversationConversationFeedbackOptions, bI as ListConversationConversationFeedbackResponse, bU as ListConversationLabelsOptions, bV as ListConversationLabelsResponse, cb as ListConversationMessagesIncludeOptions, cc as ListConversationMessagesOptions, cd as ListConversationMessagesResponse, cF as ListConversationNotesOptions, cG as ListConversationNotesResponse, bv as ListConversationOptions, bt as ListConversationsIncludeOptions, bw as ListConversationsResponse, aS as ListEscalationsOptions, aT as ListEscalationsResponse, b6 as ListLabelContactsOptions, b7 as ListLabelContactsResponse, bx as ListLabelConversationsOptions, by as ListLabelConversationsResponse, bW as ListLabelsIncludeOptions, bX as ListLabelsOptions, bY as ListLabelsResponse, ce as ListMessagesIncludeOptions, cf as ListMessagesOptions, cg as ListMessagesResponse, cu as ListModelsOptions, cv as ListModelsResponse, cO as ListSourcesOptions, cP as ListSourcesResponse, cY as ListUploadsOptions, cZ as ListUploadsResponse, dm as ListWebhookSubscriptionsOptions, dn as ListWebhookSubscriptionsResponse, c0 as Message, ck as MessageEventType, ch as MessageID, ci as MessageRole, cj as MessageStatus, da as MessageWebhookEventType, ak as MetaWhatsappChannelGetBusinessProfileOptions, al as MetaWhatsappChannelGetBusinessProfileResponse, cl as Model, cw as ModelID, cx as Note, cH as NoteID, O as Options, R as RequestFilterable, S as SortOptions, cL as Source, cQ as SourceID, dp as TestWebhookSubscriptionOptions, dq 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, b9 as UpdateContactOptions, b8 as UpdateContactPayload, ba as UpdateContactResponse, bA as UpdateConversationOptions, bz as UpdateConversationPayload, bB as UpdateConversationResponse, b_ as UpdateLabelOptions, bZ as UpdateLabelPayload, b$ as UpdateLabelResponse, cJ as UpdateNoteOptions, cI as UpdateNotePayload, cK as UpdateNoteResponse, cR as Upload, c_ as UploadID, c$ as User, d2 as UserID, dc as WebhookEventPayload, d5 as WebhookEventType, dd as WebhookResponse, de as WebhookSubscription, dr as WebhookSubscriptionID, db as WebhookSubscriptionWebhookEventType, C as default, d4 as eventWebhookSchema } from './Client-C3JKZRlU.js';
|
|
3
2
|
import { KyResponse } from 'ky';
|
|
4
3
|
import 'zod';
|
|
5
4
|
|
|
@@ -57,67 +56,4 @@ declare namespace index {
|
|
|
57
56
|
export { type index_ErrorResponse as ErrorResponse, index_SupportError as SupportError };
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
* Great Detail Support System.
|
|
62
|
-
*
|
|
63
|
-
* @copyright 2025 Great Detail Ltd
|
|
64
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
65
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
66
|
-
* @see https://greatdetail.com
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
type ConversationFeedbackID = string;
|
|
70
|
-
type ConversationFeedback = {
|
|
71
|
-
id: ConversationFeedbackID;
|
|
72
|
-
conversation: ConversationID;
|
|
73
|
-
feedback: {
|
|
74
|
-
id: string;
|
|
75
|
-
rating: number;
|
|
76
|
-
content?: Nullable<string>;
|
|
77
|
-
} & ResponseTimestamp;
|
|
78
|
-
} & ResponseTimestamp;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Great Detail Support System.
|
|
82
|
-
*
|
|
83
|
-
* @copyright 2025 Great Detail Ltd
|
|
84
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
85
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
86
|
-
* @see https://greatdetail.com
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
type CreateConversationConversationFeedbackPayload = {
|
|
90
|
-
feedback: {
|
|
91
|
-
rating: number;
|
|
92
|
-
content?: Nullable<string>;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
interface CreateConversationConversationFeedbackOptions {
|
|
96
|
-
body: CreateConversationConversationFeedbackPayload;
|
|
97
|
-
request?: SendOptions;
|
|
98
|
-
}
|
|
99
|
-
type CreateConversationConversationFeedbackResponse = {
|
|
100
|
-
data: {
|
|
101
|
-
conversationFeedback: ConversationFeedback;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Great Detail Support System.
|
|
107
|
-
*
|
|
108
|
-
* @copyright 2025 Great Detail Ltd
|
|
109
|
-
* @author Great Detail Ltd <info@greatdetail.com>
|
|
110
|
-
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
111
|
-
* @see https://greatdetail.com
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
interface ListConversationConversationFeedbackOptions {
|
|
115
|
-
request?: SendOptions;
|
|
116
|
-
}
|
|
117
|
-
type ListConversationConversationFeedbackResponse = {
|
|
118
|
-
data: {
|
|
119
|
-
conversationFeedback: ConversationFeedback;
|
|
120
|
-
}[];
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export { type ConversationFeedback, ConversationID, type CreateConversationConversationFeedbackOptions, type CreateConversationConversationFeedbackPayload, type CreateConversationConversationFeedbackResponse, DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, type ListConversationConversationFeedbackOptions, type ListConversationConversationFeedbackResponse, SupportError };
|
|
59
|
+
export { DEFAULT_SUPPORT_BASE_URL, index as Error, type ErrorResponse, SupportError };
|
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-
|
|
1
|
+
import{a as e,c as t,d as p,e as f,f as o}from"./chunk-OICZ42ZN.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
package/dist/chunk-BORTTUUM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var q=Object.defineProperty;var J=(n,t)=>{for(var e in t)q(n,e,{get:t[e],enumerable:!0})};var a=class{getHeaders(){return{}}};var x="SUPPORT_ACCESS_TOKEN",F="SUPPORT_KEY_NAME",W="SUPPORT_KEY_PASSWORD",w="SUPPORT_SIGNING_KEY",N="SUPPORT_BASE_URL";var c=class{name;#t;constructor({name:t=process.env[F],password:e=process.env[W]}={}){if(!t)throw new Error("Name option must be specified when using Basic Authentication");if(!e)throw new Error("Password option must be specified when using Basic Authentication");this.name=t,this.#t=e}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var 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}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var Q="https://api.support.greatdetail.com",j={"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 H=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 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 v=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,request:o={}}={}){return this._transport.send("v1/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.queryQuery(e)]})}listByLabel(t,{limit:e,request:o={}}={}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...o,method:"GET",searchParams:[...this._transport.limitQuery(e)]})}create({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",json:t})}update(t,{body:e,request:o={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...o,method:"PATCH",json:e})}delete(t,{request:e={}}={}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var 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),...o?[["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/escalations/"+encodeURIComponent(t),{...e,method:"GET"})}list({request:t={}}={}){return this._transport.send("v1/escalations",{...t,method:"GET"})}create({body:t,request:e={}}){return this._transport.send("v1/escalations",{...e,method:"POST",json:t})}};var 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 I=class{constructor(t){this._transport=t}get(t,{request:e={}}={}){return this._transport.send("v1/messages/"+encodeURIComponent(t),{...e,method:"GET"})}list({limit:t,include:e,request:o={}}={}){return this._transport.send("v1/messages",{...o,method:"GET",searchParams:[...this._transport.limitQuery(t),...this._transport.includeQuery(e??{})]})}listByConversation(t,{limit:e,include:o,request: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 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 y=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=j;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var U=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 S=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 K from"is-network-error";import Y,{HTTPError as z}from"ky";var E=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Y.create({prefixUrl:this.options.baseURL,timeout:12e3,hooks:{beforeRequest:[o=>{for(let s of this.options.requestFilterables){let r=s.getHeaders();for(let[p,V]of Object.entries(r))o.headers.has(p)||o.headers.set(p,V)}}]}})}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}send(t,e={}){let o=this.client(t,e).catch(async s=>{throw K(s)?new Error("A network error occurred",{cause:s}):s instanceof z?new B(s.response,s):s});return{response:()=>o,json:async()=>(await o).json()}}};var D=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 G=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 k=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}=H.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=Q;static PublicAuthentication=a;static BasicAuthentication=c;static BearerAuthentication=m;_transport;account;accountAccessToken;accountConversationSettings;action;boilerplateCategory;boilerplateContent;channel;channelConversationSettings;compositionSection;contact;conversation;escalation;label;message;model;note;source;statistics;upload;user;webhook;webhookSubscription;constructor(t,{baseURL:e,...o}={}){this._transport=new E({requestFilterables:[new y,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 g(this._transport),this.contact=new v(this._transport),this.conversation=new O(this._transport),this.escalation=new _(this._transport),this.label=new T(this._transport),this.message=new I(this._transport),this.model=new L(this._transport),this.note=new A(this._transport),this.source=new U(this._transport),this.statistics=new S(this._transport),this.upload=new D(this._transport),this.user=new G(this._transport),this.webhook=new k(this._transport),this.webhookSubscription=new P(this._transport)}static getBaseURL(){return process.env[N]??this.DEFAULT_BASE_URL}};export{J as a,a as b,Q as c,B as d,H as e,M as f};
|