@wix/auto_sdk_app-management_app-instances 1.0.48 → 1.0.49

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.
Files changed (40) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js +16 -18
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/es/index.d.mts +1 -1
  7. package/build/es/index.mjs +16 -18
  8. package/build/es/index.mjs.map +1 -1
  9. package/build/es/index.typings.d.mts +1 -1
  10. package/build/es/index.typings.mjs.map +1 -1
  11. package/build/internal/cjs/index.d.ts +1 -1
  12. package/build/internal/cjs/index.typings.d.ts +1 -1
  13. package/build/internal/es/index.d.mts +1 -1
  14. package/build/internal/es/index.typings.d.mts +1 -1
  15. package/package.json +5 -12
  16. package/build/cjs/schemas.d.ts +0 -81
  17. package/build/cjs/schemas.js +0 -174
  18. package/build/cjs/schemas.js.map +0 -1
  19. package/build/es/schemas.d.mts +0 -81
  20. package/build/es/schemas.mjs +0 -136
  21. package/build/es/schemas.mjs.map +0 -1
  22. package/build/internal/cjs/index.js +0 -415
  23. package/build/internal/cjs/index.js.map +0 -1
  24. package/build/internal/cjs/index.typings.js +0 -265
  25. package/build/internal/cjs/index.typings.js.map +0 -1
  26. package/build/internal/cjs/meta.js +0 -258
  27. package/build/internal/cjs/meta.js.map +0 -1
  28. package/build/internal/cjs/schemas.d.ts +0 -81
  29. package/build/internal/cjs/schemas.js +0 -174
  30. package/build/internal/cjs/schemas.js.map +0 -1
  31. package/build/internal/es/index.mjs +0 -377
  32. package/build/internal/es/index.mjs.map +0 -1
  33. package/build/internal/es/index.typings.mjs +0 -235
  34. package/build/internal/es/index.typings.mjs.map +0 -1
  35. package/build/internal/es/meta.mjs +0 -225
  36. package/build/internal/es/meta.mjs.map +0 -1
  37. package/build/internal/es/schemas.d.mts +0 -81
  38. package/build/internal/es/schemas.mjs +0 -136
  39. package/build/internal/es/schemas.mjs.map +0 -1
  40. package/schemas/package.json +0 -3
@@ -15,7 +15,7 @@ interface GetAppInstanceSignature {
15
15
  * have the __READ SITE OWNER EMAIL__ permission scope in addition to
16
16
  * __MANAGE YOUR APP__.
17
17
  */
18
- (): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 7>>;
18
+ (): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 5>>;
19
19
  }
20
20
  declare const onAppInstanceInstalled$1: EventDefinition<AppInstanceInstalledEnvelope, "AppInstalled">;
21
21
  declare const onAppInstanceRemoved$1: EventDefinition<AppInstanceRemovedEnvelope, "AppRemoved">;
@@ -274,17 +274,17 @@ function getAppInstance3(httpClient) {
274
274
  { httpClient }
275
275
  );
276
276
  }
277
- var onAppInstanceInstalled = (0, import_sdk_types.EventDefinition)(
277
+ var onAppInstanceInstalled = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
278
278
  "AppInstalled",
279
279
  false,
280
280
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(event)
281
281
  )();
282
- var onAppInstanceRemoved = (0, import_sdk_types.EventDefinition)(
282
+ var onAppInstanceRemoved = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
283
283
  "AppRemoved",
284
284
  false,
285
285
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(event)
286
286
  )();
287
- var onAppInstancePaidPlanAutoRenewalCancelled = (0, import_sdk_types.EventDefinition)(
287
+ var onAppInstancePaidPlanAutoRenewalCancelled = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
288
288
  "PaidPlanAutoRenewalCancelled",
289
289
  false,
290
290
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -296,7 +296,7 @@ var onAppInstancePaidPlanAutoRenewalCancelled = (0, import_sdk_types.EventDefini
296
296
  ])
297
297
  )
298
298
  )();
299
- var onAppInstancePaidPlanChanged = (0, import_sdk_types.EventDefinition)(
299
+ var onAppInstancePaidPlanChanged = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
300
300
  "PaidPlanChanged",
301
301
  false,
302
302
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -308,7 +308,7 @@ var onAppInstancePaidPlanChanged = (0, import_sdk_types.EventDefinition)(
308
308
  ])
309
309
  )
310
310
  )();
311
- var onAppInstancePaidPlanPurchased = (0, import_sdk_types.EventDefinition)(
311
+ var onAppInstancePaidPlanPurchased = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
312
312
  "PaidPlanPurchased",
313
313
  false,
314
314
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -323,7 +323,7 @@ var onAppInstancePaidPlanPurchased = (0, import_sdk_types.EventDefinition)(
323
323
  ])
324
324
  )
325
325
  )();
326
- var onAppInstancePlanConvertedToPaid = (0, import_sdk_types.EventDefinition)(
326
+ var onAppInstancePlanConvertedToPaid = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
327
327
  "PlanConvertedToPaid",
328
328
  false,
329
329
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -338,7 +338,7 @@ var onAppInstancePlanConvertedToPaid = (0, import_sdk_types.EventDefinition)(
338
338
  ])
339
339
  )
340
340
  )();
341
- var onAppInstancePlanReactivated = (0, import_sdk_types.EventDefinition)(
341
+ var onAppInstancePlanReactivated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
342
342
  "PlanReactivated",
343
343
  false,
344
344
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -353,7 +353,7 @@ var onAppInstancePlanReactivated = (0, import_sdk_types.EventDefinition)(
353
353
  ])
354
354
  )
355
355
  )();
