@livechat/developer-studio-api 3.1.9 → 3.1.10

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 CHANGED
@@ -526,7 +526,6 @@ interface WorkflowExecutionDetails {
526
526
  type Credential = {
527
527
  name: string;
528
528
  description: string;
529
- product?: string;
530
529
  } & ({
531
530
  type: "header_auth";
532
531
  data: {
@@ -547,10 +546,40 @@ type Credential = {
547
546
  access_token_url: string;
548
547
  client_id: string;
549
548
  client_secret: string;
550
- product_fields?: Record<string, string>;
549
+ provider_name: string;
550
+ provider_fields?: Record<string, string>;
551
+ connected?: boolean;
551
552
  };
552
553
  });
553
- type CredentialDto = Credential & {
554
+ type CredentialGet = {
555
+ name: string;
556
+ description: string;
557
+ } & ({
558
+ credential_type: "header_auth";
559
+ data: {
560
+ name: string;
561
+ value: string;
562
+ };
563
+ } | {
564
+ credential_type: "basic_auth";
565
+ data: {
566
+ username: string;
567
+ password: string;
568
+ };
569
+ } | {
570
+ credential_type: "oauth2";
571
+ data: {
572
+ redirect_url: string;
573
+ authorization_url: string;
574
+ access_token_url: string;
575
+ client_id: string;
576
+ client_secret: string;
577
+ provider_name: string;
578
+ provider_fields?: Record<string, string>;
579
+ connected?: boolean;
580
+ };
581
+ });
582
+ type CredentialDto = CredentialGet & {
554
583
  created_at: string;
555
584
  updated_at: string;
556
585
  };
@@ -561,10 +590,153 @@ type DeepPartial<T> = T extends object ? {
561
590
  type CreateCredentialPayload = Credential;
562
591
  type UpdateCredentialPayload = DeepPartial<Credential>;
563
592
 
593
+ type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
594
+ type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
595
+ type ApiErrorKind = "unauthorized" | "error";
596
+ type ApiError<TData = unknown> = {
597
+ code: number;
598
+ message: string;
599
+ } & ({
600
+ kind: "error";
601
+ data?: TData;
602
+ } | {
603
+ kind: "unauthorized";
604
+ source: ApiErrorSource;
605
+ });
606
+ declare abstract class ApiErrorBase<TErrorData> extends Error {
607
+ message: string;
608
+ data: TErrorData;
609
+ code: number;
610
+ readonly kind: ApiErrorKind;
611
+ abstract name: ApiErrorName;
612
+ ["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
613
+ constructor(message: string, data: TErrorData, code: number);
614
+ withCustomMessage(message: string): this;
615
+ }
616
+ declare class UnauthorizeApiError extends Error {
617
+ source: ApiErrorSource;
618
+ message: string;
619
+ readonly kind: ApiErrorKind;
620
+ readonly code = 401;
621
+ constructor(source: ApiErrorSource, message?: string);
622
+ withCustomMessage(_message: string): this;
623
+ }
624
+
625
+ interface ApiClientConfig {
626
+ baseURL: string;
627
+ }
628
+ interface ApiClientAuthorization {
629
+ token?: string;
630
+ tokenType?: string;
631
+ }
632
+ declare abstract class ApiClient<TError extends ApiErrorBase<TErrorData>, TErrorData = TError["data"]> {
633
+ private config;
634
+ private authorization?;
635
+ protected options?: RequestInit;
636
+ protected abstract Error: new (message: string, data: TErrorData, status: number) => TError;
637
+ protected abstract UnauthorizedError: new () => UnauthorizeApiError;
638
+ constructor(config: ApiClientConfig, authorization?: ApiClientAuthorization | undefined);
639
+ updateConfig(config: Partial<ApiClientConfig>): void;
640
+ updateAuthorization(authorization: Partial<ApiClientAuthorization>): void;
641
+ fetch<TResponseData>(url: string, customConfig?: {
642
+ authorization?: ApiClientAuthorization;
643
+ customErrorMessage?: string;
644
+ ensureAuthorization?: boolean;
645
+ }, customOptions?: RequestInit): Promise<Response & {
646
+ data: TResponseData;
647
+ }>;
648
+ get<TResponseData>(url: string, config?: {
649
+ authorization?: ApiClientAuthorization;
650
+ customErrorMessage?: string;
651
+ }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
652
+ data: TResponseData;
653
+ }>;
654
+ post<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
655
+ authorization?: ApiClientAuthorization;
656
+ customErrorMessage?: string;
657
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
658
+ data: TResponseData;
659
+ }>;
660
+ patch<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
661
+ authorization?: ApiClientAuthorization;
662
+ customErrorMessage?: string;
663
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
664
+ data: TResponseData;
665
+ }>;
666
+ put<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
667
+ authorization?: ApiClientAuthorization;
668
+ customErrorMessage?: string;
669
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
670
+ data: TResponseData;
671
+ }>;
672
+ delete<TResponseData, TBody = unknown>(url: string, body: TBody, config?: {
673
+ authorization?: ApiClientAuthorization;
674
+ customErrorMessage?: string;
675
+ }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
676
+ data: TResponseData;
677
+ }>;
678
+ }
679
+
680
+ interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
681
+ data: TData;
682
+ output: TOutput;
683
+ status: TStatus;
684
+ }
685
+ type SagaStepsSchema = Record<string, SagaStep | undefined>;
686
+ type SagaStepStatus<TData = NonNullable<unknown>> = {
687
+ isDone: boolean;
688
+ isLoading: boolean;
689
+ error?: {
690
+ message: string;
691
+ source?: ApiErrorSource;
692
+ data?: unknown;
693
+ statusCode?: number;
694
+ statusText?: string;
695
+ };
696
+ } & TData;
697
+ interface Saga<TStepSchema extends SagaStepsSchema> {
698
+ data: {
699
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
700
+ };
701
+ output: {
702
+ sagaId: string;
703
+ steps: {
704
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
705
+ };
706
+ isDone?: boolean;
707
+ };
708
+ status: {
709
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
710
+ };
711
+ }
712
+ type SagaInput<TSaga> = Omit<TSaga, "status">;
713
+ type SagaOutput<TSaga> = Omit<TSaga, "data">;
714
+
715
+ type SagaStepPropertyCompareResult<T> = {
716
+ isChanged: false;
717
+ } | {
718
+ isChanged: true;
719
+ value: T;
720
+ };
721
+ type SagaStepChanges<T> = {
722
+ [Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
723
+ };
724
+ type SagaStepComparer<T> = {
725
+ [Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
726
+ };
727
+
564
728
  type TextClientAuthorization = PlatformClientAuthorization;
565
729
  interface TextClientOptions extends TextClientAuthorization {
566
730
  ensureAuthorizationToken?: boolean;
567
731
  }
732
+ declare class TextApiError extends ApiErrorBase<{
733
+ error: {
734
+ type: string;
735
+ message: string;
736
+ };
737
+ }> {
738
+ name: "text";
739
+ }
568
740
  declare const textClientInstance: axios.AxiosInstance;
569
741
  declare function getTextClientAuthorization(req: {
570
742
  headers: Record<string, string | string[] | undefined> | Headers;
@@ -789,141 +961,6 @@ type MailchimpUnsubscribeWebhookData = MailchimpWebhookConcreteData<"unsubscribe
789
961
  }>;
790
962
  type MailchimpWebhookData = MailchimpSubscribeWebhookData | MailchimpUnsubscribeWebhookData;
791
963
 
792
- type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
793
- type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
794
- type ApiErrorKind = "unauthorized" | "error";
795
- type ApiError<TData = unknown> = {
796
- code: number;
797
- message: string;
798
- } & ({
799
- kind: "error";
800
- data?: TData;
801
- } | {
802
- kind: "unauthorized";
803
- source: ApiErrorSource;
804
- });
805
- declare abstract class ApiErrorBase<TErrorData> extends Error {
806
- message: string;
807
- data: TErrorData;
808
- code: number;
809
- readonly kind: ApiErrorKind;
810
- abstract name: ApiErrorName;
811
- ["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
812
- constructor(message: string, data: TErrorData, code: number);
813
- withCustomMessage(message: string): this;
814
- }
815
- declare class UnauthorizeApiError extends Error {
816
- source: ApiErrorSource;
817
- message: string;
818
- readonly kind: ApiErrorKind;
819
- readonly code = 401;
820
- constructor(source: ApiErrorSource, message?: string);
821
- withCustomMessage(_message: string): this;
822
- }
823
-
824
- interface ApiClientConfig {
825
- baseURL: string;
826
- }
827
- interface ApiClientAuthorization {
828
- token?: string;
829
- tokenType?: string;
830
- }
831
- declare abstract class ApiClient<TError extends ApiErrorBase<TErrorData>, TErrorData = TError["data"]> {
832
- private config;
833
- private authorization?;
834
- protected options?: RequestInit;
835
- protected abstract Error: new (message: string, data: TErrorData, status: number) => TError;
836
- protected abstract UnauthorizedError: new () => UnauthorizeApiError;
837
- constructor(config: ApiClientConfig, authorization?: ApiClientAuthorization | undefined);
838
- updateConfig(config: Partial<ApiClientConfig>): void;
839
- updateAuthorization(authorization: Partial<ApiClientAuthorization>): void;
840
- fetch<TResponseData>(url: string, customConfig?: {
841
- authorization?: ApiClientAuthorization;
842
- customErrorMessage?: string;
843
- ensureAuthorization?: boolean;
844
- }, customOptions?: RequestInit): Promise<Response & {
845
- data: TResponseData;
846
- }>;
847
- get<TResponseData>(url: string, config?: {
848
- authorization?: ApiClientAuthorization;
849
- customErrorMessage?: string;
850
- }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
851
- data: TResponseData;
852
- }>;
853
- post<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
854
- authorization?: ApiClientAuthorization;
855
- customErrorMessage?: string;
856
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
857
- data: TResponseData;
858
- }>;
859
- patch<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
860
- authorization?: ApiClientAuthorization;
861
- customErrorMessage?: string;
862
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
863
- data: TResponseData;
864
- }>;
865
- put<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
866
- authorization?: ApiClientAuthorization;
867
- customErrorMessage?: string;
868
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
869
- data: TResponseData;
870
- }>;
871
- delete<TResponseData, TBody = unknown>(url: string, body: TBody, config?: {
872
- authorization?: ApiClientAuthorization;
873
- customErrorMessage?: string;
874
- }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
875
- data: TResponseData;
876
- }>;
877
- }
878
-
879
- interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
880
- data: TData;
881
- output: TOutput;
882
- status: TStatus;
883
- }
884
- type SagaStepsSchema = Record<string, SagaStep | undefined>;
885
- type SagaStepStatus<TData = NonNullable<unknown>> = {
886
- isDone: boolean;
887
- isLoading: boolean;
888
- error?: {
889
- message: string;
890
- source?: ApiErrorSource;
891
- data?: unknown;
892
- statusCode?: number;
893
- statusText?: string;
894
- };
895
- } & TData;
896
- interface Saga<TStepSchema extends SagaStepsSchema> {
897
- data: {
898
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
899
- };
900
- output: {
901
- sagaId: string;
902
- steps: {
903
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
904
- };
905
- isDone?: boolean;
906
- };
907
- status: {
908
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
909
- };
910
- }
911
- type SagaInput<TSaga> = Omit<TSaga, "status">;
912
- type SagaOutput<TSaga> = Omit<TSaga, "data">;
913
-
914
- type SagaStepPropertyCompareResult<T> = {
915
- isChanged: false;
916
- } | {
917
- isChanged: true;
918
- value: T;
919
- };
920
- type SagaStepChanges<T> = {
921
- [Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
922
- };
923
- type SagaStepComparer<T> = {
924
- [Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
925
- };
926
-
927
964
  interface MailchimpClientAuthorization {
928
965
  server?: string;
929
966
  token?: string;
@@ -1968,14 +2005,14 @@ declare enum ShopifyEventNames {
1968
2005
  }
1969
2006
 
1970
2007
  interface ShopifyAuthorizeActionContext {
1971
- shop?: string;
2008
+ shop: string;
1972
2009
  }
1973
- interface ShopifyAuthorizeActionResult {
2010
+ type ShopifyAuthorizeActionResult = IntegrationAuthorizeFlowResult & {
1974
2011
  shop: string;
1975
2012
  token: string;
1976
- }
1977
- type ShopifyAuthorizeFlowContext = IntegrationFlowContext & {
1978
- authorize?: ShopifyAuthorizeActionContext;
2013
+ };
2014
+ type ShopifyAuthorizeFlowContext<TCredential extends string | undefined = string> = IntegrationAuthorizeFlowContext<TCredential> & {
2015
+ authorize: ShopifyAuthorizeActionContext;
1979
2016
  };
1980
2017
  type ShopifyAuthorizeFlowResult = ShopifyAuthorizeActionResult;
1981
2018
 
@@ -4820,4 +4857,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
4820
4857
  adapterUrl: string;
4821
4858
  }): string;
4822
4859
 
4823
- 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, 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, IntegrationAuthorizeFlowContext, IntegrationAuthorizeFlowResult, 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, TextAuthorizeActionContext, 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, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, 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 };
4860
+ 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, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, CredentialGet, 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, IntegrationAuthorizeFlowContext, IntegrationAuthorizeFlowResult, 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, TextAuthorizeActionContext, 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, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, 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 };
package/dist/index.d.ts CHANGED
@@ -526,7 +526,6 @@ interface WorkflowExecutionDetails {
526
526
  type Credential = {
527
527
  name: string;
528
528
  description: string;
529
- product?: string;
530
529
  } & ({
531
530
  type: "header_auth";
532
531
  data: {
@@ -547,10 +546,40 @@ type Credential = {
547
546
  access_token_url: string;
548
547
  client_id: string;
549
548
  client_secret: string;
550
- product_fields?: Record<string, string>;
549
+ provider_name: string;
550
+ provider_fields?: Record<string, string>;
551
+ connected?: boolean;
551
552
  };
552
553
  });
553
- type CredentialDto = Credential & {
554
+ type CredentialGet = {
555
+ name: string;
556
+ description: string;
557
+ } & ({
558
+ credential_type: "header_auth";
559
+ data: {
560
+ name: string;
561
+ value: string;
562
+ };
563
+ } | {
564
+ credential_type: "basic_auth";
565
+ data: {
566
+ username: string;
567
+ password: string;
568
+ };
569
+ } | {
570
+ credential_type: "oauth2";
571
+ data: {
572
+ redirect_url: string;
573
+ authorization_url: string;
574
+ access_token_url: string;
575
+ client_id: string;
576
+ client_secret: string;
577
+ provider_name: string;
578
+ provider_fields?: Record<string, string>;
579
+ connected?: boolean;
580
+ };
581
+ });
582
+ type CredentialDto = CredentialGet & {
554
583
  created_at: string;
555
584
  updated_at: string;
556
585
  };
@@ -561,10 +590,153 @@ type DeepPartial<T> = T extends object ? {
561
590
  type CreateCredentialPayload = Credential;
562
591
  type UpdateCredentialPayload = DeepPartial<Credential>;
563
592
 
593
+ type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
594
+ type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
595
+ type ApiErrorKind = "unauthorized" | "error";
596
+ type ApiError<TData = unknown> = {
597
+ code: number;
598
+ message: string;
599
+ } & ({
600
+ kind: "error";
601
+ data?: TData;
602
+ } | {
603
+ kind: "unauthorized";
604
+ source: ApiErrorSource;
605
+ });
606
+ declare abstract class ApiErrorBase<TErrorData> extends Error {
607
+ message: string;
608
+ data: TErrorData;
609
+ code: number;
610
+ readonly kind: ApiErrorKind;
611
+ abstract name: ApiErrorName;
612
+ ["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
613
+ constructor(message: string, data: TErrorData, code: number);
614
+ withCustomMessage(message: string): this;
615
+ }
616
+ declare class UnauthorizeApiError extends Error {
617
+ source: ApiErrorSource;
618
+ message: string;
619
+ readonly kind: ApiErrorKind;
620
+ readonly code = 401;
621
+ constructor(source: ApiErrorSource, message?: string);
622
+ withCustomMessage(_message: string): this;
623
+ }
624
+
625
+ interface ApiClientConfig {
626
+ baseURL: string;
627
+ }
628
+ interface ApiClientAuthorization {
629
+ token?: string;
630
+ tokenType?: string;
631
+ }
632
+ declare abstract class ApiClient<TError extends ApiErrorBase<TErrorData>, TErrorData = TError["data"]> {
633
+ private config;
634
+ private authorization?;
635
+ protected options?: RequestInit;
636
+ protected abstract Error: new (message: string, data: TErrorData, status: number) => TError;
637
+ protected abstract UnauthorizedError: new () => UnauthorizeApiError;
638
+ constructor(config: ApiClientConfig, authorization?: ApiClientAuthorization | undefined);
639
+ updateConfig(config: Partial<ApiClientConfig>): void;
640
+ updateAuthorization(authorization: Partial<ApiClientAuthorization>): void;
641
+ fetch<TResponseData>(url: string, customConfig?: {
642
+ authorization?: ApiClientAuthorization;
643
+ customErrorMessage?: string;
644
+ ensureAuthorization?: boolean;
645
+ }, customOptions?: RequestInit): Promise<Response & {
646
+ data: TResponseData;
647
+ }>;
648
+ get<TResponseData>(url: string, config?: {
649
+ authorization?: ApiClientAuthorization;
650
+ customErrorMessage?: string;
651
+ }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
652
+ data: TResponseData;
653
+ }>;
654
+ post<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
655
+ authorization?: ApiClientAuthorization;
656
+ customErrorMessage?: string;
657
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
658
+ data: TResponseData;
659
+ }>;
660
+ patch<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
661
+ authorization?: ApiClientAuthorization;
662
+ customErrorMessage?: string;
663
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
664
+ data: TResponseData;
665
+ }>;
666
+ put<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
667
+ authorization?: ApiClientAuthorization;
668
+ customErrorMessage?: string;
669
+ }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
670
+ data: TResponseData;
671
+ }>;
672
+ delete<TResponseData, TBody = unknown>(url: string, body: TBody, config?: {
673
+ authorization?: ApiClientAuthorization;
674
+ customErrorMessage?: string;
675
+ }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
676
+ data: TResponseData;
677
+ }>;
678
+ }
679
+
680
+ interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
681
+ data: TData;
682
+ output: TOutput;
683
+ status: TStatus;
684
+ }
685
+ type SagaStepsSchema = Record<string, SagaStep | undefined>;
686
+ type SagaStepStatus<TData = NonNullable<unknown>> = {
687
+ isDone: boolean;
688
+ isLoading: boolean;
689
+ error?: {
690
+ message: string;
691
+ source?: ApiErrorSource;
692
+ data?: unknown;
693
+ statusCode?: number;
694
+ statusText?: string;
695
+ };
696
+ } & TData;
697
+ interface Saga<TStepSchema extends SagaStepsSchema> {
698
+ data: {
699
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
700
+ };
701
+ output: {
702
+ sagaId: string;
703
+ steps: {
704
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
705
+ };
706
+ isDone?: boolean;
707
+ };
708
+ status: {
709
+ [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
710
+ };
711
+ }
712
+ type SagaInput<TSaga> = Omit<TSaga, "status">;
713
+ type SagaOutput<TSaga> = Omit<TSaga, "data">;
714
+
715
+ type SagaStepPropertyCompareResult<T> = {
716
+ isChanged: false;
717
+ } | {
718
+ isChanged: true;
719
+ value: T;
720
+ };
721
+ type SagaStepChanges<T> = {
722
+ [Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
723
+ };
724
+ type SagaStepComparer<T> = {
725
+ [Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
726
+ };
727
+
564
728
  type TextClientAuthorization = PlatformClientAuthorization;
565
729
  interface TextClientOptions extends TextClientAuthorization {
566
730
  ensureAuthorizationToken?: boolean;
567
731
  }
732
+ declare class TextApiError extends ApiErrorBase<{
733
+ error: {
734
+ type: string;
735
+ message: string;
736
+ };
737
+ }> {
738
+ name: "text";
739
+ }
568
740
  declare const textClientInstance: axios.AxiosInstance;
569
741
  declare function getTextClientAuthorization(req: {
570
742
  headers: Record<string, string | string[] | undefined> | Headers;
@@ -789,141 +961,6 @@ type MailchimpUnsubscribeWebhookData = MailchimpWebhookConcreteData<"unsubscribe
789
961
  }>;
790
962
  type MailchimpWebhookData = MailchimpSubscribeWebhookData | MailchimpUnsubscribeWebhookData;
791
963
 
792
- type ApiErrorName = "adapter" | "accounts" | "livechat" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
793
- type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify" | "text";
794
- type ApiErrorKind = "unauthorized" | "error";
795
- type ApiError<TData = unknown> = {
796
- code: number;
797
- message: string;
798
- } & ({
799
- kind: "error";
800
- data?: TData;
801
- } | {
802
- kind: "unauthorized";
803
- source: ApiErrorSource;
804
- });
805
- declare abstract class ApiErrorBase<TErrorData> extends Error {
806
- message: string;
807
- data: TErrorData;
808
- code: number;
809
- readonly kind: ApiErrorKind;
810
- abstract name: ApiErrorName;
811
- ["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
812
- constructor(message: string, data: TErrorData, code: number);
813
- withCustomMessage(message: string): this;
814
- }
815
- declare class UnauthorizeApiError extends Error {
816
- source: ApiErrorSource;
817
- message: string;
818
- readonly kind: ApiErrorKind;
819
- readonly code = 401;
820
- constructor(source: ApiErrorSource, message?: string);
821
- withCustomMessage(_message: string): this;
822
- }
823
-
824
- interface ApiClientConfig {
825
- baseURL: string;
826
- }
827
- interface ApiClientAuthorization {
828
- token?: string;
829
- tokenType?: string;
830
- }
831
- declare abstract class ApiClient<TError extends ApiErrorBase<TErrorData>, TErrorData = TError["data"]> {
832
- private config;
833
- private authorization?;
834
- protected options?: RequestInit;
835
- protected abstract Error: new (message: string, data: TErrorData, status: number) => TError;
836
- protected abstract UnauthorizedError: new () => UnauthorizeApiError;
837
- constructor(config: ApiClientConfig, authorization?: ApiClientAuthorization | undefined);
838
- updateConfig(config: Partial<ApiClientConfig>): void;
839
- updateAuthorization(authorization: Partial<ApiClientAuthorization>): void;
840
- fetch<TResponseData>(url: string, customConfig?: {
841
- authorization?: ApiClientAuthorization;
842
- customErrorMessage?: string;
843
- ensureAuthorization?: boolean;
844
- }, customOptions?: RequestInit): Promise<Response & {
845
- data: TResponseData;
846
- }>;
847
- get<TResponseData>(url: string, config?: {
848
- authorization?: ApiClientAuthorization;
849
- customErrorMessage?: string;
850
- }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
851
- data: TResponseData;
852
- }>;
853
- post<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
854
- authorization?: ApiClientAuthorization;
855
- customErrorMessage?: string;
856
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
857
- data: TResponseData;
858
- }>;
859
- patch<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
860
- authorization?: ApiClientAuthorization;
861
- customErrorMessage?: string;
862
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
863
- data: TResponseData;
864
- }>;
865
- put<TResponseData, TBody = unknown>(url: string, body: TBody, customConfig?: {
866
- authorization?: ApiClientAuthorization;
867
- customErrorMessage?: string;
868
- }, customOptions?: Omit<RequestInit, "method" | "body">): Promise<Response & {
869
- data: TResponseData;
870
- }>;
871
- delete<TResponseData, TBody = unknown>(url: string, body: TBody, config?: {
872
- authorization?: ApiClientAuthorization;
873
- customErrorMessage?: string;
874
- }, options?: Omit<RequestInit, "method" | "body">): Promise<Response & {
875
- data: TResponseData;
876
- }>;
877
- }
878
-
879
- interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
880
- data: TData;
881
- output: TOutput;
882
- status: TStatus;
883
- }
884
- type SagaStepsSchema = Record<string, SagaStep | undefined>;
885
- type SagaStepStatus<TData = NonNullable<unknown>> = {
886
- isDone: boolean;
887
- isLoading: boolean;
888
- error?: {
889
- message: string;
890
- source?: ApiErrorSource;
891
- data?: unknown;
892
- statusCode?: number;
893
- statusText?: string;
894
- };
895
- } & TData;
896
- interface Saga<TStepSchema extends SagaStepsSchema> {
897
- data: {
898
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
899
- };
900
- output: {
901
- sagaId: string;
902
- steps: {
903
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
904
- };
905
- isDone?: boolean;
906
- };
907
- status: {
908
- [name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
909
- };
910
- }
911
- type SagaInput<TSaga> = Omit<TSaga, "status">;
912
- type SagaOutput<TSaga> = Omit<TSaga, "data">;
913
-
914
- type SagaStepPropertyCompareResult<T> = {
915
- isChanged: false;
916
- } | {
917
- isChanged: true;
918
- value: T;
919
- };
920
- type SagaStepChanges<T> = {
921
- [Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
922
- };
923
- type SagaStepComparer<T> = {
924
- [Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
925
- };
926
-
927
964
  interface MailchimpClientAuthorization {
928
965
  server?: string;
929
966
  token?: string;
@@ -1968,14 +2005,14 @@ declare enum ShopifyEventNames {
1968
2005
  }
1969
2006
 
1970
2007
  interface ShopifyAuthorizeActionContext {
1971
- shop?: string;
2008
+ shop: string;
1972
2009
  }
1973
- interface ShopifyAuthorizeActionResult {
2010
+ type ShopifyAuthorizeActionResult = IntegrationAuthorizeFlowResult & {
1974
2011
  shop: string;
1975
2012
  token: string;
1976
- }
1977
- type ShopifyAuthorizeFlowContext = IntegrationFlowContext & {
1978
- authorize?: ShopifyAuthorizeActionContext;
2013
+ };
2014
+ type ShopifyAuthorizeFlowContext<TCredential extends string | undefined = string> = IntegrationAuthorizeFlowContext<TCredential> & {
2015
+ authorize: ShopifyAuthorizeActionContext;
1979
2016
  };
1980
2017
  type ShopifyAuthorizeFlowResult = ShopifyAuthorizeActionResult;
1981
2018
 
@@ -4820,4 +4857,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
4820
4857
  adapterUrl: string;
4821
4858
  }): string;
4822
4859
 
4823
- 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, 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, IntegrationAuthorizeFlowContext, IntegrationAuthorizeFlowResult, 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, TextAuthorizeActionContext, 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, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, 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 };
4860
+ 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, Category, ChatDeactivatedWebhookData, ChatTransferredWebhookData, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, CreateCredentialPayload, CreateWorkflowPayload, Credential, CredentialDto, CredentialGet, 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, IntegrationAuthorizeFlowContext, IntegrationAuthorizeFlowResult, 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, TextAuthorizeActionContext, 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, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, 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 };
package/dist/index.js CHANGED
@@ -78,6 +78,7 @@ __export(src_exports, {
78
78
  MailchimpEventNames: () => MailchimpEventNames,
79
79
  ShopifyApiError: () => ShopifyApiError,
80
80
  ShopifyEventNames: () => ShopifyEventNames,
81
+ TextApiError: () => TextApiError,
81
82
  TextLivechatEventNames: () => TextLivechatEventNames,
82
83
  UnauthorizeAccountsApiError: () => UnauthorizeAccountsApiError,
83
84
  UnauthorizeApiError: () => UnauthorizeApiError,
@@ -1446,9 +1447,33 @@ var planetscaleApi = {
1446
1447
 
1447
1448
  // src/apis/integrations/text/instance.ts
1448
1449
  var import_axios8 = __toESM(require("axios"));
1450
+ var TextApiError = class extends ApiErrorBase {
1451
+ constructor() {
1452
+ super(...arguments);
1453
+ this.name = "text";
1454
+ }
1455
+ };
1449
1456
  var textClientInstance = import_axios8.default.create({
1450
1457
  baseURL: "https://api.labs.text.com"
1451
1458
  });
1459
+ textClientInstance.interceptors.response.use(
1460
+ (r) => r,
1461
+ (error) => {
1462
+ var _a, _b, _c, _d;
1463
+ if (import_axios8.default.isAxiosError(error)) {
1464
+ if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1465
+ throw new UnauthorizeApiError("text");
1466
+ }
1467
+ }
1468
+ return Promise.reject(
1469
+ new TextApiError(
1470
+ error.message,
1471
+ (_b = error.response) == null ? void 0 : _b.data,
1472
+ (_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
1473
+ )
1474
+ );
1475
+ }
1476
+ );
1452
1477
  function getTextClientAuthorization(req, usePlatformToken = true) {
1453
1478
  if (req.headers instanceof Headers) {
1454
1479
  return {
@@ -1859,7 +1884,14 @@ var textPlatformWorkflowsCredentialsApi = {
1859
1884
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1860
1885
  ensureAuthorizationToken: true
1861
1886
  }))
1862
- );
1887
+ ).catch((error) => {
1888
+ if (error instanceof TextApiError) {
1889
+ throw error.withCustomMessage(
1890
+ `Couldn't get credential. [${error.message}]`
1891
+ );
1892
+ }
1893
+ throw error;
1894
+ });
1863
1895
  });
1864
1896
  },
1865
1897
  getList(authorization) {
@@ -1869,7 +1901,14 @@ var textPlatformWorkflowsCredentialsApi = {
1869
1901
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1870
1902
  ensureAuthorizationToken: true
1871
1903
  }))
1872
- );
1904
+ ).catch((error) => {
1905
+ if (error instanceof TextApiError) {
1906
+ throw error.withCustomMessage(
1907
+ `Couldn't get credentials. [${error.message}]`
1908
+ );
1909
+ }
1910
+ throw error;
1911
+ });
1873
1912
  });
