import { GetAppInstanceRequest as GetAppInstanceRequest$1, GetAppInstanceResponse as GetAppInstanceResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; /** * An app instance is a specific occurrence of an app on a Wix site. * When a Wix user installs an app, a unique instance is generated for that * specific site. Use the `instanceId` to keep track of the individual data * associated with each app instance. */ interface AppInstance { /** * App instance ID. Useful to keep track of the * data that's associated with the specific instance of your app * installed on a Wix site. */ instanceId?: string; /** App name, as you entered it in the App Dashboard. */ appName?: string; /** Version of your app that's installed on the Wix site. */ appVersion?: string | null; /** * Whether the Wix user has installed a free or paid version of your app * on their site. */ isFree?: boolean; /** * Billing information for the app instance. Available only in case * `{"isFree": false}`. */ billing?: BillingInfo; /** * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions) * that the Wix user has granted your app. You set the list of permissions that * your app requires from the Wix user in your app's Permissions page. */ permissions?: string[]; /** Plans available to this app instance. */ availablePlans?: AvailablePlan[]; /** * ID of the Wix site from which the instance of your app has been cloned. * * All visual settings of the Wix site and app data are duplicated during the * cloning process. Wix also notifies you in case there is any additional * external functionality for the original site. */ originInstanceId?: string | null; /** * __Deprecated__. This parameter will be removed on March 30, 2023. Use * `copiedFromTemplate` instead. * @deprecated */ isOriginSiteTemplate?: boolean; /** Whether this app instance was created when another Wix site was cloned. */ copiedFromTemplate?: boolean; /** Whether this app instance includes a free trial that hasn't started yet. */ freeTrialAvailable?: boolean; } interface BillingInfo { /** Name of the package that the site owner has paid for. */ packageName?: string; /** * Interval of the billing cycle. `ONE_TIME` indicates that the Wix user has * made a single upfront payment without any automatic subscription renewal. * This is primarily for usage credits (for example, 5 SMS) but may occasionally apply * to a one-time setup for the app. */ billingCycle?: PaymentCycleWithLiterals; /** * Date and time the Wix user purchased the app's paid plan or began their free trial. In * `YYYY-MM-DDThh:mm:ss.sssZ` format. */ timeStamp?: string; /** * Date and time the app's current billing cycle ends in * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and * multi-yearly plans. */ expirationDate?: string | null; /** * Whether the app's subscription automatically renews at the end of the * current billing cycle. */ autoRenewing?: boolean | null; /** ID of the invoice for the current billing cycle. */ invoiceId?: string | null; /** * Information about any discounts applied to the app instance's current billing cycle. * If the site owners applied a developer coupon or Wix Voucher * when installing the paid version of your app, this field holds the coupon's * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when * upgrading their Wix subscription. If there is no discount for the * current billing cycle, the field is an empty string. */ source?: string | null; /** Information about the free trial applied, if relevant. */ freeTrialInfo?: FreeTrialInfo; } declare enum PaymentCycle { NO_CYCLE = "NO_CYCLE", MONTHLY = "MONTHLY", YEARLY = "YEARLY", ONE_TIME = "ONE_TIME", TWO_YEARS = "TWO_YEARS", THREE_YEARS = "THREE_YEARS", FOUR_YEARS = "FOUR_YEARS", FIVE_YEARS = "FIVE_YEARS" } /** @enumType */ type PaymentCycleWithLiterals = PaymentCycle | 'NO_CYCLE' | 'MONTHLY' | 'YEARLY' | 'ONE_TIME' | 'TWO_YEARS' | 'THREE_YEARS' | 'FOUR_YEARS' | 'FIVE_YEARS'; interface FreeTrialInfo { /** * Current free trial status. * @readonly */ status?: FreeTrialStatusWithLiterals; /** * When the free trial has ended. Populated only once the free trial is over. * @readonly */ endDate?: Date | null; } declare enum FreeTrialStatus { /** The free trial is currently in progress. */ IN_PROGRESS = "IN_PROGRESS", /** The free trial has ended. */ ENDED = "ENDED", /** No free trial was applied, as none was available. */ NOT_AVAILABLE = "NOT_AVAILABLE" } /** @enumType */ type FreeTrialStatusWithLiterals = FreeTrialStatus | 'IN_PROGRESS' | 'ENDED' | 'NOT_AVAILABLE'; interface AvailablePlan { /** Package name of the available plan. */ packageName?: string; /** Source of the available plan. Can be a bundle or 3rd-party app. */ source?: string; } interface AppInstalled { /** * Unique identifier of the app within the website. * @format GUID */ appId?: string; /** * Instance ID of the app in the original website (relevant only when this site was [duplicated from another site](https://support.wix.com/en/article/duplicating-your-site-1472847)). * @format GUID */ originInstanceId?: string | null; } interface AppRemoved { /** * Unique identifier of the app within the website. * @format GUID */ appId?: string; } interface PaidPlanPurchased { /** Date and time of purchase. */ operationTimeStamp?: Date | null; /** * Purchased app plan. * @maxLength 100 */ vendorProductId?: string; /** Selected payment cycle. */ cycle?: PaymentCycleWithLiterals; /** Plan expiration date. */ expiresOn?: Date | null; /** * Coupon applied to purchase (if relevant). * @maxLength 150 */ couponName?: string | null; /** * Invoice ID. * @maxLength 50 */ invoiceId?: string | null; } interface PaidPlanChanged { /** Date and time of change. */ operationTimeStamp?: Date | null; /** * Newly purchased app plan. * @maxLength 100 */ vendorProductId?: string; /** Newly selected payment cycle. */ cycle?: PaymentCycleWithLiterals; /** * Previous app plan. * @maxLength 100 */ previousVendorProductId?: string | null; /** Previous payment cycle. */ previousCycle?: PaymentCycleWithLiterals; /** * Coupon applied to purchase (if relevant). * @maxLength 150 */ couponName?: string | null; /** * Invoice ID. * @maxLength 50 */ invoiceId?: string | null; } interface PaidPlanAutoRenewalCancelled { /** Date and time of auto-renewal cancellation. */ operationTimeStamp?: Date | null; /** * Current app plan. * @maxLength 100 */ vendorProductId?: string; /** Current payment cycle. */ cycle?: PaymentCycleWithLiterals; /** * Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). * @maxLength 100 */ cancelReason?: string | null; /** * Reason provided by site owner for cancellation (if relevant). * @maxLength 150 */ userReason?: string | null; /** * Cancellation type. * @maxLength 100 */ subscriptionCancellationType?: string | null; /** Whether the cancellation occurred during a free trial. */ cancelledDuringFreeTrial?: FreeTrialPeriodWithLiterals; } declare enum FreeTrialPeriod { /** During a free trial period. */ DURING_FREE_TRIAL = "DURING_FREE_TRIAL", /** Not during a free trial period. */ NOT_DURING_FREE_TRIAL = "NOT_DURING_FREE_TRIAL" } /** @enumType */ type FreeTrialPeriodWithLiterals = FreeTrialPeriod | 'DURING_FREE_TRIAL' | 'NOT_DURING_FREE_TRIAL'; interface PlanTransferred { /** Date and time of transfer. */ operationTimeStamp?: Date | null; /** * Current app plan. * @maxLength 100 */ vendorProductId?: string; /** Selected payment cycle. */ cycle?: PaymentCycleWithLiterals; /** * Invoice ID. * @maxLength 50 */ invoiceId?: string | null; } interface PlanReactivated { /** Date and time of reactivation. */ operationTimeStamp?: Date | null; /** * Current app plan. * @maxLength 100 */ vendorProductId?: string; /** Selected payment cycle. */ cycle?: PaymentCycleWithLiterals; /** Plan expiration date. */ expiresOn?: Date | null; /** * Invoice ID. * @maxLength 50 */ invoiceId?: string | null; /** Reason for reactivation. */ reason?: ReactivationReasonWithLiterals; } declare enum ReactivationReason { /** Reactivation reason unknown. */ REACTIVATION_REASON_UNKNOWN = "REACTIVATION_REASON_UNKNOWN", /** The subscription's auto-renewal is turned on. */ AUTO_RENEW_TURNED_ON = "AUTO_RENEW_TURNED_ON" } /** @enumType */ type ReactivationReasonWithLiterals = ReactivationReason | 'REACTIVATION_REASON_UNKNOWN' | 'AUTO_RENEW_TURNED_ON'; interface PlanConvertedToPaid { /** Date and time of conversion to paid subscription (free-trial ended). */ operationTimeStamp?: Date | null; /** * Current app plan. * @maxLength 100 */ vendorProductId?: string; /** Selected payment cycle. */ cycle?: PaymentCycleWithLiterals; /** Plan expiration date. */ expiresOn?: Date | null; } interface GetAppInstanceRequest { } interface GetAppInstanceResponse { /** Retrieved app instance. */ instance?: AppInstance; /** Information about the site. */ site?: SiteInfo; } interface SiteInfo { /** Display name of the site. */ siteDisplayName?: string | null; /** * 2-letter language code of the site's locale in * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ locale?: string; /** * 3-letter currency code for the site's billing in * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */ paymentCurrency?: string; /** Information about the site's supported languages. */ multilingual?: Multilingual; /** URL of the site. Available only when the site has been published. */ url?: string | null; /** Description of the site. */ description?: string | null; /** Apps made by Wix that are installed on the site. */ installedWixApps?: string[]; /** * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead. * @format EMAIL * @deprecated */ ownerEmail?: string | null; /** * Information about the site's Wix user. Available only when calling * _Get App Instance_ with the __Read Site Owner Email__ permission scope. */ ownerInfo?: OwnerInfo; /** Site ID. */ siteId?: string; /** * Type of Wix user who owns the site. * Available only when calling _Get App Instance_ with the __Read Site User Type__ permission scope. * Supported values: `"Channel DIY"`, `"Channel DIFM"`, `"Enterprise"`. */ siteUserType?: string | null; } interface Multilingual { /** Whether the site supports more than a single language. */ isMultiLingual?: boolean; /** List of supported languages. Returned only when `{"isMultiLingual": true}`. */ supportedLanguages?: SupportedLanguage[]; } interface SupportedLanguage { /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ languageCode?: string; /** Locale. */ locale?: Locale; /** Whether the supported language is the primary language for the site. */ isPrimary?: boolean; /** Language icon. */ countryCode?: string; /** How the language will be resolved. For internal use. */ resolutionMethod?: ResolutionMethodWithLiterals; /** Whether the supported language is the primary language for site visitors. */ isVisitorPrimary?: boolean | null; } interface Locale { /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ languageCode?: string; /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */ country?: string; } declare enum ResolutionMethod { QUERY_PARAM = "QUERY_PARAM", SUBDOMAIN = "SUBDOMAIN", SUBDIRECTORY = "SUBDIRECTORY" } /** @enumType */ type ResolutionMethodWithLiterals = ResolutionMethod | 'QUERY_PARAM' | 'SUBDOMAIN' | 'SUBDIRECTORY'; interface OwnerInfo { /** * Wix user's email address. Identical to the their login email. * @format EMAIL */ email?: string; /** * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`, * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`. * * Whether the Wix user has verified their email and whether they have chosen * to receive email notifications from Wix. */ emailStatus?: string; } interface GetAppInstanceByInstanceIdRequest { /** * ID of the app instance to retrieve. * @format GUID */ instanceId?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function getAppInstance(): __PublicMethodMetaInfo<'GET', {}, GetAppInstanceRequest$1, GetAppInstanceRequest, GetAppInstanceResponse$1, GetAppInstanceResponse>; export { type AccountInfo as AccountInfoOriginal, type AppInstalled as AppInstalledOriginal, type AppInstance as AppInstanceOriginal, type AppRemoved as AppRemovedOriginal, type AvailablePlan as AvailablePlanOriginal, type BillingInfo as BillingInfoOriginal, type FreeTrialInfo as FreeTrialInfoOriginal, FreeTrialPeriod as FreeTrialPeriodOriginal, type FreeTrialPeriodWithLiterals as FreeTrialPeriodWithLiteralsOriginal, FreeTrialStatus as FreeTrialStatusOriginal, type FreeTrialStatusWithLiterals as FreeTrialStatusWithLiteralsOriginal, type GetAppInstanceByInstanceIdRequest as GetAppInstanceByInstanceIdRequestOriginal, type GetAppInstanceRequest as GetAppInstanceRequestOriginal, type GetAppInstanceResponse as GetAppInstanceResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type Locale as LocaleOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type Multilingual as MultilingualOriginal, type OwnerInfo as OwnerInfoOriginal, type PaidPlanAutoRenewalCancelled as PaidPlanAutoRenewalCancelledOriginal, type PaidPlanChanged as PaidPlanChangedOriginal, type PaidPlanPurchased as PaidPlanPurchasedOriginal, PaymentCycle as PaymentCycleOriginal, type PaymentCycleWithLiterals as PaymentCycleWithLiteralsOriginal, type PlanConvertedToPaid as PlanConvertedToPaidOriginal, type PlanReactivated as PlanReactivatedOriginal, type PlanTransferred as PlanTransferredOriginal, ReactivationReason as ReactivationReasonOriginal, type ReactivationReasonWithLiterals as ReactivationReasonWithLiteralsOriginal, ResolutionMethod as ResolutionMethodOriginal, type ResolutionMethodWithLiterals as ResolutionMethodWithLiteralsOriginal, type SiteInfo as SiteInfoOriginal, type SupportedLanguage as SupportedLanguageOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, getAppInstance };