@livechat/developer-studio-api 3.1.19 → 3.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +196 -5
- package/dist/index.d.ts +196 -5
- package/dist/index.js +217 -19
- package/dist/index.mjs +208 -19
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -562,8 +562,8 @@ type DeepPartial<T> = T extends object ? {
|
|
|
562
562
|
type CreateCredentialPayload = Credential;
|
|
563
563
|
type UpdateCredentialPayload = DeepPartial<Credential>;
|
|
564
564
|
|
|
565
|
-
type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
|
|
566
|
-
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
|
|
565
|
+
type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "hubspot" | "text";
|
|
566
|
+
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "hubspot" | "text";
|
|
567
567
|
type ApiErrorKind = "unauthorized" | "error";
|
|
568
568
|
type ApiError<TData = unknown> = {
|
|
569
569
|
code: number;
|
|
@@ -988,6 +988,26 @@ declare function getShopifyClientConfig(options?: ShopifyClientOptions): AxiosRe
|
|
|
988
988
|
declare function initShopifyClient(token?: string, shop?: string): void;
|
|
989
989
|
declare function updateShopifyClient(token?: string, shop?: string): void;
|
|
990
990
|
|
|
991
|
+
interface HubspotClientAuthorization {
|
|
992
|
+
token?: string;
|
|
993
|
+
}
|
|
994
|
+
interface HubspotClientInstanceOptions extends HubspotClientAuthorization {
|
|
995
|
+
ensureAuthorizationToken?: boolean;
|
|
996
|
+
}
|
|
997
|
+
declare class HubspotApiError extends ApiErrorBase<{
|
|
998
|
+
errors: Record<string, string[]>;
|
|
999
|
+
}> {
|
|
1000
|
+
name: "hubspot";
|
|
1001
|
+
}
|
|
1002
|
+
declare const hubspotClientUrl = "https://api.hubapi.com";
|
|
1003
|
+
declare const hubspotClientInstance: axios.AxiosInstance;
|
|
1004
|
+
declare function getHubspotClientAuthorization(req: {
|
|
1005
|
+
headers: Record<string, string | string[] | undefined> | Headers;
|
|
1006
|
+
}): HubspotClientAuthorization;
|
|
1007
|
+
declare function getHubspotClientConfig(options?: HubspotClientInstanceOptions): AxiosRequestConfig;
|
|
1008
|
+
declare function initHubspotClient(token?: string): void;
|
|
1009
|
+
declare function updateHubspotClient(token?: string): void;
|
|
1010
|
+
|
|
991
1011
|
interface AccountDto {
|
|
992
1012
|
account_id: string;
|
|
993
1013
|
avatar: string;
|
|
@@ -1800,6 +1820,130 @@ type IntegrationFlowOutput<TFlowResult> = {
|
|
|
1800
1820
|
status: "cancel";
|
|
1801
1821
|
};
|
|
1802
1822
|
|
|
1823
|
+
interface HubspotAuthorizeActionResult {
|
|
1824
|
+
token: string;
|
|
1825
|
+
}
|
|
1826
|
+
type HubspotAuthorizeFlowContext = IntegrationFlowContext;
|
|
1827
|
+
interface HubspotAuthorizeFlowResult {
|
|
1828
|
+
token: string;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
declare enum HubspotEventNames {
|
|
1832
|
+
SomeEvent = "some_event"
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
declare const hubspotEventsZods: {
|
|
1836
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1837
|
+
eventName: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1838
|
+
events: {
|
|
1839
|
+
someEvent: z.ZodObject<{
|
|
1840
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1841
|
+
}, "strip", z.ZodTypeAny, {
|
|
1842
|
+
name: HubspotEventNames;
|
|
1843
|
+
}, {
|
|
1844
|
+
name: HubspotEventNames;
|
|
1845
|
+
}>;
|
|
1846
|
+
};
|
|
1847
|
+
readonly event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1848
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1849
|
+
}, "strip", z.ZodTypeAny, {
|
|
1850
|
+
name: HubspotEventNames;
|
|
1851
|
+
}, {
|
|
1852
|
+
name: HubspotEventNames;
|
|
1853
|
+
}>]>;
|
|
1854
|
+
readonly source: z.ZodObject<{
|
|
1855
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1856
|
+
sourceKey: z.ZodString;
|
|
1857
|
+
}, "strip", z.ZodTypeAny, {
|
|
1858
|
+
sourceName: "apps" | "workflows";
|
|
1859
|
+
sourceKey: string;
|
|
1860
|
+
}, {
|
|
1861
|
+
sourceName: "apps" | "workflows";
|
|
1862
|
+
sourceKey: string;
|
|
1863
|
+
}>;
|
|
1864
|
+
readonly subscribe: z.ZodIntersection<z.ZodObject<{
|
|
1865
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1866
|
+
sourceKey: z.ZodString;
|
|
1867
|
+
}, "strip", z.ZodTypeAny, {
|
|
1868
|
+
sourceName: "apps" | "workflows";
|
|
1869
|
+
sourceKey: string;
|
|
1870
|
+
}, {
|
|
1871
|
+
sourceName: "apps" | "workflows";
|
|
1872
|
+
sourceKey: string;
|
|
1873
|
+
}>, z.ZodObject<{
|
|
1874
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1875
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1876
|
+
}, "strip", z.ZodTypeAny, {
|
|
1877
|
+
name: HubspotEventNames;
|
|
1878
|
+
}, {
|
|
1879
|
+
name: HubspotEventNames;
|
|
1880
|
+
}>]>;
|
|
1881
|
+
callback: z.ZodString;
|
|
1882
|
+
}, "strip", z.ZodTypeAny, {
|
|
1883
|
+
event: {
|
|
1884
|
+
name: HubspotEventNames;
|
|
1885
|
+
};
|
|
1886
|
+
callback: string;
|
|
1887
|
+
}, {
|
|
1888
|
+
event: {
|
|
1889
|
+
name: HubspotEventNames;
|
|
1890
|
+
};
|
|
1891
|
+
callback: string;
|
|
1892
|
+
}>>;
|
|
1893
|
+
readonly subscribeContent: z.ZodObject<{
|
|
1894
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1895
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1896
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1897
|
+
}, "strip", z.ZodTypeAny, {
|
|
1898
|
+
name: HubspotEventNames;
|
|
1899
|
+
}, {
|
|
1900
|
+
name: HubspotEventNames;
|
|
1901
|
+
}>]>;
|
|
1902
|
+
listId: z.ZodString;
|
|
1903
|
+
}, "strip", z.ZodTypeAny, {
|
|
1904
|
+
event: {
|
|
1905
|
+
name: HubspotEventNames;
|
|
1906
|
+
};
|
|
1907
|
+
provider: "hubspot";
|
|
1908
|
+
listId: string;
|
|
1909
|
+
}, {
|
|
1910
|
+
event: {
|
|
1911
|
+
name: HubspotEventNames;
|
|
1912
|
+
};
|
|
1913
|
+
provider: "hubspot";
|
|
1914
|
+
listId: string;
|
|
1915
|
+
}>;
|
|
1916
|
+
readonly unsubscribe: z.ZodIntersection<z.ZodObject<{
|
|
1917
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1918
|
+
sourceKey: z.ZodString;
|
|
1919
|
+
}, "strip", z.ZodTypeAny, {
|
|
1920
|
+
sourceName: "apps" | "workflows";
|
|
1921
|
+
sourceKey: string;
|
|
1922
|
+
}, {
|
|
1923
|
+
sourceName: "apps" | "workflows";
|
|
1924
|
+
sourceKey: string;
|
|
1925
|
+
}>, z.ZodObject<{
|
|
1926
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1927
|
+
}, "strip", z.ZodTypeAny, {
|
|
1928
|
+
event: HubspotEventNames;
|
|
1929
|
+
}, {
|
|
1930
|
+
event: HubspotEventNames;
|
|
1931
|
+
}>>;
|
|
1932
|
+
readonly unsubscribeContent: z.ZodObject<{
|
|
1933
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1934
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1935
|
+
}, "strip", z.ZodTypeAny, {
|
|
1936
|
+
event: HubspotEventNames;
|
|
1937
|
+
provider: "hubspot";
|
|
1938
|
+
}, {
|
|
1939
|
+
event: HubspotEventNames;
|
|
1940
|
+
provider: "hubspot";
|
|
1941
|
+
}>;
|
|
1942
|
+
};
|
|
1943
|
+
type HubspotEvent = z.infer<typeof hubspotEventsZods.event>;
|
|
1944
|
+
type SubscribeToHubspotEventPayload = z.infer<typeof hubspotEventsZods.subscribe>;
|
|
1945
|
+
type UnsubscribeFromHubspotEventPayload = z.infer<typeof hubspotEventsZods.unsubscribe>;
|
|
1946
|
+
|
|
1803
1947
|
interface MailchimpAuthorizeActionResult {
|
|
1804
1948
|
server: string;
|
|
1805
1949
|
token: string;
|
|
@@ -2499,8 +2643,8 @@ type UnsubscribeFromTextLivechatEventPayload = z.infer<typeof textLivechatEvents
|
|
|
2499
2643
|
|
|
2500
2644
|
declare const integrationEventsZods: {
|
|
2501
2645
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
2502
|
-
providerName: z.ZodEnum<["text-livechat", "mailchimp", "shopify"]>;
|
|
2503
|
-
readonly event: z.ZodUnion<[z.ZodUnion<[z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2646
|
+
providerName: z.ZodEnum<["text-livechat", "mailchimp", "shopify", "hubspot"]>;
|
|
2647
|
+
readonly event: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2504
2648
|
name: z.ZodLiteral<TextLivechatEventNames.ChatStarted>;
|
|
2505
2649
|
}, "strip", z.ZodTypeAny, {
|
|
2506
2650
|
name: TextLivechatEventNames.ChatStarted;
|
|
@@ -2572,6 +2716,12 @@ declare const integrationEventsZods: {
|
|
|
2572
2716
|
name: MailchimpEventNames.Unsubscribed;
|
|
2573
2717
|
}, {
|
|
2574
2718
|
name: MailchimpEventNames.Unsubscribed;
|
|
2719
|
+
}>]>]>, z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2720
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
2721
|
+
}, "strip", z.ZodTypeAny, {
|
|
2722
|
+
name: HubspotEventNames;
|
|
2723
|
+
}, {
|
|
2724
|
+
name: HubspotEventNames;
|
|
2575
2725
|
}>]>]>;
|
|
2576
2726
|
readonly source: z.ZodObject<{
|
|
2577
2727
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
@@ -2751,6 +2901,28 @@ declare const integrationEventsZods: {
|
|
|
2751
2901
|
callback: string;
|
|
2752
2902
|
provider: "mailchimp";
|
|
2753
2903
|
listId: string;
|
|
2904
|
+
}>, z.ZodObject<{
|
|
2905
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
2906
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2907
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
2908
|
+
}, "strip", z.ZodTypeAny, {
|
|
2909
|
+
name: HubspotEventNames;
|
|
2910
|
+
}, {
|
|
2911
|
+
name: HubspotEventNames;
|
|
2912
|
+
}>]>;
|
|
2913
|
+
listId: z.ZodString;
|
|
2914
|
+
}, "strip", z.ZodTypeAny, {
|
|
2915
|
+
event: {
|
|
2916
|
+
name: HubspotEventNames;
|
|
2917
|
+
};
|
|
2918
|
+
provider: "hubspot";
|
|
2919
|
+
listId: string;
|
|
2920
|
+
}, {
|
|
2921
|
+
event: {
|
|
2922
|
+
name: HubspotEventNames;
|
|
2923
|
+
};
|
|
2924
|
+
provider: "hubspot";
|
|
2925
|
+
listId: string;
|
|
2754
2926
|
}>]>>;
|
|
2755
2927
|
readonly unsubscribe: z.ZodIntersection<z.ZodObject<{
|
|
2756
2928
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
@@ -2791,6 +2963,15 @@ declare const integrationEventsZods: {
|
|
|
2791
2963
|
event: MailchimpEventNames;
|
|
2792
2964
|
provider: "mailchimp";
|
|
2793
2965
|
listId: string;
|
|
2966
|
+
}>, z.ZodObject<{
|
|
2967
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
2968
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
2969
|
+
}, "strip", z.ZodTypeAny, {
|
|
2970
|
+
event: HubspotEventNames;
|
|
2971
|
+
provider: "hubspot";
|
|
2972
|
+
}, {
|
|
2973
|
+
event: HubspotEventNames;
|
|
2974
|
+
provider: "hubspot";
|
|
2794
2975
|
}>]>>;
|
|
2795
2976
|
};
|
|
2796
2977
|
type IntegrationEventSourceName = z.infer<typeof integrationEventsZods.sourceName>;
|
|
@@ -4708,6 +4889,16 @@ declare const api: {
|
|
|
4708
4889
|
refreshToken: string;
|
|
4709
4890
|
}>;
|
|
4710
4891
|
};
|
|
4892
|
+
hubspot: {
|
|
4893
|
+
getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
4894
|
+
token: string;
|
|
4895
|
+
}>;
|
|
4896
|
+
getMetadata({ token }: {
|
|
4897
|
+
token: string;
|
|
4898
|
+
}): Promise<{
|
|
4899
|
+
server: string;
|
|
4900
|
+
}>;
|
|
4901
|
+
};
|
|
4711
4902
|
text: {
|
|
4712
4903
|
app: {
|
|
4713
4904
|
monitoring: {
|
|
@@ -4838,4 +5029,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
|
|
|
4838
5029
|
adapterUrl: string;
|
|
4839
5030
|
}): string;
|
|
4840
5031
|
|
|
4841
|
-
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, ApiClient, ApiClientAuthorization, ApiClientConfig, ApiError, ApiErrorBase, ApiErrorKind, ApiErrorName, ApiErrorSource, AppAuthorizationData, AppBaseData, AppBaseTemplate, AppDeployment, AppDeploymentBlock, AppDeploymentBlockConfig, AppDeploymentData, AppDeploymentProvider, AppDisplayData, AppEventDto, AppGitHubRepository, AppGitHubRepositoryConfig, AppInfrastructureBlocks, AppManifest, AppMonetizationData, AppMonitoringCustomReport, AppMonitoringCustomReportDataDto, AppMonitoringEvent, AppMonitoringEventData, AppMonitoringEventsLog, AppMonitoringEventsLogItem, AppMonitoringEventsReportDto, AppMonitoringReportParams, AppMonitoringUptimeReportDto, AppNeonStorage, AppNeonStorageConfig, AppNetlifyDeployment, AppNetlifyDeploymentConfig, AppPlanetScaleStorage, AppPlanetScaleStorageConfig, AppPropertiesData, AppPropertyData, AppRepository, AppRepositoryBlock, AppRepositoryBlockConfig, AppRepositoryData, AppRepositoryProvider, AppRepositoryTarget, AppRepositoryTemplate, AppRepositoryTemplates, AppResourceDto, AppStatsDto, AppStorage, AppStorageBlock, AppStorageBlockConfig, AppStorageData, AppStorageProvider, AppTemplate, AppTemplates, AppVariable, AppVariableExternalProvider, AppVariableLocalProvider, AppVariableProvider, AppVariableStatus, AppVariableType, AppVercelDeployment, AppVercelDeploymentConfig, AppWidgetData, AppWidgetsData, ApplicationAutoReviewDto, ApplicationAutoReviewPayload, ApplicationBasicDetailsDto, ApplicationBenefitDto, ApplicationChatBooster, ApplicationDto, ApplicationFeatureDto, ApplicationIconDto, ApplicationOverviewDto, ApplicationPaymentDto, ApplicationPropertyDto, ApplicationScreenshotDto, ApplicationTutorialAndSupportDto, ApplicationUsageOptionsDto, ApplicationWidget, AuthorizeData, BillingAccountDto, BillingAccountInfoDto, BillingInvoiceDto, BillingProduct, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GetWorkflowPayload, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IncomingChatWebhookData, IncomingEventWebhookData, IntegrationEvent, IntegrationEventProviderName, IntegrationEventSource, IntegrationEventSourceName, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, LivechatApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpEvent, MailchimpEventNames, MailchimpListWebhook, MailchimpSubscribeWebhookData, MailchimpUnsubscribeWebhookData, MailchimpWebhookConcreteData, MailchimpWebhookData, MailchimpWebhookDataBase, MailchimpWebhookEvents, MyAccountDto, NeonAuthorizeActionResult, NeonAuthorizeFlowContext, NeonAuthorizeFlowResult, NeonClientAuthorization, NeonClientOptions, NeonProjectBranchDto, NeonProjectBranchesDto, NeonProjectDatabaseDto, NeonProjectDatabasesDto, NeonProjectDto, NeonProjectRoleDto, NeonProjectRolesDto, NeonProjectWithConnectionUriDto, NeonProjectsDto, NeonUser, NetlifyAccount, NetlifyAuthorizeActionResult, NetlifyAuthorizeFlowContext, NetlifyAuthorizeFlowResult, NetlifyClientAuthorization, NetlifyClientOptions, NetlifyDeploy, NetlifyDeployKey, NetlifyEnv, NetlifyInstallActionContext, NetlifyInstallActionResult, NetlifyInstallFlowContext, NetlifyInstallFlowResult, NetlifySite, OrganizationDto, PatDto, PatScopeDto, PatWithSecretDto, PlanetScaleAuthorizeActionResult, PlanetScaleAuthorizeFlowContext, PlanetScaleAuthorizeFlowResult, PlanetScaleClientAuthorization, PlanetScaleClientOptions, PlanetScaleDatabase, PlanetScaleDatabasePassword, PlanetScaleOrganization, PlanetScalePaginatedResult, PlanetScalePagination, PlanetScaleUser, PlatformAccountsClientAuthorization, PlatformAccountsClientInstanceOptions, PlatformAdapterClientAuthorization, PlatformAdapterClientOptions, PlatformBillingClientAuthorization, PlatformBillingClientOptions, PlatformClientAuthorization, PlatformDpsClientAuthorization, PlatformDpsClientOptions, ProductDto, PropertiesDto, Property, PropertyAccessDto, PropertyAccessItemDto, PropertyDto, PushAppPayload, PushAppResult, PushAppSaga, PushAppSagaAuthorizationStep, PushAppSagaBaseStep, PushAppSagaDeploymentStep, PushAppSagaDisplayStep, PushAppSagaMonetizationStep, PushAppSagaPropertiesStep, PushAppSagaRepositoryStep, PushAppSagaStorageStep, PushAppSagaWidgetsStep, RemoveAppAuthorizationPayload, RemoveAppMonetizationPayload, RemoveAppPropertiesPayload, RemoveAppPropertyPayload, RemoveAppWidgetPayload, RemoveAppWidgetsPayload, ResearchCustomerItemDto, ResearchCustomerLocationItemDto, ResearchDictionaryParams, ResearchMarketplaceItemDto, ResearchMarketplaceParams, ResearchTrafficItemDto, ResearchTrafficParams, Saga, SagaInput, SagaOutput, SagaStep, SagaStepChanges, SagaStepComparer, SagaStepPropertyCompareResult, SagaStepStatus, SagaStepsSchema, ScopeDto, SeedAppRepositoryPayload, SeedAppRepositoryResult, ShopifyApiError, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShopifyEvent, ShopifyEventNames, ShopifyOrderCreatedWebhookData, ShopifyWebhookConcreteData, ShopifyWebhookData, ShopifyWebhookDataBase, ShopifyWebhookTopics, ShortcutDto, SubscribeToIntegrationEventPayload, SubscribeToMailchimpEventPayload, SubscribeToShopifyEventPayload, SubscribeToTextLivechatEventPayload, SyncAppVariablePayload, TextApiError, TextAuthorizeActionResult, TextAuthorizeFlowContext, TextAuthorizeFlowResult, TextClientAuthorization, TextClientOptions, TextLiveChatEvent, TextLivechatEventNames, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, TriggerPayload, TriggerType, UnauthorizeAccountsApiError, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UnsubscribeFromIntegrationEventPayload, UnsubscribeFromMailchimpEventPayload, UnsubscribeFromShopifyEventPayload, UnsubscribeFromTextLivechatEventPayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateCredentialPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserAddedToChatWebhookData, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserRemovedFromChatWebhookData, UserVercelIntegrationDto, VercelAuthorizeActionResult, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookActions, WebhookChat, WebhookConcreteData, WebhookData, WebhookDataBase, WebhookDto, WebhookEvent, WebhookEvents, WebhookMessageEvent, WebhookSystemMessageEvent, WebhookSystemMessages, WebhookUser, WorkflowDefinitionAddNodeTask, WorkflowDefinitionAddTriggerTask, WorkflowDefinitionDto, WorkflowDefinitionForkJoinTask, WorkflowDefinitionHttpTask, WorkflowDefinitionJoinTask, WorkflowDefinitionSwitchTask, WorkflowDefinitionTask, WorkflowDefinitionTaskBase, WorkflowDefinitionTaskCore, WorkflowDefinitionTaskType, WorkflowDefinitionTerminateTask, WorkflowDefinitionsQueryParams, WorkflowDto, WorkflowExecution, WorkflowExecutionDetails, WorkflowExecutionPayload, WorkflowsDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAdapterClientAuthorization, getPlatformAdapterClientConfig, getPlatformAdapterClientDefaultConfig, getPlatformBillingClientAuthorization, getPlatformBillingClientConfig, getPlatformDpsAdminClientAuthorization, getPlatformDpsClientAuthorization, getPlatformDpsClientConfig, getRegion, getShopifyClientAuthorization, getShopifyClientConfig, getShopifyClientUrl, getTextClientAuthorization, getTextClientConfig, getVercelClientAuthorization, getVercelClientConfig, githubClientInstance, initApi, initGithubClient, initLiveChatClient, initMailchimpClient, initNeonClient, initNetlifyClient, initPlanetScaleClient, initPlatformAccountsClient, initPlatformAdapterClient, initPlatformBillingClient, initPlatformDpsClient, initShopifyClient, initTextClient, initVercelClient, integrationEventsZods, livechatClientInstance, mailchimpClientInstance, mailchimpEventsZods, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, shopifyEventsZods, textClientInstance, textLivechatEventsZods, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateTextClient, updateVercelClient, vercelClientInstance };
|
|
5032
|
+
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, ApiClient, ApiClientAuthorization, ApiClientConfig, ApiError, ApiErrorBase, ApiErrorKind, ApiErrorName, ApiErrorSource, AppAuthorizationData, AppBaseData, AppBaseTemplate, AppDeployment, AppDeploymentBlock, AppDeploymentBlockConfig, AppDeploymentData, AppDeploymentProvider, AppDisplayData, AppEventDto, AppGitHubRepository, AppGitHubRepositoryConfig, AppInfrastructureBlocks, AppManifest, AppMonetizationData, AppMonitoringCustomReport, AppMonitoringCustomReportDataDto, AppMonitoringEvent, AppMonitoringEventData, AppMonitoringEventsLog, AppMonitoringEventsLogItem, AppMonitoringEventsReportDto, AppMonitoringReportParams, AppMonitoringUptimeReportDto, AppNeonStorage, AppNeonStorageConfig, AppNetlifyDeployment, AppNetlifyDeploymentConfig, AppPlanetScaleStorage, AppPlanetScaleStorageConfig, AppPropertiesData, AppPropertyData, AppRepository, AppRepositoryBlock, AppRepositoryBlockConfig, AppRepositoryData, AppRepositoryProvider, AppRepositoryTarget, AppRepositoryTemplate, AppRepositoryTemplates, AppResourceDto, AppStatsDto, AppStorage, AppStorageBlock, AppStorageBlockConfig, AppStorageData, AppStorageProvider, AppTemplate, AppTemplates, AppVariable, AppVariableExternalProvider, AppVariableLocalProvider, AppVariableProvider, AppVariableStatus, AppVariableType, AppVercelDeployment, AppVercelDeploymentConfig, AppWidgetData, AppWidgetsData, ApplicationAutoReviewDto, ApplicationAutoReviewPayload, ApplicationBasicDetailsDto, ApplicationBenefitDto, ApplicationChatBooster, ApplicationDto, ApplicationFeatureDto, ApplicationIconDto, ApplicationOverviewDto, ApplicationPaymentDto, ApplicationPropertyDto, ApplicationScreenshotDto, ApplicationTutorialAndSupportDto, ApplicationUsageOptionsDto, ApplicationWidget, AuthorizeData, BillingAccountDto, BillingAccountInfoDto, BillingInvoiceDto, BillingProduct, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GetWorkflowPayload, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, HubspotApiError, HubspotAuthorizeActionResult, HubspotAuthorizeFlowContext, HubspotAuthorizeFlowResult, HubspotClientAuthorization, HubspotClientInstanceOptions, HubspotEvent, HubspotEventNames, IncomingChatWebhookData, IncomingEventWebhookData, IntegrationEvent, IntegrationEventProviderName, IntegrationEventSource, IntegrationEventSourceName, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, LivechatApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpEvent, MailchimpEventNames, MailchimpListWebhook, MailchimpSubscribeWebhookData, MailchimpUnsubscribeWebhookData, MailchimpWebhookConcreteData, MailchimpWebhookData, MailchimpWebhookDataBase, MailchimpWebhookEvents, MyAccountDto, NeonAuthorizeActionResult, NeonAuthorizeFlowContext, NeonAuthorizeFlowResult, NeonClientAuthorization, NeonClientOptions, NeonProjectBranchDto, NeonProjectBranchesDto, NeonProjectDatabaseDto, NeonProjectDatabasesDto, NeonProjectDto, NeonProjectRoleDto, NeonProjectRolesDto, NeonProjectWithConnectionUriDto, NeonProjectsDto, NeonUser, NetlifyAccount, NetlifyAuthorizeActionResult, NetlifyAuthorizeFlowContext, NetlifyAuthorizeFlowResult, NetlifyClientAuthorization, NetlifyClientOptions, NetlifyDeploy, NetlifyDeployKey, NetlifyEnv, NetlifyInstallActionContext, NetlifyInstallActionResult, NetlifyInstallFlowContext, NetlifyInstallFlowResult, NetlifySite, OrganizationDto, PatDto, PatScopeDto, PatWithSecretDto, PlanetScaleAuthorizeActionResult, PlanetScaleAuthorizeFlowContext, PlanetScaleAuthorizeFlowResult, PlanetScaleClientAuthorization, PlanetScaleClientOptions, PlanetScaleDatabase, PlanetScaleDatabasePassword, PlanetScaleOrganization, PlanetScalePaginatedResult, PlanetScalePagination, PlanetScaleUser, PlatformAccountsClientAuthorization, PlatformAccountsClientInstanceOptions, PlatformAdapterClientAuthorization, PlatformAdapterClientOptions, PlatformBillingClientAuthorization, PlatformBillingClientOptions, PlatformClientAuthorization, PlatformDpsClientAuthorization, PlatformDpsClientOptions, ProductDto, PropertiesDto, Property, PropertyAccessDto, PropertyAccessItemDto, PropertyDto, PushAppPayload, PushAppResult, PushAppSaga, PushAppSagaAuthorizationStep, PushAppSagaBaseStep, PushAppSagaDeploymentStep, PushAppSagaDisplayStep, PushAppSagaMonetizationStep, PushAppSagaPropertiesStep, PushAppSagaRepositoryStep, PushAppSagaStorageStep, PushAppSagaWidgetsStep, RemoveAppAuthorizationPayload, RemoveAppMonetizationPayload, RemoveAppPropertiesPayload, RemoveAppPropertyPayload, RemoveAppWidgetPayload, RemoveAppWidgetsPayload, ResearchCustomerItemDto, ResearchCustomerLocationItemDto, ResearchDictionaryParams, ResearchMarketplaceItemDto, ResearchMarketplaceParams, ResearchTrafficItemDto, ResearchTrafficParams, Saga, SagaInput, SagaOutput, SagaStep, SagaStepChanges, SagaStepComparer, SagaStepPropertyCompareResult, SagaStepStatus, SagaStepsSchema, ScopeDto, SeedAppRepositoryPayload, SeedAppRepositoryResult, ShopifyApiError, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShopifyEvent, ShopifyEventNames, ShopifyOrderCreatedWebhookData, ShopifyWebhookConcreteData, ShopifyWebhookData, ShopifyWebhookDataBase, ShopifyWebhookTopics, ShortcutDto, SubscribeToHubspotEventPayload, SubscribeToIntegrationEventPayload, SubscribeToMailchimpEventPayload, SubscribeToShopifyEventPayload, SubscribeToTextLivechatEventPayload, SyncAppVariablePayload, TextApiError, TextAuthorizeActionResult, TextAuthorizeFlowContext, TextAuthorizeFlowResult, TextClientAuthorization, TextClientOptions, TextLiveChatEvent, TextLivechatEventNames, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, TriggerPayload, TriggerType, UnauthorizeAccountsApiError, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UnsubscribeFromHubspotEventPayload, UnsubscribeFromIntegrationEventPayload, UnsubscribeFromMailchimpEventPayload, UnsubscribeFromShopifyEventPayload, UnsubscribeFromTextLivechatEventPayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateCredentialPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserAddedToChatWebhookData, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserRemovedFromChatWebhookData, UserVercelIntegrationDto, VercelAuthorizeActionResult, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookActions, WebhookChat, WebhookConcreteData, WebhookData, WebhookDataBase, WebhookDto, WebhookEvent, WebhookEvents, WebhookMessageEvent, WebhookSystemMessageEvent, WebhookSystemMessages, WebhookUser, WorkflowDefinitionAddNodeTask, WorkflowDefinitionAddTriggerTask, WorkflowDefinitionDto, WorkflowDefinitionForkJoinTask, WorkflowDefinitionHttpTask, WorkflowDefinitionJoinTask, WorkflowDefinitionSwitchTask, WorkflowDefinitionTask, WorkflowDefinitionTaskBase, WorkflowDefinitionTaskCore, WorkflowDefinitionTaskType, WorkflowDefinitionTerminateTask, WorkflowDefinitionsQueryParams, WorkflowDto, WorkflowExecution, WorkflowExecutionDetails, WorkflowExecutionPayload, WorkflowsDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getHubspotClientAuthorization, getHubspotClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAdapterClientAuthorization, getPlatformAdapterClientConfig, getPlatformAdapterClientDefaultConfig, getPlatformBillingClientAuthorization, getPlatformBillingClientConfig, getPlatformDpsAdminClientAuthorization, getPlatformDpsClientAuthorization, getPlatformDpsClientConfig, getRegion, getShopifyClientAuthorization, getShopifyClientConfig, getShopifyClientUrl, getTextClientAuthorization, getTextClientConfig, getVercelClientAuthorization, getVercelClientConfig, githubClientInstance, hubspotClientInstance, hubspotClientUrl, hubspotEventsZods, initApi, initGithubClient, initHubspotClient, initLiveChatClient, initMailchimpClient, initNeonClient, initNetlifyClient, initPlanetScaleClient, initPlatformAccountsClient, initPlatformAdapterClient, initPlatformBillingClient, initPlatformDpsClient, initShopifyClient, initTextClient, initVercelClient, integrationEventsZods, livechatClientInstance, mailchimpClientInstance, mailchimpEventsZods, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, shopifyEventsZods, textClientInstance, textLivechatEventsZods, updateGithubClient, updateHubspotClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateTextClient, updateVercelClient, vercelClientInstance };
|
package/dist/index.d.ts
CHANGED
|
@@ -562,8 +562,8 @@ type DeepPartial<T> = T extends object ? {
|
|
|
562
562
|
type CreateCredentialPayload = Credential;
|
|
563
563
|
type UpdateCredentialPayload = DeepPartial<Credential>;
|
|
564
564
|
|
|
565
|
-
type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
|
|
566
|
-
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
|
|
565
|
+
type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "hubspot" | "text";
|
|
566
|
+
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "hubspot" | "text";
|
|
567
567
|
type ApiErrorKind = "unauthorized" | "error";
|
|
568
568
|
type ApiError<TData = unknown> = {
|
|
569
569
|
code: number;
|
|
@@ -988,6 +988,26 @@ declare function getShopifyClientConfig(options?: ShopifyClientOptions): AxiosRe
|
|
|
988
988
|
declare function initShopifyClient(token?: string, shop?: string): void;
|
|
989
989
|
declare function updateShopifyClient(token?: string, shop?: string): void;
|
|
990
990
|
|
|
991
|
+
interface HubspotClientAuthorization {
|
|
992
|
+
token?: string;
|
|
993
|
+
}
|
|
994
|
+
interface HubspotClientInstanceOptions extends HubspotClientAuthorization {
|
|
995
|
+
ensureAuthorizationToken?: boolean;
|
|
996
|
+
}
|
|
997
|
+
declare class HubspotApiError extends ApiErrorBase<{
|
|
998
|
+
errors: Record<string, string[]>;
|
|
999
|
+
}> {
|
|
1000
|
+
name: "hubspot";
|
|
1001
|
+
}
|
|
1002
|
+
declare const hubspotClientUrl = "https://api.hubapi.com";
|
|
1003
|
+
declare const hubspotClientInstance: axios.AxiosInstance;
|
|
1004
|
+
declare function getHubspotClientAuthorization(req: {
|
|
1005
|
+
headers: Record<string, string | string[] | undefined> | Headers;
|
|
1006
|
+
}): HubspotClientAuthorization;
|
|
1007
|
+
declare function getHubspotClientConfig(options?: HubspotClientInstanceOptions): AxiosRequestConfig;
|
|
1008
|
+
declare function initHubspotClient(token?: string): void;
|
|
1009
|
+
declare function updateHubspotClient(token?: string): void;
|
|
1010
|
+
|
|
991
1011
|
interface AccountDto {
|
|
992
1012
|
account_id: string;
|
|
993
1013
|
avatar: string;
|
|
@@ -1800,6 +1820,130 @@ type IntegrationFlowOutput<TFlowResult> = {
|
|
|
1800
1820
|
status: "cancel";
|
|
1801
1821
|
};
|
|
1802
1822
|
|
|
1823
|
+
interface HubspotAuthorizeActionResult {
|
|
1824
|
+
token: string;
|
|
1825
|
+
}
|
|
1826
|
+
type HubspotAuthorizeFlowContext = IntegrationFlowContext;
|
|
1827
|
+
interface HubspotAuthorizeFlowResult {
|
|
1828
|
+
token: string;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
declare enum HubspotEventNames {
|
|
1832
|
+
SomeEvent = "some_event"
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
declare const hubspotEventsZods: {
|
|
1836
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1837
|
+
eventName: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1838
|
+
events: {
|
|
1839
|
+
someEvent: z.ZodObject<{
|
|
1840
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1841
|
+
}, "strip", z.ZodTypeAny, {
|
|
1842
|
+
name: HubspotEventNames;
|
|
1843
|
+
}, {
|
|
1844
|
+
name: HubspotEventNames;
|
|
1845
|
+
}>;
|
|
1846
|
+
};
|
|
1847
|
+
readonly event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1848
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1849
|
+
}, "strip", z.ZodTypeAny, {
|
|
1850
|
+
name: HubspotEventNames;
|
|
1851
|
+
}, {
|
|
1852
|
+
name: HubspotEventNames;
|
|
1853
|
+
}>]>;
|
|
1854
|
+
readonly source: z.ZodObject<{
|
|
1855
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1856
|
+
sourceKey: z.ZodString;
|
|
1857
|
+
}, "strip", z.ZodTypeAny, {
|
|
1858
|
+
sourceName: "apps" | "workflows";
|
|
1859
|
+
sourceKey: string;
|
|
1860
|
+
}, {
|
|
1861
|
+
sourceName: "apps" | "workflows";
|
|
1862
|
+
sourceKey: string;
|
|
1863
|
+
}>;
|
|
1864
|
+
readonly subscribe: z.ZodIntersection<z.ZodObject<{
|
|
1865
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1866
|
+
sourceKey: z.ZodString;
|
|
1867
|
+
}, "strip", z.ZodTypeAny, {
|
|
1868
|
+
sourceName: "apps" | "workflows";
|
|
1869
|
+
sourceKey: string;
|
|
1870
|
+
}, {
|
|
1871
|
+
sourceName: "apps" | "workflows";
|
|
1872
|
+
sourceKey: string;
|
|
1873
|
+
}>, z.ZodObject<{
|
|
1874
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1875
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1876
|
+
}, "strip", z.ZodTypeAny, {
|
|
1877
|
+
name: HubspotEventNames;
|
|
1878
|
+
}, {
|
|
1879
|
+
name: HubspotEventNames;
|
|
1880
|
+
}>]>;
|
|
1881
|
+
callback: z.ZodString;
|
|
1882
|
+
}, "strip", z.ZodTypeAny, {
|
|
1883
|
+
event: {
|
|
1884
|
+
name: HubspotEventNames;
|
|
1885
|
+
};
|
|
1886
|
+
callback: string;
|
|
1887
|
+
}, {
|
|
1888
|
+
event: {
|
|
1889
|
+
name: HubspotEventNames;
|
|
1890
|
+
};
|
|
1891
|
+
callback: string;
|
|
1892
|
+
}>>;
|
|
1893
|
+
readonly subscribeContent: z.ZodObject<{
|
|
1894
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1895
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
1896
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
1897
|
+
}, "strip", z.ZodTypeAny, {
|
|
1898
|
+
name: HubspotEventNames;
|
|
1899
|
+
}, {
|
|
1900
|
+
name: HubspotEventNames;
|
|
1901
|
+
}>]>;
|
|
1902
|
+
listId: z.ZodString;
|
|
1903
|
+
}, "strip", z.ZodTypeAny, {
|
|
1904
|
+
event: {
|
|
1905
|
+
name: HubspotEventNames;
|
|
1906
|
+
};
|
|
1907
|
+
provider: "hubspot";
|
|
1908
|
+
listId: string;
|
|
1909
|
+
}, {
|
|
1910
|
+
event: {
|
|
1911
|
+
name: HubspotEventNames;
|
|
1912
|
+
};
|
|
1913
|
+
provider: "hubspot";
|
|
1914
|
+
listId: string;
|
|
1915
|
+
}>;
|
|
1916
|
+
readonly unsubscribe: z.ZodIntersection<z.ZodObject<{
|
|
1917
|
+
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
1918
|
+
sourceKey: z.ZodString;
|
|
1919
|
+
}, "strip", z.ZodTypeAny, {
|
|
1920
|
+
sourceName: "apps" | "workflows";
|
|
1921
|
+
sourceKey: string;
|
|
1922
|
+
}, {
|
|
1923
|
+
sourceName: "apps" | "workflows";
|
|
1924
|
+
sourceKey: string;
|
|
1925
|
+
}>, z.ZodObject<{
|
|
1926
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1927
|
+
}, "strip", z.ZodTypeAny, {
|
|
1928
|
+
event: HubspotEventNames;
|
|
1929
|
+
}, {
|
|
1930
|
+
event: HubspotEventNames;
|
|
1931
|
+
}>>;
|
|
1932
|
+
readonly unsubscribeContent: z.ZodObject<{
|
|
1933
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
1934
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
1935
|
+
}, "strip", z.ZodTypeAny, {
|
|
1936
|
+
event: HubspotEventNames;
|
|
1937
|
+
provider: "hubspot";
|
|
1938
|
+
}, {
|
|
1939
|
+
event: HubspotEventNames;
|
|
1940
|
+
provider: "hubspot";
|
|
1941
|
+
}>;
|
|
1942
|
+
};
|
|
1943
|
+
type HubspotEvent = z.infer<typeof hubspotEventsZods.event>;
|
|
1944
|
+
type SubscribeToHubspotEventPayload = z.infer<typeof hubspotEventsZods.subscribe>;
|
|
1945
|
+
type UnsubscribeFromHubspotEventPayload = z.infer<typeof hubspotEventsZods.unsubscribe>;
|
|
1946
|
+
|
|
1803
1947
|
interface MailchimpAuthorizeActionResult {
|
|
1804
1948
|
server: string;
|
|
1805
1949
|
token: string;
|
|
@@ -2499,8 +2643,8 @@ type UnsubscribeFromTextLivechatEventPayload = z.infer<typeof textLivechatEvents
|
|
|
2499
2643
|
|
|
2500
2644
|
declare const integrationEventsZods: {
|
|
2501
2645
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
2502
|
-
providerName: z.ZodEnum<["text-livechat", "mailchimp", "shopify"]>;
|
|
2503
|
-
readonly event: z.ZodUnion<[z.ZodUnion<[z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2646
|
+
providerName: z.ZodEnum<["text-livechat", "mailchimp", "shopify", "hubspot"]>;
|
|
2647
|
+
readonly event: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2504
2648
|
name: z.ZodLiteral<TextLivechatEventNames.ChatStarted>;
|
|
2505
2649
|
}, "strip", z.ZodTypeAny, {
|
|
2506
2650
|
name: TextLivechatEventNames.ChatStarted;
|
|
@@ -2572,6 +2716,12 @@ declare const integrationEventsZods: {
|
|
|
2572
2716
|
name: MailchimpEventNames.Unsubscribed;
|
|
2573
2717
|
}, {
|
|
2574
2718
|
name: MailchimpEventNames.Unsubscribed;
|
|
2719
|
+
}>]>]>, z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2720
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
2721
|
+
}, "strip", z.ZodTypeAny, {
|
|
2722
|
+
name: HubspotEventNames;
|
|
2723
|
+
}, {
|
|
2724
|
+
name: HubspotEventNames;
|
|
2575
2725
|
}>]>]>;
|
|
2576
2726
|
readonly source: z.ZodObject<{
|
|
2577
2727
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
@@ -2751,6 +2901,28 @@ declare const integrationEventsZods: {
|
|
|
2751
2901
|
callback: string;
|
|
2752
2902
|
provider: "mailchimp";
|
|
2753
2903
|
listId: string;
|
|
2904
|
+
}>, z.ZodObject<{
|
|
2905
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
2906
|
+
event: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
|
|
2907
|
+
name: z.ZodLiteral<HubspotEventNames>;
|
|
2908
|
+
}, "strip", z.ZodTypeAny, {
|
|
2909
|
+
name: HubspotEventNames;
|
|
2910
|
+
}, {
|
|
2911
|
+
name: HubspotEventNames;
|
|
2912
|
+
}>]>;
|
|
2913
|
+
listId: z.ZodString;
|
|
2914
|
+
}, "strip", z.ZodTypeAny, {
|
|
2915
|
+
event: {
|
|
2916
|
+
name: HubspotEventNames;
|
|
2917
|
+
};
|
|
2918
|
+
provider: "hubspot";
|
|
2919
|
+
listId: string;
|
|
2920
|
+
}, {
|
|
2921
|
+
event: {
|
|
2922
|
+
name: HubspotEventNames;
|
|
2923
|
+
};
|
|
2924
|
+
provider: "hubspot";
|
|
2925
|
+
listId: string;
|
|
2754
2926
|
}>]>>;
|
|
2755
2927
|
readonly unsubscribe: z.ZodIntersection<z.ZodObject<{
|
|
2756
2928
|
sourceName: z.ZodEnum<["apps", "workflows"]>;
|
|
@@ -2791,6 +2963,15 @@ declare const integrationEventsZods: {
|
|
|
2791
2963
|
event: MailchimpEventNames;
|
|
2792
2964
|
provider: "mailchimp";
|
|
2793
2965
|
listId: string;
|
|
2966
|
+
}>, z.ZodObject<{
|
|
2967
|
+
provider: z.ZodLiteral<"hubspot">;
|
|
2968
|
+
event: z.ZodNativeEnum<typeof HubspotEventNames>;
|
|
2969
|
+
}, "strip", z.ZodTypeAny, {
|
|
2970
|
+
event: HubspotEventNames;
|
|
2971
|
+
provider: "hubspot";
|
|
2972
|
+
}, {
|
|
2973
|
+
event: HubspotEventNames;
|
|
2974
|
+
provider: "hubspot";
|
|
2794
2975
|
}>]>>;
|
|
2795
2976
|
};
|
|
2796
2977
|
type IntegrationEventSourceName = z.infer<typeof integrationEventsZods.sourceName>;
|
|
@@ -4708,6 +4889,16 @@ declare const api: {
|
|
|
4708
4889
|
refreshToken: string;
|
|
4709
4890
|
}>;
|
|
4710
4891
|
};
|
|
4892
|
+
hubspot: {
|
|
4893
|
+
getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
4894
|
+
token: string;
|
|
4895
|
+
}>;
|
|
4896
|
+
getMetadata({ token }: {
|
|
4897
|
+
token: string;
|
|
4898
|
+
}): Promise<{
|
|
4899
|
+
server: string;
|
|
4900
|
+
}>;
|
|
4901
|
+
};
|
|
4711
4902
|
text: {
|
|
4712
4903
|
app: {
|
|
4713
4904
|
monitoring: {
|
|
@@ -4838,4 +5029,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
|
|
|
4838
5029
|
adapterUrl: string;
|
|
4839
5030
|
}): string;
|
|
4840
5031
|
|
|
4841
|
-
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, ApiClient, ApiClientAuthorization, ApiClientConfig, ApiError, ApiErrorBase, ApiErrorKind, ApiErrorName, ApiErrorSource, AppAuthorizationData, AppBaseData, AppBaseTemplate, AppDeployment, AppDeploymentBlock, AppDeploymentBlockConfig, AppDeploymentData, AppDeploymentProvider, AppDisplayData, AppEventDto, AppGitHubRepository, AppGitHubRepositoryConfig, AppInfrastructureBlocks, AppManifest, AppMonetizationData, AppMonitoringCustomReport, AppMonitoringCustomReportDataDto, AppMonitoringEvent, AppMonitoringEventData, AppMonitoringEventsLog, AppMonitoringEventsLogItem, AppMonitoringEventsReportDto, AppMonitoringReportParams, AppMonitoringUptimeReportDto, AppNeonStorage, AppNeonStorageConfig, AppNetlifyDeployment, AppNetlifyDeploymentConfig, AppPlanetScaleStorage, AppPlanetScaleStorageConfig, AppPropertiesData, AppPropertyData, AppRepository, AppRepositoryBlock, AppRepositoryBlockConfig, AppRepositoryData, AppRepositoryProvider, AppRepositoryTarget, AppRepositoryTemplate, AppRepositoryTemplates, AppResourceDto, AppStatsDto, AppStorage, AppStorageBlock, AppStorageBlockConfig, AppStorageData, AppStorageProvider, AppTemplate, AppTemplates, AppVariable, AppVariableExternalProvider, AppVariableLocalProvider, AppVariableProvider, AppVariableStatus, AppVariableType, AppVercelDeployment, AppVercelDeploymentConfig, AppWidgetData, AppWidgetsData, ApplicationAutoReviewDto, ApplicationAutoReviewPayload, ApplicationBasicDetailsDto, ApplicationBenefitDto, ApplicationChatBooster, ApplicationDto, ApplicationFeatureDto, ApplicationIconDto, ApplicationOverviewDto, ApplicationPaymentDto, ApplicationPropertyDto, ApplicationScreenshotDto, ApplicationTutorialAndSupportDto, ApplicationUsageOptionsDto, ApplicationWidget, AuthorizeData, BillingAccountDto, BillingAccountInfoDto, BillingInvoiceDto, BillingProduct, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GetWorkflowPayload, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IncomingChatWebhookData, IncomingEventWebhookData, IntegrationEvent, IntegrationEventProviderName, IntegrationEventSource, IntegrationEventSourceName, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, LivechatApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpEvent, MailchimpEventNames, MailchimpListWebhook, MailchimpSubscribeWebhookData, MailchimpUnsubscribeWebhookData, MailchimpWebhookConcreteData, MailchimpWebhookData, MailchimpWebhookDataBase, MailchimpWebhookEvents, MyAccountDto, NeonAuthorizeActionResult, NeonAuthorizeFlowContext, NeonAuthorizeFlowResult, NeonClientAuthorization, NeonClientOptions, NeonProjectBranchDto, NeonProjectBranchesDto, NeonProjectDatabaseDto, NeonProjectDatabasesDto, NeonProjectDto, NeonProjectRoleDto, NeonProjectRolesDto, NeonProjectWithConnectionUriDto, NeonProjectsDto, NeonUser, NetlifyAccount, NetlifyAuthorizeActionResult, NetlifyAuthorizeFlowContext, NetlifyAuthorizeFlowResult, NetlifyClientAuthorization, NetlifyClientOptions, NetlifyDeploy, NetlifyDeployKey, NetlifyEnv, NetlifyInstallActionContext, NetlifyInstallActionResult, NetlifyInstallFlowContext, NetlifyInstallFlowResult, NetlifySite, OrganizationDto, PatDto, PatScopeDto, PatWithSecretDto, PlanetScaleAuthorizeActionResult, PlanetScaleAuthorizeFlowContext, PlanetScaleAuthorizeFlowResult, PlanetScaleClientAuthorization, PlanetScaleClientOptions, PlanetScaleDatabase, PlanetScaleDatabasePassword, PlanetScaleOrganization, PlanetScalePaginatedResult, PlanetScalePagination, PlanetScaleUser, PlatformAccountsClientAuthorization, PlatformAccountsClientInstanceOptions, PlatformAdapterClientAuthorization, PlatformAdapterClientOptions, PlatformBillingClientAuthorization, PlatformBillingClientOptions, PlatformClientAuthorization, PlatformDpsClientAuthorization, PlatformDpsClientOptions, ProductDto, PropertiesDto, Property, PropertyAccessDto, PropertyAccessItemDto, PropertyDto, PushAppPayload, PushAppResult, PushAppSaga, PushAppSagaAuthorizationStep, PushAppSagaBaseStep, PushAppSagaDeploymentStep, PushAppSagaDisplayStep, PushAppSagaMonetizationStep, PushAppSagaPropertiesStep, PushAppSagaRepositoryStep, PushAppSagaStorageStep, PushAppSagaWidgetsStep, RemoveAppAuthorizationPayload, RemoveAppMonetizationPayload, RemoveAppPropertiesPayload, RemoveAppPropertyPayload, RemoveAppWidgetPayload, RemoveAppWidgetsPayload, ResearchCustomerItemDto, ResearchCustomerLocationItemDto, ResearchDictionaryParams, ResearchMarketplaceItemDto, ResearchMarketplaceParams, ResearchTrafficItemDto, ResearchTrafficParams, Saga, SagaInput, SagaOutput, SagaStep, SagaStepChanges, SagaStepComparer, SagaStepPropertyCompareResult, SagaStepStatus, SagaStepsSchema, ScopeDto, SeedAppRepositoryPayload, SeedAppRepositoryResult, ShopifyApiError, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShopifyEvent, ShopifyEventNames, ShopifyOrderCreatedWebhookData, ShopifyWebhookConcreteData, ShopifyWebhookData, ShopifyWebhookDataBase, ShopifyWebhookTopics, ShortcutDto, SubscribeToIntegrationEventPayload, SubscribeToMailchimpEventPayload, SubscribeToShopifyEventPayload, SubscribeToTextLivechatEventPayload, SyncAppVariablePayload, TextApiError, TextAuthorizeActionResult, TextAuthorizeFlowContext, TextAuthorizeFlowResult, TextClientAuthorization, TextClientOptions, TextLiveChatEvent, TextLivechatEventNames, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, TriggerPayload, TriggerType, UnauthorizeAccountsApiError, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UnsubscribeFromIntegrationEventPayload, UnsubscribeFromMailchimpEventPayload, UnsubscribeFromShopifyEventPayload, UnsubscribeFromTextLivechatEventPayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateCredentialPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserAddedToChatWebhookData, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserRemovedFromChatWebhookData, UserVercelIntegrationDto, VercelAuthorizeActionResult, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookActions, WebhookChat, WebhookConcreteData, WebhookData, WebhookDataBase, WebhookDto, WebhookEvent, WebhookEvents, WebhookMessageEvent, WebhookSystemMessageEvent, WebhookSystemMessages, WebhookUser, WorkflowDefinitionAddNodeTask, WorkflowDefinitionAddTriggerTask, WorkflowDefinitionDto, WorkflowDefinitionForkJoinTask, WorkflowDefinitionHttpTask, WorkflowDefinitionJoinTask, WorkflowDefinitionSwitchTask, WorkflowDefinitionTask, WorkflowDefinitionTaskBase, WorkflowDefinitionTaskCore, WorkflowDefinitionTaskType, WorkflowDefinitionTerminateTask, WorkflowDefinitionsQueryParams, WorkflowDto, WorkflowExecution, WorkflowExecutionDetails, WorkflowExecutionPayload, WorkflowsDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAdapterClientAuthorization, getPlatformAdapterClientConfig, getPlatformAdapterClientDefaultConfig, getPlatformBillingClientAuthorization, getPlatformBillingClientConfig, getPlatformDpsAdminClientAuthorization, getPlatformDpsClientAuthorization, getPlatformDpsClientConfig, getRegion, getShopifyClientAuthorization, getShopifyClientConfig, getShopifyClientUrl, getTextClientAuthorization, getTextClientConfig, getVercelClientAuthorization, getVercelClientConfig, githubClientInstance, initApi, initGithubClient, initLiveChatClient, initMailchimpClient, initNeonClient, initNetlifyClient, initPlanetScaleClient, initPlatformAccountsClient, initPlatformAdapterClient, initPlatformBillingClient, initPlatformDpsClient, initShopifyClient, initTextClient, initVercelClient, integrationEventsZods, livechatClientInstance, mailchimpClientInstance, mailchimpEventsZods, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, shopifyEventsZods, textClientInstance, textLivechatEventsZods, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateTextClient, updateVercelClient, vercelClientInstance };
|
|
5032
|
+
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, ApiClient, ApiClientAuthorization, ApiClientConfig, ApiError, ApiErrorBase, ApiErrorKind, ApiErrorName, ApiErrorSource, AppAuthorizationData, AppBaseData, AppBaseTemplate, AppDeployment, AppDeploymentBlock, AppDeploymentBlockConfig, AppDeploymentData, AppDeploymentProvider, AppDisplayData, AppEventDto, AppGitHubRepository, AppGitHubRepositoryConfig, AppInfrastructureBlocks, AppManifest, AppMonetizationData, AppMonitoringCustomReport, AppMonitoringCustomReportDataDto, AppMonitoringEvent, AppMonitoringEventData, AppMonitoringEventsLog, AppMonitoringEventsLogItem, AppMonitoringEventsReportDto, AppMonitoringReportParams, AppMonitoringUptimeReportDto, AppNeonStorage, AppNeonStorageConfig, AppNetlifyDeployment, AppNetlifyDeploymentConfig, AppPlanetScaleStorage, AppPlanetScaleStorageConfig, AppPropertiesData, AppPropertyData, AppRepository, AppRepositoryBlock, AppRepositoryBlockConfig, AppRepositoryData, AppRepositoryProvider, AppRepositoryTarget, AppRepositoryTemplate, AppRepositoryTemplates, AppResourceDto, AppStatsDto, AppStorage, AppStorageBlock, AppStorageBlockConfig, AppStorageData, AppStorageProvider, AppTemplate, AppTemplates, AppVariable, AppVariableExternalProvider, AppVariableLocalProvider, AppVariableProvider, AppVariableStatus, AppVariableType, AppVercelDeployment, AppVercelDeploymentConfig, AppWidgetData, AppWidgetsData, ApplicationAutoReviewDto, ApplicationAutoReviewPayload, ApplicationBasicDetailsDto, ApplicationBenefitDto, ApplicationChatBooster, ApplicationDto, ApplicationFeatureDto, ApplicationIconDto, ApplicationOverviewDto, ApplicationPaymentDto, ApplicationPropertyDto, ApplicationScreenshotDto, ApplicationTutorialAndSupportDto, ApplicationUsageOptionsDto, ApplicationWidget, AuthorizeData, BillingAccountDto, BillingAccountInfoDto, BillingInvoiceDto, BillingProduct, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GetWorkflowPayload, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, HubspotApiError, HubspotAuthorizeActionResult, HubspotAuthorizeFlowContext, HubspotAuthorizeFlowResult, HubspotClientAuthorization, HubspotClientInstanceOptions, HubspotEvent, HubspotEventNames, IncomingChatWebhookData, IncomingEventWebhookData, IntegrationEvent, IntegrationEventProviderName, IntegrationEventSource, IntegrationEventSourceName, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, LivechatApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpEvent, MailchimpEventNames, MailchimpListWebhook, MailchimpSubscribeWebhookData, MailchimpUnsubscribeWebhookData, MailchimpWebhookConcreteData, MailchimpWebhookData, MailchimpWebhookDataBase, MailchimpWebhookEvents, MyAccountDto, NeonAuthorizeActionResult, NeonAuthorizeFlowContext, NeonAuthorizeFlowResult, NeonClientAuthorization, NeonClientOptions, NeonProjectBranchDto, NeonProjectBranchesDto, NeonProjectDatabaseDto, NeonProjectDatabasesDto, NeonProjectDto, NeonProjectRoleDto, NeonProjectRolesDto, NeonProjectWithConnectionUriDto, NeonProjectsDto, NeonUser, NetlifyAccount, NetlifyAuthorizeActionResult, NetlifyAuthorizeFlowContext, NetlifyAuthorizeFlowResult, NetlifyClientAuthorization, NetlifyClientOptions, NetlifyDeploy, NetlifyDeployKey, NetlifyEnv, NetlifyInstallActionContext, NetlifyInstallActionResult, NetlifyInstallFlowContext, NetlifyInstallFlowResult, NetlifySite, OrganizationDto, PatDto, PatScopeDto, PatWithSecretDto, PlanetScaleAuthorizeActionResult, PlanetScaleAuthorizeFlowContext, PlanetScaleAuthorizeFlowResult, PlanetScaleClientAuthorization, PlanetScaleClientOptions, PlanetScaleDatabase, PlanetScaleDatabasePassword, PlanetScaleOrganization, PlanetScalePaginatedResult, PlanetScalePagination, PlanetScaleUser, PlatformAccountsClientAuthorization, PlatformAccountsClientInstanceOptions, PlatformAdapterClientAuthorization, PlatformAdapterClientOptions, PlatformBillingClientAuthorization, PlatformBillingClientOptions, PlatformClientAuthorization, PlatformDpsClientAuthorization, PlatformDpsClientOptions, ProductDto, PropertiesDto, Property, PropertyAccessDto, PropertyAccessItemDto, PropertyDto, PushAppPayload, PushAppResult, PushAppSaga, PushAppSagaAuthorizationStep, PushAppSagaBaseStep, PushAppSagaDeploymentStep, PushAppSagaDisplayStep, PushAppSagaMonetizationStep, PushAppSagaPropertiesStep, PushAppSagaRepositoryStep, PushAppSagaStorageStep, PushAppSagaWidgetsStep, RemoveAppAuthorizationPayload, RemoveAppMonetizationPayload, RemoveAppPropertiesPayload, RemoveAppPropertyPayload, RemoveAppWidgetPayload, RemoveAppWidgetsPayload, ResearchCustomerItemDto, ResearchCustomerLocationItemDto, ResearchDictionaryParams, ResearchMarketplaceItemDto, ResearchMarketplaceParams, ResearchTrafficItemDto, ResearchTrafficParams, Saga, SagaInput, SagaOutput, SagaStep, SagaStepChanges, SagaStepComparer, SagaStepPropertyCompareResult, SagaStepStatus, SagaStepsSchema, ScopeDto, SeedAppRepositoryPayload, SeedAppRepositoryResult, ShopifyApiError, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShopifyEvent, ShopifyEventNames, ShopifyOrderCreatedWebhookData, ShopifyWebhookConcreteData, ShopifyWebhookData, ShopifyWebhookDataBase, ShopifyWebhookTopics, ShortcutDto, SubscribeToHubspotEventPayload, SubscribeToIntegrationEventPayload, SubscribeToMailchimpEventPayload, SubscribeToShopifyEventPayload, SubscribeToTextLivechatEventPayload, SyncAppVariablePayload, TextApiError, TextAuthorizeActionResult, TextAuthorizeFlowContext, TextAuthorizeFlowResult, TextClientAuthorization, TextClientOptions, TextLiveChatEvent, TextLivechatEventNames, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, TriggerPayload, TriggerType, UnauthorizeAccountsApiError, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UnsubscribeFromHubspotEventPayload, UnsubscribeFromIntegrationEventPayload, UnsubscribeFromMailchimpEventPayload, UnsubscribeFromShopifyEventPayload, UnsubscribeFromTextLivechatEventPayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateCredentialPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserAddedToChatWebhookData, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserRemovedFromChatWebhookData, UserVercelIntegrationDto, VercelAuthorizeActionResult, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookActions, WebhookChat, WebhookConcreteData, WebhookData, WebhookDataBase, WebhookDto, WebhookEvent, WebhookEvents, WebhookMessageEvent, WebhookSystemMessageEvent, WebhookSystemMessages, WebhookUser, WorkflowDefinitionAddNodeTask, WorkflowDefinitionAddTriggerTask, WorkflowDefinitionDto, WorkflowDefinitionForkJoinTask, WorkflowDefinitionHttpTask, WorkflowDefinitionJoinTask, WorkflowDefinitionSwitchTask, WorkflowDefinitionTask, WorkflowDefinitionTaskBase, WorkflowDefinitionTaskCore, WorkflowDefinitionTaskType, WorkflowDefinitionTerminateTask, WorkflowDefinitionsQueryParams, WorkflowDto, WorkflowExecution, WorkflowExecutionDetails, WorkflowExecutionPayload, WorkflowsDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getHubspotClientAuthorization, getHubspotClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAdapterClientAuthorization, getPlatformAdapterClientConfig, getPlatformAdapterClientDefaultConfig, getPlatformBillingClientAuthorization, getPlatformBillingClientConfig, getPlatformDpsAdminClientAuthorization, getPlatformDpsClientAuthorization, getPlatformDpsClientConfig, getRegion, getShopifyClientAuthorization, getShopifyClientConfig, getShopifyClientUrl, getTextClientAuthorization, getTextClientConfig, getVercelClientAuthorization, getVercelClientConfig, githubClientInstance, hubspotClientInstance, hubspotClientUrl, hubspotEventsZods, initApi, initGithubClient, initHubspotClient, initLiveChatClient, initMailchimpClient, initNeonClient, initNetlifyClient, initPlanetScaleClient, initPlatformAccountsClient, initPlatformAdapterClient, initPlatformBillingClient, initPlatformDpsClient, initShopifyClient, initTextClient, initVercelClient, integrationEventsZods, livechatClientInstance, mailchimpClientInstance, mailchimpEventsZods, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, shopifyEventsZods, textClientInstance, textLivechatEventsZods, updateGithubClient, updateHubspotClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateTextClient, updateVercelClient, vercelClientInstance };
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,8 @@ __export(src_exports, {
|
|
|
73
73
|
ApiClient: () => ApiClient,
|
|
74
74
|
ApiErrorBase: () => ApiErrorBase,
|
|
75
75
|
DpsApiError: () => DpsApiError,
|
|
76
|
+
HubspotApiError: () => HubspotApiError,
|
|
77
|
+
HubspotEventNames: () => HubspotEventNames,
|
|
76
78
|
LivechatApiError: () => LivechatApiError,
|
|
77
79
|
MailchimpApiError: () => MailchimpApiError,
|
|
78
80
|
MailchimpEventNames: () => MailchimpEventNames,
|
|
@@ -97,6 +99,8 @@ __export(src_exports, {
|
|
|
97
99
|
getEmptyAppAutoReview: () => getEmptyAppAutoReview,
|
|
98
100
|
getGitHubClientAuthorization: () => getGitHubClientAuthorization,
|
|
99
101
|
getGithubClientConfig: () => getGithubClientConfig,
|
|
102
|
+
getHubspotClientAuthorization: () => getHubspotClientAuthorization,
|
|
103
|
+
getHubspotClientConfig: () => getHubspotClientConfig,
|
|
100
104
|
getIntegrationFlowUrl: () => getIntegrationFlowUrl,
|
|
101
105
|
getLiveChatClientAuthorization: () => getLiveChatClientAuthorization,
|
|
102
106
|
getLiveChatClientConfig: () => getLiveChatClientConfig,
|
|
@@ -127,8 +131,12 @@ __export(src_exports, {
|
|
|
127
131
|
getVercelClientAuthorization: () => getVercelClientAuthorization,
|
|
128
132
|
getVercelClientConfig: () => getVercelClientConfig,
|
|
129
133
|
githubClientInstance: () => githubClientInstance,
|
|
134
|
+
hubspotClientInstance: () => hubspotClientInstance,
|
|
135
|
+
hubspotClientUrl: () => hubspotClientUrl,
|
|
136
|
+
hubspotEventsZods: () => hubspotEventsZods,
|
|
130
137
|
initApi: () => initApi,
|
|
131
138
|
initGithubClient: () => initGithubClient,
|
|
139
|
+
initHubspotClient: () => initHubspotClient,
|
|
132
140
|
initLiveChatClient: () => initLiveChatClient,
|
|
133
141
|
initMailchimpClient: () => initMailchimpClient,
|
|
134
142
|
initNeonClient: () => initNeonClient,
|
|
@@ -157,6 +165,7 @@ __export(src_exports, {
|
|
|
157
165
|
textClientInstance: () => textClientInstance,
|
|
158
166
|
textLivechatEventsZods: () => textLivechatEventsZods,
|
|
159
167
|
updateGithubClient: () => updateGithubClient,
|
|
168
|
+
updateHubspotClient: () => updateHubspotClient,
|
|
160
169
|
updateMailchimpClient: () => updateMailchimpClient,
|
|
161
170
|
updateNeonClient: () => updateNeonClient,
|
|
162
171
|
updateNetlifyClient: () => updateNetlifyClient,
|
|
@@ -2938,7 +2947,7 @@ function getMailchimpClientConfig(options = {}) {
|
|
|
2938
2947
|
}
|
|
2939
2948
|
function initMailchimpClient(token, server) {
|
|
2940
2949
|
if (token && server) {
|
|
2941
|
-
updateMailchimpClient(token);
|
|
2950
|
+
updateMailchimpClient(token, server);
|
|
2942
2951
|
}
|
|
2943
2952
|
}
|
|
2944
2953
|
function updateMailchimpClient(token, server) {
|
|
@@ -3199,6 +3208,56 @@ var shopifyApi = {
|
|
|
3199
3208
|
}
|
|
3200
3209
|
};
|
|
3201
3210
|
|
|
3211
|
+
// src/apis/integrations/hubspot/api.ts
|
|
3212
|
+
var import_axios18 = __toESM(require("axios"));
|
|
3213
|
+
var hubspotApi = {
|
|
3214
|
+
getToken(code, clientId, clientSecret, redirectUri) {
|
|
3215
|
+
return __async(this, null, function* () {
|
|
3216
|
+
var _a;
|
|
3217
|
+
const data = new URLSearchParams({
|
|
3218
|
+
code,
|
|
3219
|
+
client_id: clientId,
|
|
3220
|
+
client_secret: clientSecret,
|
|
3221
|
+
redirect_uri: redirectUri,
|
|
3222
|
+
grant_type: "authorization_code"
|
|
3223
|
+
});
|
|
3224
|
+
const tokenResponse = yield import_axios18.default.post(
|
|
3225
|
+
"https://api.hubapi.com/oauth/v1/token",
|
|
3226
|
+
data,
|
|
3227
|
+
{
|
|
3228
|
+
headers: {
|
|
3229
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
);
|
|
3233
|
+
const params = new URLSearchParams(
|
|
3234
|
+
tokenResponse.data
|
|
3235
|
+
);
|
|
3236
|
+
return {
|
|
3237
|
+
token: (_a = params.get("access_token")) != null ? _a : ""
|
|
3238
|
+
};
|
|
3239
|
+
});
|
|
3240
|
+
},
|
|
3241
|
+
getMetadata(_0) {
|
|
3242
|
+
return __async(this, arguments, function* ({ token }) {
|
|
3243
|
+
const {
|
|
3244
|
+
data: { dc: server }
|
|
3245
|
+
} = yield import_axios18.default.get(
|
|
3246
|
+
"https://login.mailchimp.com/oauth2/metadata",
|
|
3247
|
+
{
|
|
3248
|
+
headers: {
|
|
3249
|
+
"Content-Type": "application/json",
|
|
3250
|
+
Authorization: `OAuth ${token}`
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
);
|
|
3254
|
+
return {
|
|
3255
|
+
server
|
|
3256
|
+
};
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3259
|
+
};
|
|
3260
|
+
|
|
3202
3261
|
// src/apis/integrations/api.ts
|
|
3203
3262
|
var integrationsApi = {
|
|
3204
3263
|
github: gitHubApi,
|
|
@@ -3208,11 +3267,12 @@ var integrationsApi = {
|
|
|
3208
3267
|
shopify: shopifyApi,
|
|
3209
3268
|
neon: neonApi,
|
|
3210
3269
|
planetscale: planetscaleApi,
|
|
3270
|
+
hubspot: hubspotApi,
|
|
3211
3271
|
text: textApi
|
|
3212
3272
|
};
|
|
3213
3273
|
|
|
3214
3274
|
// src/apis/products/livechat/instance.ts
|
|
3215
|
-
var
|
|
3275
|
+
var import_axios19 = __toESM(require("axios"));
|
|
3216
3276
|
var REGION = {
|
|
3217
3277
|
FRA: "fra",
|
|
3218
3278
|
DAL: "dal",
|
|
@@ -3232,7 +3292,7 @@ var LivechatApiError = class extends ApiErrorBase {
|
|
|
3232
3292
|
this.name = "livechat";
|
|
3233
3293
|
}
|
|
3234
3294
|
};
|
|
3235
|
-
var livechatClientInstance =
|
|
3295
|
+
var livechatClientInstance = import_axios19.default.create({
|
|
3236
3296
|
baseURL: "https://api.labs.livechatinc.com"
|
|
3237
3297
|
});
|
|
3238
3298
|
livechatClientInstance.interceptors.response.use(
|
|
@@ -4127,14 +4187,14 @@ var platformAccountsApi = {
|
|
|
4127
4187
|
};
|
|
4128
4188
|
|
|
4129
4189
|
// src/apis/platform/dps/instance.ts
|
|
4130
|
-
var
|
|
4190
|
+
var import_axios20 = __toESM(require("axios"));
|
|
4131
4191
|
var DpsApiError = class extends ApiErrorBase {
|
|
4132
4192
|
constructor() {
|
|
4133
4193
|
super(...arguments);
|
|
4134
4194
|
this.name = "dps";
|
|
4135
4195
|
}
|
|
4136
4196
|
};
|
|
4137
|
-
var platformDpsClientInstance =
|
|
4197
|
+
var platformDpsClientInstance = import_axios20.default.create({
|
|
4138
4198
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
4139
4199
|
});
|
|
4140
4200
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -5737,7 +5797,7 @@ var platformDpsApi = {
|
|
|
5737
5797
|
};
|
|
5738
5798
|
|
|
5739
5799
|
// src/apis/platform/adapter/instance.ts
|
|
5740
|
-
var
|
|
5800
|
+
var import_axios21 = __toESM(require("axios"));
|
|
5741
5801
|
var REGION2 = {
|
|
5742
5802
|
FRA: "fra",
|
|
5743
5803
|
DAL: "dal",
|
|
@@ -5767,7 +5827,7 @@ var AdapterApiError = class _AdapterApiError extends ApiErrorBase {
|
|
|
5767
5827
|
);
|
|
5768
5828
|
}
|
|
5769
5829
|
};
|
|
5770
|
-
var platformAdapterClientInstance =
|
|
5830
|
+
var platformAdapterClientInstance = import_axios21.default.create({
|
|
5771
5831
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5772
5832
|
headers: {
|
|
5773
5833
|
"Content-Type": "application/json"
|
|
@@ -6487,9 +6547,79 @@ var WorkflowDefinitionTaskType = {
|
|
|
6487
6547
|
addTrigger: "ADD_TRIGGER"
|
|
6488
6548
|
};
|
|
6489
6549
|
|
|
6550
|
+
// src/apis/integrations/hubspot/instance.ts
|
|
6551
|
+
var import_axios22 = __toESM(require("axios"));
|
|
6552
|
+
var HubspotApiError = class extends ApiErrorBase {
|
|
6553
|
+
constructor() {
|
|
6554
|
+
super(...arguments);
|
|
6555
|
+
this.name = "hubspot";
|
|
6556
|
+
}
|
|
6557
|
+
};
|
|
6558
|
+
var hubspotClientUrl = `https://api.hubapi.com`;
|
|
6559
|
+
var hubspotClientInstance = import_axios22.default.create({
|
|
6560
|
+
headers: {
|
|
6561
|
+
"Content-Type": "application/json"
|
|
6562
|
+
}
|
|
6563
|
+
});
|
|
6564
|
+
hubspotClientInstance.interceptors.response.use(
|
|
6565
|
+
(r) => r,
|
|
6566
|
+
(error) => {
|
|
6567
|
+
var _a, _b, _c, _d;
|
|
6568
|
+
if (import_axios22.default.isAxiosError(error)) {
|
|
6569
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
6570
|
+
throw new UnauthorizeApiError("hubspot");
|
|
6571
|
+
}
|
|
6572
|
+
}
|
|
6573
|
+
return Promise.reject(
|
|
6574
|
+
new HubspotApiError(
|
|
6575
|
+
error.message,
|
|
6576
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
6577
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
6578
|
+
)
|
|
6579
|
+
);
|
|
6580
|
+
}
|
|
6581
|
+
);
|
|
6582
|
+
function getHubspotClientAuthorization(req) {
|
|
6583
|
+
if (req.headers instanceof Headers) {
|
|
6584
|
+
return {
|
|
6585
|
+
token: req.headers.get("x-adapter-hubspot-token")
|
|
6586
|
+
};
|
|
6587
|
+
}
|
|
6588
|
+
return {
|
|
6589
|
+
token: req.headers["x-adapter-hubspot-token"]
|
|
6590
|
+
};
|
|
6591
|
+
}
|
|
6592
|
+
function getHubspotClientConfig(options = {}) {
|
|
6593
|
+
var _a;
|
|
6594
|
+
const currentHeaders = hubspotClientInstance.defaults.headers;
|
|
6595
|
+
const config = {
|
|
6596
|
+
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
|
|
6597
|
+
};
|
|
6598
|
+
if (options.ensureAuthorizationToken && !config.authorization) {
|
|
6599
|
+
throw new UnauthorizeApiError("hubspot");
|
|
6600
|
+
}
|
|
6601
|
+
return {
|
|
6602
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
6603
|
+
};
|
|
6604
|
+
}
|
|
6605
|
+
function initHubspotClient(token) {
|
|
6606
|
+
if (token) {
|
|
6607
|
+
updateHubspotClient(token);
|
|
6608
|
+
}
|
|
6609
|
+
}
|
|
6610
|
+
function updateHubspotClient(token) {
|
|
6611
|
+
const defaults = hubspotClientInstance.defaults;
|
|
6612
|
+
const headers = defaults.headers;
|
|
6613
|
+
if (token) {
|
|
6614
|
+
headers.Authorization = `Bearer ${token}`;
|
|
6615
|
+
} else {
|
|
6616
|
+
delete headers.Authorization;
|
|
6617
|
+
}
|
|
6618
|
+
}
|
|
6619
|
+
|
|
6490
6620
|
// src/apis/platform/billing/instance.ts
|
|
6491
|
-
var
|
|
6492
|
-
var platformBillingClientInstance =
|
|
6621
|
+
var import_axios23 = __toESM(require("axios"));
|
|
6622
|
+
var platformBillingClientInstance = import_axios23.default.create({
|
|
6493
6623
|
baseURL: "https://billing.labs.livechatinc.com"
|
|
6494
6624
|
});
|
|
6495
6625
|
function getPlatformBillingClientAuthorization(req) {
|
|
@@ -6530,7 +6660,7 @@ function initPlatformBillingClient(baseUrl, token) {
|
|
|
6530
6660
|
}
|
|
6531
6661
|
|
|
6532
6662
|
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
6533
|
-
var
|
|
6663
|
+
var import_zod5 = require("zod");
|
|
6534
6664
|
|
|
6535
6665
|
// src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
|
|
6536
6666
|
var ShopifyEventNames = /* @__PURE__ */ ((ShopifyEventNames2) => {
|
|
@@ -6749,34 +6879,93 @@ var textLivechatEventsZods = {
|
|
|
6749
6879
|
}
|
|
6750
6880
|
};
|
|
6751
6881
|
|
|
6882
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
|
|
6883
|
+
var import_zod4 = require("zod");
|
|
6884
|
+
|
|
6885
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/dtos/events.ts
|
|
6886
|
+
var HubspotEventNames = /* @__PURE__ */ ((HubspotEventNames2) => {
|
|
6887
|
+
HubspotEventNames2["SomeEvent"] = "some_event";
|
|
6888
|
+
return HubspotEventNames2;
|
|
6889
|
+
})(HubspotEventNames || {});
|
|
6890
|
+
|
|
6891
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
|
|
6892
|
+
var hubspotEventsZods = {
|
|
6893
|
+
provider: import_zod4.z.literal("hubspot"),
|
|
6894
|
+
eventName: import_zod4.z.nativeEnum(HubspotEventNames),
|
|
6895
|
+
events: {
|
|
6896
|
+
someEvent: import_zod4.z.object({
|
|
6897
|
+
name: import_zod4.z.literal("some_event" /* SomeEvent */)
|
|
6898
|
+
})
|
|
6899
|
+
},
|
|
6900
|
+
get event() {
|
|
6901
|
+
return import_zod4.z.discriminatedUnion("name", [this.events.someEvent]);
|
|
6902
|
+
},
|
|
6903
|
+
get source() {
|
|
6904
|
+
return import_zod4.z.object({
|
|
6905
|
+
sourceName: import_zod4.z.enum(["apps", "workflows"]),
|
|
6906
|
+
sourceKey: import_zod4.z.string()
|
|
6907
|
+
});
|
|
6908
|
+
},
|
|
6909
|
+
get subscribe() {
|
|
6910
|
+
return this.source.and(
|
|
6911
|
+
import_zod4.z.object({
|
|
6912
|
+
event: this.event,
|
|
6913
|
+
callback: import_zod4.z.string()
|
|
6914
|
+
})
|
|
6915
|
+
);
|
|
6916
|
+
},
|
|
6917
|
+
get subscribeContent() {
|
|
6918
|
+
return import_zod4.z.object({
|
|
6919
|
+
provider: this.provider,
|
|
6920
|
+
event: this.event,
|
|
6921
|
+
listId: import_zod4.z.string()
|
|
6922
|
+
});
|
|
6923
|
+
},
|
|
6924
|
+
get unsubscribe() {
|
|
6925
|
+
return this.source.and(
|
|
6926
|
+
import_zod4.z.object({
|
|
6927
|
+
event: this.eventName
|
|
6928
|
+
})
|
|
6929
|
+
);
|
|
6930
|
+
},
|
|
6931
|
+
get unsubscribeContent() {
|
|
6932
|
+
return import_zod4.z.object({
|
|
6933
|
+
provider: this.provider,
|
|
6934
|
+
event: this.eventName
|
|
6935
|
+
});
|
|
6936
|
+
}
|
|
6937
|
+
};
|
|
6938
|
+
|
|
6752
6939
|
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
6753
6940
|
var integrationEventsZods = {
|
|
6754
|
-
sourceName:
|
|
6755
|
-
providerName:
|
|
6941
|
+
sourceName: import_zod5.z.enum(["apps", "workflows"]),
|
|
6942
|
+
providerName: import_zod5.z.enum(["text-livechat", "mailchimp", "shopify", "hubspot"]),
|
|
6756
6943
|
get event() {
|
|
6757
|
-
return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event);
|
|
6944
|
+
return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event);
|
|
6758
6945
|
},
|
|
6759
6946
|
get source() {
|
|
6760
|
-
return
|
|
6947
|
+
return import_zod5.z.object({
|
|
6761
6948
|
sourceName: this.sourceName,
|
|
6762
|
-
sourceKey:
|
|
6949
|
+
sourceKey: import_zod5.z.string()
|
|
6763
6950
|
});
|
|
6764
6951
|
},
|
|
6765
6952
|
get subscribe() {
|
|
6766
6953
|
return this.source.and(
|
|
6767
|
-
|
|
6954
|
+
import_zod5.z.discriminatedUnion("provider", [
|
|
6768
6955
|
textLivechatEventsZods.subscribeContent,
|
|
6769
6956
|
shopifyEventsZods.subscribeContent,
|
|
6770
|
-
mailchimpEventsZods.subscribeContent
|
|
6957
|
+
mailchimpEventsZods.subscribeContent,
|
|
6958
|
+
hubspotEventsZods.subscribeContent
|
|
6771
6959
|
])
|
|
6772
6960
|
);
|
|
6773
6961
|
},
|
|
6774
6962
|
get unsubscribe() {
|
|
6775
6963
|
return this.source.and(
|
|
6776
|
-
|
|
6964
|
+
import_zod5.z.discriminatedUnion("provider", [
|
|
6777
6965
|
textLivechatEventsZods.unsubscribeContent,
|
|
6778
6966
|
shopifyEventsZods.unsubscribeContent,
|
|
6779
|
-
mailchimpEventsZods.unsubscribeContent
|
|
6967
|
+
mailchimpEventsZods.unsubscribeContent,
|
|
6968
|
+
hubspotEventsZods.unsubscribeContent
|
|
6780
6969
|
])
|
|
6781
6970
|
);
|
|
6782
6971
|
}
|
|
@@ -7106,6 +7295,8 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
7106
7295
|
ApiClient,
|
|
7107
7296
|
ApiErrorBase,
|
|
7108
7297
|
DpsApiError,
|
|
7298
|
+
HubspotApiError,
|
|
7299
|
+
HubspotEventNames,
|
|
7109
7300
|
LivechatApiError,
|
|
7110
7301
|
MailchimpApiError,
|
|
7111
7302
|
MailchimpEventNames,
|
|
@@ -7130,6 +7321,8 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
7130
7321
|
getEmptyAppAutoReview,
|
|
7131
7322
|
getGitHubClientAuthorization,
|
|
7132
7323
|
getGithubClientConfig,
|
|
7324
|
+
getHubspotClientAuthorization,
|
|
7325
|
+
getHubspotClientConfig,
|
|
7133
7326
|
getIntegrationFlowUrl,
|
|
7134
7327
|
getLiveChatClientAuthorization,
|
|
7135
7328
|
getLiveChatClientConfig,
|
|
@@ -7160,8 +7353,12 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
7160
7353
|
getVercelClientAuthorization,
|
|
7161
7354
|
getVercelClientConfig,
|
|
7162
7355
|
githubClientInstance,
|
|
7356
|
+
hubspotClientInstance,
|
|
7357
|
+
hubspotClientUrl,
|
|
7358
|
+
hubspotEventsZods,
|
|
7163
7359
|
initApi,
|
|
7164
7360
|
initGithubClient,
|
|
7361
|
+
initHubspotClient,
|
|
7165
7362
|
initLiveChatClient,
|
|
7166
7363
|
initMailchimpClient,
|
|
7167
7364
|
initNeonClient,
|
|
@@ -7190,6 +7387,7 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
7190
7387
|
textClientInstance,
|
|
7191
7388
|
textLivechatEventsZods,
|
|
7192
7389
|
updateGithubClient,
|
|
7390
|
+
updateHubspotClient,
|
|
7193
7391
|
updateMailchimpClient,
|
|
7194
7392
|
updateNeonClient,
|
|
7195
7393
|
updateNetlifyClient,
|
package/dist/index.mjs
CHANGED
|
@@ -2807,7 +2807,7 @@ function getMailchimpClientConfig(options = {}) {
|
|
|
2807
2807
|
}
|
|
2808
2808
|
function initMailchimpClient(token, server) {
|
|
2809
2809
|
if (token && server) {
|
|
2810
|
-
updateMailchimpClient(token);
|
|
2810
|
+
updateMailchimpClient(token, server);
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
2813
|
function updateMailchimpClient(token, server) {
|
|
@@ -3068,6 +3068,56 @@ var shopifyApi = {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
};
|
|
3070
3070
|
|
|
3071
|
+
// src/apis/integrations/hubspot/api.ts
|
|
3072
|
+
import axios16 from "axios";
|
|
3073
|
+
var hubspotApi = {
|
|
3074
|
+
getToken(code, clientId, clientSecret, redirectUri) {
|
|
3075
|
+
return __async(this, null, function* () {
|
|
3076
|
+
var _a;
|
|
3077
|
+
const data = new URLSearchParams({
|
|
3078
|
+
code,
|
|
3079
|
+
client_id: clientId,
|
|
3080
|
+
client_secret: clientSecret,
|
|
3081
|
+
redirect_uri: redirectUri,
|
|
3082
|
+
grant_type: "authorization_code"
|
|
3083
|
+
});
|
|
3084
|
+
const tokenResponse = yield axios16.post(
|
|
3085
|
+
"https://api.hubapi.com/oauth/v1/token",
|
|
3086
|
+
data,
|
|
3087
|
+
{
|
|
3088
|
+
headers: {
|
|
3089
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
);
|
|
3093
|
+
const params = new URLSearchParams(
|
|
3094
|
+
tokenResponse.data
|
|
3095
|
+
);
|
|
3096
|
+
return {
|
|
3097
|
+
token: (_a = params.get("access_token")) != null ? _a : ""
|
|
3098
|
+
};
|
|
3099
|
+
});
|
|
3100
|
+
},
|
|
3101
|
+
getMetadata(_0) {
|
|
3102
|
+
return __async(this, arguments, function* ({ token }) {
|
|
3103
|
+
const {
|
|
3104
|
+
data: { dc: server }
|
|
3105
|
+
} = yield axios16.get(
|
|
3106
|
+
"https://login.mailchimp.com/oauth2/metadata",
|
|
3107
|
+
{
|
|
3108
|
+
headers: {
|
|
3109
|
+
"Content-Type": "application/json",
|
|
3110
|
+
Authorization: `OAuth ${token}`
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
);
|
|
3114
|
+
return {
|
|
3115
|
+
server
|
|
3116
|
+
};
|
|
3117
|
+
});
|
|
3118
|
+
}
|
|
3119
|
+
};
|
|
3120
|
+
|
|
3071
3121
|
// src/apis/integrations/api.ts
|
|
3072
3122
|
var integrationsApi = {
|
|
3073
3123
|
github: gitHubApi,
|
|
@@ -3077,11 +3127,12 @@ var integrationsApi = {
|
|
|
3077
3127
|
shopify: shopifyApi,
|
|
3078
3128
|
neon: neonApi,
|
|
3079
3129
|
planetscale: planetscaleApi,
|
|
3130
|
+
hubspot: hubspotApi,
|
|
3080
3131
|
text: textApi
|
|
3081
3132
|
};
|
|
3082
3133
|
|
|
3083
3134
|
// src/apis/products/livechat/instance.ts
|
|
3084
|
-
import
|
|
3135
|
+
import axios17 from "axios";
|
|
3085
3136
|
var REGION = {
|
|
3086
3137
|
FRA: "fra",
|
|
3087
3138
|
DAL: "dal",
|
|
@@ -3101,7 +3152,7 @@ var LivechatApiError = class extends ApiErrorBase {
|
|
|
3101
3152
|
this.name = "livechat";
|
|
3102
3153
|
}
|
|
3103
3154
|
};
|
|
3104
|
-
var livechatClientInstance =
|
|
3155
|
+
var livechatClientInstance = axios17.create({
|
|
3105
3156
|
baseURL: "https://api.labs.livechatinc.com"
|
|
3106
3157
|
});
|
|
3107
3158
|
livechatClientInstance.interceptors.response.use(
|
|
@@ -3996,14 +4047,14 @@ var platformAccountsApi = {
|
|
|
3996
4047
|
};
|
|
3997
4048
|
|
|
3998
4049
|
// src/apis/platform/dps/instance.ts
|
|
3999
|
-
import
|
|
4050
|
+
import axios18 from "axios";
|
|
4000
4051
|
var DpsApiError = class extends ApiErrorBase {
|
|
4001
4052
|
constructor() {
|
|
4002
4053
|
super(...arguments);
|
|
4003
4054
|
this.name = "dps";
|
|
4004
4055
|
}
|
|
4005
4056
|
};
|
|
4006
|
-
var platformDpsClientInstance =
|
|
4057
|
+
var platformDpsClientInstance = axios18.create({
|
|
4007
4058
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
4008
4059
|
});
|
|
4009
4060
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -5606,7 +5657,7 @@ var platformDpsApi = {
|
|
|
5606
5657
|
};
|
|
5607
5658
|
|
|
5608
5659
|
// src/apis/platform/adapter/instance.ts
|
|
5609
|
-
import
|
|
5660
|
+
import axios19 from "axios";
|
|
5610
5661
|
var REGION2 = {
|
|
5611
5662
|
FRA: "fra",
|
|
5612
5663
|
DAL: "dal",
|
|
@@ -5636,7 +5687,7 @@ var AdapterApiError = class _AdapterApiError extends ApiErrorBase {
|
|
|
5636
5687
|
);
|
|
5637
5688
|
}
|
|
5638
5689
|
};
|
|
5639
|
-
var platformAdapterClientInstance =
|
|
5690
|
+
var platformAdapterClientInstance = axios19.create({
|
|
5640
5691
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5641
5692
|
headers: {
|
|
5642
5693
|
"Content-Type": "application/json"
|
|
@@ -6356,9 +6407,79 @@ var WorkflowDefinitionTaskType = {
|
|
|
6356
6407
|
addTrigger: "ADD_TRIGGER"
|
|
6357
6408
|
};
|
|
6358
6409
|
|
|
6410
|
+
// src/apis/integrations/hubspot/instance.ts
|
|
6411
|
+
import axios20 from "axios";
|
|
6412
|
+
var HubspotApiError = class extends ApiErrorBase {
|
|
6413
|
+
constructor() {
|
|
6414
|
+
super(...arguments);
|
|
6415
|
+
this.name = "hubspot";
|
|
6416
|
+
}
|
|
6417
|
+
};
|
|
6418
|
+
var hubspotClientUrl = `https://api.hubapi.com`;
|
|
6419
|
+
var hubspotClientInstance = axios20.create({
|
|
6420
|
+
headers: {
|
|
6421
|
+
"Content-Type": "application/json"
|
|
6422
|
+
}
|
|
6423
|
+
});
|
|
6424
|
+
hubspotClientInstance.interceptors.response.use(
|
|
6425
|
+
(r) => r,
|
|
6426
|
+
(error) => {
|
|
6427
|
+
var _a, _b, _c, _d;
|
|
6428
|
+
if (axios20.isAxiosError(error)) {
|
|
6429
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
6430
|
+
throw new UnauthorizeApiError("hubspot");
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
return Promise.reject(
|
|
6434
|
+
new HubspotApiError(
|
|
6435
|
+
error.message,
|
|
6436
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
6437
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
6438
|
+
)
|
|
6439
|
+
);
|
|
6440
|
+
}
|
|
6441
|
+
);
|
|
6442
|
+
function getHubspotClientAuthorization(req) {
|
|
6443
|
+
if (req.headers instanceof Headers) {
|
|
6444
|
+
return {
|
|
6445
|
+
token: req.headers.get("x-adapter-hubspot-token")
|
|
6446
|
+
};
|
|
6447
|
+
}
|
|
6448
|
+
return {
|
|
6449
|
+
token: req.headers["x-adapter-hubspot-token"]
|
|
6450
|
+
};
|
|
6451
|
+
}
|
|
6452
|
+
function getHubspotClientConfig(options = {}) {
|
|
6453
|
+
var _a;
|
|
6454
|
+
const currentHeaders = hubspotClientInstance.defaults.headers;
|
|
6455
|
+
const config = {
|
|
6456
|
+
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
|
|
6457
|
+
};
|
|
6458
|
+
if (options.ensureAuthorizationToken && !config.authorization) {
|
|
6459
|
+
throw new UnauthorizeApiError("hubspot");
|
|
6460
|
+
}
|
|
6461
|
+
return {
|
|
6462
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
6463
|
+
};
|
|
6464
|
+
}
|
|
6465
|
+
function initHubspotClient(token) {
|
|
6466
|
+
if (token) {
|
|
6467
|
+
updateHubspotClient(token);
|
|
6468
|
+
}
|
|
6469
|
+
}
|
|
6470
|
+
function updateHubspotClient(token) {
|
|
6471
|
+
const defaults = hubspotClientInstance.defaults;
|
|
6472
|
+
const headers = defaults.headers;
|
|
6473
|
+
if (token) {
|
|
6474
|
+
headers.Authorization = `Bearer ${token}`;
|
|
6475
|
+
} else {
|
|
6476
|
+
delete headers.Authorization;
|
|
6477
|
+
}
|
|
6478
|
+
}
|
|
6479
|
+
|
|
6359
6480
|
// src/apis/platform/billing/instance.ts
|
|
6360
|
-
import
|
|
6361
|
-
var platformBillingClientInstance =
|
|
6481
|
+
import axios21 from "axios";
|
|
6482
|
+
var platformBillingClientInstance = axios21.create({
|
|
6362
6483
|
baseURL: "https://billing.labs.livechatinc.com"
|
|
6363
6484
|
});
|
|
6364
6485
|
function getPlatformBillingClientAuthorization(req) {
|
|
@@ -6399,7 +6520,7 @@ function initPlatformBillingClient(baseUrl, token) {
|
|
|
6399
6520
|
}
|
|
6400
6521
|
|
|
6401
6522
|
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
6402
|
-
import { z as
|
|
6523
|
+
import { z as z5 } from "zod";
|
|
6403
6524
|
|
|
6404
6525
|
// src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
|
|
6405
6526
|
var ShopifyEventNames = /* @__PURE__ */ ((ShopifyEventNames2) => {
|
|
@@ -6618,34 +6739,93 @@ var textLivechatEventsZods = {
|
|
|
6618
6739
|
}
|
|
6619
6740
|
};
|
|
6620
6741
|
|
|
6742
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
|
|
6743
|
+
import { z as z4 } from "zod";
|
|
6744
|
+
|
|
6745
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/dtos/events.ts
|
|
6746
|
+
var HubspotEventNames = /* @__PURE__ */ ((HubspotEventNames2) => {
|
|
6747
|
+
HubspotEventNames2["SomeEvent"] = "some_event";
|
|
6748
|
+
return HubspotEventNames2;
|
|
6749
|
+
})(HubspotEventNames || {});
|
|
6750
|
+
|
|
6751
|
+
// src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
|
|
6752
|
+
var hubspotEventsZods = {
|
|
6753
|
+
provider: z4.literal("hubspot"),
|
|
6754
|
+
eventName: z4.nativeEnum(HubspotEventNames),
|
|
6755
|
+
events: {
|
|
6756
|
+
someEvent: z4.object({
|
|
6757
|
+
name: z4.literal("some_event" /* SomeEvent */)
|
|
6758
|
+
})
|
|
6759
|
+
},
|
|
6760
|
+
get event() {
|
|
6761
|
+
return z4.discriminatedUnion("name", [this.events.someEvent]);
|
|
6762
|
+
},
|
|
6763
|
+
get source() {
|
|
6764
|
+
return z4.object({
|
|
6765
|
+
sourceName: z4.enum(["apps", "workflows"]),
|
|
6766
|
+
sourceKey: z4.string()
|
|
6767
|
+
});
|
|
6768
|
+
},
|
|
6769
|
+
get subscribe() {
|
|
6770
|
+
return this.source.and(
|
|
6771
|
+
z4.object({
|
|
6772
|
+
event: this.event,
|
|
6773
|
+
callback: z4.string()
|
|
6774
|
+
})
|
|
6775
|
+
);
|
|
6776
|
+
},
|
|
6777
|
+
get subscribeContent() {
|
|
6778
|
+
return z4.object({
|
|
6779
|
+
provider: this.provider,
|
|
6780
|
+
event: this.event,
|
|
6781
|
+
listId: z4.string()
|
|
6782
|
+
});
|
|
6783
|
+
},
|
|
6784
|
+
get unsubscribe() {
|
|
6785
|
+
return this.source.and(
|
|
6786
|
+
z4.object({
|
|
6787
|
+
event: this.eventName
|
|
6788
|
+
})
|
|
6789
|
+
);
|
|
6790
|
+
},
|
|
6791
|
+
get unsubscribeContent() {
|
|
6792
|
+
return z4.object({
|
|
6793
|
+
provider: this.provider,
|
|
6794
|
+
event: this.eventName
|
|
6795
|
+
});
|
|
6796
|
+
}
|
|
6797
|
+
};
|
|
6798
|
+
|
|
6621
6799
|
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
6622
6800
|
var integrationEventsZods = {
|
|
6623
|
-
sourceName:
|
|
6624
|
-
providerName:
|
|
6801
|
+
sourceName: z5.enum(["apps", "workflows"]),
|
|
6802
|
+
providerName: z5.enum(["text-livechat", "mailchimp", "shopify", "hubspot"]),
|
|
6625
6803
|
get event() {
|
|
6626
|
-
return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event);
|
|
6804
|
+
return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event);
|
|
6627
6805
|
},
|
|
6628
6806
|
get source() {
|
|
6629
|
-
return
|
|
6807
|
+
return z5.object({
|
|
6630
6808
|
sourceName: this.sourceName,
|
|
6631
|
-
sourceKey:
|
|
6809
|
+
sourceKey: z5.string()
|
|
6632
6810
|
});
|
|
6633
6811
|
},
|
|
6634
6812
|
get subscribe() {
|
|
6635
6813
|
return this.source.and(
|
|
6636
|
-
|
|
6814
|
+
z5.discriminatedUnion("provider", [
|
|
6637
6815
|
textLivechatEventsZods.subscribeContent,
|
|
6638
6816
|
shopifyEventsZods.subscribeContent,
|
|
6639
|
-
mailchimpEventsZods.subscribeContent
|
|
6817
|
+
mailchimpEventsZods.subscribeContent,
|
|
6818
|
+
hubspotEventsZods.subscribeContent
|
|
6640
6819
|
])
|
|
6641
6820
|
);
|
|
6642
6821
|
},
|
|
6643
6822
|
get unsubscribe() {
|
|
6644
6823
|
return this.source.and(
|
|
6645
|
-
|
|
6824
|
+
z5.discriminatedUnion("provider", [
|
|
6646
6825
|
textLivechatEventsZods.unsubscribeContent,
|
|
6647
6826
|
shopifyEventsZods.unsubscribeContent,
|
|
6648
|
-
mailchimpEventsZods.unsubscribeContent
|
|
6827
|
+
mailchimpEventsZods.unsubscribeContent,
|
|
6828
|
+
hubspotEventsZods.unsubscribeContent
|
|
6649
6829
|
])
|
|
6650
6830
|
);
|
|
6651
6831
|
}
|
|
@@ -6974,6 +7154,8 @@ export {
|
|
|
6974
7154
|
ApiClient,
|
|
6975
7155
|
ApiErrorBase,
|
|
6976
7156
|
DpsApiError,
|
|
7157
|
+
HubspotApiError,
|
|
7158
|
+
HubspotEventNames,
|
|
6977
7159
|
LivechatApiError,
|
|
6978
7160
|
MailchimpApiError,
|
|
6979
7161
|
MailchimpEventNames,
|
|
@@ -6998,6 +7180,8 @@ export {
|
|
|
6998
7180
|
getEmptyAppAutoReview,
|
|
6999
7181
|
getGitHubClientAuthorization,
|
|
7000
7182
|
getGithubClientConfig,
|
|
7183
|
+
getHubspotClientAuthorization,
|
|
7184
|
+
getHubspotClientConfig,
|
|
7001
7185
|
getIntegrationFlowUrl,
|
|
7002
7186
|
getLiveChatClientAuthorization,
|
|
7003
7187
|
getLiveChatClientConfig,
|
|
@@ -7028,8 +7212,12 @@ export {
|
|
|
7028
7212
|
getVercelClientAuthorization,
|
|
7029
7213
|
getVercelClientConfig,
|
|
7030
7214
|
githubClientInstance,
|
|
7215
|
+
hubspotClientInstance,
|
|
7216
|
+
hubspotClientUrl,
|
|
7217
|
+
hubspotEventsZods,
|
|
7031
7218
|
initApi,
|
|
7032
7219
|
initGithubClient,
|
|
7220
|
+
initHubspotClient,
|
|
7033
7221
|
initLiveChatClient,
|
|
7034
7222
|
initMailchimpClient,
|
|
7035
7223
|
initNeonClient,
|
|
@@ -7058,6 +7246,7 @@ export {
|
|
|
7058
7246
|
textClientInstance,
|
|
7059
7247
|
textLivechatEventsZods,
|
|
7060
7248
|
updateGithubClient,
|
|
7249
|
+
updateHubspotClient,
|
|
7061
7250
|
updateMailchimpClient,
|
|
7062
7251
|
updateNeonClient,
|
|
7063
7252
|
updateNetlifyClient,
|