1874
1913
  },
1875
1914
  create(payload, authorization) {
@@ -1880,7 +1919,14 @@ var textPlatformWorkflowsCredentialsApi = {
1880
1919
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1881
1920
  ensureAuthorizationToken: true
1882
1921
  }))
1883
- );
1922
+ ).catch((error) => {
1923
+ if (error instanceof TextApiError) {
1924
+ throw error.withCustomMessage(
1925
+ `Couldn't create credential. [${error.message}]`
1926
+ );
1927
+ }
1928
+ throw error;
1929
+ });
1884
1930
  });
1885
1931
  },
1886
1932
  update(id, payload, authorization) {
@@ -1891,7 +1937,14 @@ var textPlatformWorkflowsCredentialsApi = {
1891
1937
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1892
1938
  ensureAuthorizationToken: true
1893
1939
  }))
1894
- );
1940
+ ).catch((error) => {
1941
+ if (error instanceof TextApiError) {
1942
+ throw error.withCustomMessage(
1943
+ `Couldn't update credentials. [${error.message}]`
1944
+ );
1945
+ }
1946
+ throw error;
1947
+ });
1895
1948
  });
1896
1949
  },
1897
1950
  delete(id, authorization) {
@@ -1901,20 +1954,34 @@ var textPlatformWorkflowsCredentialsApi = {
1901
1954
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1902
1955
  ensureAuthorizationToken: true
1903
1956
  }))