356
- var onAppInstancePlanTransferred = (0, import_sdk_types.EventDefinition)(
356
+ var onAppInstancePlanTransferred = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
357
357
  "PlanTransferred",
358
358
  false,
359
359
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -370,28 +370,26 @@ var onAppInstancePlanTransferred = (0, import_sdk_types.EventDefinition)(
370
370
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
371
371
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
372
372
  var getAppInstance4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAppInstance3);
373
- var onAppInstanceInstalled2 = (0, import_event_definition_modules.createEventModule)(
373
+ var onAppInstanceInstalled2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
374
374
  onAppInstanceInstalled
375
375
  );
376
- var onAppInstanceRemoved2 = (0, import_event_definition_modules.createEventModule)(
376
+ var onAppInstanceRemoved2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
377
377
  onAppInstanceRemoved
378
378
  );
379
- var onAppInstancePaidPlanAutoRenewalCancelled2 = (0, import_event_definition_modules.createEventModule)(
379
+ var onAppInstancePaidPlanAutoRenewalCancelled2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
380
380
  onAppInstancePaidPlanAutoRenewalCancelled
381
381
  );
382
- var onAppInstancePaidPlanChanged2 = (0, import_event_definition_modules.createEventModule)(
382
+ var onAppInstancePaidPlanChanged2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
383
383
  onAppInstancePaidPlanChanged
384
384
  );
385
- var onAppInstancePaidPlanPurchased2 = (0, import_event_definition_modules.createEventModule)(
385
+ var onAppInstancePaidPlanPurchased2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
386
386
  onAppInstancePaidPlanPurchased
387
387
  );
388
- var onAppInstancePlanConvertedToPaid2 = (0, import_event_definition_modules.createEventModule)(
389
- onAppInstancePlanConvertedToPaid
390
- );
391
- var onAppInstancePlanReactivated2 = (0, import_event_definition_modules.createEventModule)(
388
+ var onAppInstancePlanConvertedToPaid2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(onAppInstancePlanConvertedToPaid);
389
+ var onAppInstancePlanReactivated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
392
390
  onAppInstancePlanReactivated
393
391
  );
394
- var onAppInstancePlanTransferred2 = (0, import_event_definition_modules.createEventModule)(
392
+ var onAppInstancePlanTransferred2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
395
393
  onAppInstancePlanTransferred
396
394
  );
397
395
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.public.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.universal.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.http.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.context.ts"],"sourcesContent":["export * from './src/devcenter-app-instance-v1-app-instance-app-instances.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppInstanceInstalledEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n AppInstanceRemovedEnvelope,\n GetAppInstanceResponse,\n getAppInstance as universalGetAppInstance,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function getAppInstance(\n httpClient: HttpClient\n): GetAppInstanceSignature {\n return () =>\n universalGetAppInstance(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetAppInstanceSignature {\n /**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\n (): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 7\n >\n >;\n}\n\nexport const onAppInstanceInstalled = EventDefinition(\n 'AppInstalled',\n false,\n (event: AppInstanceInstalledEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<AppInstanceInstalledEnvelope>();\nexport const onAppInstanceRemoved = EventDefinition(\n 'AppRemoved',\n false,\n (event: AppInstanceRemovedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<AppInstanceRemovedEnvelope>();\nexport const onAppInstancePaidPlanAutoRenewalCancelled = EventDefinition(\n 'PaidPlanAutoRenewalCancelled',\n false,\n (event: AppInstancePaidPlanAutoRenewalCancelledEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n)<AppInstancePaidPlanAutoRenewalCancelledEnvelope>();\nexport const onAppInstancePaidPlanChanged = EventDefinition(\n 'PaidPlanChanged',\n false,\n (event: AppInstancePaidPlanChangedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n)<AppInstancePaidPlanChangedEnvelope>();\nexport const onAppInstancePaidPlanPurchased = EventDefinition(\n 'PaidPlanPurchased',\n false,\n (event: AppInstancePaidPlanPurchasedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePaidPlanPurchasedEnvelope>();\nexport const onAppInstancePlanConvertedToPaid = EventDefinition(\n 'PlanConvertedToPaid',\n false,\n (event: AppInstancePlanConvertedToPaidEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePlanConvertedToPaidEnvelope>();\nexport const onAppInstancePlanReactivated = EventDefinition(\n 'PlanReactivated',\n false,\n (event: AppInstancePlanReactivatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePlanReactivatedEnvelope>();\nexport const onAppInstancePlanTransferred = EventDefinition(\n 'PlanTransferred',\n false,\n (event: AppInstancePlanTransferredEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n)<AppInstancePlanTransferredEnvelope>();\n\nexport {\n AccountInfo,\n AppInstalled,\n AppInstance,\n AppInstanceInstalledEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n AppInstanceRemovedEnvelope,\n AppRemoved,\n AvailablePlan,\n BaseEventMetadata,\n BillingInfo,\n FreeTrialInfo,\n FreeTrialPeriod,\n FreeTrialStatus,\n GetAppInstanceByInstanceIdRequest,\n GetAppInstanceRequest,\n GetAppInstanceResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n Locale,\n MessageEnvelope,\n Multilingual,\n OwnerInfo,\n PaidPlanAutoRenewalCancelled,\n PaidPlanChanged,\n PaidPlanPurchased,\n PaymentCycle,\n PlanConvertedToPaid,\n PlanReactivated,\n PlanTransferred,\n ReactivationReason,\n ResolutionMethod,\n SiteInfo,\n SupportedLanguage,\n WebhookIdentityType,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppInstanceV1AppInstance from './devcenter-app-instance-v1-app-instance-app-instances.http.js';\n\n/**\n * An app instance is a specific occurrence of an app on a Wix site.\n * When a Wix user installs an app, a unique instance is generated for that\n * specific site. Use the `instanceId` to keep track of the individual data\n * associated with each app instance.\n */\nexport interface AppInstance {\n /**\n * App instance ID. Useful to keep track of the\n * data that's associated with the specific instance of your app\n * installed on a Wix site.\n */\n instanceId?: string;\n /** App name, as you entered it in the App Dashboard. */\n appName?: string;\n /** Version of your app that's installed on the Wix site. */\n appVersion?: string | null;\n /**\n * Whether the Wix user has installed a free or paid version of your app\n * on their site.\n */\n isFree?: boolean;\n /**\n * Billing information for the app instance. Available only in case\n * `{\"isFree\": false}`.\n */\n billing?: BillingInfo;\n /**\n * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)\n * that the Wix user has granted your app. You set the list of permissions that\n * your app requires from the Wix user in your app's Permissions page.\n */\n permissions?: string[];\n /** Plans available to this app instance. */\n availablePlans?: AvailablePlan[];\n /**\n * ID of the Wix site from which the instance of your app has been cloned.\n *\n * All visual settings of the Wix site and app data are duplicated during the\n * cloning process. Wix also notifies you in case there is any additional\n * external functionality for the original site.\n */\n originInstanceId?: string | null;\n /**\n * __Deprecated__. This parameter will be removed on March 30, 2023. Use\n * `copiedFromTemplate` instead.\n * @deprecated\n */\n isOriginSiteTemplate?: boolean;\n /** Whether this app instance was created when another Wix site was cloned. */\n copiedFromTemplate?: boolean;\n /** Whether this app instance includes a free trial that hasn't started yet. */\n freeTrialAvailable?: boolean;\n}\n\nexport interface BillingInfo {\n /** Name of the package that the site owner has paid for. */\n packageName?: string;\n /**\n * Interval of the billing cycle. `ONE_TIME` indicates that the Wix user has\n * made a single upfront payment without any automatic subscription renewal.\n * This is primarily for usage credits (for example, 5 SMS) but may occasionally apply\n * to a one-time setup for the app.\n */\n billingCycle?: PaymentCycleWithLiterals;\n /**\n * Date and time the Wix user purchased the app's paid plan or began their free trial. In\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n timeStamp?: string;\n /**\n * Date and time the app's current billing cycle ends in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and\n * multi-yearly plans.\n */\n expirationDate?: string | null;\n /**\n * Whether the app's subscription automatically renews at the end of the\n * current billing cycle.\n */\n autoRenewing?: boolean | null;\n /** ID of the invoice for the current billing cycle. */\n invoiceId?: string | null;\n /**\n * Information about any discounts applied to the app instance's current billing cycle.\n * If the site owners applied a developer coupon or Wix Voucher\n * when installing the paid version of your app, this field holds the coupon's\n * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when\n * upgrading their Wix subscription. If there is no discount for the\n * current billing cycle, the field is an empty string.\n */\n source?: string | null;\n /** Information about the free trial applied, if relevant. */\n freeTrialInfo?: FreeTrialInfo;\n}\n\nexport enum PaymentCycle {\n NO_CYCLE = 'NO_CYCLE',\n MONTHLY = 'MONTHLY',\n YEARLY = 'YEARLY',\n ONE_TIME = 'ONE_TIME',\n TWO_YEARS = 'TWO_YEARS',\n THREE_YEARS = 'THREE_YEARS',\n FOUR_YEARS = 'FOUR_YEARS',\n FIVE_YEARS = 'FIVE_YEARS',\n}\n\n/** @enumType */\nexport type PaymentCycleWithLiterals =\n | PaymentCycle\n | 'NO_CYCLE'\n | 'MONTHLY'\n | 'YEARLY'\n | 'ONE_TIME'\n | 'TWO_YEARS'\n | 'THREE_YEARS'\n | 'FOUR_YEARS'\n | 'FIVE_YEARS';\n\nexport interface FreeTrialInfo {\n /**\n * Current free trial status.\n * @readonly\n */\n status?: FreeTrialStatusWithLiterals;\n /**\n * When the free trial has ended. Populated only once the free trial is over.\n * @readonly\n */\n endDate?: Date | null;\n}\n\nexport enum FreeTrialStatus {\n /** The free trial is currently in progress. */\n IN_PROGRESS = 'IN_PROGRESS',\n /** The free trial has ended. */\n ENDED = 'ENDED',\n /** No free trial was applied, as none was available. */\n NOT_AVAILABLE = 'NOT_AVAILABLE',\n}\n\n/** @enumType */\nexport type FreeTrialStatusWithLiterals =\n | FreeTrialStatus\n | 'IN_PROGRESS'\n | 'ENDED'\n | 'NOT_AVAILABLE';\n\nexport interface AvailablePlan {\n /** Package name of the available plan. */\n packageName?: string;\n /** Source of the available plan. Can be a bundle or 3rd-party app. */\n source?: string;\n}\n\nexport interface AppInstalled {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n /**\n * 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)).\n * @format GUID\n */\n originInstanceId?: string | null;\n}\n\nexport interface AppRemoved {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface PaidPlanPurchased {\n /** Date and time of purchase. */\n operationTimeStamp?: Date | null;\n /**\n * Purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanChanged {\n /** Date and time of change. */\n operationTimeStamp?: Date | null;\n /**\n * Newly purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Newly selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Previous app plan.\n * @maxLength 100\n */\n previousVendorProductId?: string | null;\n /** Previous payment cycle. */\n previousCycle?: PaymentCycleWithLiterals;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanAutoRenewalCancelled {\n /** Date and time of auto-renewal cancellation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Current payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant).\n * @maxLength 100\n */\n cancelReason?: string | null;\n /**\n * Reason provided by site owner for cancellation (if relevant).\n * @maxLength 150\n */\n userReason?: string | null;\n /**\n * Cancellation type.\n * @maxLength 100\n */\n subscriptionCancellationType?: string | null;\n /** Whether the cancellation occurred during a free trial. */\n cancelledDuringFreeTrial?: FreeTrialPeriodWithLiterals;\n}\n\nexport enum FreeTrialPeriod {\n /** During a free trial period. */\n DURING_FREE_TRIAL = 'DURING_FREE_TRIAL',\n /** Not during a free trial period. */\n NOT_DURING_FREE_TRIAL = 'NOT_DURING_FREE_TRIAL',\n}\n\n/** @enumType */\nexport type FreeTrialPeriodWithLiterals =\n | FreeTrialPeriod\n | 'DURING_FREE_TRIAL'\n | 'NOT_DURING_FREE_TRIAL';\n\nexport interface PlanTransferred {\n /** Date and time of transfer. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PlanReactivated {\n /** Date and time of reactivation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n /** Reason for reactivation. */\n reason?: ReactivationReasonWithLiterals;\n}\n\nexport enum ReactivationReason {\n /** Reactivation reason unknown. */\n REACTIVATION_REASON_UNKNOWN = 'REACTIVATION_REASON_UNKNOWN',\n /** The subscription's auto-renewal is turned on. */\n AUTO_RENEW_TURNED_ON = 'AUTO_RENEW_TURNED_ON',\n}\n\n/** @enumType */\nexport type ReactivationReasonWithLiterals =\n | ReactivationReason\n | 'REACTIVATION_REASON_UNKNOWN'\n | 'AUTO_RENEW_TURNED_ON';\n\nexport interface PlanConvertedToPaid {\n /** Date and time of conversion to paid subscription (free-trial ended). */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n}\n\nexport interface GetAppInstanceRequest {}\n\nexport interface GetAppInstanceResponse {\n /** Retrieved app instance. */\n instance?: AppInstance;\n /** Information about the site. */\n site?: SiteInfo;\n}\n\nexport interface SiteInfo {\n /** Display name of the site. */\n siteDisplayName?: string | null;\n /**\n * 2-letter language code of the site's locale in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n */\n locale?: string;\n /**\n * 3-letter currency code for the site's billing in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n paymentCurrency?: string;\n /** Information about the site's supported languages. */\n multilingual?: Multilingual;\n /** URL of the site. Available only when the site has been published. */\n url?: string | null;\n /** Description of the site. */\n description?: string | null;\n /** Apps made by Wix that are installed on the site. */\n installedWixApps?: string[];\n /**\n * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.\n * @format EMAIL\n * @deprecated\n */\n ownerEmail?: string | null;\n /**\n * Information about the site's Wix user. Available only when calling\n * _Get App Instance_ with the __Read Site Owner Email__ permission scope.\n */\n ownerInfo?: OwnerInfo;\n /** Site ID. */\n siteId?: string;\n /**\n * Type of Wix user who owns the site.\n * Available only when calling _Get App Instance_ with the __Read Site User Type__ permission scope.\n * Supported values: `\"Channel DIY\"`, `\"Channel DIFM\"`, `\"Enterprise\"`.\n */\n siteUserType?: string | null;\n}\n\nexport interface Multilingual {\n /** Whether the site supports more than a single language. */\n isMultiLingual?: boolean;\n /** List of supported languages. Returned only when `{\"isMultiLingual\": true}`. */\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Locale. */\n locale?: Locale;\n /** Whether the supported language is the primary language for the site. */\n isPrimary?: boolean;\n /** Language icon. */\n countryCode?: string;\n /** How the language will be resolved. For internal use. */\n resolutionMethod?: ResolutionMethodWithLiterals;\n /** Whether the supported language is the primary language for site visitors. */\n isVisitorPrimary?: boolean | null;\n}\n\nexport interface Locale {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */\n country?: string;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\n/** @enumType */\nexport type ResolutionMethodWithLiterals =\n | ResolutionMethod\n | 'QUERY_PARAM'\n | 'SUBDOMAIN'\n | 'SUBDIRECTORY';\n\nexport interface OwnerInfo {\n /**\n * Wix user's email address. Identical to the their login email.\n * @format EMAIL\n */\n email?: string;\n /**\n * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,\n * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.\n *\n * Whether the Wix user has verified their email and whether they have chosen\n * to receive email notifications from Wix.\n */\n emailStatus?: string;\n}\n\nexport interface GetAppInstanceByInstanceIdRequest {\n /**\n * ID of the app instance to retrieve.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface AppInstanceInstalledEnvelope {\n data: AppInstalled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppInstalled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug installed\n */\nexport declare function onAppInstanceInstalled(\n handler: (event: AppInstanceInstalledEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstanceRemovedEnvelope {\n data: AppRemoved;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppRemoved\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug removed\n */\nexport declare function onAppInstanceRemoved(\n handler: (event: AppInstanceRemovedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {\n data: PaidPlanAutoRenewalCancelled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanAutoRenewalCancelled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_auto_renewal_cancelled\n */\nexport declare function onAppInstancePaidPlanAutoRenewalCancelled(\n handler: (\n event: AppInstancePaidPlanAutoRenewalCancelledEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanChangedEnvelope {\n data: PaidPlanChanged;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanChanged\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_changed\n */\nexport declare function onAppInstancePaidPlanChanged(\n handler: (event: AppInstancePaidPlanChangedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanPurchasedEnvelope {\n data: PaidPlanPurchased;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanPurchased\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_purchased\n */\nexport declare function onAppInstancePaidPlanPurchased(\n handler: (event: AppInstancePaidPlanPurchasedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanConvertedToPaidEnvelope {\n data: PlanConvertedToPaid;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanConvertedToPaid\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_converted_to_paid\n */\nexport declare function onAppInstancePlanConvertedToPaid(\n handler: (\n event: AppInstancePlanConvertedToPaidEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanReactivatedEnvelope {\n data: PlanReactivated;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanReactivated\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_reactivated\n */\nexport declare function onAppInstancePlanReactivated(\n handler: (event: AppInstancePlanReactivatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanTransferredEnvelope {\n data: PlanTransferred;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanTransferred\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_transferred\n */\nexport declare function onAppInstancePlanTransferred(\n handler: (event: AppInstancePlanTransferredEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n * @public\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance\n */\nexport async function getAppInstance(): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixDevcenterAppInstanceV1AppInstance.getAppInstance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiAppInstanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n _: [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-instances';\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\nexport function getAppInstance(payload: object): RequestOptionsFactory<any> {\n function __getAppInstance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.app_instance.v1.app_instance',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.AppInstanceService.GetAppInstance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressMarketAimApiAppInstanceServiceUrl({\n protoPath: '/v1/instance',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'instance.billing.freeTrialInfo.endDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getAppInstance;\n}\n","import { getAppInstance as publicGetAppInstance } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onAppInstanceInstalled as publicOnAppInstanceInstalled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstanceRemoved as publicOnAppInstanceRemoved } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanAutoRenewalCancelled as publicOnAppInstancePaidPlanAutoRenewalCancelled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanChanged as publicOnAppInstancePaidPlanChanged } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanPurchased as publicOnAppInstancePaidPlanPurchased } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanConvertedToPaid as publicOnAppInstancePlanConvertedToPaid } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanReactivated as publicOnAppInstancePlanReactivated } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanTransferred as publicOnAppInstancePlanTransferred } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\n\nexport const getAppInstance: MaybeContext<\n BuildRESTFunction<typeof publicGetAppInstance> & typeof publicGetAppInstance\n> = /*#__PURE__*/ createRESTModule(publicGetAppInstance);\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n */\nexport const onAppInstanceInstalled: BuildEventDefinition<\n typeof publicOnAppInstanceInstalled\n> &\n typeof publicOnAppInstanceInstalled = createEventModule(\n publicOnAppInstanceInstalled\n);\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n */\nexport const onAppInstanceRemoved: BuildEventDefinition<\n typeof publicOnAppInstanceRemoved\n> &\n typeof publicOnAppInstanceRemoved = createEventModule(\n publicOnAppInstanceRemoved\n);\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n */\nexport const onAppInstancePaidPlanAutoRenewalCancelled: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanAutoRenewalCancelled\n> &\n typeof publicOnAppInstancePaidPlanAutoRenewalCancelled = createEventModule(\n publicOnAppInstancePaidPlanAutoRenewalCancelled\n);\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n */\nexport const onAppInstancePaidPlanChanged: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanChanged\n> &\n typeof publicOnAppInstancePaidPlanChanged = createEventModule(\n publicOnAppInstancePaidPlanChanged\n);\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n */\nexport const onAppInstancePaidPlanPurchased: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanPurchased\n> &\n typeof publicOnAppInstancePaidPlanPurchased = createEventModule(\n publicOnAppInstancePaidPlanPurchased\n);\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n */\nexport const onAppInstancePlanConvertedToPaid: BuildEventDefinition<\n typeof publicOnAppInstancePlanConvertedToPaid\n> &\n typeof publicOnAppInstancePlanConvertedToPaid = createEventModule(\n publicOnAppInstancePlanConvertedToPaid\n);\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n */\nexport const onAppInstancePlanReactivated: BuildEventDefinition<\n typeof publicOnAppInstancePlanReactivated\n> &\n typeof publicOnAppInstancePlanReactivated = createEventModule(\n publicOnAppInstancePlanReactivated\n);\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n */\nexport const onAppInstancePlanTransferred: BuildEventDefinition<\n typeof publicOnAppInstancePlanTransferred\n> &\n typeof publicOnAppInstancePlanTransferred = createEventModule(\n publicOnAppInstancePlanTransferred\n);\n\nexport {\n PaymentCycle,\n FreeTrialStatus,\n FreeTrialPeriod,\n ReactivationReason,\n ResolutionMethod,\n WebhookIdentityType,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\nexport {\n AppInstance,\n BillingInfo,\n FreeTrialInfo,\n AvailablePlan,\n AppInstalled,\n AppRemoved,\n PaidPlanPurchased,\n PaidPlanChanged,\n PaidPlanAutoRenewalCancelled,\n PlanTransferred,\n PlanReactivated,\n PlanConvertedToPaid,\n GetAppInstanceRequest,\n GetAppInstanceResponse,\n SiteInfo,\n Multilingual,\n SupportedLanguage,\n Locale,\n OwnerInfo,\n GetAppInstanceByInstanceIdRequest,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n AppInstanceInstalledEnvelope,\n AppInstanceRemovedEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\nexport {\n PaymentCycleWithLiterals,\n FreeTrialStatusWithLiterals,\n FreeTrialPeriodWithLiterals,\n ReactivationReasonWithLiterals,\n ResolutionMethodWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,8BAAAC;AAAA,EAAA,iDAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,sCAAAC;AAAA,EAAA,wCAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QAC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AA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,0BAA0B,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAsC;;;AG9KtC,IAAAC,uBAAiC;AACjC,sCAAkC;AAe3B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAOhD,IAAMC,8BAG2B;AAAA,EACtC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAMO,IAAMC,iDAG8C;AAAA,EACzD;AACF;AAIO,IAAMC,oCAGiC;AAAA,EAC5C;AACF;AAIO,IAAMC,sCAGmC;AAAA,EAC9C;AACF;AAIO,IAAMC,wCAGqC;AAAA,EAChD;AACF;AAIO,IAAMC,oCAGiC;AAAA,EAC5C;AACF;AAIO,IAAMC,oCAGiC;AAAA,EAC5C;AACF;","names":["getAppInstance","onAppInstanceInstalled","onAppInstancePaidPlanAutoRenewalCancelled","onAppInstancePaidPlanChanged","onAppInstancePaidPlanPurchased","onAppInstancePlanConvertedToPaid","onAppInstancePlanReactivated","onAppInstancePlanTransferred","onAppInstanceRemoved","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_rest_modules","payload","PaymentCycle","FreeTrialStatus","FreeTrialPeriod","ReactivationReason","ResolutionMethod","WebhookIdentityType","getAppInstance","sdkTransformError","getAppInstance","import_rest_modules","getAppInstance","onAppInstanceInstalled","onAppInstanceRemoved","onAppInstancePaidPlanAutoRenewalCancelled","onAppInstancePaidPlanChanged","onAppInstancePaidPlanPurchased","onAppInstancePlanConvertedToPaid","onAppInstancePlanReactivated","onAppInstancePlanTransferred"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.public.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.universal.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.http.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.context.ts"],"sourcesContent":["export * from './src/devcenter-app-instance-v1-app-instance-app-instances.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppInstanceInstalledEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n AppInstanceRemovedEnvelope,\n GetAppInstanceResponse,\n getAppInstance as universalGetAppInstance,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function getAppInstance(\n httpClient: HttpClient\n): GetAppInstanceSignature {\n return () =>\n universalGetAppInstance(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetAppInstanceSignature {\n /**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\n (): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 5\n >\n >;\n}\n\nexport const onAppInstanceInstalled = /*#__PURE__*/ EventDefinition(\n 'AppInstalled',\n false,\n (event: AppInstanceInstalledEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<AppInstanceInstalledEnvelope>();\nexport const onAppInstanceRemoved = /*#__PURE__*/ EventDefinition(\n 'AppRemoved',\n false,\n (event: AppInstanceRemovedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(event)\n)<AppInstanceRemovedEnvelope>();\nexport const onAppInstancePaidPlanAutoRenewalCancelled =\n /*#__PURE__*/ EventDefinition(\n 'PaidPlanAutoRenewalCancelled',\n false,\n (event: AppInstancePaidPlanAutoRenewalCancelledEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n )<AppInstancePaidPlanAutoRenewalCancelledEnvelope>();\nexport const onAppInstancePaidPlanChanged = /*#__PURE__*/ EventDefinition(\n 'PaidPlanChanged',\n false,\n (event: AppInstancePaidPlanChangedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n)<AppInstancePaidPlanChangedEnvelope>();\nexport const onAppInstancePaidPlanPurchased = /*#__PURE__*/ EventDefinition(\n 'PaidPlanPurchased',\n false,\n (event: AppInstancePaidPlanPurchasedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePaidPlanPurchasedEnvelope>();\nexport const onAppInstancePlanConvertedToPaid = /*#__PURE__*/ EventDefinition(\n 'PlanConvertedToPaid',\n false,\n (event: AppInstancePlanConvertedToPaidEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePlanConvertedToPaidEnvelope>();\nexport const onAppInstancePlanReactivated = /*#__PURE__*/ EventDefinition(\n 'PlanReactivated',\n false,\n (event: AppInstancePlanReactivatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'data.operationTimeStamp' },\n { path: 'data.expiresOn' },\n ],\n },\n ])\n )\n)<AppInstancePlanReactivatedEnvelope>();\nexport const onAppInstancePlanTransferred = /*#__PURE__*/ EventDefinition(\n 'PlanTransferred',\n false,\n (event: AppInstancePlanTransferredEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'data.operationTimeStamp' }],\n },\n ])\n )\n)<AppInstancePlanTransferredEnvelope>();\n\nexport {\n AccountInfo,\n AppInstalled,\n AppInstance,\n AppInstanceInstalledEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n AppInstanceRemovedEnvelope,\n AppRemoved,\n AvailablePlan,\n BaseEventMetadata,\n BillingInfo,\n FreeTrialInfo,\n FreeTrialPeriod,\n FreeTrialStatus,\n GetAppInstanceByInstanceIdRequest,\n GetAppInstanceRequest,\n GetAppInstanceResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n Locale,\n MessageEnvelope,\n Multilingual,\n OwnerInfo,\n PaidPlanAutoRenewalCancelled,\n PaidPlanChanged,\n PaidPlanPurchased,\n PaymentCycle,\n PlanConvertedToPaid,\n PlanReactivated,\n PlanTransferred,\n ReactivationReason,\n ResolutionMethod,\n SiteInfo,\n SupportedLanguage,\n WebhookIdentityType,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppInstanceV1AppInstance from './devcenter-app-instance-v1-app-instance-app-instances.http.js';\n\n/**\n * An app instance is a specific occurrence of an app on a Wix site.\n * When a Wix user installs an app, a unique instance is generated for that\n * specific site. Use the `instanceId` to keep track of the individual data\n * associated with each app instance.\n */\nexport interface AppInstance {\n /**\n * App instance ID. Useful to keep track of the\n * data that's associated with the specific instance of your app\n * installed on a Wix site.\n */\n instanceId?: string;\n /** App name, as you entered it in the App Dashboard. */\n appName?: string;\n /** Version of your app that's installed on the Wix site. */\n appVersion?: string | null;\n /**\n * Whether the Wix user has installed a free or paid version of your app\n * on their site.\n */\n isFree?: boolean;\n /**\n * Billing information for the app instance. Available only in case\n * `{\"isFree\": false}`.\n */\n billing?: BillingInfo;\n /**\n * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)\n * that the Wix user has granted your app. You set the list of permissions that\n * your app requires from the Wix user in your app's Permissions page.\n */\n permissions?: string[];\n /** Plans available to this app instance. */\n availablePlans?: AvailablePlan[];\n /**\n * ID of the Wix site from which the instance of your app has been cloned.\n *\n * All visual settings of the Wix site and app data are duplicated during the\n * cloning process. Wix also notifies you in case there is any additional\n * external functionality for the original site.\n */\n originInstanceId?: string | null;\n /**\n * __Deprecated__. This parameter will be removed on March 30, 2023. Use\n * `copiedFromTemplate` instead.\n * @deprecated\n */\n isOriginSiteTemplate?: boolean;\n /** Whether this app instance was created when another Wix site was cloned. */\n copiedFromTemplate?: boolean;\n /** Whether this app instance includes a free trial that hasn't started yet. */\n freeTrialAvailable?: boolean;\n}\n\nexport interface BillingInfo {\n /** Name of the package that the site owner has paid for. */\n packageName?: string;\n /**\n * Interval of the billing cycle. `ONE_TIME` indicates that the Wix user has\n * made a single upfront payment without any automatic subscription renewal.\n * This is primarily for usage credits (for example, 5 SMS) but may occasionally apply\n * to a one-time setup for the app.\n */\n billingCycle?: PaymentCycleWithLiterals;\n /**\n * Date and time the Wix user purchased the app's paid plan or began their free trial. In\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n timeStamp?: string;\n /**\n * Date and time the app's current billing cycle ends in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and\n * multi-yearly plans.\n */\n expirationDate?: string | null;\n /**\n * Whether the app's subscription automatically renews at the end of the\n * current billing cycle.\n */\n autoRenewing?: boolean | null;\n /** ID of the invoice for the current billing cycle. */\n invoiceId?: string | null;\n /**\n * Information about any discounts applied to the app instance's current billing cycle.\n * If the site owners applied a developer coupon or Wix Voucher\n * when installing the paid version of your app, this field holds the coupon's\n * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when\n * upgrading their Wix subscription. If there is no discount for the\n * current billing cycle, the field is an empty string.\n */\n source?: string | null;\n /** Information about the free trial applied, if relevant. */\n freeTrialInfo?: FreeTrialInfo;\n}\n\nexport enum PaymentCycle {\n NO_CYCLE = 'NO_CYCLE',\n MONTHLY = 'MONTHLY',\n YEARLY = 'YEARLY',\n ONE_TIME = 'ONE_TIME',\n TWO_YEARS = 'TWO_YEARS',\n THREE_YEARS = 'THREE_YEARS',\n FOUR_YEARS = 'FOUR_YEARS',\n FIVE_YEARS = 'FIVE_YEARS',\n}\n\n/** @enumType */\nexport type PaymentCycleWithLiterals =\n | PaymentCycle\n | 'NO_CYCLE'\n | 'MONTHLY'\n | 'YEARLY'\n | 'ONE_TIME'\n | 'TWO_YEARS'\n | 'THREE_YEARS'\n | 'FOUR_YEARS'\n | 'FIVE_YEARS';\n\nexport interface FreeTrialInfo {\n /**\n * Current free trial status.\n * @readonly\n */\n status?: FreeTrialStatusWithLiterals;\n /**\n * When the free trial has ended. Populated only once the free trial is over.\n * @readonly\n */\n endDate?: Date | null;\n}\n\nexport enum FreeTrialStatus {\n /** The free trial is currently in progress. */\n IN_PROGRESS = 'IN_PROGRESS',\n /** The free trial has ended. */\n ENDED = 'ENDED',\n /** No free trial was applied, as none was available. */\n NOT_AVAILABLE = 'NOT_AVAILABLE',\n}\n\n/** @enumType */\nexport type FreeTrialStatusWithLiterals =\n | FreeTrialStatus\n | 'IN_PROGRESS'\n | 'ENDED'\n | 'NOT_AVAILABLE';\n\nexport interface AvailablePlan {\n /** Package name of the available plan. */\n packageName?: string;\n /** Source of the available plan. Can be a bundle or 3rd-party app. */\n source?: string;\n}\n\nexport interface AppInstalled {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n /**\n * 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)).\n * @format GUID\n */\n originInstanceId?: string | null;\n}\n\nexport interface AppRemoved {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface PaidPlanPurchased {\n /** Date and time of purchase. */\n operationTimeStamp?: Date | null;\n /**\n * Purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanChanged {\n /** Date and time of change. */\n operationTimeStamp?: Date | null;\n /**\n * Newly purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Newly selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Previous app plan.\n * @maxLength 100\n */\n previousVendorProductId?: string | null;\n /** Previous payment cycle. */\n previousCycle?: PaymentCycleWithLiterals;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanAutoRenewalCancelled {\n /** Date and time of auto-renewal cancellation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Current payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant).\n * @maxLength 100\n */\n cancelReason?: string | null;\n /**\n * Reason provided by site owner for cancellation (if relevant).\n * @maxLength 150\n */\n userReason?: string | null;\n /**\n * Cancellation type.\n * @maxLength 100\n */\n subscriptionCancellationType?: string | null;\n /** Whether the cancellation occurred during a free trial. */\n cancelledDuringFreeTrial?: FreeTrialPeriodWithLiterals;\n}\n\nexport enum FreeTrialPeriod {\n /** During a free trial period. */\n DURING_FREE_TRIAL = 'DURING_FREE_TRIAL',\n /** Not during a free trial period. */\n NOT_DURING_FREE_TRIAL = 'NOT_DURING_FREE_TRIAL',\n}\n\n/** @enumType */\nexport type FreeTrialPeriodWithLiterals =\n | FreeTrialPeriod\n | 'DURING_FREE_TRIAL'\n | 'NOT_DURING_FREE_TRIAL';\n\nexport interface PlanTransferred {\n /** Date and time of transfer. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PlanReactivated {\n /** Date and time of reactivation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n /** Reason for reactivation. */\n reason?: ReactivationReasonWithLiterals;\n}\n\nexport enum ReactivationReason {\n /** Reactivation reason unknown. */\n REACTIVATION_REASON_UNKNOWN = 'REACTIVATION_REASON_UNKNOWN',\n /** The subscription's auto-renewal is turned on. */\n AUTO_RENEW_TURNED_ON = 'AUTO_RENEW_TURNED_ON',\n}\n\n/** @enumType */\nexport type ReactivationReasonWithLiterals =\n | ReactivationReason\n | 'REACTIVATION_REASON_UNKNOWN'\n | 'AUTO_RENEW_TURNED_ON';\n\nexport interface PlanConvertedToPaid {\n /** Date and time of conversion to paid subscription (free-trial ended). */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n}\n\nexport interface GetAppInstanceRequest {}\n\nexport interface GetAppInstanceResponse {\n /** Retrieved app instance. */\n instance?: AppInstance;\n /** Information about the site. */\n site?: SiteInfo;\n}\n\nexport interface SiteInfo {\n /** Display name of the site. */\n siteDisplayName?: string | null;\n /**\n * 2-letter language code of the site's locale in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n */\n locale?: string;\n /**\n * 3-letter currency code for the site's billing in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n paymentCurrency?: string;\n /** Information about the site's supported languages. */\n multilingual?: Multilingual;\n /** URL of the site. Available only when the site has been published. */\n url?: string | null;\n /** Description of the site. */\n description?: string | null;\n /** Apps made by Wix that are installed on the site. */\n installedWixApps?: string[];\n /**\n * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.\n * @format EMAIL\n * @deprecated\n */\n ownerEmail?: string | null;\n /**\n * Information about the site's Wix user. Available only when calling\n * _Get App Instance_ with the __Read Site Owner Email__ permission scope.\n */\n ownerInfo?: OwnerInfo;\n /** Site ID. */\n siteId?: string;\n /**\n * Type of Wix user who owns the site.\n * Available only when calling _Get App Instance_ with the __Read Site User Type__ permission scope.\n * Supported values: `\"Channel DIY\"`, `\"Channel DIFM\"`, `\"Enterprise\"`.\n */\n siteUserType?: string | null;\n}\n\nexport interface Multilingual {\n /** Whether the site supports more than a single language. */\n isMultiLingual?: boolean;\n /** List of supported languages. Returned only when `{\"isMultiLingual\": true}`. */\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Locale. */\n locale?: Locale;\n /** Whether the supported language is the primary language for the site. */\n isPrimary?: boolean;\n /** Language icon. */\n countryCode?: string;\n /** How the language will be resolved. For internal use. */\n resolutionMethod?: ResolutionMethodWithLiterals;\n /** Whether the supported language is the primary language for site visitors. */\n isVisitorPrimary?: boolean | null;\n}\n\nexport interface Locale {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */\n country?: string;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\n/** @enumType */\nexport type ResolutionMethodWithLiterals =\n | ResolutionMethod\n | 'QUERY_PARAM'\n | 'SUBDOMAIN'\n | 'SUBDIRECTORY';\n\nexport interface OwnerInfo {\n /**\n * Wix user's email address. Identical to the their login email.\n * @format EMAIL\n */\n email?: string;\n /**\n * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,\n * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.\n *\n * Whether the Wix user has verified their email and whether they have chosen\n * to receive email notifications from Wix.\n */\n emailStatus?: string;\n}\n\nexport interface GetAppInstanceByInstanceIdRequest {\n /**\n * ID of the app instance to retrieve.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface AppInstanceInstalledEnvelope {\n data: AppInstalled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppInstalled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug installed\n */\nexport declare function onAppInstanceInstalled(\n handler: (event: AppInstanceInstalledEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstanceRemovedEnvelope {\n data: AppRemoved;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppRemoved\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug removed\n */\nexport declare function onAppInstanceRemoved(\n handler: (event: AppInstanceRemovedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {\n data: PaidPlanAutoRenewalCancelled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanAutoRenewalCancelled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_auto_renewal_cancelled\n */\nexport declare function onAppInstancePaidPlanAutoRenewalCancelled(\n handler: (\n event: AppInstancePaidPlanAutoRenewalCancelledEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanChangedEnvelope {\n data: PaidPlanChanged;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanChanged\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_changed\n */\nexport declare function onAppInstancePaidPlanChanged(\n handler: (event: AppInstancePaidPlanChangedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanPurchasedEnvelope {\n data: PaidPlanPurchased;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanPurchased\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_purchased\n */\nexport declare function onAppInstancePaidPlanPurchased(\n handler: (event: AppInstancePaidPlanPurchasedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanConvertedToPaidEnvelope {\n data: PlanConvertedToPaid;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanConvertedToPaid\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_converted_to_paid\n */\nexport declare function onAppInstancePlanConvertedToPaid(\n handler: (\n event: AppInstancePlanConvertedToPaidEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanReactivatedEnvelope {\n data: PlanReactivated;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanReactivated\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_reactivated\n */\nexport declare function onAppInstancePlanReactivated(\n handler: (event: AppInstancePlanReactivatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanTransferredEnvelope {\n data: PlanTransferred;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanTransferred\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_transferred\n */\nexport declare function onAppInstancePlanTransferred(\n handler: (event: AppInstancePlanTransferredEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n * @public\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance\n */\nexport async function getAppInstance(): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixDevcenterAppInstanceV1AppInstance.getAppInstance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiAppInstanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n _: [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-instances';\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\nexport function getAppInstance(payload: object): RequestOptionsFactory<any> {\n function __getAppInstance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.app_instance.v1.app_instance',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.AppInstanceService.GetAppInstance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressMarketAimApiAppInstanceServiceUrl({\n protoPath: '/v1/instance',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'instance.billing.freeTrialInfo.endDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getAppInstance;\n}\n","import { getAppInstance as publicGetAppInstance } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onAppInstanceInstalled as publicOnAppInstanceInstalled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstanceRemoved as publicOnAppInstanceRemoved } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanAutoRenewalCancelled as publicOnAppInstancePaidPlanAutoRenewalCancelled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanChanged as publicOnAppInstancePaidPlanChanged } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePaidPlanPurchased as publicOnAppInstancePaidPlanPurchased } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanConvertedToPaid as publicOnAppInstancePlanConvertedToPaid } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanReactivated as publicOnAppInstancePlanReactivated } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\nimport { onAppInstancePlanTransferred as publicOnAppInstancePlanTransferred } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';\n\nexport const getAppInstance: MaybeContext<\n BuildRESTFunction<typeof publicGetAppInstance> & typeof publicGetAppInstance\n> = /*#__PURE__*/ createRESTModule(publicGetAppInstance);\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n */\nexport const onAppInstanceInstalled: BuildEventDefinition<\n typeof publicOnAppInstanceInstalled\n> &\n typeof publicOnAppInstanceInstalled = /*#__PURE__*/ createEventModule(\n publicOnAppInstanceInstalled\n);\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n */\nexport const onAppInstanceRemoved: BuildEventDefinition<\n typeof publicOnAppInstanceRemoved\n> &\n typeof publicOnAppInstanceRemoved = /*#__PURE__*/ createEventModule(\n publicOnAppInstanceRemoved\n);\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n */\nexport const onAppInstancePaidPlanAutoRenewalCancelled: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanAutoRenewalCancelled\n> &\n typeof publicOnAppInstancePaidPlanAutoRenewalCancelled =\n /*#__PURE__*/ createEventModule(\n publicOnAppInstancePaidPlanAutoRenewalCancelled\n );\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n */\nexport const onAppInstancePaidPlanChanged: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanChanged\n> &\n typeof publicOnAppInstancePaidPlanChanged = /*#__PURE__*/ createEventModule(\n publicOnAppInstancePaidPlanChanged\n);\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n */\nexport const onAppInstancePaidPlanPurchased: BuildEventDefinition<\n typeof publicOnAppInstancePaidPlanPurchased\n> &\n typeof publicOnAppInstancePaidPlanPurchased = /*#__PURE__*/ createEventModule(\n publicOnAppInstancePaidPlanPurchased\n);\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n */\nexport const onAppInstancePlanConvertedToPaid: BuildEventDefinition<\n typeof publicOnAppInstancePlanConvertedToPaid\n> &\n typeof publicOnAppInstancePlanConvertedToPaid =\n /*#__PURE__*/ createEventModule(publicOnAppInstancePlanConvertedToPaid);\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n */\nexport const onAppInstancePlanReactivated: BuildEventDefinition<\n typeof publicOnAppInstancePlanReactivated\n> &\n typeof publicOnAppInstancePlanReactivated = /*#__PURE__*/ createEventModule(\n publicOnAppInstancePlanReactivated\n);\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n */\nexport const onAppInstancePlanTransferred: BuildEventDefinition<\n typeof publicOnAppInstancePlanTransferred\n> &\n typeof publicOnAppInstancePlanTransferred = /*#__PURE__*/ createEventModule(\n publicOnAppInstancePlanTransferred\n);\n\nexport {\n PaymentCycle,\n FreeTrialStatus,\n FreeTrialPeriod,\n ReactivationReason,\n ResolutionMethod,\n WebhookIdentityType,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\nexport {\n AppInstance,\n BillingInfo,\n FreeTrialInfo,\n AvailablePlan,\n AppInstalled,\n AppRemoved,\n PaidPlanPurchased,\n PaidPlanChanged,\n PaidPlanAutoRenewalCancelled,\n PlanTransferred,\n PlanReactivated,\n PlanConvertedToPaid,\n GetAppInstanceRequest,\n GetAppInstanceResponse,\n SiteInfo,\n Multilingual,\n SupportedLanguage,\n Locale,\n OwnerInfo,\n GetAppInstanceByInstanceIdRequest,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n AppInstanceInstalledEnvelope,\n AppInstanceRemovedEnvelope,\n AppInstancePaidPlanAutoRenewalCancelledEnvelope,\n AppInstancePaidPlanChangedEnvelope,\n AppInstancePaidPlanPurchasedEnvelope,\n AppInstancePlanConvertedToPaidEnvelope,\n AppInstancePlanReactivatedEnvelope,\n AppInstancePlanTransferredEnvelope,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\nexport {\n PaymentCycleWithLiterals,\n FreeTrialStatusWithLiterals,\n FreeTrialPeriodWithLiterals,\n ReactivationReasonWithLiterals,\n ResolutionMethodWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,8BAAAC;AAAA,EAAA,iDAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,sCAAAC;AAAA,EAAA,wCAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AA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,2DAAiBA,eAAoB;AAOhD,IAAMC,0BAGyC;AAAA,EACpD;AACF;AAIO,IAAMC,wBAGuC;AAAA,EAClD;AACF;AAMO,IAAMC,6CAIG;AAAA,EACZ;AACF;AAIK,IAAMC,gCAG+C;AAAA,EAC1D;AACF;AAIO,IAAMC,kCAGiD;AAAA,EAC5D;AACF;AAIO,IAAMC,oCAIG,uEAAkB,gCAAsC;AAIjE,IAAMC,gCAG+C;AAAA,EAC1D;AACF;AAIO,IAAMC,gCAG+C;AAAA,EAC1D;AACF;","names":["getAppInstance","onAppInstanceInstalled","onAppInstancePaidPlanAutoRenewalCancelled","onAppInstancePaidPlanChanged","onAppInstancePaidPlanPurchased","onAppInstancePlanConvertedToPaid","onAppInstancePlanReactivated","onAppInstancePlanTransferred","onAppInstanceRemoved","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_rest_modules","payload","PaymentCycle","FreeTrialStatus","FreeTrialPeriod","ReactivationReason","ResolutionMethod","WebhookIdentityType","getAppInstance","sdkTransformError","getAppInstance","import_rest_modules","getAppInstance","onAppInstanceInstalled","onAppInstanceRemoved","onAppInstancePaidPlanAutoRenewalCancelled","onAppInstancePaidPlanChanged","onAppInstancePaidPlanPurchased","onAppInstancePlanConvertedToPaid","onAppInstancePlanReactivated","onAppInstancePlanTransferred"]}
@@ -664,6 +664,6 @@ declare function onAppInstancePlanTransferred(handler: (event: AppInstancePlanTr
664
664
  * @applicableIdentity APP
665
665
  * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance
666
666
  */
667
- declare function getAppInstance(): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 7>>;
667
+ declare function getAppInstance(): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 5>>;
668
668
 
669
669
  export { type AccountInfo, type AppInstalled, type AppInstance, type AppInstanceInstalledEnvelope, type AppInstancePaidPlanAutoRenewalCancelledEnvelope, type AppInstancePaidPlanChangedEnvelope, type AppInstancePaidPlanPurchasedEnvelope, type AppInstancePlanConvertedToPaidEnvelope, type AppInstancePlanReactivatedEnvelope, type AppInstancePlanTransferredEnvelope, type AppInstanceRemovedEnvelope, type AppRemoved, type AvailablePlan, type BaseEventMetadata, type BillingInfo, type FreeTrialInfo, FreeTrialPeriod, type FreeTrialPeriodWithLiterals, FreeTrialStatus, type FreeTrialStatusWithLiterals, type GetAppInstanceByInstanceIdRequest, type GetAppInstanceRequest, type GetAppInstanceResponse, type IdentificationData, type IdentificationDataIdOneOf, type Locale, type MessageEnvelope, type Multilingual, type OwnerInfo, type PaidPlanAutoRenewalCancelled, type PaidPlanChanged, type PaidPlanPurchased, PaymentCycle, type PaymentCycleWithLiterals, type PlanConvertedToPaid, type PlanReactivated, type PlanTransferred, ReactivationReason, type ReactivationReasonWithLiterals, ResolutionMethod, type ResolutionMethodWithLiterals, type SiteInfo, type SupportedLanguage, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getAppInstance, onAppInstanceInstalled, onAppInstancePaidPlanAutoRenewalCancelled, onAppInstancePaidPlanChanged, onAppInstancePaidPlanPurchased, onAppInstancePlanConvertedToPaid, onAppInstancePlanReactivated, onAppInstancePlanTransferred, onAppInstanceRemoved };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.universal.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.http.ts"],"sourcesContent":["export * from './src/devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppInstanceV1AppInstance from './devcenter-app-instance-v1-app-instance-app-instances.http.js';\n\n/**\n * An app instance is a specific occurrence of an app on a Wix site.\n * When a Wix user installs an app, a unique instance is generated for that\n * specific site. Use the `instanceId` to keep track of the individual data\n * associated with each app instance.\n */\nexport interface AppInstance {\n /**\n * App instance ID. Useful to keep track of the\n * data that's associated with the specific instance of your app\n * installed on a Wix site.\n */\n instanceId?: string;\n /** App name, as you entered it in the App Dashboard. */\n appName?: string;\n /** Version of your app that's installed on the Wix site. */\n appVersion?: string | null;\n /**\n * Whether the Wix user has installed a free or paid version of your app\n * on their site.\n */\n isFree?: boolean;\n /**\n * Billing information for the app instance. Available only in case\n * `{\"isFree\": false}`.\n */\n billing?: BillingInfo;\n /**\n * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)\n * that the Wix user has granted your app. You set the list of permissions that\n * your app requires from the Wix user in your app's Permissions page.\n */\n permissions?: string[];\n /** Plans available to this app instance. */\n availablePlans?: AvailablePlan[];\n /**\n * ID of the Wix site from which the instance of your app has been cloned.\n *\n * All visual settings of the Wix site and app data are duplicated during the\n * cloning process. Wix also notifies you in case there is any additional\n * external functionality for the original site.\n */\n originInstanceId?: string | null;\n /**\n * __Deprecated__. This parameter will be removed on March 30, 2023. Use\n * `copiedFromTemplate` instead.\n * @deprecated\n */\n isOriginSiteTemplate?: boolean;\n /** Whether this app instance was created when another Wix site was cloned. */\n copiedFromTemplate?: boolean;\n /** Whether this app instance includes a free trial that hasn't started yet. */\n freeTrialAvailable?: boolean;\n}\n\nexport interface BillingInfo {\n /** Name of the package that the site owner has paid for. */\n packageName?: string;\n /**\n * Interval of the billing cycle. `ONE_TIME` indicates that the Wix user has\n * made a single upfront payment without any automatic subscription renewal.\n * This is primarily for usage credits (for example, 5 SMS) but may occasionally apply\n * to a one-time setup for the app.\n */\n billingCycle?: PaymentCycleWithLiterals;\n /**\n * Date and time the Wix user purchased the app's paid plan or began their free trial. In\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n timeStamp?: string;\n /**\n * Date and time the app's current billing cycle ends in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and\n * multi-yearly plans.\n */\n expirationDate?: string | null;\n /**\n * Whether the app's subscription automatically renews at the end of the\n * current billing cycle.\n */\n autoRenewing?: boolean | null;\n /** ID of the invoice for the current billing cycle. */\n invoiceId?: string | null;\n /**\n * Information about any discounts applied to the app instance's current billing cycle.\n * If the site owners applied a developer coupon or Wix Voucher\n * when installing the paid version of your app, this field holds the coupon's\n * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when\n * upgrading their Wix subscription. If there is no discount for the\n * current billing cycle, the field is an empty string.\n */\n source?: string | null;\n /** Information about the free trial applied, if relevant. */\n freeTrialInfo?: FreeTrialInfo;\n}\n\nexport enum PaymentCycle {\n NO_CYCLE = 'NO_CYCLE',\n MONTHLY = 'MONTHLY',\n YEARLY = 'YEARLY',\n ONE_TIME = 'ONE_TIME',\n TWO_YEARS = 'TWO_YEARS',\n THREE_YEARS = 'THREE_YEARS',\n FOUR_YEARS = 'FOUR_YEARS',\n FIVE_YEARS = 'FIVE_YEARS',\n}\n\n/** @enumType */\nexport type PaymentCycleWithLiterals =\n | PaymentCycle\n | 'NO_CYCLE'\n | 'MONTHLY'\n | 'YEARLY'\n | 'ONE_TIME'\n | 'TWO_YEARS'\n | 'THREE_YEARS'\n | 'FOUR_YEARS'\n | 'FIVE_YEARS';\n\nexport interface FreeTrialInfo {\n /**\n * Current free trial status.\n * @readonly\n */\n status?: FreeTrialStatusWithLiterals;\n /**\n * When the free trial has ended. Populated only once the free trial is over.\n * @readonly\n */\n endDate?: Date | null;\n}\n\nexport enum FreeTrialStatus {\n /** The free trial is currently in progress. */\n IN_PROGRESS = 'IN_PROGRESS',\n /** The free trial has ended. */\n ENDED = 'ENDED',\n /** No free trial was applied, as none was available. */\n NOT_AVAILABLE = 'NOT_AVAILABLE',\n}\n\n/** @enumType */\nexport type FreeTrialStatusWithLiterals =\n | FreeTrialStatus\n | 'IN_PROGRESS'\n | 'ENDED'\n | 'NOT_AVAILABLE';\n\nexport interface AvailablePlan {\n /** Package name of the available plan. */\n packageName?: string;\n /** Source of the available plan. Can be a bundle or 3rd-party app. */\n source?: string;\n}\n\nexport interface AppInstalled {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n /**\n * 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)).\n * @format GUID\n */\n originInstanceId?: string | null;\n}\n\nexport interface AppRemoved {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface PaidPlanPurchased {\n /** Date and time of purchase. */\n operationTimeStamp?: Date | null;\n /**\n * Purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanChanged {\n /** Date and time of change. */\n operationTimeStamp?: Date | null;\n /**\n * Newly purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Newly selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Previous app plan.\n * @maxLength 100\n */\n previousVendorProductId?: string | null;\n /** Previous payment cycle. */\n previousCycle?: PaymentCycleWithLiterals;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanAutoRenewalCancelled {\n /** Date and time of auto-renewal cancellation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Current payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant).\n * @maxLength 100\n */\n cancelReason?: string | null;\n /**\n * Reason provided by site owner for cancellation (if relevant).\n * @maxLength 150\n */\n userReason?: string | null;\n /**\n * Cancellation type.\n * @maxLength 100\n */\n subscriptionCancellationType?: string | null;\n /** Whether the cancellation occurred during a free trial. */\n cancelledDuringFreeTrial?: FreeTrialPeriodWithLiterals;\n}\n\nexport enum FreeTrialPeriod {\n /** During a free trial period. */\n DURING_FREE_TRIAL = 'DURING_FREE_TRIAL',\n /** Not during a free trial period. */\n NOT_DURING_FREE_TRIAL = 'NOT_DURING_FREE_TRIAL',\n}\n\n/** @enumType */\nexport type FreeTrialPeriodWithLiterals =\n | FreeTrialPeriod\n | 'DURING_FREE_TRIAL'\n | 'NOT_DURING_FREE_TRIAL';\n\nexport interface PlanTransferred {\n /** Date and time of transfer. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PlanReactivated {\n /** Date and time of reactivation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n /** Reason for reactivation. */\n reason?: ReactivationReasonWithLiterals;\n}\n\nexport enum ReactivationReason {\n /** Reactivation reason unknown. */\n REACTIVATION_REASON_UNKNOWN = 'REACTIVATION_REASON_UNKNOWN',\n /** The subscription's auto-renewal is turned on. */\n AUTO_RENEW_TURNED_ON = 'AUTO_RENEW_TURNED_ON',\n}\n\n/** @enumType */\nexport type ReactivationReasonWithLiterals =\n | ReactivationReason\n | 'REACTIVATION_REASON_UNKNOWN'\n | 'AUTO_RENEW_TURNED_ON';\n\nexport interface PlanConvertedToPaid {\n /** Date and time of conversion to paid subscription (free-trial ended). */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n}\n\nexport interface GetAppInstanceRequest {}\n\nexport interface GetAppInstanceResponse {\n /** Retrieved app instance. */\n instance?: AppInstance;\n /** Information about the site. */\n site?: SiteInfo;\n}\n\nexport interface SiteInfo {\n /** Display name of the site. */\n siteDisplayName?: string | null;\n /**\n * 2-letter language code of the site's locale in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n */\n locale?: string;\n /**\n * 3-letter currency code for the site's billing in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n paymentCurrency?: string;\n /** Information about the site's supported languages. */\n multilingual?: Multilingual;\n /** URL of the site. Available only when the site has been published. */\n url?: string | null;\n /** Description of the site. */\n description?: string | null;\n /** Apps made by Wix that are installed on the site. */\n installedWixApps?: string[];\n /**\n * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.\n * @format EMAIL\n * @deprecated\n */\n ownerEmail?: string | null;\n /**\n * Information about the site's Wix user. Available only when calling\n * _Get App Instance_ with the __Read Site Owner Email__ permission scope.\n */\n ownerInfo?: OwnerInfo;\n /** Site ID. */\n siteId?: string;\n /**\n * Type of Wix user who owns the site.\n * Available only when calling _Get App Instance_ with the __Read Site User Type__ permission scope.\n * Supported values: `\"Channel DIY\"`, `\"Channel DIFM\"`, `\"Enterprise\"`.\n */\n siteUserType?: string | null;\n}\n\nexport interface Multilingual {\n /** Whether the site supports more than a single language. */\n isMultiLingual?: boolean;\n /** List of supported languages. Returned only when `{\"isMultiLingual\": true}`. */\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Locale. */\n locale?: Locale;\n /** Whether the supported language is the primary language for the site. */\n isPrimary?: boolean;\n /** Language icon. */\n countryCode?: string;\n /** How the language will be resolved. For internal use. */\n resolutionMethod?: ResolutionMethodWithLiterals;\n /** Whether the supported language is the primary language for site visitors. */\n isVisitorPrimary?: boolean | null;\n}\n\nexport interface Locale {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */\n country?: string;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\n/** @enumType */\nexport type ResolutionMethodWithLiterals =\n | ResolutionMethod\n | 'QUERY_PARAM'\n | 'SUBDOMAIN'\n | 'SUBDIRECTORY';\n\nexport interface OwnerInfo {\n /**\n * Wix user's email address. Identical to the their login email.\n * @format EMAIL\n */\n email?: string;\n /**\n * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,\n * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.\n *\n * Whether the Wix user has verified their email and whether they have chosen\n * to receive email notifications from Wix.\n */\n emailStatus?: string;\n}\n\nexport interface GetAppInstanceByInstanceIdRequest {\n /**\n * ID of the app instance to retrieve.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface AppInstanceInstalledEnvelope {\n data: AppInstalled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppInstalled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug installed\n */\nexport declare function onAppInstanceInstalled(\n handler: (event: AppInstanceInstalledEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstanceRemovedEnvelope {\n data: AppRemoved;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppRemoved\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug removed\n */\nexport declare function onAppInstanceRemoved(\n handler: (event: AppInstanceRemovedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {\n data: PaidPlanAutoRenewalCancelled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanAutoRenewalCancelled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_auto_renewal_cancelled\n */\nexport declare function onAppInstancePaidPlanAutoRenewalCancelled(\n handler: (\n event: AppInstancePaidPlanAutoRenewalCancelledEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanChangedEnvelope {\n data: PaidPlanChanged;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanChanged\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_changed\n */\nexport declare function onAppInstancePaidPlanChanged(\n handler: (event: AppInstancePaidPlanChangedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanPurchasedEnvelope {\n data: PaidPlanPurchased;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanPurchased\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_purchased\n */\nexport declare function onAppInstancePaidPlanPurchased(\n handler: (event: AppInstancePaidPlanPurchasedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanConvertedToPaidEnvelope {\n data: PlanConvertedToPaid;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanConvertedToPaid\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_converted_to_paid\n */\nexport declare function onAppInstancePlanConvertedToPaid(\n handler: (\n event: AppInstancePlanConvertedToPaidEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanReactivatedEnvelope {\n data: PlanReactivated;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanReactivated\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_reactivated\n */\nexport declare function onAppInstancePlanReactivated(\n handler: (event: AppInstancePlanReactivatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanTransferredEnvelope {\n data: PlanTransferred;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanTransferred\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_transferred\n */\nexport declare function onAppInstancePlanTransferred(\n handler: (event: AppInstancePlanTransferredEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n * @public\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance\n */\nexport async function getAppInstance(): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixDevcenterAppInstanceV1AppInstance.getAppInstance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiAppInstanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n _: [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-instances';\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\nexport function getAppInstance(payload: object): RequestOptionsFactory<any> {\n function __getAppInstance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.app_instance.v1.app_instance',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.AppInstanceService.GetAppInstance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressMarketAimApiAppInstanceServiceUrl({\n protoPath: '/v1/instance',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'instance.billing.freeTrialInfo.endDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getAppInstance;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAA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,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,uBAAoB;AACpB,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,SAAM;AALI,SAAAA;AAAA,GAAA;AAoPZ,eAAsBC,kBAiCpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,CAAC,CAAC;AAExD,QAAM,UAC2C,eAAe,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getAppInstance","import_rest_modules","payload","PaymentCycle","FreeTrialStatus","FreeTrialPeriod","ReactivationReason","ResolutionMethod","WebhookIdentityType","getAppInstance","sdkTransformError"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.universal.ts","../../src/devcenter-app-instance-v1-app-instance-app-instances.http.ts"],"sourcesContent":["export * from './src/devcenter-app-instance-v1-app-instance-app-instances.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppInstanceV1AppInstance from './devcenter-app-instance-v1-app-instance-app-instances.http.js';\n\n/**\n * An app instance is a specific occurrence of an app on a Wix site.\n * When a Wix user installs an app, a unique instance is generated for that\n * specific site. Use the `instanceId` to keep track of the individual data\n * associated with each app instance.\n */\nexport interface AppInstance {\n /**\n * App instance ID. Useful to keep track of the\n * data that's associated with the specific instance of your app\n * installed on a Wix site.\n */\n instanceId?: string;\n /** App name, as you entered it in the App Dashboard. */\n appName?: string;\n /** Version of your app that's installed on the Wix site. */\n appVersion?: string | null;\n /**\n * Whether the Wix user has installed a free or paid version of your app\n * on their site.\n */\n isFree?: boolean;\n /**\n * Billing information for the app instance. Available only in case\n * `{\"isFree\": false}`.\n */\n billing?: BillingInfo;\n /**\n * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)\n * that the Wix user has granted your app. You set the list of permissions that\n * your app requires from the Wix user in your app's Permissions page.\n */\n permissions?: string[];\n /** Plans available to this app instance. */\n availablePlans?: AvailablePlan[];\n /**\n * ID of the Wix site from which the instance of your app has been cloned.\n *\n * All visual settings of the Wix site and app data are duplicated during the\n * cloning process. Wix also notifies you in case there is any additional\n * external functionality for the original site.\n */\n originInstanceId?: string | null;\n /**\n * __Deprecated__. This parameter will be removed on March 30, 2023. Use\n * `copiedFromTemplate` instead.\n * @deprecated\n */\n isOriginSiteTemplate?: boolean;\n /** Whether this app instance was created when another Wix site was cloned. */\n copiedFromTemplate?: boolean;\n /** Whether this app instance includes a free trial that hasn't started yet. */\n freeTrialAvailable?: boolean;\n}\n\nexport interface BillingInfo {\n /** Name of the package that the site owner has paid for. */\n packageName?: string;\n /**\n * Interval of the billing cycle. `ONE_TIME` indicates that the Wix user has\n * made a single upfront payment without any automatic subscription renewal.\n * This is primarily for usage credits (for example, 5 SMS) but may occasionally apply\n * to a one-time setup for the app.\n */\n billingCycle?: PaymentCycleWithLiterals;\n /**\n * Date and time the Wix user purchased the app's paid plan or began their free trial. In\n * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n */\n timeStamp?: string;\n /**\n * Date and time the app's current billing cycle ends in\n * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and\n * multi-yearly plans.\n */\n expirationDate?: string | null;\n /**\n * Whether the app's subscription automatically renews at the end of the\n * current billing cycle.\n */\n autoRenewing?: boolean | null;\n /** ID of the invoice for the current billing cycle. */\n invoiceId?: string | null;\n /**\n * Information about any discounts applied to the app instance's current billing cycle.\n * If the site owners applied a developer coupon or Wix Voucher\n * when installing the paid version of your app, this field holds the coupon's\n * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when\n * upgrading their Wix subscription. If there is no discount for the\n * current billing cycle, the field is an empty string.\n */\n source?: string | null;\n /** Information about the free trial applied, if relevant. */\n freeTrialInfo?: FreeTrialInfo;\n}\n\nexport enum PaymentCycle {\n NO_CYCLE = 'NO_CYCLE',\n MONTHLY = 'MONTHLY',\n YEARLY = 'YEARLY',\n ONE_TIME = 'ONE_TIME',\n TWO_YEARS = 'TWO_YEARS',\n THREE_YEARS = 'THREE_YEARS',\n FOUR_YEARS = 'FOUR_YEARS',\n FIVE_YEARS = 'FIVE_YEARS',\n}\n\n/** @enumType */\nexport type PaymentCycleWithLiterals =\n | PaymentCycle\n | 'NO_CYCLE'\n | 'MONTHLY'\n | 'YEARLY'\n | 'ONE_TIME'\n | 'TWO_YEARS'\n | 'THREE_YEARS'\n | 'FOUR_YEARS'\n | 'FIVE_YEARS';\n\nexport interface FreeTrialInfo {\n /**\n * Current free trial status.\n * @readonly\n */\n status?: FreeTrialStatusWithLiterals;\n /**\n * When the free trial has ended. Populated only once the free trial is over.\n * @readonly\n */\n endDate?: Date | null;\n}\n\nexport enum FreeTrialStatus {\n /** The free trial is currently in progress. */\n IN_PROGRESS = 'IN_PROGRESS',\n /** The free trial has ended. */\n ENDED = 'ENDED',\n /** No free trial was applied, as none was available. */\n NOT_AVAILABLE = 'NOT_AVAILABLE',\n}\n\n/** @enumType */\nexport type FreeTrialStatusWithLiterals =\n | FreeTrialStatus\n | 'IN_PROGRESS'\n | 'ENDED'\n | 'NOT_AVAILABLE';\n\nexport interface AvailablePlan {\n /** Package name of the available plan. */\n packageName?: string;\n /** Source of the available plan. Can be a bundle or 3rd-party app. */\n source?: string;\n}\n\nexport interface AppInstalled {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n /**\n * 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)).\n * @format GUID\n */\n originInstanceId?: string | null;\n}\n\nexport interface AppRemoved {\n /**\n * Unique identifier of the app within the website.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface PaidPlanPurchased {\n /** Date and time of purchase. */\n operationTimeStamp?: Date | null;\n /**\n * Purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanChanged {\n /** Date and time of change. */\n operationTimeStamp?: Date | null;\n /**\n * Newly purchased app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Newly selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Previous app plan.\n * @maxLength 100\n */\n previousVendorProductId?: string | null;\n /** Previous payment cycle. */\n previousCycle?: PaymentCycleWithLiterals;\n /**\n * Coupon applied to purchase (if relevant).\n * @maxLength 150\n */\n couponName?: string | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PaidPlanAutoRenewalCancelled {\n /** Date and time of auto-renewal cancellation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Current payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant).\n * @maxLength 100\n */\n cancelReason?: string | null;\n /**\n * Reason provided by site owner for cancellation (if relevant).\n * @maxLength 150\n */\n userReason?: string | null;\n /**\n * Cancellation type.\n * @maxLength 100\n */\n subscriptionCancellationType?: string | null;\n /** Whether the cancellation occurred during a free trial. */\n cancelledDuringFreeTrial?: FreeTrialPeriodWithLiterals;\n}\n\nexport enum FreeTrialPeriod {\n /** During a free trial period. */\n DURING_FREE_TRIAL = 'DURING_FREE_TRIAL',\n /** Not during a free trial period. */\n NOT_DURING_FREE_TRIAL = 'NOT_DURING_FREE_TRIAL',\n}\n\n/** @enumType */\nexport type FreeTrialPeriodWithLiterals =\n | FreeTrialPeriod\n | 'DURING_FREE_TRIAL'\n | 'NOT_DURING_FREE_TRIAL';\n\nexport interface PlanTransferred {\n /** Date and time of transfer. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n}\n\nexport interface PlanReactivated {\n /** Date and time of reactivation. */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n /**\n * Invoice ID.\n * @maxLength 50\n */\n invoiceId?: string | null;\n /** Reason for reactivation. */\n reason?: ReactivationReasonWithLiterals;\n}\n\nexport enum ReactivationReason {\n /** Reactivation reason unknown. */\n REACTIVATION_REASON_UNKNOWN = 'REACTIVATION_REASON_UNKNOWN',\n /** The subscription's auto-renewal is turned on. */\n AUTO_RENEW_TURNED_ON = 'AUTO_RENEW_TURNED_ON',\n}\n\n/** @enumType */\nexport type ReactivationReasonWithLiterals =\n | ReactivationReason\n | 'REACTIVATION_REASON_UNKNOWN'\n | 'AUTO_RENEW_TURNED_ON';\n\nexport interface PlanConvertedToPaid {\n /** Date and time of conversion to paid subscription (free-trial ended). */\n operationTimeStamp?: Date | null;\n /**\n * Current app plan.\n * @maxLength 100\n */\n vendorProductId?: string;\n /** Selected payment cycle. */\n cycle?: PaymentCycleWithLiterals;\n /** Plan expiration date. */\n expiresOn?: Date | null;\n}\n\nexport interface GetAppInstanceRequest {}\n\nexport interface GetAppInstanceResponse {\n /** Retrieved app instance. */\n instance?: AppInstance;\n /** Information about the site. */\n site?: SiteInfo;\n}\n\nexport interface SiteInfo {\n /** Display name of the site. */\n siteDisplayName?: string | null;\n /**\n * 2-letter language code of the site's locale in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n */\n locale?: string;\n /**\n * 3-letter currency code for the site's billing in\n * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n */\n paymentCurrency?: string;\n /** Information about the site's supported languages. */\n multilingual?: Multilingual;\n /** URL of the site. Available only when the site has been published. */\n url?: string | null;\n /** Description of the site. */\n description?: string | null;\n /** Apps made by Wix that are installed on the site. */\n installedWixApps?: string[];\n /**\n * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.\n * @format EMAIL\n * @deprecated\n */\n ownerEmail?: string | null;\n /**\n * Information about the site's Wix user. Available only when calling\n * _Get App Instance_ with the __Read Site Owner Email__ permission scope.\n */\n ownerInfo?: OwnerInfo;\n /** Site ID. */\n siteId?: string;\n /**\n * Type of Wix user who owns the site.\n * Available only when calling _Get App Instance_ with the __Read Site User Type__ permission scope.\n * Supported values: `\"Channel DIY\"`, `\"Channel DIFM\"`, `\"Enterprise\"`.\n */\n siteUserType?: string | null;\n}\n\nexport interface Multilingual {\n /** Whether the site supports more than a single language. */\n isMultiLingual?: boolean;\n /** List of supported languages. Returned only when `{\"isMultiLingual\": true}`. */\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Locale. */\n locale?: Locale;\n /** Whether the supported language is the primary language for the site. */\n isPrimary?: boolean;\n /** Language icon. */\n countryCode?: string;\n /** How the language will be resolved. For internal use. */\n resolutionMethod?: ResolutionMethodWithLiterals;\n /** Whether the supported language is the primary language for site visitors. */\n isVisitorPrimary?: boolean | null;\n}\n\nexport interface Locale {\n /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */\n languageCode?: string;\n /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */\n country?: string;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\n/** @enumType */\nexport type ResolutionMethodWithLiterals =\n | ResolutionMethod\n | 'QUERY_PARAM'\n | 'SUBDOMAIN'\n | 'SUBDIRECTORY';\n\nexport interface OwnerInfo {\n /**\n * Wix user's email address. Identical to the their login email.\n * @format EMAIL\n */\n email?: string;\n /**\n * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,\n * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.\n *\n * Whether the Wix user has verified their email and whether they have chosen\n * to receive email notifications from Wix.\n */\n emailStatus?: string;\n}\n\nexport interface GetAppInstanceByInstanceIdRequest {\n /**\n * ID of the app instance to retrieve.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface AppInstanceInstalledEnvelope {\n data: AppInstalled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is installed on a Wix site.\n *\n * Both App Instance Installed and [App Installation Created](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-created) trigger on the first install of your app.\n * The two events carry different data. Subscribe to App Installation Created to receive the full [App Installation object](https://dev.wix.com/docs/api-reference/app-management/app-installations/app-installation-object) directly.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppInstalled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug installed\n */\nexport declare function onAppInstanceInstalled(\n handler: (event: AppInstanceInstalledEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstanceRemovedEnvelope {\n data: AppRemoved;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when an instance of your app is uninstalled from a Wix site.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType AppRemoved\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug removed\n */\nexport declare function onAppInstanceRemoved(\n handler: (event: AppInstanceRemovedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {\n data: PaidPlanAutoRenewalCancelled;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user either cancels a paid plan for your app, or cancels the plan's auto-renewal. The\n * Wix user can continue to use your app until the end of the current billing\n * cycle.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanAutoRenewalCancelled\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_auto_renewal_cancelled\n */\nexport declare function onAppInstancePaidPlanAutoRenewalCancelled(\n handler: (\n event: AppInstancePaidPlanAutoRenewalCancelledEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanChangedEnvelope {\n data: PaidPlanChanged;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user upgrades or downgrades their plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanChanged\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_changed\n */\nexport declare function onAppInstancePaidPlanChanged(\n handler: (event: AppInstancePaidPlanChangedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePaidPlanPurchasedEnvelope {\n data: PaidPlanPurchased;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user purchases a paid plan for your app.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PaidPlanPurchased\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug paid_plan_purchased\n */\nexport declare function onAppInstancePaidPlanPurchased(\n handler: (event: AppInstancePaidPlanPurchasedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanConvertedToPaidEnvelope {\n data: PlanConvertedToPaid;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a Wix user reaches the end of a free-trial period and is charged successfully.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanConvertedToPaid\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_converted_to_paid\n */\nexport declare function onAppInstancePlanConvertedToPaid(\n handler: (\n event: AppInstancePlanConvertedToPaidEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanReactivatedEnvelope {\n data: PlanReactivated;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when auto-renewal is turned on for a paid plan.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanReactivated\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_reactivated\n */\nexport declare function onAppInstancePlanReactivated(\n handler: (event: AppInstancePlanReactivatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AppInstancePlanTransferredEnvelope {\n data: PlanTransferred;\n metadata: BaseEventMetadata;\n}\n\n/**\n * Triggered when a paid plan for your app is transferred to a different Wix account.\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @webhook\n * @eventType PlanTransferred\n * @serviceIdentifier com.wixpress.market.aim.api.AppInstanceService\n * @slug plan_transferred\n */\nexport declare function onAppInstancePlanTransferred(\n handler: (event: AppInstancePlanTransferredEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n * @public\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance\n */\nexport async function getAppInstance(): Promise<\n NonNullablePaths<\n GetAppInstanceResponse,\n | `instance.instanceId`\n | `instance.appName`\n | `instance.isFree`\n | `instance.billing.packageName`\n | `instance.billing.billingCycle`\n | `instance.billing.timeStamp`\n | `instance.billing.freeTrialInfo.status`\n | `instance.permissions`\n | `instance.availablePlans`\n | `instance.availablePlans.${number}.packageName`\n | `instance.availablePlans.${number}.source`\n | `instance.isOriginSiteTemplate`\n | `instance.copiedFromTemplate`\n | `instance.freeTrialAvailable`\n | `site.locale`\n | `site.paymentCurrency`\n | `site.multilingual.isMultiLingual`\n | `site.multilingual.supportedLanguages`\n | `site.multilingual.supportedLanguages.${number}.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.languageCode`\n | `site.multilingual.supportedLanguages.${number}.locale.country`\n | `site.multilingual.supportedLanguages.${number}.isPrimary`\n | `site.multilingual.supportedLanguages.${number}.countryCode`\n | `site.multilingual.supportedLanguages.${number}.resolutionMethod`\n | `site.installedWixApps`\n | `site.ownerInfo.email`\n | `site.ownerInfo.emailStatus`\n | `site.siteId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixDevcenterAppInstanceV1AppInstance.getAppInstance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiAppInstanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n _: [\n {\n srcPath: '/devcenter/app-instance/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/devcenter/checkout/v1/checkout',\n destPath: '/v1/checkout',\n },\n {\n srcPath: '/devcenter/checkout/v1/metered-billing-charges',\n destPath: '/v1/metered-billing-charges',\n },\n {\n srcPath: '/devcenter/scripts/v1/scripts',\n destPath: '/v1/scripts',\n },\n {\n srcPath: '/market/aim/v1/billing-event',\n destPath: '/v1/billing-event',\n },\n {\n srcPath: '/devcenter/bi-events/v1/bi-event',\n destPath: '/v1/bi-event',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-instances';\n\n/**\n * Retrieves data about the instance of your app that's installed on a Wix\n * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,\n * or to check which apps made by Wix are installed on the site.\n *\n * You must authenticate this method [as a Wix app](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth#step-2--make-an-authenticated-api-request).\n *\n * To retrieve `site.ownerInfo` in the response, you must\n * have the __READ SITE OWNER EMAIL__ permission scope in addition to\n * __MANAGE YOUR APP__.\n */\nexport function getAppInstance(payload: object): RequestOptionsFactory<any> {\n function __getAppInstance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.app_instance.v1.app_instance',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.AppInstanceService.GetAppInstance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressMarketAimApiAppInstanceServiceUrl({\n protoPath: '/v1/instance',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'instance.billing.freeTrialInfo.endDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getAppInstance;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AA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L,EAAAA,oBAAA,iCAA8B;AAE9B,EAAAA,oBAAA,0BAAuB;AAJb,SAAAA;AAAA,GAAA;AA2GL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;AAyGL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,uBAAoB;AACpB,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,SAAM;AALI,SAAAA;AAAA,GAAA;AAoPZ,eAAsBC,kBAiCpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,CAAC,CAAC;AAExD,QAAM,UAC2C,eAAe,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getAppInstance","import_rest_modules","payload","PaymentCycle","FreeTrialStatus","FreeTrialPeriod","ReactivationReason","ResolutionMethod","WebhookIdentityType","getAppInstance","sdkTransformError"]}
@@ -15,7 +15,7 @@ interface GetAppInstanceSignature {
15
15
  * have the __READ SITE OWNER EMAIL__ permission scope in addition to
16
16
  * __MANAGE YOUR APP__.
17
17
  */
18
- (): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 7>>;
18
+ (): Promise<NonNullablePaths<GetAppInstanceResponse, `instance.instanceId` | `instance.appName` | `instance.isFree` | `instance.billing.packageName` | `instance.billing.billingCycle` | `instance.billing.timeStamp` | `instance.billing.freeTrialInfo.status` | `instance.permissions` | `instance.availablePlans` | `instance.availablePlans.${number}.packageName` | `instance.availablePlans.${number}.source` | `instance.isOriginSiteTemplate` | `instance.copiedFromTemplate` | `instance.freeTrialAvailable` | `site.locale` | `site.paymentCurrency` | `site.multilingual.isMultiLingual` | `site.multilingual.supportedLanguages` | `site.multilingual.supportedLanguages.${number}.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.languageCode` | `site.multilingual.supportedLanguages.${number}.locale.country` | `site.multilingual.supportedLanguages.${number}.isPrimary` | `site.multilingual.supportedLanguages.${number}.countryCode` | `site.multilingual.supportedLanguages.${number}.resolutionMethod` | `site.installedWixApps` | `site.ownerInfo.email` | `site.ownerInfo.emailStatus` | `site.siteId`, 5>>;
19
19
  }
20
20
  declare const onAppInstanceInstalled$1: EventDefinition<AppInstanceInstalledEnvelope, "AppInstalled">;
21
21
  declare const onAppInstanceRemoved$1: EventDefinition<AppInstanceRemovedEnvelope, "AppRemoved">;