@livechat/developer-studio-api 3.0.44 → 3.0.46
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 +126 -82
- package/dist/index.d.ts +126 -82
- package/dist/index.js +165 -80
- package/dist/index.mjs +163 -80
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -572,6 +572,105 @@ declare function getNeonClientConfig(options?: NeonClientOptions): AxiosRequestC
|
|
|
572
572
|
declare function initNeonClient(token?: string): void;
|
|
573
573
|
declare function updateNeonClient(token?: string): void;
|
|
574
574
|
|
|
575
|
+
interface MailchimpListWebhook {
|
|
576
|
+
id: string;
|
|
577
|
+
list_id: string;
|
|
578
|
+
url: string;
|
|
579
|
+
events: {
|
|
580
|
+
subscribe: boolean;
|
|
581
|
+
unsubscribe: boolean;
|
|
582
|
+
profile: boolean;
|
|
583
|
+
cleaned: boolean;
|
|
584
|
+
upemail: boolean;
|
|
585
|
+
campaign: boolean;
|
|
586
|
+
};
|
|
587
|
+
sources: {
|
|
588
|
+
user: boolean;
|
|
589
|
+
admin: boolean;
|
|
590
|
+
api: boolean;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
type ApiErrorName = "adapter" | "accounts" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
595
|
+
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
596
|
+
type ApiErrorKind = "unauthorized" | "error";
|
|
597
|
+
type ApiError<TData = unknown> = {
|
|
598
|
+
code: number;
|
|
599
|
+
message: string;
|
|
600
|
+
} & ({
|
|
601
|
+
kind: "error";
|
|
602
|
+
data?: TData;
|
|
603
|
+
} | {
|
|
604
|
+
kind: "unauthorized";
|
|
605
|
+
source: ApiErrorSource;
|
|
606
|
+
});
|
|
607
|
+
declare abstract class ApiErrorBase<TErrorData> extends Error {
|
|
608
|
+
message: string;
|
|
609
|
+
data: TErrorData;
|
|
610
|
+
code: number;
|
|
611
|
+
readonly kind: ApiErrorKind;
|
|
612
|
+
abstract name: ApiErrorName;
|
|
613
|
+
["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
|
|
614
|
+
constructor(message: string, data: TErrorData, code: number);
|
|
615
|
+
withCustomMessage(message: string): this;
|
|
616
|
+
}
|
|
617
|
+
declare class UnauthorizeApiError extends Error {
|
|
618
|
+
source: ApiErrorSource;
|
|
619
|
+
message: string;
|
|
620
|
+
readonly kind: ApiErrorKind;
|
|
621
|
+
readonly code = 401;
|
|
622
|
+
constructor(source: ApiErrorSource, message?: string);
|
|
623
|
+
withCustomMessage(_message: string): this;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
|
|
627
|
+
data: TData;
|
|
628
|
+
output: TOutput;
|
|
629
|
+
status: TStatus;
|
|
630
|
+
}
|
|
631
|
+
type SagaStepsSchema = Record<string, SagaStep | undefined>;
|
|
632
|
+
type SagaStepStatus<TData = NonNullable<unknown>> = {
|
|
633
|
+
isDone: boolean;
|
|
634
|
+
isLoading: boolean;
|
|
635
|
+
error?: {
|
|
636
|
+
message: string;
|
|
637
|
+
source?: ApiErrorSource;
|
|
638
|
+
data?: unknown;
|
|
639
|
+
statusCode?: number;
|
|
640
|
+
statusText?: string;
|
|
641
|
+
};
|
|
642
|
+
} & TData;
|
|
643
|
+
interface Saga<TStepSchema extends SagaStepsSchema> {
|
|
644
|
+
data: {
|
|
645
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
|
|
646
|
+
};
|
|
647
|
+
output: {
|
|
648
|
+
sagaId: string;
|
|
649
|
+
steps: {
|
|
650
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
|
|
651
|
+
};
|
|
652
|
+
isDone?: boolean;
|
|
653
|
+
};
|
|
654
|
+
status: {
|
|
655
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
type SagaInput<TSaga> = Omit<TSaga, "status">;
|
|
659
|
+
type SagaOutput<TSaga> = Omit<TSaga, "data">;
|
|
660
|
+
|
|
661
|
+
type SagaStepPropertyCompareResult<T> = {
|
|
662
|
+
isChanged: false;
|
|
663
|
+
} | {
|
|
664
|
+
isChanged: true;
|
|
665
|
+
value: T;
|
|
666
|
+
};
|
|
667
|
+
type SagaStepChanges<T> = {
|
|
668
|
+
[Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
|
|
669
|
+
};
|
|
670
|
+
type SagaStepComparer<T> = {
|
|
671
|
+
[Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
|
|
672
|
+
};
|
|
673
|
+
|
|
575
674
|
interface MailchimpClientAuthorization {
|
|
576
675
|
server?: string;
|
|
577
676
|
token?: string;
|
|
@@ -579,6 +678,11 @@ interface MailchimpClientAuthorization {
|
|
|
579
678
|
interface MailchimpClientInstanceOptions extends MailchimpClientAuthorization {
|
|
580
679
|
ensureAuthorizationToken?: boolean;
|
|
581
680
|
}
|
|
681
|
+
declare class MailchimpApiError extends ApiErrorBase<{
|
|
682
|
+
errors: Record<string, string[]>;
|
|
683
|
+
}> {
|
|
684
|
+
name: "mailchimp";
|
|
685
|
+
}
|
|
582
686
|
declare const getMailchimpClientUrl: (server: string) => string;
|
|
583
687
|
declare const mailchimpClientInstance: axios.AxiosInstance;
|
|
584
688
|
declare function getMailchimpClientAuthorization(req: {
|
|
@@ -595,6 +699,11 @@ interface ShopifyClientAuthorization {
|
|
|
595
699
|
interface ShopifyClientOptions extends ShopifyClientAuthorization {
|
|
596
700
|
ensureAuthorizationToken?: boolean;
|
|
597
701
|
}
|
|
702
|
+
declare class ShopifyApiError extends ApiErrorBase<{
|
|
703
|
+
errors: Record<string, string[]>;
|
|
704
|
+
}> {
|
|
705
|
+
name: "shopify";
|
|
706
|
+
}
|
|
598
707
|
declare const shopifyClientInstance: axios.AxiosInstance;
|
|
599
708
|
declare const getShopifyClientUrl: (store: string) => string;
|
|
600
709
|
declare function getShopifyClientAuthorization(req: {
|
|
@@ -715,86 +824,6 @@ interface OrganizationDto {
|
|
|
715
824
|
}[];
|
|
716
825
|
}
|
|
717
826
|
|
|
718
|
-
type ApiErrorName = "adapter" | "accounts" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
719
|
-
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
720
|
-
type ApiErrorKind = "unauthorized" | "error";
|
|
721
|
-
type ApiError<TData = unknown> = {
|
|
722
|
-
code: number;
|
|
723
|
-
message: string;
|
|
724
|
-
} & ({
|
|
725
|
-
kind: "error";
|
|
726
|
-
data?: TData;
|
|
727
|
-
} | {
|
|
728
|
-
kind: "unauthorized";
|
|
729
|
-
source: ApiErrorSource;
|
|
730
|
-
});
|
|
731
|
-
declare abstract class ApiErrorBase<TErrorData> extends Error {
|
|
732
|
-
message: string;
|
|
733
|
-
data: TErrorData;
|
|
734
|
-
code: number;
|
|
735
|
-
readonly kind: ApiErrorKind;
|
|
736
|
-
abstract name: ApiErrorName;
|
|
737
|
-
["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
|
|
738
|
-
constructor(message: string, data: TErrorData, code: number);
|
|
739
|
-
withCustomMessage(message: string): this;
|
|
740
|
-
}
|
|
741
|
-
declare class UnauthorizeApiError extends Error {
|
|
742
|
-
source: ApiErrorSource;
|
|
743
|
-
message: string;
|
|
744
|
-
readonly kind: ApiErrorKind;
|
|
745
|
-
readonly code = 401;
|
|
746
|
-
constructor(source: ApiErrorSource, message?: string);
|
|
747
|
-
withCustomMessage(_message: string): this;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
|
|
751
|
-
data: TData;
|
|
752
|
-
output: TOutput;
|
|
753
|
-
status: TStatus;
|
|
754
|
-
}
|
|
755
|
-
type SagaStepsSchema = Record<string, SagaStep | undefined>;
|
|
756
|
-
type SagaStepStatus<TData = NonNullable<unknown>> = {
|
|
757
|
-
isDone: boolean;
|
|
758
|
-
isLoading: boolean;
|
|
759
|
-
error?: {
|
|
760
|
-
message: string;
|
|
761
|
-
source?: ApiErrorSource;
|
|
762
|
-
data?: unknown;
|
|
763
|
-
statusCode?: number;
|
|
764
|
-
statusText?: string;
|
|
765
|
-
};
|
|
766
|
-
} & TData;
|
|
767
|
-
interface Saga<TStepSchema extends SagaStepsSchema> {
|
|
768
|
-
data: {
|
|
769
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
|
|
770
|
-
};
|
|
771
|
-
output: {
|
|
772
|
-
sagaId: string;
|
|
773
|
-
steps: {
|
|
774
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
|
|
775
|
-
};
|
|
776
|
-
isDone?: boolean;
|
|
777
|
-
};
|
|
778
|
-
status: {
|
|
779
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
type SagaInput<TSaga> = Omit<TSaga, "status">;
|
|
783
|
-
type SagaOutput<TSaga> = Omit<TSaga, "data">;
|
|
784
|
-
|
|
785
|
-
type SagaStepPropertyCompareResult<T> = {
|
|
786
|
-
isChanged: false;
|
|
787
|
-
} | {
|
|
788
|
-
isChanged: true;
|
|
789
|
-
value: T;
|
|
790
|
-
};
|
|
791
|
-
type SagaStepChanges<T> = {
|
|
792
|
-
[Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
|
|
793
|
-
};
|
|
794
|
-
type SagaStepComparer<T> = {
|
|
795
|
-
[Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
|
|
796
|
-
};
|
|
797
|
-
|
|
798
827
|
interface PlatformClientAuthorization {
|
|
799
828
|
token?: string;
|
|
800
829
|
tokenType?: "Basic" | "Bearer";
|
|
@@ -2975,6 +3004,17 @@ declare const api: {
|
|
|
2975
3004
|
}>;
|
|
2976
3005
|
};
|
|
2977
3006
|
mailchimp: {
|
|
3007
|
+
lists: {
|
|
3008
|
+
webhooks: {
|
|
3009
|
+
list(listId: string, authorization?: MailchimpClientAuthorization | undefined): Promise<{
|
|
3010
|
+
webhooks: MailchimpListWebhook[];
|
|
3011
|
+
}>;
|
|
3012
|
+
add(listId: string, webhook: Omit<MailchimpListWebhook, "id" | "list_id">, authorization?: MailchimpClientAuthorization | undefined): Promise<{
|
|
3013
|
+
webhook: MailchimpListWebhook;
|
|
3014
|
+
}>;
|
|
3015
|
+
delete(listId: string, webhookId: string, authorization?: MailchimpClientAuthorization | undefined): Promise<void>;
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
2978
3018
|
getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
2979
3019
|
token: string;
|
|
2980
3020
|
}>;
|
|
@@ -2986,12 +3026,16 @@ declare const api: {
|
|
|
2986
3026
|
};
|
|
2987
3027
|
shopify: {
|
|
2988
3028
|
webhooks: {
|
|
2989
|
-
list(
|
|
3029
|
+
list(options?: {
|
|
3030
|
+
topic?: string | undefined;
|
|
3031
|
+
address?: string | undefined;
|
|
3032
|
+
} | undefined, authorization?: ShopifyClientAuthorization | undefined): Promise<{
|
|
2990
3033
|
webhooks: shopify_api_node.IWebhook[];
|
|
2991
3034
|
}>;
|
|
2992
3035
|
register(webhook: shopify_api_node.ICreateWebhook, authorization?: ShopifyClientAuthorization | undefined): Promise<{
|
|
2993
3036
|
webhook: shopify_api_node.IWebhook;
|
|
2994
3037
|
}>;
|
|
3038
|
+
unregister(webhookId: number, authorization?: ShopifyClientAuthorization | undefined): Promise<void>;
|
|
2995
3039
|
};
|
|
2996
3040
|
getToken(shop: string, code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
2997
3041
|
token: string;
|
|
@@ -3173,4 +3217,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
|
|
|
3173
3217
|
adapterUrl: string;
|
|
3174
3218
|
}): string;
|
|
3175
3219
|
|
|
3176
|
-
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, 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, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, 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, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShortcutDto, SyncAppVariablePayload, TextClientAuthorization, TextClientOptions, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserVercelIntegrationDto, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAccountsClientConfig, 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, livechatClientInstance, mailchimpClientInstance, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, textClientInstance, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateVercelClient, vercelClientInstance };
|
|
3220
|
+
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, 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, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpListWebhook, 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, ShortcutDto, SyncAppVariablePayload, TextClientAuthorization, TextClientOptions, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserVercelIntegrationDto, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAccountsClientConfig, 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, livechatClientInstance, mailchimpClientInstance, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, textClientInstance, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateVercelClient, vercelClientInstance };
|
package/dist/index.d.ts
CHANGED
|
@@ -572,6 +572,105 @@ declare function getNeonClientConfig(options?: NeonClientOptions): AxiosRequestC
|
|
|
572
572
|
declare function initNeonClient(token?: string): void;
|
|
573
573
|
declare function updateNeonClient(token?: string): void;
|
|
574
574
|
|
|
575
|
+
interface MailchimpListWebhook {
|
|
576
|
+
id: string;
|
|
577
|
+
list_id: string;
|
|
578
|
+
url: string;
|
|
579
|
+
events: {
|
|
580
|
+
subscribe: boolean;
|
|
581
|
+
unsubscribe: boolean;
|
|
582
|
+
profile: boolean;
|
|
583
|
+
cleaned: boolean;
|
|
584
|
+
upemail: boolean;
|
|
585
|
+
campaign: boolean;
|
|
586
|
+
};
|
|
587
|
+
sources: {
|
|
588
|
+
user: boolean;
|
|
589
|
+
admin: boolean;
|
|
590
|
+
api: boolean;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
type ApiErrorName = "adapter" | "accounts" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
595
|
+
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
596
|
+
type ApiErrorKind = "unauthorized" | "error";
|
|
597
|
+
type ApiError<TData = unknown> = {
|
|
598
|
+
code: number;
|
|
599
|
+
message: string;
|
|
600
|
+
} & ({
|
|
601
|
+
kind: "error";
|
|
602
|
+
data?: TData;
|
|
603
|
+
} | {
|
|
604
|
+
kind: "unauthorized";
|
|
605
|
+
source: ApiErrorSource;
|
|
606
|
+
});
|
|
607
|
+
declare abstract class ApiErrorBase<TErrorData> extends Error {
|
|
608
|
+
message: string;
|
|
609
|
+
data: TErrorData;
|
|
610
|
+
code: number;
|
|
611
|
+
readonly kind: ApiErrorKind;
|
|
612
|
+
abstract name: ApiErrorName;
|
|
613
|
+
["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
|
|
614
|
+
constructor(message: string, data: TErrorData, code: number);
|
|
615
|
+
withCustomMessage(message: string): this;
|
|
616
|
+
}
|
|
617
|
+
declare class UnauthorizeApiError extends Error {
|
|
618
|
+
source: ApiErrorSource;
|
|
619
|
+
message: string;
|
|
620
|
+
readonly kind: ApiErrorKind;
|
|
621
|
+
readonly code = 401;
|
|
622
|
+
constructor(source: ApiErrorSource, message?: string);
|
|
623
|
+
withCustomMessage(_message: string): this;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
|
|
627
|
+
data: TData;
|
|
628
|
+
output: TOutput;
|
|
629
|
+
status: TStatus;
|
|
630
|
+
}
|
|
631
|
+
type SagaStepsSchema = Record<string, SagaStep | undefined>;
|
|
632
|
+
type SagaStepStatus<TData = NonNullable<unknown>> = {
|
|
633
|
+
isDone: boolean;
|
|
634
|
+
isLoading: boolean;
|
|
635
|
+
error?: {
|
|
636
|
+
message: string;
|
|
637
|
+
source?: ApiErrorSource;
|
|
638
|
+
data?: unknown;
|
|
639
|
+
statusCode?: number;
|
|
640
|
+
statusText?: string;
|
|
641
|
+
};
|
|
642
|
+
} & TData;
|
|
643
|
+
interface Saga<TStepSchema extends SagaStepsSchema> {
|
|
644
|
+
data: {
|
|
645
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
|
|
646
|
+
};
|
|
647
|
+
output: {
|
|
648
|
+
sagaId: string;
|
|
649
|
+
steps: {
|
|
650
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
|
|
651
|
+
};
|
|
652
|
+
isDone?: boolean;
|
|
653
|
+
};
|
|
654
|
+
status: {
|
|
655
|
+
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
type SagaInput<TSaga> = Omit<TSaga, "status">;
|
|
659
|
+
type SagaOutput<TSaga> = Omit<TSaga, "data">;
|
|
660
|
+
|
|
661
|
+
type SagaStepPropertyCompareResult<T> = {
|
|
662
|
+
isChanged: false;
|
|
663
|
+
} | {
|
|
664
|
+
isChanged: true;
|
|
665
|
+
value: T;
|
|
666
|
+
};
|
|
667
|
+
type SagaStepChanges<T> = {
|
|
668
|
+
[Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
|
|
669
|
+
};
|
|
670
|
+
type SagaStepComparer<T> = {
|
|
671
|
+
[Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
|
|
672
|
+
};
|
|
673
|
+
|
|
575
674
|
interface MailchimpClientAuthorization {
|
|
576
675
|
server?: string;
|
|
577
676
|
token?: string;
|
|
@@ -579,6 +678,11 @@ interface MailchimpClientAuthorization {
|
|
|
579
678
|
interface MailchimpClientInstanceOptions extends MailchimpClientAuthorization {
|
|
580
679
|
ensureAuthorizationToken?: boolean;
|
|
581
680
|
}
|
|
681
|
+
declare class MailchimpApiError extends ApiErrorBase<{
|
|
682
|
+
errors: Record<string, string[]>;
|
|
683
|
+
}> {
|
|
684
|
+
name: "mailchimp";
|
|
685
|
+
}
|
|
582
686
|
declare const getMailchimpClientUrl: (server: string) => string;
|
|
583
687
|
declare const mailchimpClientInstance: axios.AxiosInstance;
|
|
584
688
|
declare function getMailchimpClientAuthorization(req: {
|
|
@@ -595,6 +699,11 @@ interface ShopifyClientAuthorization {
|
|
|
595
699
|
interface ShopifyClientOptions extends ShopifyClientAuthorization {
|
|
596
700
|
ensureAuthorizationToken?: boolean;
|
|
597
701
|
}
|
|
702
|
+
declare class ShopifyApiError extends ApiErrorBase<{
|
|
703
|
+
errors: Record<string, string[]>;
|
|
704
|
+
}> {
|
|
705
|
+
name: "shopify";
|
|
706
|
+
}
|
|
598
707
|
declare const shopifyClientInstance: axios.AxiosInstance;
|
|
599
708
|
declare const getShopifyClientUrl: (store: string) => string;
|
|
600
709
|
declare function getShopifyClientAuthorization(req: {
|
|
@@ -715,86 +824,6 @@ interface OrganizationDto {
|
|
|
715
824
|
}[];
|
|
716
825
|
}
|
|
717
826
|
|
|
718
|
-
type ApiErrorName = "adapter" | "accounts" | "dps" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
719
|
-
type ApiErrorSource = "accounts" | "github" | "vercel" | "netlify" | "planetscale" | "neon" | "mailchimp" | "shopify";
|
|
720
|
-
type ApiErrorKind = "unauthorized" | "error";
|
|
721
|
-
type ApiError<TData = unknown> = {
|
|
722
|
-
code: number;
|
|
723
|
-
message: string;
|
|
724
|
-
} & ({
|
|
725
|
-
kind: "error";
|
|
726
|
-
data?: TData;
|
|
727
|
-
} | {
|
|
728
|
-
kind: "unauthorized";
|
|
729
|
-
source: ApiErrorSource;
|
|
730
|
-
});
|
|
731
|
-
declare abstract class ApiErrorBase<TErrorData> extends Error {
|
|
732
|
-
message: string;
|
|
733
|
-
data: TErrorData;
|
|
734
|
-
code: number;
|
|
735
|
-
readonly kind: ApiErrorKind;
|
|
736
|
-
abstract name: ApiErrorName;
|
|
737
|
-
["constructor"]: new (...args: ConstructorParameters<typeof ApiErrorBase>) => this;
|
|
738
|
-
constructor(message: string, data: TErrorData, code: number);
|
|
739
|
-
withCustomMessage(message: string): this;
|
|
740
|
-
}
|
|
741
|
-
declare class UnauthorizeApiError extends Error {
|
|
742
|
-
source: ApiErrorSource;
|
|
743
|
-
message: string;
|
|
744
|
-
readonly kind: ApiErrorKind;
|
|
745
|
-
readonly code = 401;
|
|
746
|
-
constructor(source: ApiErrorSource, message?: string);
|
|
747
|
-
withCustomMessage(_message: string): this;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
interface SagaStep<TData = unknown, TOutput = unknown, TStatus = unknown> {
|
|
751
|
-
data: TData;
|
|
752
|
-
output: TOutput;
|
|
753
|
-
status: TStatus;
|
|
754
|
-
}
|
|
755
|
-
type SagaStepsSchema = Record<string, SagaStep | undefined>;
|
|
756
|
-
type SagaStepStatus<TData = NonNullable<unknown>> = {
|
|
757
|
-
isDone: boolean;
|
|
758
|
-
isLoading: boolean;
|
|
759
|
-
error?: {
|
|
760
|
-
message: string;
|
|
761
|
-
source?: ApiErrorSource;
|
|
762
|
-
data?: unknown;
|
|
763
|
-
statusCode?: number;
|
|
764
|
-
statusText?: string;
|
|
765
|
-
};
|
|
766
|
-
} & TData;
|
|
767
|
-
interface Saga<TStepSchema extends SagaStepsSchema> {
|
|
768
|
-
data: {
|
|
769
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["data"];
|
|
770
|
-
};
|
|
771
|
-
output: {
|
|
772
|
-
sagaId: string;
|
|
773
|
-
steps: {
|
|
774
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : NonNullable<TStepSchema[name]>["output"];
|
|
775
|
-
};
|
|
776
|
-
isDone?: boolean;
|
|
777
|
-
};
|
|
778
|
-
status: {
|
|
779
|
-
[name in keyof TStepSchema]: TStepSchema[name] extends undefined ? undefined : SagaStepStatus & NonNullable<TStepSchema[name]>["status"];
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
type SagaInput<TSaga> = Omit<TSaga, "status">;
|
|
783
|
-
type SagaOutput<TSaga> = Omit<TSaga, "data">;
|
|
784
|
-
|
|
785
|
-
type SagaStepPropertyCompareResult<T> = {
|
|
786
|
-
isChanged: false;
|
|
787
|
-
} | {
|
|
788
|
-
isChanged: true;
|
|
789
|
-
value: T;
|
|
790
|
-
};
|
|
791
|
-
type SagaStepChanges<T> = {
|
|
792
|
-
[Key in keyof T]: SagaStepPropertyCompareResult<T[Key]>;
|
|
793
|
-
};
|
|
794
|
-
type SagaStepComparer<T> = {
|
|
795
|
-
[Key in keyof T]: (current: T[Key] | undefined, pending: T[Key] | undefined) => SagaStepPropertyCompareResult<T[Key]>;
|
|
796
|
-
};
|
|
797
|
-
|
|
798
827
|
interface PlatformClientAuthorization {
|
|
799
828
|
token?: string;
|
|
800
829
|
tokenType?: "Basic" | "Bearer";
|
|
@@ -2975,6 +3004,17 @@ declare const api: {
|
|
|
2975
3004
|
}>;
|
|
2976
3005
|
};
|
|
2977
3006
|
mailchimp: {
|
|
3007
|
+
lists: {
|
|
3008
|
+
webhooks: {
|
|
3009
|
+
list(listId: string, authorization?: MailchimpClientAuthorization | undefined): Promise<{
|
|
3010
|
+
webhooks: MailchimpListWebhook[];
|
|
3011
|
+
}>;
|
|
3012
|
+
add(listId: string, webhook: Omit<MailchimpListWebhook, "id" | "list_id">, authorization?: MailchimpClientAuthorization | undefined): Promise<{
|
|
3013
|
+
webhook: MailchimpListWebhook;
|
|
3014
|
+
}>;
|
|
3015
|
+
delete(listId: string, webhookId: string, authorization?: MailchimpClientAuthorization | undefined): Promise<void>;
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
2978
3018
|
getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
2979
3019
|
token: string;
|
|
2980
3020
|
}>;
|
|
@@ -2986,12 +3026,16 @@ declare const api: {
|
|
|
2986
3026
|
};
|
|
2987
3027
|
shopify: {
|
|
2988
3028
|
webhooks: {
|
|
2989
|
-
list(
|
|
3029
|
+
list(options?: {
|
|
3030
|
+
topic?: string | undefined;
|
|
3031
|
+
address?: string | undefined;
|
|
3032
|
+
} | undefined, authorization?: ShopifyClientAuthorization | undefined): Promise<{
|
|
2990
3033
|
webhooks: shopify_api_node.IWebhook[];
|
|
2991
3034
|
}>;
|
|
2992
3035
|
register(webhook: shopify_api_node.ICreateWebhook, authorization?: ShopifyClientAuthorization | undefined): Promise<{
|
|
2993
3036
|
webhook: shopify_api_node.IWebhook;
|
|
2994
3037
|
}>;
|
|
3038
|
+
unregister(webhookId: number, authorization?: ShopifyClientAuthorization | undefined): Promise<void>;
|
|
2995
3039
|
};
|
|
2996
3040
|
getToken(shop: string, code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
|
|
2997
3041
|
token: string;
|
|
@@ -3173,4 +3217,4 @@ declare function getIntegrationFlowUrl<TContext extends IntegrationFlowContext,
|
|
|
3173
3217
|
adapterUrl: string;
|
|
3174
3218
|
}): string;
|
|
3175
3219
|
|
|
3176
|
-
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, 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, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, 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, ShopifyAuthorizeActionContext, ShopifyAuthorizeActionResult, ShopifyAuthorizeFlowContext, ShopifyAuthorizeFlowResult, ShopifyClientAuthorization, ShopifyClientOptions, ShortcutDto, SyncAppVariablePayload, TextClientAuthorization, TextClientOptions, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserVercelIntegrationDto, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAccountsClientConfig, 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, livechatClientInstance, mailchimpClientInstance, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, textClientInstance, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateVercelClient, vercelClientInstance };
|
|
3220
|
+
export { API_NOTIFICATIONS, AccountDto, AccountsApiError, AdapterApiError, AddAppAuthorizationPayload, AddAppAuthorizationResult, AgentConfigurationDto, AgentDto, 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, ClientDto, ClientInfoDto, ClientScopeDto, ClientWithSecretDto, CreateAppVariablePayload, CreateApplicationAuthorizationPayload, CreateApplicationChatActionPayload, CreateApplicationPayload, CreateApplicationResponse, CreateApplicationSubmissionPayload, CreateClientPayload, DeveloperLedgerParams, DpsApiError, EditAppVariablePayload, GetAppMonitoringCustomReportDataPayload, GetAppMonitoringEventsLogPayload, GetAppMonitoringEventsLogResponse, GetAppMonitoringEventsReportPayload, GetAppMonitoringUptimeReportPayload, GetPlanetScaleDatabasePasswordsResult, GetPlanetScaleDatabasesResult, GetPlanetScaleOrganizationsResult, GetTextPlatformDashboardReportParams, GetVercelProjectsResult, GitHubAuthorizeAppActionResult, GitHubAuthorizeFlowContext, GitHubAuthorizeFlowResult, GitHubAuthorizeOauthActionResult, GitHubInstallActionContext, GitHubInstallActionResult, GitHubInstallFlowContext, GitHubInstallFlowResult, GitHubInstallation, GitHubRepository, GitHubRepositoryBranch, GitHubRepositoryHook, GitHubRepositoryIssue, GitHubRepositoryKey, GitHubRepositorySeed, GithubClientAuthorization, GithubClientOptions, IntegrationFlowContext, IntegrationFlowOutput, IssueLabel, LinkAppDeploymentData, LinkAppDeploymentNetlifyData, LinkAppDeploymentNetlifySiteData, LinkAppDeploymentPayload, LinkAppDeploymentResult, LinkAppDeploymentVercelData, LinkAppDeploymentVercelProjectData, LinkAppRepositoryData, LinkAppRepositoryGitHubData, LinkAppRepositoryPayload, LinkAppRepositoryResult, LinkAppStorageData, LinkAppStorageNeonData, LinkAppStoragePayload, LinkAppStoragePlanetScaleData, LinkAppStoragePlanetScaleDatabaseData, LiveChatClientAuthorization, LiveChatClientOptions, LiveChatConfigurationApiError, MailchimpApiError, MailchimpAuthorizeActionResult, MailchimpAuthorizeFlowContext, MailchimpAuthorizeFlowResult, MailchimpClientAuthorization, MailchimpClientInstanceOptions, MailchimpListWebhook, 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, ShortcutDto, SyncAppVariablePayload, TextClientAuthorization, TextClientOptions, TextPlatformDashboardCreditsDto, TextPlatformDashboardPaymentDto, TextPlatformDashboardReportDto, TextPlatformDashboardReportItemDto, UnauthorizeApiError, UnlinkAppDeploymentData, UnlinkAppDeploymentPayload, UnlinkAppRepositoryData, UnlinkAppRepositoryPayload, UnlinkAppStorageData, UnlinkAppStoragePayload, UpdateAppAuthorizationPayload, UpdateAppInfrastructureBlocksPayload, UpdateApplicationChangelogPayload, UpdateApplicationChatActionPayload, UpdateApplicationDirectInstallUrlPayload, UpdateApplicationIconPayload, UpdateApplicationOnboardingPayload, UpdateApplicationProductPayload, UpdateApplicationWebhookPayload, UpdateApplicationWidgetDto, UpdateChatWebhookPayload, UpdateClientPayload, UpdateUserFeatures, UpdateUserIntegrations, UpsertAppDeploymentPayload, UpsertAppMonetizationPayload, UpsertAppPropertiesPayload, UpsertAppPropertyPayload, UpsertAppRepositoryPayload, UpsertAppResourcePayload, UpsertAppStoragePayload, UpsertAppWidgetPayload, UpsertAppWidgetsPayload, UpsertApplicationChatBoosterPayload, UserDto, UserGitHubIntegrationDto, UserIntegrationsDto, UserNeonIntegrationDto, UserNetlifyIntegrationDto, UserPlanetScaleIntegrationDto, UserVercelIntegrationDto, VercelAuthorizeFlowContext, VercelAuthorizeFlowResult, VercelClientAuthorization, VercelClientOptions, VercelConnectActionContext, VercelConnectActionResult, VercelDeploy, VercelInstallActionContext, VercelInstallActionResult, VercelInstallFlowContext, VercelInstallFlowResult, VercelIntegrateActionResult, VercelNamespace, VercelPaginatedResult, VercelPagination, VercelProject, VercelProjectEnv, VercelRepository, VercelSearchRepositoryResponse, VerifyAppPayload, VerifyAppResult, Webhook, WebhookDto, allAppTemplates, api, appBaseTemplates, appRepositoryTemplates, appRepositoryTemplatesMap, appTemplates, appTemplatesMap, getAppAutoReviewPayload, getEmptyAppAutoReview, getGitHubClientAuthorization, getGithubClientConfig, getIntegrationFlowUrl, getLiveChatClientAuthorization, getLiveChatClientConfig, getMailchimpClientAuthorization, getMailchimpClientConfig, getMailchimpClientUrl, getNeonClientAuthorization, getNeonClientConfig, getNetlifyClientAuthorization, getNetlifyClientConfig, getPlanetScaleClientAuthorization, getPlanetScaleClientConfig, getPlatformAccountsClientAuthorization, getPlatformAccountsClientConfig, 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, livechatClientInstance, mailchimpClientInstance, neonClientInstance, netlifyClientInstance, planetScaleClientInstance, platformAccountsClientInstance, platformAdapterClientInstance, platformBillingClientInstance, platformDpsClientInstance, shopifyClientInstance, textClientInstance, updateGithubClient, updateMailchimpClient, updateNeonClient, updateNetlifyClient, updatePlanetScaleClient, updatePlatformAdapterClient, updateShopifyClient, updateVercelClient, vercelClientInstance };
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,8 @@ __export(src_exports, {
|
|
|
72
72
|
AdapterApiError: () => AdapterApiError,
|
|
73
73
|
ApiErrorBase: () => ApiErrorBase,
|
|
74
74
|
DpsApiError: () => DpsApiError,
|
|
75
|
+
MailchimpApiError: () => MailchimpApiError,
|
|
76
|
+
ShopifyApiError: () => ShopifyApiError,
|
|
75
77
|
UnauthorizeApiError: () => UnauthorizeApiError,
|
|
76
78
|
allAppTemplates: () => allAppTemplates,
|
|
77
79
|
api: () => api,
|
|
@@ -2364,8 +2366,127 @@ var neonApi = {
|
|
|
2364
2366
|
};
|
|
2365
2367
|
|
|
2366
2368
|
// src/apis/integrations/mailchimp/api.ts
|
|
2369
|
+
var import_axios14 = __toESM(require("axios"));
|
|
2370
|
+
|
|
2371
|
+
// src/apis/integrations/mailchimp/instance.ts
|
|
2367
2372
|
var import_axios13 = __toESM(require("axios"));
|
|
2373
|
+
var MailchimpApiError = class extends ApiErrorBase {
|
|
2374
|
+
constructor() {
|
|
2375
|
+
super(...arguments);
|
|
2376
|
+
this.name = "mailchimp";
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
|
|
2380
|
+
var mailchimpClientInstance = import_axios13.default.create({
|
|
2381
|
+
headers: {
|
|
2382
|
+
"Content-Type": "application/json"
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
mailchimpClientInstance.interceptors.response.use(
|
|
2386
|
+
(r) => r,
|
|
2387
|
+
(error) => {
|
|
2388
|
+
var _a, _b, _c, _d;
|
|
2389
|
+
if (import_axios13.default.isAxiosError(error)) {
|
|
2390
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2391
|
+
throw new UnauthorizeApiError("mailchimp");
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
return Promise.reject(
|
|
2395
|
+
new MailchimpApiError(
|
|
2396
|
+
error.message,
|
|
2397
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2398
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2399
|
+
)
|
|
2400
|
+
);
|
|
2401
|
+
}
|
|
2402
|
+
);
|
|
2403
|
+
function getMailchimpClientAuthorization(req) {
|
|
2404
|
+
return {
|
|
2405
|
+
server: req.headers["mailchimp-server"],
|
|
2406
|
+
token: req.headers["mailchimp-token"]
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
function getMailchimpClientConfig(options = {}) {
|
|
2410
|
+
var _a, _b;
|
|
2411
|
+
const currentBaseUrl = mailchimpClientInstance.defaults.baseURL;
|
|
2412
|
+
const currentHeaders = mailchimpClientInstance.defaults.headers;
|
|
2413
|
+
const config = {
|
|
2414
|
+
baseUrl: (_a = options.server ? getMailchimpClientUrl(options.server) : void 0) != null ? _a : currentBaseUrl,
|
|
2415
|
+
authorization: (_b = options.token ? `Bearer ${options.token}` : void 0) != null ? _b : currentHeaders.Authorization
|
|
2416
|
+
};
|
|
2417
|
+
if (options.ensureAuthorizationToken && (!config.authorization || !config.baseUrl)) {
|
|
2418
|
+
throw new UnauthorizeApiError("mailchimp");
|
|
2419
|
+
}
|
|
2420
|
+
return {
|
|
2421
|
+
baseURL: config.baseUrl,
|
|
2422
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
function initMailchimpClient(token, server) {
|
|
2426
|
+
if (token && server) {
|
|
2427
|
+
updateMailchimpClient(token);
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
function updateMailchimpClient(token, server) {
|
|
2431
|
+
const defaults = mailchimpClientInstance.defaults;
|
|
2432
|
+
const headers = defaults.headers;
|
|
2433
|
+
if (token) {
|
|
2434
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2435
|
+
} else {
|
|
2436
|
+
delete headers.Authorization;
|
|
2437
|
+
}
|
|
2438
|
+
if (server) {
|
|
2439
|
+
defaults.baseURL = getMailchimpClientUrl(server);
|
|
2440
|
+
} else {
|
|
2441
|
+
delete defaults.baseURL;
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
// src/apis/integrations/mailchimp/lists/webhooks/api.ts
|
|
2446
|
+
var mailchimpListsWebhooksApi = {
|
|
2447
|
+
list(listId, authorization) {
|
|
2448
|
+
return __async(this, null, function* () {
|
|
2449
|
+
const response = yield mailchimpClientInstance.get(
|
|
2450
|
+
`/lists/${listId}/webhooks`,
|
|
2451
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2452
|
+
ensureAuthorizationToken: true
|
|
2453
|
+
}))
|
|
2454
|
+
);
|
|
2455
|
+
return response.data;
|
|
2456
|
+
});
|
|
2457
|
+
},
|
|
2458
|
+
add(listId, webhook, authorization) {
|
|
2459
|
+
return __async(this, null, function* () {
|
|
2460
|
+
const response = yield mailchimpClientInstance.post(
|
|
2461
|
+
`/lists/${listId}/webhooks`,
|
|
2462
|
+
webhook,
|
|
2463
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2464
|
+
ensureAuthorizationToken: true
|
|
2465
|
+
}))
|
|
2466
|
+
);
|
|
2467
|
+
return response.data;
|
|
2468
|
+
});
|
|
2469
|
+
},
|
|
2470
|
+
delete(listId, webhookId, authorization) {
|
|
2471
|
+
return __async(this, null, function* () {
|
|
2472
|
+
yield mailchimpClientInstance.delete(
|
|
2473
|
+
`/lists/${listId}/webhooks/${webhookId}`,
|
|
2474
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2475
|
+
ensureAuthorizationToken: true
|
|
2476
|
+
}))
|
|
2477
|
+
);
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
};
|
|
2481
|
+
|
|
2482
|
+
// src/apis/integrations/mailchimp/lists/api.ts
|
|
2483
|
+
var mailchimpListsApi = {
|
|
2484
|
+
webhooks: mailchimpListsWebhooksApi
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2487
|
+
// src/apis/integrations/mailchimp/api.ts
|
|
2368
2488
|
var mailchimpApi = {
|
|
2489
|
+
lists: mailchimpListsApi,
|
|
2369
2490
|
getToken(code, clientId, clientSecret, redirectUri) {
|
|
2370
2491
|
return __async(this, null, function* () {
|
|
2371
2492
|
var _a;
|
|
@@ -2376,7 +2497,7 @@ var mailchimpApi = {
|
|
|
2376
2497
|
redirect_uri: redirectUri,
|
|
2377
2498
|
grant_type: "authorization_code"
|
|
2378
2499
|
});
|
|
2379
|
-
const tokenResponse = yield
|
|
2500
|
+
const tokenResponse = yield import_axios14.default.post(
|
|
2380
2501
|
"https://login.mailchimp.com/oauth2/token",
|
|
2381
2502
|
data,
|
|
2382
2503
|
{
|
|
@@ -2397,7 +2518,7 @@ var mailchimpApi = {
|
|
|
2397
2518
|
return __async(this, arguments, function* ({ token }) {
|
|
2398
2519
|
const {
|
|
2399
2520
|
data: { dc: server }
|
|
2400
|
-
} = yield
|
|
2521
|
+
} = yield import_axios14.default.get(
|
|
2401
2522
|
"https://login.mailchimp.com/oauth2/metadata",
|
|
2402
2523
|
{
|
|
2403
2524
|
headers: {
|
|
@@ -2414,21 +2535,33 @@ var mailchimpApi = {
|
|
|
2414
2535
|
};
|
|
2415
2536
|
|
|
2416
2537
|
// src/apis/integrations/shopify/api.ts
|
|
2417
|
-
var
|
|
2538
|
+
var import_axios16 = __toESM(require("axios"));
|
|
2418
2539
|
|
|
2419
2540
|
// src/apis/integrations/shopify/instance.ts
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2541
|
+
var import_axios15 = __toESM(require("axios"));
|
|
2542
|
+
var ShopifyApiError = class extends ApiErrorBase {
|
|
2543
|
+
constructor() {
|
|
2544
|
+
super(...arguments);
|
|
2545
|
+
this.name = "shopify";
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
var shopifyClientInstance = import_axios15.default.create();
|
|
2422
2549
|
shopifyClientInstance.interceptors.response.use(
|
|
2423
2550
|
(r) => r,
|
|
2424
2551
|
(error) => {
|
|
2425
|
-
var _a;
|
|
2426
|
-
if (
|
|
2552
|
+
var _a, _b, _c, _d;
|
|
2553
|
+
if (import_axios15.default.isAxiosError(error)) {
|
|
2427
2554
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2428
2555
|
throw new UnauthorizeApiError("shopify");
|
|
2429
2556
|
}
|
|
2430
2557
|
}
|
|
2431
|
-
|
|
2558
|
+
return Promise.reject(
|
|
2559
|
+
new ShopifyApiError(
|
|
2560
|
+
error.message,
|
|
2561
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2562
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2563
|
+
)
|
|
2564
|
+
);
|
|
2432
2565
|
}
|
|
2433
2566
|
);
|
|
2434
2567
|
var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2024-04`;
|
|
@@ -2476,10 +2609,11 @@ function updateShopifyClient(token, shop) {
|
|
|
2476
2609
|
|
|
2477
2610
|
// src/apis/integrations/shopify/webhooks/api.ts
|
|
2478
2611
|
var shopifyWebhooksApi = {
|
|
2479
|
-
list(authorization) {
|
|
2612
|
+
list(options, authorization) {
|
|
2480
2613
|
return __async(this, null, function* () {
|
|
2614
|
+
const params = new URLSearchParams(options);
|
|
2481
2615
|
const response = yield shopifyClientInstance.get(
|
|
2482
|
-
`/webhooks.json`,
|
|
2616
|
+
`/webhooks.json?${params.toString()}`,
|
|
2483
2617
|
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2484
2618
|
ensureAuthorizationToken: true
|
|
2485
2619
|
}))
|
|
@@ -2500,6 +2634,16 @@ var shopifyWebhooksApi = {
|
|
|
2500
2634
|
);
|
|
2501
2635
|
return response.data;
|
|
2502
2636
|
});
|
|
2637
|
+
},
|
|
2638
|
+
unregister(webhookId, authorization) {
|
|
2639
|
+
return __async(this, null, function* () {
|
|
2640
|
+
yield shopifyClientInstance.delete(
|
|
2641
|
+
`/webhooks/${webhookId}.json`,
|
|
2642
|
+
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2643
|
+
ensureAuthorizationToken: true
|
|
2644
|
+
}))
|
|
2645
|
+
);
|
|
2646
|
+
});
|
|
2503
2647
|
}
|
|
2504
2648
|
};
|
|
2505
2649
|
|
|
@@ -2516,7 +2660,7 @@ var shopifyApi = {
|
|
|
2516
2660
|
redirect_uri: redirectUri,
|
|
2517
2661
|
grant_type: "authorization_code"
|
|
2518
2662
|
});
|
|
2519
|
-
const response = yield
|
|
2663
|
+
const response = yield import_axios16.default.post(
|
|
2520
2664
|
`https://${shop}.myshopify.com/admin/oauth/access_token`,
|
|
2521
2665
|
data,
|
|
2522
2666
|
{
|
|
@@ -2546,7 +2690,7 @@ var integrationsApi = {
|
|
|
2546
2690
|
};
|
|
2547
2691
|
|
|
2548
2692
|
// src/apis/products/livechat/instance.ts
|
|
2549
|
-
var
|
|
2693
|
+
var import_axios17 = __toESM(require("axios"));
|
|
2550
2694
|
var REGION = {
|
|
2551
2695
|
FRA: "fra",
|
|
2552
2696
|
DAL: "dal",
|
|
@@ -2560,7 +2704,7 @@ var getRegion = (token) => {
|
|
|
2560
2704
|
return region;
|
|
2561
2705
|
}
|
|
2562
2706
|
};
|
|
2563
|
-
var livechatClientInstance =
|
|
2707
|
+
var livechatClientInstance = import_axios17.default.create({
|
|
2564
2708
|
baseURL: "https://api.labs.livechatinc.com"
|
|
2565
2709
|
});
|
|
2566
2710
|
function getLiveChatClientAuthorization(req) {
|
|
@@ -3079,14 +3223,14 @@ var productsApi = {
|
|
|
3079
3223
|
};
|
|
3080
3224
|
|
|
3081
3225
|
// src/apis/platform/accounts/instance.ts
|
|
3082
|
-
var
|
|
3226
|
+
var import_axios18 = __toESM(require("axios"));
|
|
3083
3227
|
var AccountsApiError = class extends ApiErrorBase {
|
|
3084
3228
|
constructor() {
|
|
3085
3229
|
super(...arguments);
|
|
3086
3230
|
this.name = "accounts";
|
|
3087
3231
|
}
|
|
3088
3232
|
};
|
|
3089
|
-
var platformAccountsClientInstance =
|
|
3233
|
+
var platformAccountsClientInstance = import_axios18.default.create({
|
|
3090
3234
|
baseURL: "https://accounts.labs.livechatinc.com"
|
|
3091
3235
|
});
|
|
3092
3236
|
platformAccountsClientInstance.interceptors.response.use(
|
|
@@ -3416,14 +3560,14 @@ var platformAccountsApi = {
|
|
|
3416
3560
|
};
|
|
3417
3561
|
|
|
3418
3562
|
// src/apis/platform/dps/instance.ts
|
|
3419
|
-
var
|
|
3563
|
+
var import_axios19 = __toESM(require("axios"));
|
|
3420
3564
|
var DpsApiError = class extends ApiErrorBase {
|
|
3421
3565
|
constructor() {
|
|
3422
3566
|
super(...arguments);
|
|
3423
3567
|
this.name = "dps";
|
|
3424
3568
|
}
|
|
3425
3569
|
};
|
|
3426
|
-
var platformDpsClientInstance =
|
|
3570
|
+
var platformDpsClientInstance = import_axios19.default.create({
|
|
3427
3571
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3428
3572
|
});
|
|
3429
3573
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -4982,7 +5126,7 @@ var platformDpsApi = {
|
|
|
4982
5126
|
};
|
|
4983
5127
|
|
|
4984
5128
|
// src/apis/platform/adapter/instance.ts
|
|
4985
|
-
var
|
|
5129
|
+
var import_axios20 = __toESM(require("axios"));
|
|
4986
5130
|
var REGION2 = {
|
|
4987
5131
|
FRA: "fra",
|
|
4988
5132
|
DAL: "dal",
|
|
@@ -5002,7 +5146,7 @@ var AdapterApiError = class extends ApiErrorBase {
|
|
|
5002
5146
|
this.name = "adapter";
|
|
5003
5147
|
}
|
|
5004
5148
|
};
|
|
5005
|
-
var platformAdapterClientInstance =
|
|
5149
|
+
var platformAdapterClientInstance = import_axios20.default.create({
|
|
5006
5150
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5007
5151
|
headers: {
|
|
5008
5152
|
"Content-Type": "application/json"
|
|
@@ -5653,67 +5797,6 @@ var platformAdapterConductorApi = {
|
|
|
5653
5797
|
}
|
|
5654
5798
|
};
|
|
5655
5799
|
|
|
5656
|
-
// src/apis/integrations/mailchimp/instance.ts
|
|
5657
|
-
var import_axios20 = __toESM(require("axios"));
|
|
5658
|
-
var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
|
|
5659
|
-
var mailchimpClientInstance = import_axios20.default.create({
|
|
5660
|
-
headers: {
|
|
5661
|
-
"Content-Type": "application/json"
|
|
5662
|
-
}
|
|
5663
|
-
});
|
|
5664
|
-
mailchimpClientInstance.interceptors.response.use(
|
|
5665
|
-
(r) => r,
|
|
5666
|
-
(error) => {
|
|
5667
|
-
var _a;
|
|
5668
|
-
if (import_axios20.default.isAxiosError(error)) {
|
|
5669
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
5670
|
-
throw new UnauthorizeApiError("mailchimp");
|
|
5671
|
-
}
|
|
5672
|
-
}
|
|
5673
|
-
throw error;
|
|
5674
|
-
}
|
|
5675
|
-
);
|
|
5676
|
-
function getMailchimpClientAuthorization(req) {
|
|
5677
|
-
return {
|
|
5678
|
-
server: req.headers["mailchimp-server"],
|
|
5679
|
-
token: req.headers["mailchimp-token"]
|
|
5680
|
-
};
|
|
5681
|
-
}
|
|
5682
|
-
function getMailchimpClientConfig(options = {}) {
|
|
5683
|
-
var _a, _b;
|
|
5684
|
-
const currentBaseUrl = mailchimpClientInstance.defaults.baseURL;
|
|
5685
|
-
const currentHeaders = mailchimpClientInstance.defaults.headers;
|
|
5686
|
-
const config = {
|
|
5687
|
-
baseUrl: (_a = options.server ? getMailchimpClientUrl(options.server) : void 0) != null ? _a : currentBaseUrl,
|
|
5688
|
-
authorization: (_b = options.token ? `Bearer ${options.token}` : void 0) != null ? _b : currentHeaders.Authorization
|
|
5689
|
-
};
|
|
5690
|
-
if (options.ensureAuthorizationToken && (!config.authorization || !config.baseUrl)) {
|
|
5691
|
-
throw new UnauthorizeApiError("mailchimp");
|
|
5692
|
-
}
|
|
5693
|
-
return {
|
|
5694
|
-
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
5695
|
-
};
|
|
5696
|
-
}
|
|
5697
|
-
function initMailchimpClient(token, server) {
|
|
5698
|
-
if (token && server) {
|
|
5699
|
-
updateMailchimpClient(token);
|
|
5700
|
-
}
|
|
5701
|
-
}
|
|
5702
|
-
function updateMailchimpClient(token, server) {
|
|
5703
|
-
const defaults = mailchimpClientInstance.defaults;
|
|
5704
|
-
const headers = defaults.headers;
|
|
5705
|
-
if (token) {
|
|
5706
|
-
headers.Authorization = `Bearer ${token}`;
|
|
5707
|
-
} else {
|
|
5708
|
-
delete headers.Authorization;
|
|
5709
|
-
}
|
|
5710
|
-
if (server) {
|
|
5711
|
-
defaults.baseURL = getMailchimpClientUrl(server);
|
|
5712
|
-
} else {
|
|
5713
|
-
delete defaults.baseURL;
|
|
5714
|
-
}
|
|
5715
|
-
}
|
|
5716
|
-
|
|
5717
5800
|
// src/apis/platform/billing/instance.ts
|
|
5718
5801
|
var import_axios21 = __toESM(require("axios"));
|
|
5719
5802
|
var platformBillingClientInstance = import_axios21.default.create({
|
|
@@ -5978,6 +6061,8 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
5978
6061
|
AdapterApiError,
|
|
5979
6062
|
ApiErrorBase,
|
|
5980
6063
|
DpsApiError,
|
|
6064
|
+
MailchimpApiError,
|
|
6065
|
+
ShopifyApiError,
|
|
5981
6066
|
UnauthorizeApiError,
|
|
5982
6067
|
allAppTemplates,
|
|
5983
6068
|
api,
|
package/dist/index.mjs
CHANGED
|
@@ -2250,8 +2250,127 @@ var neonApi = {
|
|
|
2250
2250
|
};
|
|
2251
2251
|
|
|
2252
2252
|
// src/apis/integrations/mailchimp/api.ts
|
|
2253
|
+
import axios12 from "axios";
|
|
2254
|
+
|
|
2255
|
+
// src/apis/integrations/mailchimp/instance.ts
|
|
2253
2256
|
import axios11 from "axios";
|
|
2257
|
+
var MailchimpApiError = class extends ApiErrorBase {
|
|
2258
|
+
constructor() {
|
|
2259
|
+
super(...arguments);
|
|
2260
|
+
this.name = "mailchimp";
|
|
2261
|
+
}
|
|
2262
|
+
};
|
|
2263
|
+
var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
|
|
2264
|
+
var mailchimpClientInstance = axios11.create({
|
|
2265
|
+
headers: {
|
|
2266
|
+
"Content-Type": "application/json"
|
|
2267
|
+
}
|
|
2268
|
+
});
|
|
2269
|
+
mailchimpClientInstance.interceptors.response.use(
|
|
2270
|
+
(r) => r,
|
|
2271
|
+
(error) => {
|
|
2272
|
+
var _a, _b, _c, _d;
|
|
2273
|
+
if (axios11.isAxiosError(error)) {
|
|
2274
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2275
|
+
throw new UnauthorizeApiError("mailchimp");
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
return Promise.reject(
|
|
2279
|
+
new MailchimpApiError(
|
|
2280
|
+
error.message,
|
|
2281
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2282
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2283
|
+
)
|
|
2284
|
+
);
|
|
2285
|
+
}
|
|
2286
|
+
);
|
|
2287
|
+
function getMailchimpClientAuthorization(req) {
|
|
2288
|
+
return {
|
|
2289
|
+
server: req.headers["mailchimp-server"],
|
|
2290
|
+
token: req.headers["mailchimp-token"]
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
function getMailchimpClientConfig(options = {}) {
|
|
2294
|
+
var _a, _b;
|
|
2295
|
+
const currentBaseUrl = mailchimpClientInstance.defaults.baseURL;
|
|
2296
|
+
const currentHeaders = mailchimpClientInstance.defaults.headers;
|
|
2297
|
+
const config = {
|
|
2298
|
+
baseUrl: (_a = options.server ? getMailchimpClientUrl(options.server) : void 0) != null ? _a : currentBaseUrl,
|
|
2299
|
+
authorization: (_b = options.token ? `Bearer ${options.token}` : void 0) != null ? _b : currentHeaders.Authorization
|
|
2300
|
+
};
|
|
2301
|
+
if (options.ensureAuthorizationToken && (!config.authorization || !config.baseUrl)) {
|
|
2302
|
+
throw new UnauthorizeApiError("mailchimp");
|
|
2303
|
+
}
|
|
2304
|
+
return {
|
|
2305
|
+
baseURL: config.baseUrl,
|
|
2306
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
function initMailchimpClient(token, server) {
|
|
2310
|
+
if (token && server) {
|
|
2311
|
+
updateMailchimpClient(token);
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
function updateMailchimpClient(token, server) {
|
|
2315
|
+
const defaults = mailchimpClientInstance.defaults;
|
|
2316
|
+
const headers = defaults.headers;
|
|
2317
|
+
if (token) {
|
|
2318
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2319
|
+
} else {
|
|
2320
|
+
delete headers.Authorization;
|
|
2321
|
+
}
|
|
2322
|
+
if (server) {
|
|
2323
|
+
defaults.baseURL = getMailchimpClientUrl(server);
|
|
2324
|
+
} else {
|
|
2325
|
+
delete defaults.baseURL;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
// src/apis/integrations/mailchimp/lists/webhooks/api.ts
|
|
2330
|
+
var mailchimpListsWebhooksApi = {
|
|
2331
|
+
list(listId, authorization) {
|
|
2332
|
+
return __async(this, null, function* () {
|
|
2333
|
+
const response = yield mailchimpClientInstance.get(
|
|
2334
|
+
`/lists/${listId}/webhooks`,
|
|
2335
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2336
|
+
ensureAuthorizationToken: true
|
|
2337
|
+
}))
|
|
2338
|
+
);
|
|
2339
|
+
return response.data;
|
|
2340
|
+
});
|
|
2341
|
+
},
|
|
2342
|
+
add(listId, webhook, authorization) {
|
|
2343
|
+
return __async(this, null, function* () {
|
|
2344
|
+
const response = yield mailchimpClientInstance.post(
|
|
2345
|
+
`/lists/${listId}/webhooks`,
|
|
2346
|
+
webhook,
|
|
2347
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2348
|
+
ensureAuthorizationToken: true
|
|
2349
|
+
}))
|
|
2350
|
+
);
|
|
2351
|
+
return response.data;
|
|
2352
|
+
});
|
|
2353
|
+
},
|
|
2354
|
+
delete(listId, webhookId, authorization) {
|
|
2355
|
+
return __async(this, null, function* () {
|
|
2356
|
+
yield mailchimpClientInstance.delete(
|
|
2357
|
+
`/lists/${listId}/webhooks/${webhookId}`,
|
|
2358
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2359
|
+
ensureAuthorizationToken: true
|
|
2360
|
+
}))
|
|
2361
|
+
);
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
|
|
2366
|
+
// src/apis/integrations/mailchimp/lists/api.ts
|
|
2367
|
+
var mailchimpListsApi = {
|
|
2368
|
+
webhooks: mailchimpListsWebhooksApi
|
|
2369
|
+
};
|
|
2370
|
+
|
|
2371
|
+
// src/apis/integrations/mailchimp/api.ts
|
|
2254
2372
|
var mailchimpApi = {
|
|
2373
|
+
lists: mailchimpListsApi,
|
|
2255
2374
|
getToken(code, clientId, clientSecret, redirectUri) {
|
|
2256
2375
|
return __async(this, null, function* () {
|
|
2257
2376
|
var _a;
|
|
@@ -2262,7 +2381,7 @@ var mailchimpApi = {
|
|
|
2262
2381
|
redirect_uri: redirectUri,
|
|
2263
2382
|
grant_type: "authorization_code"
|
|
2264
2383
|
});
|
|
2265
|
-
const tokenResponse = yield
|
|
2384
|
+
const tokenResponse = yield axios12.post(
|
|
2266
2385
|
"https://login.mailchimp.com/oauth2/token",
|
|
2267
2386
|
data,
|
|
2268
2387
|
{
|
|
@@ -2283,7 +2402,7 @@ var mailchimpApi = {
|
|
|
2283
2402
|
return __async(this, arguments, function* ({ token }) {
|
|
2284
2403
|
const {
|
|
2285
2404
|
data: { dc: server }
|
|
2286
|
-
} = yield
|
|
2405
|
+
} = yield axios12.get(
|
|
2287
2406
|
"https://login.mailchimp.com/oauth2/metadata",
|
|
2288
2407
|
{
|
|
2289
2408
|
headers: {
|
|
@@ -2300,21 +2419,33 @@ var mailchimpApi = {
|
|
|
2300
2419
|
};
|
|
2301
2420
|
|
|
2302
2421
|
// src/apis/integrations/shopify/api.ts
|
|
2303
|
-
import
|
|
2422
|
+
import axios14 from "axios";
|
|
2304
2423
|
|
|
2305
2424
|
// src/apis/integrations/shopify/instance.ts
|
|
2306
|
-
import
|
|
2307
|
-
var
|
|
2425
|
+
import axios13 from "axios";
|
|
2426
|
+
var ShopifyApiError = class extends ApiErrorBase {
|
|
2427
|
+
constructor() {
|
|
2428
|
+
super(...arguments);
|
|
2429
|
+
this.name = "shopify";
|
|
2430
|
+
}
|
|
2431
|
+
};
|
|
2432
|
+
var shopifyClientInstance = axios13.create();
|
|
2308
2433
|
shopifyClientInstance.interceptors.response.use(
|
|
2309
2434
|
(r) => r,
|
|
2310
2435
|
(error) => {
|
|
2311
|
-
var _a;
|
|
2312
|
-
if (
|
|
2436
|
+
var _a, _b, _c, _d;
|
|
2437
|
+
if (axios13.isAxiosError(error)) {
|
|
2313
2438
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2314
2439
|
throw new UnauthorizeApiError("shopify");
|
|
2315
2440
|
}
|
|
2316
2441
|
}
|
|
2317
|
-
|
|
2442
|
+
return Promise.reject(
|
|
2443
|
+
new ShopifyApiError(
|
|
2444
|
+
error.message,
|
|
2445
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2446
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2447
|
+
)
|
|
2448
|
+
);
|
|
2318
2449
|
}
|
|
2319
2450
|
);
|
|
2320
2451
|
var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2024-04`;
|
|
@@ -2362,10 +2493,11 @@ function updateShopifyClient(token, shop) {
|
|
|
2362
2493
|
|
|
2363
2494
|
// src/apis/integrations/shopify/webhooks/api.ts
|
|
2364
2495
|
var shopifyWebhooksApi = {
|
|
2365
|
-
list(authorization) {
|
|
2496
|
+
list(options, authorization) {
|
|
2366
2497
|
return __async(this, null, function* () {
|
|
2498
|
+
const params = new URLSearchParams(options);
|
|
2367
2499
|
const response = yield shopifyClientInstance.get(
|
|
2368
|
-
`/webhooks.json`,
|
|
2500
|
+
`/webhooks.json?${params.toString()}`,
|
|
2369
2501
|
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2370
2502
|
ensureAuthorizationToken: true
|
|
2371
2503
|
}))
|
|
@@ -2386,6 +2518,16 @@ var shopifyWebhooksApi = {
|
|
|
2386
2518
|
);
|
|
2387
2519
|
return response.data;
|
|
2388
2520
|
});
|
|
2521
|
+
},
|
|
2522
|
+
unregister(webhookId, authorization) {
|
|
2523
|
+
return __async(this, null, function* () {
|
|
2524
|
+
yield shopifyClientInstance.delete(
|
|
2525
|
+
`/webhooks/${webhookId}.json`,
|
|
2526
|
+
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2527
|
+
ensureAuthorizationToken: true
|
|
2528
|
+
}))
|
|
2529
|
+
);
|
|
2530
|
+
});
|
|
2389
2531
|
}
|
|
2390
2532
|
};
|
|
2391
2533
|
|
|
@@ -2402,7 +2544,7 @@ var shopifyApi = {
|
|
|
2402
2544
|
redirect_uri: redirectUri,
|
|
2403
2545
|
grant_type: "authorization_code"
|
|
2404
2546
|
});
|
|
2405
|
-
const response = yield
|
|
2547
|
+
const response = yield axios14.post(
|
|
2406
2548
|
`https://${shop}.myshopify.com/admin/oauth/access_token`,
|
|
2407
2549
|
data,
|
|
2408
2550
|
{
|
|
@@ -2432,7 +2574,7 @@ var integrationsApi = {
|
|
|
2432
2574
|
};
|
|
2433
2575
|
|
|
2434
2576
|
// src/apis/products/livechat/instance.ts
|
|
2435
|
-
import
|
|
2577
|
+
import axios15 from "axios";
|
|
2436
2578
|
var REGION = {
|
|
2437
2579
|
FRA: "fra",
|
|
2438
2580
|
DAL: "dal",
|
|
@@ -2446,7 +2588,7 @@ var getRegion = (token) => {
|
|
|
2446
2588
|
return region;
|
|
2447
2589
|
}
|
|
2448
2590
|
};
|
|
2449
|
-
var livechatClientInstance =
|
|
2591
|
+
var livechatClientInstance = axios15.create({
|
|
2450
2592
|
baseURL: "https://api.labs.livechatinc.com"
|
|
2451
2593
|
});
|
|
2452
2594
|
function getLiveChatClientAuthorization(req) {
|
|
@@ -2965,14 +3107,14 @@ var productsApi = {
|
|
|
2965
3107
|
};
|
|
2966
3108
|
|
|
2967
3109
|
// src/apis/platform/accounts/instance.ts
|
|
2968
|
-
import
|
|
3110
|
+
import axios16 from "axios";
|
|
2969
3111
|
var AccountsApiError = class extends ApiErrorBase {
|
|
2970
3112
|
constructor() {
|
|
2971
3113
|
super(...arguments);
|
|
2972
3114
|
this.name = "accounts";
|
|
2973
3115
|
}
|
|
2974
3116
|
};
|
|
2975
|
-
var platformAccountsClientInstance =
|
|
3117
|
+
var platformAccountsClientInstance = axios16.create({
|
|
2976
3118
|
baseURL: "https://accounts.labs.livechatinc.com"
|
|
2977
3119
|
});
|
|
2978
3120
|
platformAccountsClientInstance.interceptors.response.use(
|
|
@@ -3302,14 +3444,14 @@ var platformAccountsApi = {
|
|
|
3302
3444
|
};
|
|
3303
3445
|
|
|
3304
3446
|
// src/apis/platform/dps/instance.ts
|
|
3305
|
-
import
|
|
3447
|
+
import axios17 from "axios";
|
|
3306
3448
|
var DpsApiError = class extends ApiErrorBase {
|
|
3307
3449
|
constructor() {
|
|
3308
3450
|
super(...arguments);
|
|
3309
3451
|
this.name = "dps";
|
|
3310
3452
|
}
|
|
3311
3453
|
};
|
|
3312
|
-
var platformDpsClientInstance =
|
|
3454
|
+
var platformDpsClientInstance = axios17.create({
|
|
3313
3455
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3314
3456
|
});
|
|
3315
3457
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -4868,7 +5010,7 @@ var platformDpsApi = {
|
|
|
4868
5010
|
};
|
|
4869
5011
|
|
|
4870
5012
|
// src/apis/platform/adapter/instance.ts
|
|
4871
|
-
import
|
|
5013
|
+
import axios18 from "axios";
|
|
4872
5014
|
var REGION2 = {
|
|
4873
5015
|
FRA: "fra",
|
|
4874
5016
|
DAL: "dal",
|
|
@@ -4888,7 +5030,7 @@ var AdapterApiError = class extends ApiErrorBase {
|
|
|
4888
5030
|
this.name = "adapter";
|
|
4889
5031
|
}
|
|
4890
5032
|
};
|
|
4891
|
-
var platformAdapterClientInstance =
|
|
5033
|
+
var platformAdapterClientInstance = axios18.create({
|
|
4892
5034
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
4893
5035
|
headers: {
|
|
4894
5036
|
"Content-Type": "application/json"
|
|
@@ -5539,67 +5681,6 @@ var platformAdapterConductorApi = {
|
|
|
5539
5681
|
}
|
|
5540
5682
|
};
|
|
5541
5683
|
|
|
5542
|
-
// src/apis/integrations/mailchimp/instance.ts
|
|
5543
|
-
import axios18 from "axios";
|
|
5544
|
-
var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
|
|
5545
|
-
var mailchimpClientInstance = axios18.create({
|
|
5546
|
-
headers: {
|
|
5547
|
-
"Content-Type": "application/json"
|
|
5548
|
-
}
|
|
5549
|
-
});
|
|
5550
|
-
mailchimpClientInstance.interceptors.response.use(
|
|
5551
|
-
(r) => r,
|
|
5552
|
-
(error) => {
|
|
5553
|
-
var _a;
|
|
5554
|
-
if (axios18.isAxiosError(error)) {
|
|
5555
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
5556
|
-
throw new UnauthorizeApiError("mailchimp");
|
|
5557
|
-
}
|
|
5558
|
-
}
|
|
5559
|
-
throw error;
|
|
5560
|
-
}
|
|
5561
|
-
);
|
|
5562
|
-
function getMailchimpClientAuthorization(req) {
|
|
5563
|
-
return {
|
|
5564
|
-
server: req.headers["mailchimp-server"],
|
|
5565
|
-
token: req.headers["mailchimp-token"]
|
|
5566
|
-
};
|
|
5567
|
-
}
|
|
5568
|
-
function getMailchimpClientConfig(options = {}) {
|
|
5569
|
-
var _a, _b;
|
|
5570
|
-
const currentBaseUrl = mailchimpClientInstance.defaults.baseURL;
|
|
5571
|
-
const currentHeaders = mailchimpClientInstance.defaults.headers;
|
|
5572
|
-
const config = {
|
|
5573
|
-
baseUrl: (_a = options.server ? getMailchimpClientUrl(options.server) : void 0) != null ? _a : currentBaseUrl,
|
|
5574
|
-
authorization: (_b = options.token ? `Bearer ${options.token}` : void 0) != null ? _b : currentHeaders.Authorization
|
|
5575
|
-
};
|
|
5576
|
-
if (options.ensureAuthorizationToken && (!config.authorization || !config.baseUrl)) {
|
|
5577
|
-
throw new UnauthorizeApiError("mailchimp");
|
|
5578
|
-
}
|
|
5579
|
-
return {
|
|
5580
|
-
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
5581
|
-
};
|
|
5582
|
-
}
|
|
5583
|
-
function initMailchimpClient(token, server) {
|
|
5584
|
-
if (token && server) {
|
|
5585
|
-
updateMailchimpClient(token);
|
|
5586
|
-
}
|
|
5587
|
-
}
|
|
5588
|
-
function updateMailchimpClient(token, server) {
|
|
5589
|
-
const defaults = mailchimpClientInstance.defaults;
|
|
5590
|
-
const headers = defaults.headers;
|
|
5591
|
-
if (token) {
|
|
5592
|
-
headers.Authorization = `Bearer ${token}`;
|
|
5593
|
-
} else {
|
|
5594
|
-
delete headers.Authorization;
|
|
5595
|
-
}
|
|
5596
|
-
if (server) {
|
|
5597
|
-
defaults.baseURL = getMailchimpClientUrl(server);
|
|
5598
|
-
} else {
|
|
5599
|
-
delete defaults.baseURL;
|
|
5600
|
-
}
|
|
5601
|
-
}
|
|
5602
|
-
|
|
5603
5684
|
// src/apis/platform/billing/instance.ts
|
|
5604
5685
|
import axios19 from "axios";
|
|
5605
5686
|
var platformBillingClientInstance = axios19.create({
|
|
@@ -5863,6 +5944,8 @@ export {
|
|
|
5863
5944
|
AdapterApiError,
|
|
5864
5945
|
ApiErrorBase,
|
|
5865
5946
|
DpsApiError,
|
|
5947
|
+
MailchimpApiError,
|
|
5948
|
+
ShopifyApiError,
|
|
5866
5949
|
UnauthorizeApiError,
|
|
5867
5950
|
allAppTemplates,
|
|
5868
5951
|
api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/developer-studio-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.46",
|
|
4
4
|
"description": "This project is API for LiveChat Developer Studio.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"typescript": "^5.1.6",
|
|
22
22
|
"eslint-config-custom": "0.0.7",
|
|
23
23
|
"tsconfig": "0.0.1",
|
|
24
|
-
"utils": "0.0.
|
|
24
|
+
"utils": "0.0.4"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsup",
|