1904
- );
1957
+ ).catch((error) => {
1958
+ if (error instanceof TextApiError) {
1959
+ throw error.withCustomMessage(
1960
+ `Couldn't delete credentials. [${error.message}]`
1961
+ );
1962
+ }
1963
+ throw error;
1964
+ });
1905
1965
  });
1906
1966
  },
1907
1967
  connect(id, code, authorization) {
1908
1968
  return __async(this, null, function* () {
1909
1969
  return textClientInstance.put(
1910
- `/workflow_platform/credentials/${id}/connect`,
1970
+ `/workflow_platform/credentials/${id}/connection`,
1911
1971
  {
1912
1972
  code
1913
1973
  },
1914
1974
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1915
1975
  ensureAuthorizationToken: true
1916
1976
  }))
1917
- );
1977
+ ).catch((error) => {
1978
+ if (error instanceof TextApiError) {
1979
+ throw error.withCustomMessage(
1980
+ `Couldn't connect to credentials. [${error.message}]`
1981
+ );
1982
+ }
1983
+ throw error;
1984
+ });
1918
1985
  });
1919
1986
  }
1920
1987
  };
@@ -6836,6 +6903,7 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
6836
6903
  MailchimpEventNames,
6837
6904
  ShopifyApiError,
6838
6905
  ShopifyEventNames,
