@livechat/developer-studio-api 3.0.44 → 3.0.45
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 +166 -80
- package/dist/index.mjs +164 -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,128 @@ 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
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
function initMailchimpClient(token, server) {
|
|
2425
|
+
if (token && server) {
|
|
2426
|
+
updateMailchimpClient(token);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
function updateMailchimpClient(token, server) {
|
|
2430
|
+
const defaults = mailchimpClientInstance.defaults;
|
|
2431
|
+
const headers = defaults.headers;
|
|
2432
|
+
if (token) {
|
|
2433
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2434
|
+
} else {
|
|
2435
|
+
delete headers.Authorization;
|
|
2436
|
+
}
|
|
2437
|
+
if (server) {
|
|
2438
|
+
defaults.baseURL = getMailchimpClientUrl(server);
|
|
2439
|
+
} else {
|
|
2440
|
+
delete defaults.baseURL;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
// src/apis/integrations/mailchimp/lists/webhooks/api.ts
|
|
2445
|
+
var mailchimpListsWebhooksApi = {
|
|
2446
|
+
list(listId, authorization) {
|
|
2447
|
+
return __async(this, null, function* () {
|
|
2448
|
+
const response = yield mailchimpClientInstance.get(
|
|
2449
|
+
`/lists/${listId}/webhooks`,
|
|
2450
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2451
|
+
ensureAuthorizationToken: true
|
|
2452
|
+
}))
|
|
2453
|
+
);
|
|
2454
|
+
return response.data;
|
|
2455
|
+
});
|
|
2456
|
+
},
|
|
2457
|
+
add(listId, webhook, authorization) {
|
|
2458
|
+
return __async(this, null, function* () {
|
|
2459
|
+
const response = yield mailchimpClientInstance.post(
|
|
2460
|
+
`/list/${listId}/webhooks`,
|
|
2461
|
+
{
|
|
2462
|
+
webhook
|
|
2463
|
+
},
|
|
2464
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2465
|
+
ensureAuthorizationToken: true
|
|
2466
|
+
}))
|
|
2467
|
+
);
|
|
2468
|
+
return response.data;
|
|
2469
|
+
});
|
|
2470
|
+
},
|
|
2471
|
+
delete(listId, webhookId, authorization) {
|
|
2472
|
+
return __async(this, null, function* () {
|
|
2473
|
+
yield mailchimpClientInstance.delete(
|
|
2474
|
+
`/lists/${listId}/webhooks/${webhookId}`,
|
|
2475
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2476
|
+
ensureAuthorizationToken: true
|
|
2477
|
+
}))
|
|
2478
|
+
);
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
|
|
2483
|
+
// src/apis/integrations/mailchimp/lists/api.ts
|
|
2484
|
+
var mailchimpListsApi = {
|
|
2485
|
+
webhooks: mailchimpListsWebhooksApi
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
// src/apis/integrations/mailchimp/api.ts
|
|
2368
2489
|
var mailchimpApi = {
|
|
2490
|
+
lists: mailchimpListsApi,
|
|
2369
2491
|
getToken(code, clientId, clientSecret, redirectUri) {
|
|
2370
2492
|
return __async(this, null, function* () {
|
|
2371
2493
|
var _a;
|
|
@@ -2376,7 +2498,7 @@ var mailchimpApi = {
|
|
|
2376
2498
|
redirect_uri: redirectUri,
|
|
2377
2499
|
grant_type: "authorization_code"
|
|
2378
2500
|
});
|
|
2379
|
-
const tokenResponse = yield
|
|
2501
|
+
const tokenResponse = yield import_axios14.default.post(
|
|
2380
2502
|
"https://login.mailchimp.com/oauth2/token",
|
|
2381
2503
|
data,
|
|
2382
2504
|
{
|
|
@@ -2397,7 +2519,7 @@ var mailchimpApi = {
|
|
|
2397
2519
|
return __async(this, arguments, function* ({ token }) {
|
|
2398
2520
|
const {
|
|
2399
2521
|
data: { dc: server }
|
|
2400
|
-
} = yield
|
|
2522
|
+
} = yield import_axios14.default.get(
|
|
2401
2523
|
"https://login.mailchimp.com/oauth2/metadata",
|
|
2402
2524
|
{
|
|
2403
2525
|
headers: {
|
|
@@ -2414,21 +2536,33 @@ var mailchimpApi = {
|
|
|
2414
2536
|
};
|
|
2415
2537
|
|
|
2416
2538
|
// src/apis/integrations/shopify/api.ts
|
|
2417
|
-
var
|
|
2539
|
+
var import_axios16 = __toESM(require("axios"));
|
|
2418
2540
|
|
|
2419
2541
|
// src/apis/integrations/shopify/instance.ts
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2542
|
+
var import_axios15 = __toESM(require("axios"));
|
|
2543
|
+
var ShopifyApiError = class extends ApiErrorBase {
|
|
2544
|
+
constructor() {
|
|
2545
|
+
super(...arguments);
|
|
2546
|
+
this.name = "shopify";
|
|
2547
|
+
}
|
|
2548
|
+
};
|
|
2549
|
+
var shopifyClientInstance = import_axios15.default.create();
|
|
2422
2550
|
shopifyClientInstance.interceptors.response.use(
|
|
2423
2551
|
(r) => r,
|
|
2424
2552
|
(error) => {
|
|
2425
|
-
var _a;
|
|
2426
|
-
if (
|
|
2553
|
+
var _a, _b, _c, _d;
|
|
2554
|
+
if (import_axios15.default.isAxiosError(error)) {
|
|
2427
2555
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2428
2556
|
throw new UnauthorizeApiError("shopify");
|
|
2429
2557
|
}
|
|
2430
2558
|
}
|
|
2431
|
-
|
|
2559
|
+
return Promise.reject(
|
|
2560
|
+
new ShopifyApiError(
|
|
2561
|
+
error.message,
|
|
2562
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2563
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2564
|
+
)
|
|
2565
|
+
);
|
|
2432
2566
|
}
|
|
2433
2567
|
);
|
|
2434
2568
|
var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2024-04`;
|
|
@@ -2476,10 +2610,11 @@ function updateShopifyClient(token, shop) {
|
|
|
2476
2610
|
|
|
2477
2611
|
// src/apis/integrations/shopify/webhooks/api.ts
|
|
2478
2612
|
var shopifyWebhooksApi = {
|
|
2479
|
-
list(authorization) {
|
|
2613
|
+
list(options, authorization) {
|
|
2480
2614
|
return __async(this, null, function* () {
|
|
2615
|
+
const params = new URLSearchParams(options);
|
|
2481
2616
|
const response = yield shopifyClientInstance.get(
|
|
2482
|
-
`/webhooks.json`,
|
|
2617
|
+
`/webhooks.json?${params.toString()}`,
|
|
2483
2618
|
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2484
2619
|
ensureAuthorizationToken: true
|
|
2485
2620
|
}))
|
|
@@ -2500,6 +2635,16 @@ var shopifyWebhooksApi = {
|
|
|
2500
2635
|
);
|
|
2501
2636
|
return response.data;
|
|
2502
2637
|
});
|
|
2638
|
+
},
|
|
2639
|
+
unregister(webhookId, authorization) {
|
|
2640
|
+
return __async(this, null, function* () {
|
|
2641
|
+
yield shopifyClientInstance.delete(
|
|
2642
|
+
`/webhooks/${webhookId}.json`,
|
|
2643
|
+
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2644
|
+
ensureAuthorizationToken: true
|
|
2645
|
+
}))
|
|
2646
|
+
);
|
|
2647
|
+
});
|
|
2503
2648
|
}
|
|
2504
2649
|
};
|
|
2505
2650
|
|
|
@@ -2516,7 +2661,7 @@ var shopifyApi = {
|
|
|
2516
2661
|
redirect_uri: redirectUri,
|
|
2517
2662
|
grant_type: "authorization_code"
|
|
2518
2663
|
});
|
|
2519
|
-
const response = yield
|
|
2664
|
+
const response = yield import_axios16.default.post(
|
|
2520
2665
|
`https://${shop}.myshopify.com/admin/oauth/access_token`,
|
|
2521
2666
|
data,
|
|
2522
2667
|
{
|
|
@@ -2546,7 +2691,7 @@ var integrationsApi = {
|
|
|
2546
2691
|
};
|
|
2547
2692
|
|
|
2548
2693
|
// src/apis/products/livechat/instance.ts
|
|
2549
|
-
var
|
|
2694
|
+
var import_axios17 = __toESM(require("axios"));
|
|
2550
2695
|
var REGION = {
|
|
2551
2696
|
FRA: "fra",
|
|
2552
2697
|
DAL: "dal",
|
|
@@ -2560,7 +2705,7 @@ var getRegion = (token) => {
|
|
|
2560
2705
|
return region;
|
|
2561
2706
|
}
|
|
2562
2707
|
};
|
|
2563
|
-
var livechatClientInstance =
|
|
2708
|
+
var livechatClientInstance = import_axios17.default.create({
|
|
2564
2709
|
baseURL: "https://api.labs.livechatinc.com"
|
|
2565
2710
|
});
|
|
2566
2711
|
function getLiveChatClientAuthorization(req) {
|
|
@@ -3079,14 +3224,14 @@ var productsApi = {
|
|
|
3079
3224
|
};
|
|
3080
3225
|
|
|
3081
3226
|
// src/apis/platform/accounts/instance.ts
|
|
3082
|
-
var
|
|
3227
|
+
var import_axios18 = __toESM(require("axios"));
|
|
3083
3228
|
var AccountsApiError = class extends ApiErrorBase {
|
|
3084
3229
|
constructor() {
|
|
3085
3230
|
super(...arguments);
|
|
3086
3231
|
this.name = "accounts";
|
|
3087
3232
|
}
|
|
3088
3233
|
};
|
|
3089
|
-
var platformAccountsClientInstance =
|
|
3234
|
+
var platformAccountsClientInstance = import_axios18.default.create({
|
|
3090
3235
|
baseURL: "https://accounts.labs.livechatinc.com"
|
|
3091
3236
|
});
|
|
3092
3237
|
platformAccountsClientInstance.interceptors.response.use(
|
|
@@ -3416,14 +3561,14 @@ var platformAccountsApi = {
|
|
|
3416
3561
|
};
|
|
3417
3562
|
|
|
3418
3563
|
// src/apis/platform/dps/instance.ts
|
|
3419
|
-
var
|
|
3564
|
+
var import_axios19 = __toESM(require("axios"));
|
|
3420
3565
|
var DpsApiError = class extends ApiErrorBase {
|
|
3421
3566
|
constructor() {
|
|
3422
3567
|
super(...arguments);
|
|
3423
3568
|
this.name = "dps";
|
|
3424
3569
|
}
|
|
3425
3570
|
};
|
|
3426
|
-
var platformDpsClientInstance =
|
|
3571
|
+
var platformDpsClientInstance = import_axios19.default.create({
|
|
3427
3572
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3428
3573
|
});
|
|
3429
3574
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -4982,7 +5127,7 @@ var platformDpsApi = {
|
|
|
4982
5127
|
};
|
|
4983
5128
|
|
|
4984
5129
|
// src/apis/platform/adapter/instance.ts
|
|
4985
|
-
var
|
|
5130
|
+
var import_axios20 = __toESM(require("axios"));
|
|
4986
5131
|
var REGION2 = {
|
|
4987
5132
|
FRA: "fra",
|
|
4988
5133
|
DAL: "dal",
|
|
@@ -5002,7 +5147,7 @@ var AdapterApiError = class extends ApiErrorBase {
|
|
|
5002
5147
|
this.name = "adapter";
|
|
5003
5148
|
}
|
|
5004
5149
|
};
|
|
5005
|
-
var platformAdapterClientInstance =
|
|
5150
|
+
var platformAdapterClientInstance = import_axios20.default.create({
|
|
5006
5151
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5007
5152
|
headers: {
|
|
5008
5153
|
"Content-Type": "application/json"
|
|
@@ -5653,67 +5798,6 @@ var platformAdapterConductorApi = {
|
|
|
5653
5798
|
}
|
|
5654
5799
|
};
|
|
5655
5800
|
|
|
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
5801
|
// src/apis/platform/billing/instance.ts
|
|
5718
5802
|
var import_axios21 = __toESM(require("axios"));
|
|
5719
5803
|
var platformBillingClientInstance = import_axios21.default.create({
|
|
@@ -5978,6 +6062,8 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
|
|
|
5978
6062
|
AdapterApiError,
|
|
5979
6063
|
ApiErrorBase,
|
|
5980
6064
|
DpsApiError,
|
|
6065
|
+
MailchimpApiError,
|
|
6066
|
+
ShopifyApiError,
|
|
5981
6067
|
UnauthorizeApiError,
|
|
5982
6068
|
allAppTemplates,
|
|
5983
6069
|
api,
|
package/dist/index.mjs
CHANGED
|
@@ -2250,8 +2250,128 @@ 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
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
function initMailchimpClient(token, server) {
|
|
2309
|
+
if (token && server) {
|
|
2310
|
+
updateMailchimpClient(token);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
function updateMailchimpClient(token, server) {
|
|
2314
|
+
const defaults = mailchimpClientInstance.defaults;
|
|
2315
|
+
const headers = defaults.headers;
|
|
2316
|
+
if (token) {
|
|
2317
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2318
|
+
} else {
|
|
2319
|
+
delete headers.Authorization;
|
|
2320
|
+
}
|
|
2321
|
+
if (server) {
|
|
2322
|
+
defaults.baseURL = getMailchimpClientUrl(server);
|
|
2323
|
+
} else {
|
|
2324
|
+
delete defaults.baseURL;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
// src/apis/integrations/mailchimp/lists/webhooks/api.ts
|
|
2329
|
+
var mailchimpListsWebhooksApi = {
|
|
2330
|
+
list(listId, authorization) {
|
|
2331
|
+
return __async(this, null, function* () {
|
|
2332
|
+
const response = yield mailchimpClientInstance.get(
|
|
2333
|
+
`/lists/${listId}/webhooks`,
|
|
2334
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2335
|
+
ensureAuthorizationToken: true
|
|
2336
|
+
}))
|
|
2337
|
+
);
|
|
2338
|
+
return response.data;
|
|
2339
|
+
});
|
|
2340
|
+
},
|
|
2341
|
+
add(listId, webhook, authorization) {
|
|
2342
|
+
return __async(this, null, function* () {
|
|
2343
|
+
const response = yield mailchimpClientInstance.post(
|
|
2344
|
+
`/list/${listId}/webhooks`,
|
|
2345
|
+
{
|
|
2346
|
+
webhook
|
|
2347
|
+
},
|
|
2348
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2349
|
+
ensureAuthorizationToken: true
|
|
2350
|
+
}))
|
|
2351
|
+
);
|
|
2352
|
+
return response.data;
|
|
2353
|
+
});
|
|
2354
|
+
},
|
|
2355
|
+
delete(listId, webhookId, authorization) {
|
|
2356
|
+
return __async(this, null, function* () {
|
|
2357
|
+
yield mailchimpClientInstance.delete(
|
|
2358
|
+
`/lists/${listId}/webhooks/${webhookId}`,
|
|
2359
|
+
getMailchimpClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2360
|
+
ensureAuthorizationToken: true
|
|
2361
|
+
}))
|
|
2362
|
+
);
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
};
|
|
2366
|
+
|
|
2367
|
+
// src/apis/integrations/mailchimp/lists/api.ts
|
|
2368
|
+
var mailchimpListsApi = {
|
|
2369
|
+
webhooks: mailchimpListsWebhooksApi
|
|
2370
|
+
};
|
|
2371
|
+
|
|
2372
|
+
// src/apis/integrations/mailchimp/api.ts
|
|
2254
2373
|
var mailchimpApi = {
|
|
2374
|
+
lists: mailchimpListsApi,
|
|
2255
2375
|
getToken(code, clientId, clientSecret, redirectUri) {
|
|
2256
2376
|
return __async(this, null, function* () {
|
|
2257
2377
|
var _a;
|
|
@@ -2262,7 +2382,7 @@ var mailchimpApi = {
|
|
|
2262
2382
|
redirect_uri: redirectUri,
|
|
2263
2383
|
grant_type: "authorization_code"
|
|
2264
2384
|
});
|
|
2265
|
-
const tokenResponse = yield
|
|
2385
|
+
const tokenResponse = yield axios12.post(
|
|
2266
2386
|
"https://login.mailchimp.com/oauth2/token",
|
|
2267
2387
|
data,
|
|
2268
2388
|
{
|
|
@@ -2283,7 +2403,7 @@ var mailchimpApi = {
|
|
|
2283
2403
|
return __async(this, arguments, function* ({ token }) {
|
|
2284
2404
|
const {
|
|
2285
2405
|
data: { dc: server }
|
|
2286
|
-
} = yield
|
|
2406
|
+
} = yield axios12.get(
|
|
2287
2407
|
"https://login.mailchimp.com/oauth2/metadata",
|
|
2288
2408
|
{
|
|
2289
2409
|
headers: {
|
|
@@ -2300,21 +2420,33 @@ var mailchimpApi = {
|
|
|
2300
2420
|
};
|
|
2301
2421
|
|
|
2302
2422
|
// src/apis/integrations/shopify/api.ts
|
|
2303
|
-
import
|
|
2423
|
+
import axios14 from "axios";
|
|
2304
2424
|
|
|
2305
2425
|
// src/apis/integrations/shopify/instance.ts
|
|
2306
|
-
import
|
|
2307
|
-
var
|
|
2426
|
+
import axios13 from "axios";
|
|
2427
|
+
var ShopifyApiError = class extends ApiErrorBase {
|
|
2428
|
+
constructor() {
|
|
2429
|
+
super(...arguments);
|
|
2430
|
+
this.name = "shopify";
|
|
2431
|
+
}
|
|
2432
|
+
};
|
|
2433
|
+
var shopifyClientInstance = axios13.create();
|
|
2308
2434
|
shopifyClientInstance.interceptors.response.use(
|
|
2309
2435
|
(r) => r,
|
|
2310
2436
|
(error) => {
|
|
2311
|
-
var _a;
|
|
2312
|
-
if (
|
|
2437
|
+
var _a, _b, _c, _d;
|
|
2438
|
+
if (axios13.isAxiosError(error)) {
|
|
2313
2439
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2314
2440
|
throw new UnauthorizeApiError("shopify");
|
|
2315
2441
|
}
|
|
2316
2442
|
}
|
|
2317
|
-
|
|
2443
|
+
return Promise.reject(
|
|
2444
|
+
new ShopifyApiError(
|
|
2445
|
+
error.message,
|
|
2446
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2447
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2448
|
+
)
|
|
2449
|
+
);
|
|
2318
2450
|
}
|
|
2319
2451
|
);
|
|
2320
2452
|
var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2024-04`;
|
|
@@ -2362,10 +2494,11 @@ function updateShopifyClient(token, shop) {
|
|
|
2362
2494
|
|
|
2363
2495
|
// src/apis/integrations/shopify/webhooks/api.ts
|
|
2364
2496
|
var shopifyWebhooksApi = {
|
|
2365
|
-
list(authorization) {
|
|
2497
|
+
list(options, authorization) {
|
|
2366
2498
|
return __async(this, null, function* () {
|
|
2499
|
+
const params = new URLSearchParams(options);
|
|
2367
2500
|
const response = yield shopifyClientInstance.get(
|
|
2368
|
-
`/webhooks.json`,
|
|
2501
|
+
`/webhooks.json?${params.toString()}`,
|
|
2369
2502
|
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2370
2503
|
ensureAuthorizationToken: true
|
|
2371
2504
|
}))
|
|
@@ -2386,6 +2519,16 @@ var shopifyWebhooksApi = {
|
|
|
2386
2519
|
);
|
|
2387
2520
|
return response.data;
|
|
2388
2521
|
});
|
|
2522
|
+
},
|
|
2523
|
+
unregister(webhookId, authorization) {
|
|
2524
|
+
return __async(this, null, function* () {
|
|
2525
|
+
yield shopifyClientInstance.delete(
|
|
2526
|
+
`/webhooks/${webhookId}.json`,
|
|
2527
|
+
getShopifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2528
|
+
ensureAuthorizationToken: true
|
|
2529
|
+
}))
|
|
2530
|
+
);
|
|
2531
|
+
});
|
|
2389
2532
|
}
|
|
2390
2533
|
};
|
|
2391
2534
|
|
|
@@ -2402,7 +2545,7 @@ var shopifyApi = {
|
|
|
2402
2545
|
redirect_uri: redirectUri,
|
|
2403
2546
|
grant_type: "authorization_code"
|
|
2404
2547
|
});
|
|
2405
|
-
const response = yield
|
|
2548
|
+
const response = yield axios14.post(
|
|
2406
2549
|
`https://${shop}.myshopify.com/admin/oauth/access_token`,
|
|
2407
2550
|
data,
|
|
2408
2551
|
{
|
|
@@ -2432,7 +2575,7 @@ var integrationsApi = {
|
|
|
2432
2575
|
};
|
|
2433
2576
|
|
|
2434
2577
|
// src/apis/products/livechat/instance.ts
|
|
2435
|
-
import
|
|
2578
|
+
import axios15 from "axios";
|
|
2436
2579
|
var REGION = {
|
|
2437
2580
|
FRA: "fra",
|
|
2438
2581
|
DAL: "dal",
|
|
@@ -2446,7 +2589,7 @@ var getRegion = (token) => {
|
|
|
2446
2589
|
return region;
|
|
2447
2590
|
}
|
|
2448
2591
|
};
|
|
2449
|
-
var livechatClientInstance =
|
|
2592
|
+
var livechatClientInstance = axios15.create({
|
|
2450
2593
|
baseURL: "https://api.labs.livechatinc.com"
|
|
2451
2594
|
});
|
|
2452
2595
|
function getLiveChatClientAuthorization(req) {
|
|
@@ -2965,14 +3108,14 @@ var productsApi = {
|
|
|
2965
3108
|
};
|
|
2966
3109
|
|
|
2967
3110
|
// src/apis/platform/accounts/instance.ts
|
|
2968
|
-
import
|
|
3111
|
+
import axios16 from "axios";
|
|
2969
3112
|
var AccountsApiError = class extends ApiErrorBase {
|
|
2970
3113
|
constructor() {
|
|
2971
3114
|
super(...arguments);
|
|
2972
3115
|
this.name = "accounts";
|
|
2973
3116
|
}
|
|
2974
3117
|
};
|
|
2975
|
-
var platformAccountsClientInstance =
|
|
3118
|
+
var platformAccountsClientInstance = axios16.create({
|
|
2976
3119
|
baseURL: "https://accounts.labs.livechatinc.com"
|
|
2977
3120
|
});
|
|
2978
3121
|
platformAccountsClientInstance.interceptors.response.use(
|
|
@@ -3302,14 +3445,14 @@ var platformAccountsApi = {
|
|
|
3302
3445
|
};
|
|
3303
3446
|
|
|
3304
3447
|
// src/apis/platform/dps/instance.ts
|
|
3305
|
-
import
|
|
3448
|
+
import axios17 from "axios";
|
|
3306
3449
|
var DpsApiError = class extends ApiErrorBase {
|
|
3307
3450
|
constructor() {
|
|
3308
3451
|
super(...arguments);
|
|
3309
3452
|
this.name = "dps";
|
|
3310
3453
|
}
|
|
3311
3454
|
};
|
|
3312
|
-
var platformDpsClientInstance =
|
|
3455
|
+
var platformDpsClientInstance = axios17.create({
|
|
3313
3456
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3314
3457
|
});
|
|
3315
3458
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -4868,7 +5011,7 @@ var platformDpsApi = {
|
|
|
4868
5011
|
};
|
|
4869
5012
|
|
|
4870
5013
|
// src/apis/platform/adapter/instance.ts
|
|
4871
|
-
import
|
|
5014
|
+
import axios18 from "axios";
|
|
4872
5015
|
var REGION2 = {
|
|
4873
5016
|
FRA: "fra",
|
|
4874
5017
|
DAL: "dal",
|
|
@@ -4888,7 +5031,7 @@ var AdapterApiError = class extends ApiErrorBase {
|
|
|
4888
5031
|
this.name = "adapter";
|
|
4889
5032
|
}
|
|
4890
5033
|
};
|
|
4891
|
-
var platformAdapterClientInstance =
|
|
5034
|
+
var platformAdapterClientInstance = axios18.create({
|
|
4892
5035
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
4893
5036
|
headers: {
|
|
4894
5037
|
"Content-Type": "application/json"
|
|
@@ -5539,67 +5682,6 @@ var platformAdapterConductorApi = {
|
|
|
5539
5682
|
}
|
|
5540
5683
|
};
|
|
5541
5684
|
|
|
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
5685
|
// src/apis/platform/billing/instance.ts
|
|
5604
5686
|
import axios19 from "axios";
|
|
5605
5687
|
var platformBillingClientInstance = axios19.create({
|
|
@@ -5863,6 +5945,8 @@ export {
|
|
|
5863
5945
|
AdapterApiError,
|
|
5864
5946
|
ApiErrorBase,
|
|
5865
5947
|
DpsApiError,
|
|
5948
|
+
MailchimpApiError,
|
|
5949
|
+
ShopifyApiError,
|
|
5866
5950
|
UnauthorizeApiError,
|
|
5867
5951
|
allAppTemplates,
|
|
5868
5952
|
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.45",
|
|
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",
|