6906
+ TextApiError,
6839
6907
  TextLivechatEventNames,
6840
6908
  UnauthorizeAccountsApiError,
6841
6909
  UnauthorizeApiError,
package/dist/index.mjs CHANGED
@@ -1316,9 +1316,33 @@ var planetscaleApi = {
1316
1316
 
1317
1317
  // src/apis/integrations/text/instance.ts
1318
1318
  import axios6 from "axios";
1319
+ var TextApiError = class extends ApiErrorBase {
1320
+ constructor() {
1321
+ super(...arguments);
1322
+ this.name = "text";
1323
+ }
1324
+ };
1319
1325
  var textClientInstance = axios6.create({
1320
1326
  baseURL: "https://api.labs.text.com"
1321
1327
  });
1328
+ textClientInstance.interceptors.response.use(
1329
+ (r) => r,
1330
+ (error) => {
1331
+ var _a, _b, _c, _d;
1332
+ if (axios6.isAxiosError(error)) {
1333
+ if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1334
+ throw new UnauthorizeApiError("text");
1335
+ }
1336
+ }
1337
+ return Promise.reject(
1338
+ new TextApiError(
1339
+ error.message,
1340
+ (_b = error.response) == null ? void 0 : _b.data,
1341
+ (_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
1342
+ )
1343
+ );
1344
+ }
1345
+ );
1322
1346
  function getTextClientAuthorization(req, usePlatformToken = true) {
1323
1347
  if (req.headers instanceof Headers) {
1324
1348
  return {
@@ -1729,7 +1753,14 @@ var textPlatformWorkflowsCredentialsApi = {
1729
1753
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1730
1754
  ensureAuthorizationToken: true
1731
1755
  }))
1732
- );
1756
+ ).catch((error) => {
1757
+ if (error instanceof TextApiError) {
1758
+ throw error.withCustomMessage(
1759
+ `Couldn't get credential. [${error.message}]`
1760
+ );
1761
+ }
1762
+ throw error;
1763
+ });
1733
1764
  });
1734
1765
  },
1735
1766
  getList(authorization) {
@@ -1739,7 +1770,14 @@ var textPlatformWorkflowsCredentialsApi = {
1739
1770
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1740
1771
  ensureAuthorizationToken: true
1741
1772
  }))
1742
- );
1773
+ ).catch((error) => {
1774
+ if (error instanceof TextApiError) {
1775
+ throw error.withCustomMessage(
1776
+ `Couldn't get credentials. [${error.message}]`
1777
+ );
1778
+ }
1779
+ throw error;
1780
+ });
1743
1781
  });
1744
1782
  },
1745
1783
  create(payload, authorization) {
@@ -1750,7 +1788,14 @@ var textPlatformWorkflowsCredentialsApi = {
1750
1788
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1751
1789
  ensureAuthorizationToken: true
1752
1790
  }))
1753
- );
1791
+ ).catch((error) => {
1792
+ if (error instanceof TextApiError) {
1793
+ throw error.withCustomMessage(
1794
+ `Couldn't create credential. [${error.message}]`
1795
+ );
1796
+ }
1797
+ throw error;
1798
+ });
1754
1799
  });
1755
1800
  },
1756
1801
  update(id, payload, authorization) {
@@ -1761,7 +1806,14 @@ var textPlatformWorkflowsCredentialsApi = {
1761
1806
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1762
1807
  ensureAuthorizationToken: true
1763
1808
  }))
1764
- );
1809
+ ).catch((error) => {
1810
+ if (error instanceof TextApiError) {
1811
+ throw error.withCustomMessage(
1812
+ `Couldn't update credentials. [${error.message}]`
1813
+ );
1814
+ }
1815
+ throw error;
1816
+ });
1765
1817
  });
1766
1818
  },
1767
1819
  delete(id, authorization) {
@@ -1771,20 +1823,34 @@ var textPlatformWorkflowsCredentialsApi = {
1771
1823
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1772
1824
  ensureAuthorizationToken: true
1773
1825
  }))
1774
- );
1826
+ ).catch((error) => {
1827
+ if (error instanceof TextApiError) {
1828
+ throw error.withCustomMessage(
1829
+ `Couldn't delete credentials. [${error.message}]`
1830
+ );
1831
+ }
1832
+ throw error;
1833
+ });
1775
1834
  });
1776
1835
  },
1777
1836
  connect(id, code, authorization) {
1778
1837
  return __async(this, null, function* () {
1779
1838
  return textClientInstance.put(
1780
- `/workflow_platform/credentials/${id}/connect`,
1839
+ `/workflow_platform/credentials/${id}/connection`,
1781
1840
  {
1782
1841
  code
1783
1842
  },
1784
1843
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
1785
1844
  ensureAuthorizationToken: true
1786
1845
  }))
1787
- );
1846
+ ).catch((error) => {
1847
+ if (error instanceof TextApiError) {
1848
+ throw error.withCustomMessage(
1849
+ `Couldn't connect to credentials. [${error.message}]`
1850
+ );
1851
+ }
1852
+ throw error;
1853
+ });
1788
1854
  });
1789
1855
  }
1790
1856
  };
@@ -6705,6 +6771,7 @@ export {
6705
6771
  MailchimpEventNames,
6706
6772
  ShopifyApiError,
6707
6773
  ShopifyEventNames,
6774
+ TextApiError,
6708
6775
  TextLivechatEventNames,
6709
6776
  UnauthorizeAccountsApiError,
6710
6777
  UnauthorizeApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "3.1.9",
3
+ "version": "3.1.10",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,9 +20,9 @@
20
20
  "@types/node": "^17.0.12",
21
21
  "tsup": "^7.1.0",
22
22
  "typescript": "^5.1.6",
23
- "utils": "0.0.4",
23
+ "eslint-config-custom": "0.0.8",
24
24
  "tsconfig": "0.0.1",
25
- "eslint-config-custom": "0.0.8"
25
+ "utils": "0.0.4"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsup",