@wix/auto_sdk_app-management_app-plans 1.0.16 → 1.0.18

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.
@@ -1,7 +1,8 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { L as ListAppPlansByAppIdResponse } from './appmarket-v1-app-plans-app-plans.universal-DIYQWTDw.js';
3
- export { k as AppPlanInfo, A as AppPlans, B as BillingSource, d as Cycle, C as CycleType, f as Discount, g as DiscountSourceDataOneOf, D as DiscountType, e as Duration, b as DurationUnit, G as GetAvailableAppPlansRequest, l as GetAvailableAppPlansResponse, m as GetPricingPageUrlRequest, n as GetPricingPageUrlResponse, i as ListAppPlansByAppIdRequest, h as Plan, P as Price, c as SaleSource, S as SaleType, a as SourceType, j as TaxSettings, T as TaxType, U as UsageBasedDetails } from './appmarket-v1-app-plans-app-plans.universal-DIYQWTDw.js';
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { ListAppPlansByAppIdResponse } from './index.typings.js';
3
+ export { AppPlanInfo, AppPlans, BillingSource, Cycle, CycleType, Discount, DiscountSourceDataOneOf, DiscountType, Duration, DurationUnit, GetAvailableAppPlansRequest, GetAvailableAppPlansResponse, GetPricingPageUrlRequest, GetPricingPageUrlResponse, ListAppPlansByAppIdRequest, Plan, Price, SaleSource, SaleType, SourceType, TaxSettings, TaxType, UsageBasedDetails } from './index.typings.js';
4
4
 
5
+ type AppPlansNonNullablePaths = `_id` | `plans` | `plans.${number}._id` | `plans.${number}.vendorId` | `plans.${number}.name`;
5
6
  declare function listAppPlansByAppId$1(httpClient: HttpClient): ListAppPlansByAppIdSignature;
6
7
  interface ListAppPlansByAppIdSignature {
7
8
  /**
@@ -29,7 +30,9 @@ interface ListAppPlansByAppIdSignature {
29
30
  * Min: 1 app ID
30
31
  * Max: 100 app IDs
31
32
  */
32
- (appIds: string[]): Promise<ListAppPlansByAppIdResponse>;
33
+ (appIds: string[]): Promise<NonNullablePaths<ListAppPlansByAppIdResponse, `taxSettings.showPriceWithTax` | `taxSettings.taxType` | `currency` | `currencySymbol` | {
34
+ [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;
35
+ }[AppPlansNonNullablePaths]>>;
33
36
  }
34
37
 
35
38
  declare const listAppPlansByAppId: MaybeContext<BuildRESTFunction<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/appmarket-v1-app-plans-app-plans.universal.ts","../../src/appmarket-v1-app-plans-app-plans.http.ts","../../src/appmarket-v1-app-plans-app-plans.public.ts","../../src/appmarket-v1-app-plans-app-plans.context.ts"],"sourcesContent":["export * from './src/appmarket-v1-app-plans-app-plans.context.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 ambassadorWixAppmarketV1AppPlans from './appmarket-v1-app-plans-app-plans.http.js';\n\nexport interface AppPlans {\n /** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n _id?: string;\n /**\n * List of the app's pricing plans.\n *\n * Min: `0` plans\n * Max: `50` plans\n * @maxSize 50\n */\n plans?: Plan[];\n}\n\nexport enum SaleType {\n /** Default value, can be used when no specific sale is associated. */\n SALE_TYPE_UNSPECIFIED = 'SALE_TYPE_UNSPECIFIED',\n CYBER_MONDAY = 'CYBER_MONDAY',\n NOVEMBER_SALE = 'NOVEMBER_SALE',\n BLACK_FRIDAY = 'BLACK_FRIDAY',\n DEVELOPER_SALE = 'DEVELOPER_SALE',\n}\n\n/** @enumType */\nexport type SaleTypeWithLiterals =\n | SaleType\n | 'SALE_TYPE_UNSPECIFIED'\n | 'CYBER_MONDAY'\n | 'NOVEMBER_SALE'\n | 'BLACK_FRIDAY'\n | 'DEVELOPER_SALE';\n\nexport enum DiscountType {\n DISCOUNT_TYPE_UNSPECIFIED = 'DISCOUNT_TYPE_UNSPECIFIED',\n /** Discount is a fixed amount in USD. */\n FIXED_AMOUNT = 'FIXED_AMOUNT',\n /** Discount is a percentage of the total price. */\n PERCENTAGE = 'PERCENTAGE',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n | DiscountType\n | 'DISCOUNT_TYPE_UNSPECIFIED'\n | 'FIXED_AMOUNT'\n | 'PERCENTAGE';\n\nexport enum SourceType {\n /** Default value, can be used when no specific source is associated. */\n SOURCE_TYPE_UNSPECIFIED = 'SOURCE_TYPE_UNSPECIFIED',\n /** Discount is due to Wix/Developer Sale */\n SALE = 'SALE',\n /** Discount is due to App Benefit */\n APP_BENEFIT = 'APP_BENEFIT',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals =\n | SourceType\n | 'SOURCE_TYPE_UNSPECIFIED'\n | 'SALE'\n | 'APP_BENEFIT';\n\nexport interface SaleSource {\n /** @format GUID */\n saleId?: string | null;\n saleType?: SaleTypeWithLiterals;\n startDate?: Date | null;\n endDate?: Date | null;\n}\n\nexport interface Cycle {\n /**\n * Type of the billing cycle.\n *\n * + `\"UNKNOWN_UNIT\"`: There is no information about the billing cycle.\n * + `\"ONE_TIME\"`: The customer pays for unlimited usage of the app with a single payment.\n * + `\"RECURRING\"`: The customer pays for a subscription to the app on a recurring schedule.\n */\n cycleType?: CycleTypeWithLiterals;\n /** Duration of the billing cycle. Available only for `{\"cycleType\": \"RECURRING\"}`. */\n cycleDuration?: Duration;\n}\n\nexport enum DurationUnit {\n /** unknown interval unit */\n UNKNOWN_UNIT = 'UNKNOWN_UNIT',\n /** month */\n MONTH = 'MONTH',\n /** year */\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type DurationUnitWithLiterals =\n | DurationUnit\n | 'UNKNOWN_UNIT'\n | 'MONTH'\n | 'YEAR';\n\nexport enum CycleType {\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n ONE_TIME = 'ONE_TIME',\n RECURRING = 'RECURRING',\n}\n\n/** @enumType */\nexport type CycleTypeWithLiterals =\n | CycleType\n | 'UNKNOWN_TYPE'\n | 'ONE_TIME'\n | 'RECURRING';\n\nexport interface Duration {\n /** Unit of the billing cycle. */\n unit?: DurationUnitWithLiterals;\n /** Count of units that make up the billing cycle. */\n count?: number;\n}\n\nexport interface UsageBasedDetails {\n /**\n * Smallest possible amount that your app charges customers in usage-based\n * pricing. For example, the price of a single SMS message if your\n * app charges customers for sending text messages. Always in\n * [USD](https://en.wikipedia.org/wiki/United_States_dollar).\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n minimumChargeIncrement?: string | null;\n /**\n * Recurring, monthly base fee in usage-based pricing that your app\n * charges customers regardless of how much they use your app.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n monthlyBaseFee?: string | null;\n /**\n * Description of the usage-based pricing plan, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n *\n * Max: 1024 characters\n */\n customChargeDescription?: string | null;\n}\n\nexport interface Discount extends DiscountSourceDataOneOf {\n type?: DiscountTypeWithLiterals;\n /**\n * Discount amount\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n amount?: string;\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price with 12.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /**\n * Source of the discount.\n * @internal\n */\n sourceType?: SourceTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface DiscountSourceDataOneOf {}\n\nexport enum BillingSource {\n UNKNOWN = 'UNKNOWN',\n /** plan billing and charges is managed by Wix */\n WIX = 'WIX',\n /** plan billing and charges is managed by the app */\n EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type BillingSourceWithLiterals =\n | BillingSource\n | 'UNKNOWN'\n | 'WIX'\n | 'EXTERNAL';\n\nexport interface Price {\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price by 12.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /** Information about the plan's recurring billing cycle or single payment. */\n billingCycle?: Cycle;\n /**\n * Details about the plan's usage-based pricing.\n * Available only for plans with\n * [usage-based pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/usage-based-pricing).\n */\n usageBaseOptions?: UsageBasedDetails;\n discount?: Discount;\n billingSource?: BillingSourceWithLiterals;\n /**\n * Can be shown instead of plan price - used for dynamic plans\n * @maxLength 140\n */\n customPaymentTitle?: string | null;\n}\n\nexport interface Plan {\n /**\n * ID of the app plan.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * ID of your app's pricing plan, as displayed in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Identical to `vendorProductId` in the\n * [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).\n */\n vendorId?: string;\n /** Name of your app's pricing plan, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n name?: string;\n /**\n * List of your plan's benefits, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Currently, the benefits are available only in English.\n *\n * Min: `0` benefits\n * Max: `4` benefits\n * Max per benefit: 1024 characters\n * @maxSize 4\n * @maxLength 1024\n */\n benefits?: string[];\n /**\n * List of the plan's prices. Available only when the plan's prices are managed\n * by Wix and not externally.\n *\n * Min: `0` prices\n * Max: `10` prices\n * @maxSize 10\n */\n prices?: Price[];\n}\n\nexport interface ListAppPlansByAppIdRequest {\n /**\n * List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @minSize 1\n * @maxSize 100\n */\n appIds: string[];\n}\n\nexport interface ListAppPlansByAppIdResponse {\n /**\n * Tax settings. Wix calculates the tax settings based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the tax settings based on the caller's IP address. Note that the\n * tax settings may not resolve properly if you call through a VPN.\n */\n taxSettings?: TaxSettings;\n /**\n * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format. Wix calculates the currency based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the currency based on the caller's IP address. Note that the\n * currency may not resolve properly if you call through a VPN.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Currency symbol in decimal HTML entity format. For example, `&#36;` for $\n * (United States Dollar). Wix calculates the currency symbol based on the\n * country code that you pass in the call's header. If you don't pass a country\n * code in the header, Wix calculates the tax settings based on the caller's IP\n * address. Note that the currency symbol may not resolve properly if you call\n * through a VPN.\n */\n currencySymbol?: string;\n /**\n * Retrieved app plans.\n *\n * Min: 0 plans\n * Max: 50 plans\n *\n * If any plans aren't returned, it's likely because they haven't been activated yet.\n * @maxSize 50\n */\n appPlans?: AppPlans[];\n}\n\nexport interface TaxSettings {\n /**\n * Whether you must display the total price including taxes in the given\n * country.\n */\n showPriceWithTax?: boolean;\n /**\n * Tax rate for the given country as percentage. Returned as `0` when\n * `{\"showPriceWithTax\": false}`.\n * @format DECIMAL_VALUE\n */\n percentage?: string | null;\n /**\n * Type of tax required in the given country.\n *\n * + `\"NOT_APPLICABLE\"`: The country doesn't require that you display the total price including taxes, or Wix failed to calculate the country based on the call's IP address.\n * + `\"VAT\"`: The given country requires that you display the total price including [value-added tax (VAT)](https://en.wikipedia.org/wiki/Value-added_tax).\n * + `\"GST\"`: The given country requires that you display the total price including [generation-skipping transfer tax (GST)](https://en.wikipedia.org/wiki/Generation-skipping_transfer_tax).\n */\n taxType?: TaxTypeWithLiterals;\n}\n\nexport enum TaxType {\n NOT_APPLICABLE = 'NOT_APPLICABLE',\n VAT = 'VAT',\n GST = 'GST',\n}\n\n/** @enumType */\nexport type TaxTypeWithLiterals = TaxType | 'NOT_APPLICABLE' | 'VAT' | 'GST';\n\nexport interface GetAvailableAppPlansRequest {\n /**\n * AppId to get the available app plans for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan info to retrieve the available app plans for. */\n appPlanInfo?: AppPlanInfo;\n}\n\n/**\n * An `AppPlanInfo` object describes which app plan you want to retrieve data for.\n * Every plan in an app is identified by a unique combination of `productId` and `billingCycle`.\n */\nexport interface AppPlanInfo {\n /**\n * The app plan's vendorId to retrieve the response for.\n *\n * Max: 100 characters\n * @maxLength 100\n */\n vendorId?: string;\n /** The app plan cycle to retrieve the response for. */\n billingCycle?: Cycle;\n}\n\nexport interface GetAvailableAppPlansResponse {\n /** The available upgrades for the given app plan. */\n availableUpgrades?: AppPlans;\n /** The available downgrades for the given app plan. */\n availableDowngrades?: AppPlans;\n /** The current app plan. */\n currentPlan?: Plan;\n}\n\nexport interface GetPricingPageUrlRequest {\n /**\n * AppId to get the pricing page url for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan to retrieve the pricing page url for. */\n appPlanInfo?: AppPlanInfo;\n}\n\nexport interface GetPricingPageUrlResponse {\n /**\n * the pricing page url, if there is a app plan that is upgradable.\n * @format WEB_URL\n */\n packagePickerUrl?: string | null;\n}\n\ntype AppPlansNonNullablePaths =\n | `_id`\n | `plans`\n | `plans.${number}._id`\n | `plans.${number}.vendorId`\n | `plans.${number}.name`;\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n * @param appIds - List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @public\n * @documentationMaturity preview\n * @requiredField appIds\n * @fqn wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId\n */\nexport async function listAppPlansByAppId(\n appIds: string[]\n): Promise<\n NonNullablePaths<\n ListAppPlansByAppIdResponse,\n | `taxSettings.showPriceWithTax`\n | `taxSettings.taxType`\n | `currency`\n | `currencySymbol`\n | {\n [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;\n }[AppPlansNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ appIds: appIds });\n\n const reqOpts = ambassadorWixAppmarketV1AppPlans.listAppPlansByAppId(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: { appIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appIds']\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 resolveWixAppmarketAppPlansV1AppsPlansUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-market/apps-plans',\n destPath: '/api',\n },\n {\n srcPath: '/api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-plans';\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n */\nexport function listAppPlansByAppId(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPlansByAppId({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.appmarket.v1.app_plans',\n method: 'GET' as any,\n methodFqn: 'wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId',\n packageName: PACKAGE_NAME,\n url: resolveWixAppmarketAppPlansV1AppsPlansUrl({\n protoPath: '/v1/apps-plans/{appIds}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPlans.plans.prices.discount.saleOptions.startDate' },\n { path: 'appPlans.plans.prices.discount.saleOptions.endDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPlansByAppId;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n ListAppPlansByAppIdResponse,\n listAppPlansByAppId as universalListAppPlansByAppId,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function listAppPlansByAppId(\n httpClient: HttpClient\n): ListAppPlansByAppIdSignature {\n return (appIds: string[]) =>\n universalListAppPlansByAppId(\n appIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPlansByAppIdSignature {\n /**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n * @param - List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n */\n (appIds: string[]): Promise<ListAppPlansByAppIdResponse>;\n}\n\nexport {\n AppPlanInfo,\n AppPlans,\n BillingSource,\n Cycle,\n CycleType,\n Discount,\n DiscountSourceDataOneOf,\n DiscountType,\n Duration,\n DurationUnit,\n GetAvailableAppPlansRequest,\n GetAvailableAppPlansResponse,\n GetPricingPageUrlRequest,\n GetPricingPageUrlResponse,\n ListAppPlansByAppIdRequest,\n ListAppPlansByAppIdResponse,\n Plan,\n Price,\n SaleSource,\n SaleType,\n SourceType,\n TaxSettings,\n TaxType,\n UsageBasedDetails,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n","import { listAppPlansByAppId as publicListAppPlansByAppId } from './appmarket-v1-app-plans-app-plans.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAppPlansByAppId: MaybeContext<\n BuildRESTFunction<typeof publicListAppPlansByAppId> &\n typeof publicListAppPlansByAppId\n> = /*#__PURE__*/ createRESTModule(publicListAppPlansByAppId);\n\nexport {\n SaleType,\n DiscountType,\n SourceType,\n DurationUnit,\n CycleType,\n BillingSource,\n TaxType,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\nexport {\n AppPlans,\n SaleSource,\n Cycle,\n Duration,\n UsageBasedDetails,\n Discount,\n DiscountSourceDataOneOf,\n Price,\n Plan,\n ListAppPlansByAppIdRequest,\n ListAppPlansByAppIdResponse,\n TaxSettings,\n GetAvailableAppPlansRequest,\n AppPlanInfo,\n GetAvailableAppPlansResponse,\n GetPricingPageUrlRequest,\n GetPricingPageUrlResponse,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,0CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;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,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AA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N,EAAAA,SAAA,SAAM;AAHI,SAAAA;AAAA,GAAA;AAkGZ,eAAsBC,qBACpB,QAYA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,OAAe,CAAC;AAExE,QAAM,UAA2C,oBAAoB,OAAO;AAE5E,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,EAAE,QAAQ,OAAO;AAAA,QAC3C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEjfO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,WACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,IAAAC,uBAAiC;AAG1B,IAAMC,uBAGK,2DAAiBA,oBAAyB;","names":["listAppPlansByAppId","import_rest_modules","payload","SaleType","DiscountType","SourceType","DurationUnit","CycleType","BillingSource","TaxType","listAppPlansByAppId","sdkTransformError","listAppPlansByAppId","import_rest_modules","listAppPlansByAppId"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/appmarket-v1-app-plans-app-plans.universal.ts","../../src/appmarket-v1-app-plans-app-plans.http.ts","../../src/appmarket-v1-app-plans-app-plans.public.ts","../../src/appmarket-v1-app-plans-app-plans.context.ts"],"sourcesContent":["export * from './src/appmarket-v1-app-plans-app-plans.context.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 ambassadorWixAppmarketV1AppPlans from './appmarket-v1-app-plans-app-plans.http.js';\n\nexport interface AppPlans {\n /** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n _id?: string;\n /**\n * List of the app's pricing plans.\n *\n * Min: `0` plans\n * Max: `50` plans\n * @maxSize 50\n */\n plans?: Plan[];\n}\n\nexport enum SaleType {\n /** Default value, can be used when no specific sale is associated. */\n SALE_TYPE_UNSPECIFIED = 'SALE_TYPE_UNSPECIFIED',\n CYBER_MONDAY = 'CYBER_MONDAY',\n NOVEMBER_SALE = 'NOVEMBER_SALE',\n BLACK_FRIDAY = 'BLACK_FRIDAY',\n DEVELOPER_SALE = 'DEVELOPER_SALE',\n}\n\n/** @enumType */\nexport type SaleTypeWithLiterals =\n | SaleType\n | 'SALE_TYPE_UNSPECIFIED'\n | 'CYBER_MONDAY'\n | 'NOVEMBER_SALE'\n | 'BLACK_FRIDAY'\n | 'DEVELOPER_SALE';\n\nexport enum DiscountType {\n DISCOUNT_TYPE_UNSPECIFIED = 'DISCOUNT_TYPE_UNSPECIFIED',\n /** Discount is a fixed amount in USD. */\n FIXED_AMOUNT = 'FIXED_AMOUNT',\n /** Discount is a percentage of the total price. */\n PERCENTAGE = 'PERCENTAGE',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n | DiscountType\n | 'DISCOUNT_TYPE_UNSPECIFIED'\n | 'FIXED_AMOUNT'\n | 'PERCENTAGE';\n\nexport enum SourceType {\n /** Default value, can be used when no specific source is associated. */\n SOURCE_TYPE_UNSPECIFIED = 'SOURCE_TYPE_UNSPECIFIED',\n /** Discount is due to Wix/Developer Sale */\n SALE = 'SALE',\n /** Discount is due to App Benefit */\n APP_BENEFIT = 'APP_BENEFIT',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals =\n | SourceType\n | 'SOURCE_TYPE_UNSPECIFIED'\n | 'SALE'\n | 'APP_BENEFIT';\n\nexport interface SaleSource {\n /** @format GUID */\n saleId?: string | null;\n saleType?: SaleTypeWithLiterals;\n startDate?: Date | null;\n endDate?: Date | null;\n}\n\nexport interface Cycle {\n /**\n * Type of the billing cycle.\n *\n * + `\"UNKNOWN_UNIT\"`: There is no information about the billing cycle.\n * + `\"ONE_TIME\"`: The customer pays for unlimited usage of the app with a single payment.\n * + `\"RECURRING\"`: The customer pays for a subscription to the app on a recurring schedule.\n */\n cycleType?: CycleTypeWithLiterals;\n /** Duration of the billing cycle. Available only for `{\"cycleType\": \"RECURRING\"}`. */\n cycleDuration?: Duration;\n}\n\nexport enum DurationUnit {\n /** unknown interval unit */\n UNKNOWN_UNIT = 'UNKNOWN_UNIT',\n /** month */\n MONTH = 'MONTH',\n /** year */\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type DurationUnitWithLiterals =\n | DurationUnit\n | 'UNKNOWN_UNIT'\n | 'MONTH'\n | 'YEAR';\n\nexport enum CycleType {\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n ONE_TIME = 'ONE_TIME',\n RECURRING = 'RECURRING',\n}\n\n/** @enumType */\nexport type CycleTypeWithLiterals =\n | CycleType\n | 'UNKNOWN_TYPE'\n | 'ONE_TIME'\n | 'RECURRING';\n\nexport interface Duration {\n /** Unit of the billing cycle. */\n unit?: DurationUnitWithLiterals;\n /** Count of units that make up the billing cycle. */\n count?: number;\n}\n\nexport interface UsageBasedDetails {\n /**\n * Smallest possible amount that your app charges customers in usage-based\n * pricing. For example, the price of a single SMS message if your\n * app charges customers for sending text messages. Always in\n * [USD](https://en.wikipedia.org/wiki/United_States_dollar).\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n minimumChargeIncrement?: string | null;\n /**\n * Recurring, monthly base fee in usage-based pricing that your app\n * charges customers regardless of how much they use your app.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n monthlyBaseFee?: string | null;\n /**\n * Description of the usage-based pricing plan, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n *\n * Max: 1024 characters\n */\n customChargeDescription?: string | null;\n}\n\nexport interface Discount extends DiscountSourceDataOneOf {\n type?: DiscountTypeWithLiterals;\n /**\n * Discount amount\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n amount?: string;\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price with 12.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /**\n * Source of the discount.\n * @internal\n */\n sourceType?: SourceTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface DiscountSourceDataOneOf {}\n\nexport enum BillingSource {\n UNKNOWN = 'UNKNOWN',\n /** plan billing and charges is managed by Wix */\n WIX = 'WIX',\n /** plan billing and charges is managed by the app */\n EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type BillingSourceWithLiterals =\n | BillingSource\n | 'UNKNOWN'\n | 'WIX'\n | 'EXTERNAL';\n\nexport interface Price {\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price by 12.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /** Information about the plan's recurring billing cycle or single payment. */\n billingCycle?: Cycle;\n /**\n * Details about the plan's usage-based pricing.\n * Available only for plans with\n * [usage-based pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/usage-based-pricing).\n */\n usageBaseOptions?: UsageBasedDetails;\n discount?: Discount;\n billingSource?: BillingSourceWithLiterals;\n /**\n * Can be shown instead of plan price - used for dynamic plans\n * @maxLength 140\n */\n customPaymentTitle?: string | null;\n}\n\nexport interface Plan {\n /**\n * ID of the app plan.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * ID of your app's pricing plan, as displayed in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Identical to `vendorProductId` in the\n * [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).\n */\n vendorId?: string;\n /** Name of your app's pricing plan, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n name?: string;\n /**\n * List of your plan's benefits, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Currently, the benefits are available only in English.\n *\n * Min: `0` benefits\n * Max: `4` benefits\n * Max per benefit: 1024 characters\n * @maxSize 4\n * @maxLength 1024\n */\n benefits?: string[];\n /**\n * List of the plan's prices. Available only when the plan's prices are managed\n * by Wix and not externally.\n *\n * Min: `0` prices\n * Max: `10` prices\n * @maxSize 10\n */\n prices?: Price[];\n}\n\nexport interface ListAppPlansByAppIdRequest {\n /**\n * List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @minSize 1\n * @maxSize 100\n */\n appIds: string[];\n}\n\nexport interface ListAppPlansByAppIdResponse {\n /**\n * Tax settings. Wix calculates the tax settings based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the tax settings based on the caller's IP address. Note that the\n * tax settings may not resolve properly if you call through a VPN.\n */\n taxSettings?: TaxSettings;\n /**\n * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format. Wix calculates the currency based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the currency based on the caller's IP address. Note that the\n * currency may not resolve properly if you call through a VPN.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Currency symbol in decimal HTML entity format. For example, `&#36;` for $\n * (United States Dollar). Wix calculates the currency symbol based on the\n * country code that you pass in the call's header. If you don't pass a country\n * code in the header, Wix calculates the tax settings based on the caller's IP\n * address. Note that the currency symbol may not resolve properly if you call\n * through a VPN.\n */\n currencySymbol?: string;\n /**\n * Retrieved app plans.\n *\n * Min: 0 plans\n * Max: 50 plans\n *\n * If any plans aren't returned, it's likely because they haven't been activated yet.\n * @maxSize 50\n */\n appPlans?: AppPlans[];\n}\n\nexport interface TaxSettings {\n /**\n * Whether you must display the total price including taxes in the given\n * country.\n */\n showPriceWithTax?: boolean;\n /**\n * Tax rate for the given country as percentage. Returned as `0` when\n * `{\"showPriceWithTax\": false}`.\n * @format DECIMAL_VALUE\n */\n percentage?: string | null;\n /**\n * Type of tax required in the given country.\n *\n * + `\"NOT_APPLICABLE\"`: The country doesn't require that you display the total price including taxes, or Wix failed to calculate the country based on the call's IP address.\n * + `\"VAT\"`: The given country requires that you display the total price including [value-added tax (VAT)](https://en.wikipedia.org/wiki/Value-added_tax).\n * + `\"GST\"`: The given country requires that you display the total price including [generation-skipping transfer tax (GST)](https://en.wikipedia.org/wiki/Generation-skipping_transfer_tax).\n */\n taxType?: TaxTypeWithLiterals;\n}\n\nexport enum TaxType {\n NOT_APPLICABLE = 'NOT_APPLICABLE',\n VAT = 'VAT',\n GST = 'GST',\n}\n\n/** @enumType */\nexport type TaxTypeWithLiterals = TaxType | 'NOT_APPLICABLE' | 'VAT' | 'GST';\n\nexport interface GetAvailableAppPlansRequest {\n /**\n * AppId to get the available app plans for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan info to retrieve the available app plans for. */\n appPlanInfo?: AppPlanInfo;\n}\n\n/**\n * An `AppPlanInfo` object describes which app plan you want to retrieve data for.\n * Every plan in an app is identified by a unique combination of `productId` and `billingCycle`.\n */\nexport interface AppPlanInfo {\n /**\n * The app plan's vendorId to retrieve the response for.\n *\n * Max: 100 characters\n * @maxLength 100\n */\n vendorId?: string;\n /** The app plan cycle to retrieve the response for. */\n billingCycle?: Cycle;\n}\n\nexport interface GetAvailableAppPlansResponse {\n /** The available upgrades for the given app plan. */\n availableUpgrades?: AppPlans;\n /** The available downgrades for the given app plan. */\n availableDowngrades?: AppPlans;\n /** The current app plan. */\n currentPlan?: Plan;\n}\n\nexport interface GetPricingPageUrlRequest {\n /**\n * AppId to get the pricing page url for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan to retrieve the pricing page url for. */\n appPlanInfo?: AppPlanInfo;\n}\n\nexport interface GetPricingPageUrlResponse {\n /**\n * the pricing page url, if there is a app plan that is upgradable.\n * @format WEB_URL\n */\n packagePickerUrl?: string | null;\n}\n\ntype AppPlansNonNullablePaths =\n | `_id`\n | `plans`\n | `plans.${number}._id`\n | `plans.${number}.vendorId`\n | `plans.${number}.name`;\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n * @param appIds - List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @public\n * @documentationMaturity preview\n * @requiredField appIds\n * @fqn wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId\n */\nexport async function listAppPlansByAppId(\n appIds: string[]\n): Promise<\n NonNullablePaths<\n ListAppPlansByAppIdResponse,\n | `taxSettings.showPriceWithTax`\n | `taxSettings.taxType`\n | `currency`\n | `currencySymbol`\n | {\n [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;\n }[AppPlansNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ appIds: appIds });\n\n const reqOpts = ambassadorWixAppmarketV1AppPlans.listAppPlansByAppId(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: { appIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appIds']\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 resolveWixAppmarketAppPlansV1AppsPlansUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-market/apps-plans',\n destPath: '/api',\n },\n {\n srcPath: '/api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-plans';\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n */\nexport function listAppPlansByAppId(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPlansByAppId({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.appmarket.v1.app_plans',\n method: 'GET' as any,\n methodFqn: 'wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId',\n packageName: PACKAGE_NAME,\n url: resolveWixAppmarketAppPlansV1AppsPlansUrl({\n protoPath: '/v1/apps-plans/{appIds}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPlans.plans.prices.discount.saleOptions.startDate' },\n { path: 'appPlans.plans.prices.discount.saleOptions.endDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPlansByAppId;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ListAppPlansByAppIdResponse,\n listAppPlansByAppId as universalListAppPlansByAppId,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\ntype AppPlansNonNullablePaths =\n | `_id`\n | `plans`\n | `plans.${number}._id`\n | `plans.${number}.vendorId`\n | `plans.${number}.name`;\n\nexport function listAppPlansByAppId(\n httpClient: HttpClient\n): ListAppPlansByAppIdSignature {\n return (appIds: string[]) =>\n universalListAppPlansByAppId(\n appIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPlansByAppIdSignature {\n /**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n * @param - List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n */\n (appIds: string[]): Promise<\n NonNullablePaths<\n ListAppPlansByAppIdResponse,\n | `taxSettings.showPriceWithTax`\n | `taxSettings.taxType`\n | `currency`\n | `currencySymbol`\n | {\n [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;\n }[AppPlansNonNullablePaths]\n >\n >;\n}\n\nexport {\n AppPlanInfo,\n AppPlans,\n BillingSource,\n Cycle,\n CycleType,\n Discount,\n DiscountSourceDataOneOf,\n DiscountType,\n Duration,\n DurationUnit,\n GetAvailableAppPlansRequest,\n GetAvailableAppPlansResponse,\n GetPricingPageUrlRequest,\n GetPricingPageUrlResponse,\n ListAppPlansByAppIdRequest,\n ListAppPlansByAppIdResponse,\n Plan,\n Price,\n SaleSource,\n SaleType,\n SourceType,\n TaxSettings,\n TaxType,\n UsageBasedDetails,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n","import { listAppPlansByAppId as publicListAppPlansByAppId } from './appmarket-v1-app-plans-app-plans.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAppPlansByAppId: MaybeContext<\n BuildRESTFunction<typeof publicListAppPlansByAppId> &\n typeof publicListAppPlansByAppId\n> = /*#__PURE__*/ createRESTModule(publicListAppPlansByAppId);\n\nexport {\n SaleType,\n DiscountType,\n SourceType,\n DurationUnit,\n CycleType,\n BillingSource,\n TaxType,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\nexport {\n AppPlans,\n SaleSource,\n Cycle,\n Duration,\n UsageBasedDetails,\n Discount,\n DiscountSourceDataOneOf,\n Price,\n Plan,\n ListAppPlansByAppIdRequest,\n ListAppPlansByAppIdResponse,\n TaxSettings,\n GetAvailableAppPlansRequest,\n AppPlanInfo,\n GetAvailableAppPlansResponse,\n GetPricingPageUrlRequest,\n GetPricingPageUrlResponse,\n} from './appmarket-v1-app-plans-app-plans.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,0CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;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,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MAC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U;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,QAAQ,OAAO;AAAA,QAC3C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE1eO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,WACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvBA,IAAAC,uBAAiC;AAG1B,IAAMC,uBAGK,2DAAiBA,oBAAyB;","names":["listAppPlansByAppId","import_rest_modules","payload","SaleType","DiscountType","SourceType","DurationUnit","CycleType","BillingSource","TaxType","listAppPlansByAppId","sdkTransformError","listAppPlansByAppId","import_rest_modules","listAppPlansByAppId"]}
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface AppPlans {
2
4
  /** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */
3
5
  _id?: string;
@@ -37,6 +39,8 @@ declare enum SourceType {
37
39
  /** Discount is due to App Benefit */
38
40
  APP_BENEFIT = "APP_BENEFIT"
39
41
  }
42
+ /** @enumType */
43
+ type SourceTypeWithLiterals = SourceType | 'SOURCE_TYPE_UNSPECIFIED' | 'SALE' | 'APP_BENEFIT';
40
44
  interface SaleSource {
41
45
  /** @format GUID */
42
46
  saleId?: string | null;
@@ -352,5 +356,38 @@ interface GetPricingPageUrlResponse {
352
356
  */
353
357
  packagePickerUrl?: string | null;
354
358
  }
359
+ type AppPlansNonNullablePaths = `_id` | `plans` | `plans.${number}._id` | `plans.${number}.vendorId` | `plans.${number}.name`;
360
+ /**
361
+ * Retrieves plans for the given apps.
362
+ *
363
+ *
364
+ * Also returns tax settings and currency details. Wix calculates this information
365
+ * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
366
+ * format that you pass in the call's header. If you don't pass a country code in
367
+ * the header, Wix calculates the tax settings and currency details based on the
368
+ * call's IP address. Note that the tax settings and currency details may not resolve
369
+ * properly if you call through a VPN.
370
+ *
371
+ * Prices for plans that are managed outside of Wix aren't returned.
372
+ *
373
+ * Consumers must pay for yearly and multi-yearly plans of your app every month.
374
+ * For these plans this method returns the price that the consumer must pay every
375
+ * month and not the total price for the entire year.
376
+ *
377
+ * > **Notes:**
378
+ * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.
379
+ * > - This method only returns app plans that have been activated.
380
+ * @param appIds - List of app IDs to retrieve plans for.
381
+ *
382
+ * Min: 1 app ID
383
+ * Max: 100 app IDs
384
+ * @public
385
+ * @documentationMaturity preview
386
+ * @requiredField appIds
387
+ * @fqn wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId
388
+ */
389
+ declare function listAppPlansByAppId(appIds: string[]): Promise<NonNullablePaths<ListAppPlansByAppIdResponse, `taxSettings.showPriceWithTax` | `taxSettings.taxType` | `currency` | `currencySymbol` | {
390
+ [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;
391
+ }[AppPlansNonNullablePaths]>>;
355
392
 
356
- export { type AppPlans as A, BillingSource as B, CycleType as C, DiscountType as D, type GetAvailableAppPlansRequest as G, type ListAppPlansByAppIdResponse as L, type Price as P, SaleType as S, TaxType as T, type UsageBasedDetails as U, SourceType as a, DurationUnit as b, type SaleSource as c, type Cycle as d, type Duration as e, type Discount as f, type DiscountSourceDataOneOf as g, type Plan as h, type ListAppPlansByAppIdRequest as i, type TaxSettings as j, type AppPlanInfo as k, type GetAvailableAppPlansResponse as l, type GetPricingPageUrlRequest as m, type GetPricingPageUrlResponse as n };
393
+ export { type AppPlanInfo, type AppPlans, BillingSource, type BillingSourceWithLiterals, type Cycle, CycleType, type CycleTypeWithLiterals, type Discount, type DiscountSourceDataOneOf, DiscountType, type DiscountTypeWithLiterals, type Duration, DurationUnit, type DurationUnitWithLiterals, type GetAvailableAppPlansRequest, type GetAvailableAppPlansResponse, type GetPricingPageUrlRequest, type GetPricingPageUrlResponse, type ListAppPlansByAppIdRequest, type ListAppPlansByAppIdResponse, type Plan, type Price, type SaleSource, SaleType, type SaleTypeWithLiterals, SourceType, type SourceTypeWithLiterals, type TaxSettings, TaxType, type TaxTypeWithLiterals, type UsageBasedDetails, listAppPlansByAppId };
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ BillingSource: () => BillingSource,
24
+ CycleType: () => CycleType,
25
+ DiscountType: () => DiscountType,
26
+ DurationUnit: () => DurationUnit,
27
+ SaleType: () => SaleType,
28
+ SourceType: () => SourceType,
29
+ TaxType: () => TaxType,
30
+ listAppPlansByAppId: () => listAppPlansByAppId2
31
+ });
32
+ module.exports = __toCommonJS(index_typings_exports);
33
+
34
+ // src/appmarket-v1-app-plans-app-plans.universal.ts
35
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
36
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
37
+
38
+ // src/appmarket-v1-app-plans-app-plans.http.ts
39
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
40
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
41
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
42
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
43
+ function resolveWixAppmarketAppPlansV1AppsPlansUrl(opts) {
44
+ const domainToMappings = {
45
+ "api._api_base_domain_": [
46
+ {
47
+ srcPath: "/apps-plans",
48
+ destPath: ""
49
+ }
50
+ ],
51
+ "manage._base_domain_": [
52
+ {
53
+ srcPath: "/_api/app-market/apps-plans",
54
+ destPath: "/api"
55
+ },
56
+ {
57
+ srcPath: "/api/apps-plans",
58
+ destPath: ""
59
+ },
60
+ {
61
+ srcPath: "/apps-plans",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ "bo._base_domain_": [
66
+ {
67
+ srcPath: "/_api/apps-plans",
68
+ destPath: ""
69
+ },
70
+ {
71
+ srcPath: "/apps-plans",
72
+ destPath: ""
73
+ }
74
+ ],
75
+ "wixbo.ai": [
76
+ {
77
+ srcPath: "/_api/apps-plans",
78
+ destPath: ""
79
+ },
80
+ {
81
+ srcPath: "/apps-plans",
82
+ destPath: ""
83
+ }
84
+ ],
85
+ "wix-bo.com": [
86
+ {
87
+ srcPath: "/_api/apps-plans",
88
+ destPath: ""
89
+ },
90
+ {
91
+ srcPath: "/apps-plans",
92
+ destPath: ""
93
+ }
94
+ ],
95
+ "editor._base_domain_": [
96
+ {
97
+ srcPath: "/_api/apps-plans",
98
+ destPath: ""
99
+ }
100
+ ],
101
+ "blocks._base_domain_": [
102
+ {
103
+ srcPath: "/_api/apps-plans",
104
+ destPath: ""
105
+ }
106
+ ],
107
+ "create.editorx": [
108
+ {
109
+ srcPath: "/_api/apps-plans",
110
+ destPath: ""
111
+ }
112
+ ],
113
+ "www._base_domain_": [
114
+ {
115
+ srcPath: "/apps-plans",
116
+ destPath: ""
117
+ },
118
+ {
119
+ srcPath: "/_api/apps-plans",
120
+ destPath: ""
121
+ }
122
+ ],
123
+ "www.wixapis.com": [
124
+ {
125
+ srcPath: "/apps-plans",
126
+ destPath: ""
127
+ }
128
+ ]
129
+ };
130
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
131
+ }
132
+ var PACKAGE_NAME = "@wix/auto_sdk_app-management_app-plans";
133
+ function listAppPlansByAppId(payload) {
134
+ function __listAppPlansByAppId({ host }) {
135
+ const metadata = {
136
+ entityFqdn: "wix.appmarket.v1.app_plans",
137
+ method: "GET",
138
+ methodFqn: "wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId",
139
+ packageName: PACKAGE_NAME,
140
+ url: resolveWixAppmarketAppPlansV1AppsPlansUrl({
141
+ protoPath: "/v1/apps-plans/{appIds}",
142
+ data: payload,
143
+ host
144
+ }),
145
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
146
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
147
+ {
148
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
149
+ paths: [
150
+ { path: "appPlans.plans.prices.discount.saleOptions.startDate" },
151
+ { path: "appPlans.plans.prices.discount.saleOptions.endDate" }
152
+ ]
153
+ }
154
+ ])
155
+ };
156
+ return metadata;
157
+ }
158
+ return __listAppPlansByAppId;
159
+ }
160
+
161
+ // src/appmarket-v1-app-plans-app-plans.universal.ts
162
+ var SaleType = /* @__PURE__ */ ((SaleType2) => {
163
+ SaleType2["SALE_TYPE_UNSPECIFIED"] = "SALE_TYPE_UNSPECIFIED";
164
+ SaleType2["CYBER_MONDAY"] = "CYBER_MONDAY";
165
+ SaleType2["NOVEMBER_SALE"] = "NOVEMBER_SALE";
166
+ SaleType2["BLACK_FRIDAY"] = "BLACK_FRIDAY";
167
+ SaleType2["DEVELOPER_SALE"] = "DEVELOPER_SALE";
168
+ return SaleType2;
169
+ })(SaleType || {});
170
+ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
171
+ DiscountType2["DISCOUNT_TYPE_UNSPECIFIED"] = "DISCOUNT_TYPE_UNSPECIFIED";
172
+ DiscountType2["FIXED_AMOUNT"] = "FIXED_AMOUNT";
173
+ DiscountType2["PERCENTAGE"] = "PERCENTAGE";
174
+ return DiscountType2;
175
+ })(DiscountType || {});
176
+ var SourceType = /* @__PURE__ */ ((SourceType2) => {
177
+ SourceType2["SOURCE_TYPE_UNSPECIFIED"] = "SOURCE_TYPE_UNSPECIFIED";
178
+ SourceType2["SALE"] = "SALE";
179
+ SourceType2["APP_BENEFIT"] = "APP_BENEFIT";
180
+ return SourceType2;
181
+ })(SourceType || {});
182
+ var DurationUnit = /* @__PURE__ */ ((DurationUnit2) => {
183
+ DurationUnit2["UNKNOWN_UNIT"] = "UNKNOWN_UNIT";
184
+ DurationUnit2["MONTH"] = "MONTH";
185
+ DurationUnit2["YEAR"] = "YEAR";
186
+ return DurationUnit2;
187
+ })(DurationUnit || {});
188
+ var CycleType = /* @__PURE__ */ ((CycleType2) => {
189
+ CycleType2["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
190
+ CycleType2["ONE_TIME"] = "ONE_TIME";
191
+ CycleType2["RECURRING"] = "RECURRING";
192
+ return CycleType2;
193
+ })(CycleType || {});
194
+ var BillingSource = /* @__PURE__ */ ((BillingSource2) => {
195
+ BillingSource2["UNKNOWN"] = "UNKNOWN";
196
+ BillingSource2["WIX"] = "WIX";
197
+ BillingSource2["EXTERNAL"] = "EXTERNAL";
198
+ return BillingSource2;
199
+ })(BillingSource || {});
200
+ var TaxType = /* @__PURE__ */ ((TaxType2) => {
201
+ TaxType2["NOT_APPLICABLE"] = "NOT_APPLICABLE";
202
+ TaxType2["VAT"] = "VAT";
203
+ TaxType2["GST"] = "GST";
204
+ return TaxType2;
205
+ })(TaxType || {});
206
+ async function listAppPlansByAppId2(appIds) {
207
+ const { httpClient, sideEffects } = arguments[1];
208
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ appIds });
209
+ const reqOpts = listAppPlansByAppId(payload);
210
+ sideEffects?.onSiteCall?.();
211
+ try {
212
+ const result = await httpClient.request(reqOpts);
213
+ sideEffects?.onSuccess?.(result);
214
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
215
+ } catch (err) {
216
+ const transformedError = (0, import_transform_error.transformError)(
217
+ err,
218
+ {
219
+ spreadPathsToArguments: {},
220
+ explicitPathsToArguments: { appIds: "$[0]" },
221
+ singleArgumentUnchanged: false
222
+ },
223
+ ["appIds"]
224
+ );
225
+ sideEffects?.onError?.(err);
226
+ throw transformedError;
227
+ }
228
+ }
229
+ // Annotate the CommonJS export names for ESM import in node:
230
+ 0 && (module.exports = {
231
+ BillingSource,
232
+ CycleType,
233
+ DiscountType,
234
+ DurationUnit,
235
+ SaleType,
236
+ SourceType,
237
+ TaxType,
238
+ listAppPlansByAppId
239
+ });
240
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/appmarket-v1-app-plans-app-plans.universal.ts","../../src/appmarket-v1-app-plans-app-plans.http.ts"],"sourcesContent":["export * from './src/appmarket-v1-app-plans-app-plans.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 ambassadorWixAppmarketV1AppPlans from './appmarket-v1-app-plans-app-plans.http.js';\n\nexport interface AppPlans {\n /** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n _id?: string;\n /**\n * List of the app's pricing plans.\n *\n * Min: `0` plans\n * Max: `50` plans\n * @maxSize 50\n */\n plans?: Plan[];\n}\n\nexport enum SaleType {\n /** Default value, can be used when no specific sale is associated. */\n SALE_TYPE_UNSPECIFIED = 'SALE_TYPE_UNSPECIFIED',\n CYBER_MONDAY = 'CYBER_MONDAY',\n NOVEMBER_SALE = 'NOVEMBER_SALE',\n BLACK_FRIDAY = 'BLACK_FRIDAY',\n DEVELOPER_SALE = 'DEVELOPER_SALE',\n}\n\n/** @enumType */\nexport type SaleTypeWithLiterals =\n | SaleType\n | 'SALE_TYPE_UNSPECIFIED'\n | 'CYBER_MONDAY'\n | 'NOVEMBER_SALE'\n | 'BLACK_FRIDAY'\n | 'DEVELOPER_SALE';\n\nexport enum DiscountType {\n DISCOUNT_TYPE_UNSPECIFIED = 'DISCOUNT_TYPE_UNSPECIFIED',\n /** Discount is a fixed amount in USD. */\n FIXED_AMOUNT = 'FIXED_AMOUNT',\n /** Discount is a percentage of the total price. */\n PERCENTAGE = 'PERCENTAGE',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n | DiscountType\n | 'DISCOUNT_TYPE_UNSPECIFIED'\n | 'FIXED_AMOUNT'\n | 'PERCENTAGE';\n\nexport enum SourceType {\n /** Default value, can be used when no specific source is associated. */\n SOURCE_TYPE_UNSPECIFIED = 'SOURCE_TYPE_UNSPECIFIED',\n /** Discount is due to Wix/Developer Sale */\n SALE = 'SALE',\n /** Discount is due to App Benefit */\n APP_BENEFIT = 'APP_BENEFIT',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals =\n | SourceType\n | 'SOURCE_TYPE_UNSPECIFIED'\n | 'SALE'\n | 'APP_BENEFIT';\n\nexport interface SaleSource {\n /** @format GUID */\n saleId?: string | null;\n saleType?: SaleTypeWithLiterals;\n startDate?: Date | null;\n endDate?: Date | null;\n}\n\nexport interface Cycle {\n /**\n * Type of the billing cycle.\n *\n * + `\"UNKNOWN_UNIT\"`: There is no information about the billing cycle.\n * + `\"ONE_TIME\"`: The customer pays for unlimited usage of the app with a single payment.\n * + `\"RECURRING\"`: The customer pays for a subscription to the app on a recurring schedule.\n */\n cycleType?: CycleTypeWithLiterals;\n /** Duration of the billing cycle. Available only for `{\"cycleType\": \"RECURRING\"}`. */\n cycleDuration?: Duration;\n}\n\nexport enum DurationUnit {\n /** unknown interval unit */\n UNKNOWN_UNIT = 'UNKNOWN_UNIT',\n /** month */\n MONTH = 'MONTH',\n /** year */\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type DurationUnitWithLiterals =\n | DurationUnit\n | 'UNKNOWN_UNIT'\n | 'MONTH'\n | 'YEAR';\n\nexport enum CycleType {\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n ONE_TIME = 'ONE_TIME',\n RECURRING = 'RECURRING',\n}\n\n/** @enumType */\nexport type CycleTypeWithLiterals =\n | CycleType\n | 'UNKNOWN_TYPE'\n | 'ONE_TIME'\n | 'RECURRING';\n\nexport interface Duration {\n /** Unit of the billing cycle. */\n unit?: DurationUnitWithLiterals;\n /** Count of units that make up the billing cycle. */\n count?: number;\n}\n\nexport interface UsageBasedDetails {\n /**\n * Smallest possible amount that your app charges customers in usage-based\n * pricing. For example, the price of a single SMS message if your\n * app charges customers for sending text messages. Always in\n * [USD](https://en.wikipedia.org/wiki/United_States_dollar).\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n minimumChargeIncrement?: string | null;\n /**\n * Recurring, monthly base fee in usage-based pricing that your app\n * charges customers regardless of how much they use your app.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n monthlyBaseFee?: string | null;\n /**\n * Description of the usage-based pricing plan, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n *\n * Max: 1024 characters\n */\n customChargeDescription?: string | null;\n}\n\nexport interface Discount extends DiscountSourceDataOneOf {\n type?: DiscountTypeWithLiterals;\n /**\n * Discount amount\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n amount?: string;\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price with 12.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00, maxScale:2 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /**\n * Source of the discount.\n * @internal\n */\n sourceType?: SourceTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface DiscountSourceDataOneOf {}\n\nexport enum BillingSource {\n UNKNOWN = 'UNKNOWN',\n /** plan billing and charges is managed by Wix */\n WIX = 'WIX',\n /** plan billing and charges is managed by the app */\n EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type BillingSourceWithLiterals =\n | BillingSource\n | 'UNKNOWN'\n | 'WIX'\n | 'EXTERNAL';\n\nexport interface Price {\n /**\n * Price without taxes. For yearly plans, Wix calculates and returns the\n * average price per month. You can get the full price by multiplying the\n * returned price by 12.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n priceBeforeTax?: string;\n /**\n * Total price including taxes.\n *\n * Min: `0.00`\n * Max: 1024 characters\n * @format DECIMAL_VALUE\n * @decimalValue options { gte:0.00 }\n * @maxLength 1024\n */\n totalPrice?: string;\n /** Information about the plan's recurring billing cycle or single payment. */\n billingCycle?: Cycle;\n /**\n * Details about the plan's usage-based pricing.\n * Available only for plans with\n * [usage-based pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/usage-based-pricing).\n */\n usageBaseOptions?: UsageBasedDetails;\n discount?: Discount;\n billingSource?: BillingSourceWithLiterals;\n /**\n * Can be shown instead of plan price - used for dynamic plans\n * @maxLength 140\n */\n customPaymentTitle?: string | null;\n}\n\nexport interface Plan {\n /**\n * ID of the app plan.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * ID of your app's pricing plan, as displayed in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Identical to `vendorProductId` in the\n * [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).\n */\n vendorId?: string;\n /** Name of your app's pricing plan, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */\n name?: string;\n /**\n * List of your plan's benefits, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).\n * Currently, the benefits are available only in English.\n *\n * Min: `0` benefits\n * Max: `4` benefits\n * Max per benefit: 1024 characters\n * @maxSize 4\n * @maxLength 1024\n */\n benefits?: string[];\n /**\n * List of the plan's prices. Available only when the plan's prices are managed\n * by Wix and not externally.\n *\n * Min: `0` prices\n * Max: `10` prices\n * @maxSize 10\n */\n prices?: Price[];\n}\n\nexport interface ListAppPlansByAppIdRequest {\n /**\n * List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @minSize 1\n * @maxSize 100\n */\n appIds: string[];\n}\n\nexport interface ListAppPlansByAppIdResponse {\n /**\n * Tax settings. Wix calculates the tax settings based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the tax settings based on the caller's IP address. Note that the\n * tax settings may not resolve properly if you call through a VPN.\n */\n taxSettings?: TaxSettings;\n /**\n * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\n * format. Wix calculates the currency based on the country code that\n * you pass in the call's header. If you don't pass a country code in the header,\n * Wix calculates the currency based on the caller's IP address. Note that the\n * currency may not resolve properly if you call through a VPN.\n * @format CURRENCY\n */\n currency?: string;\n /**\n * Currency symbol in decimal HTML entity format. For example, `&#36;` for $\n * (United States Dollar). Wix calculates the currency symbol based on the\n * country code that you pass in the call's header. If you don't pass a country\n * code in the header, Wix calculates the tax settings based on the caller's IP\n * address. Note that the currency symbol may not resolve properly if you call\n * through a VPN.\n */\n currencySymbol?: string;\n /**\n * Retrieved app plans.\n *\n * Min: 0 plans\n * Max: 50 plans\n *\n * If any plans aren't returned, it's likely because they haven't been activated yet.\n * @maxSize 50\n */\n appPlans?: AppPlans[];\n}\n\nexport interface TaxSettings {\n /**\n * Whether you must display the total price including taxes in the given\n * country.\n */\n showPriceWithTax?: boolean;\n /**\n * Tax rate for the given country as percentage. Returned as `0` when\n * `{\"showPriceWithTax\": false}`.\n * @format DECIMAL_VALUE\n */\n percentage?: string | null;\n /**\n * Type of tax required in the given country.\n *\n * + `\"NOT_APPLICABLE\"`: The country doesn't require that you display the total price including taxes, or Wix failed to calculate the country based on the call's IP address.\n * + `\"VAT\"`: The given country requires that you display the total price including [value-added tax (VAT)](https://en.wikipedia.org/wiki/Value-added_tax).\n * + `\"GST\"`: The given country requires that you display the total price including [generation-skipping transfer tax (GST)](https://en.wikipedia.org/wiki/Generation-skipping_transfer_tax).\n */\n taxType?: TaxTypeWithLiterals;\n}\n\nexport enum TaxType {\n NOT_APPLICABLE = 'NOT_APPLICABLE',\n VAT = 'VAT',\n GST = 'GST',\n}\n\n/** @enumType */\nexport type TaxTypeWithLiterals = TaxType | 'NOT_APPLICABLE' | 'VAT' | 'GST';\n\nexport interface GetAvailableAppPlansRequest {\n /**\n * AppId to get the available app plans for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan info to retrieve the available app plans for. */\n appPlanInfo?: AppPlanInfo;\n}\n\n/**\n * An `AppPlanInfo` object describes which app plan you want to retrieve data for.\n * Every plan in an app is identified by a unique combination of `productId` and `billingCycle`.\n */\nexport interface AppPlanInfo {\n /**\n * The app plan's vendorId to retrieve the response for.\n *\n * Max: 100 characters\n * @maxLength 100\n */\n vendorId?: string;\n /** The app plan cycle to retrieve the response for. */\n billingCycle?: Cycle;\n}\n\nexport interface GetAvailableAppPlansResponse {\n /** The available upgrades for the given app plan. */\n availableUpgrades?: AppPlans;\n /** The available downgrades for the given app plan. */\n availableDowngrades?: AppPlans;\n /** The current app plan. */\n currentPlan?: Plan;\n}\n\nexport interface GetPricingPageUrlRequest {\n /**\n * AppId to get the pricing page url for.\n * @format GUID\n */\n appId?: string;\n /** The specific app plan to retrieve the pricing page url for. */\n appPlanInfo?: AppPlanInfo;\n}\n\nexport interface GetPricingPageUrlResponse {\n /**\n * the pricing page url, if there is a app plan that is upgradable.\n * @format WEB_URL\n */\n packagePickerUrl?: string | null;\n}\n\ntype AppPlansNonNullablePaths =\n | `_id`\n | `plans`\n | `plans.${number}._id`\n | `plans.${number}.vendorId`\n | `plans.${number}.name`;\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n * @param appIds - List of app IDs to retrieve plans for.\n *\n * Min: 1 app ID\n * Max: 100 app IDs\n * @public\n * @documentationMaturity preview\n * @requiredField appIds\n * @fqn wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId\n */\nexport async function listAppPlansByAppId(\n appIds: string[]\n): Promise<\n NonNullablePaths<\n ListAppPlansByAppIdResponse,\n | `taxSettings.showPriceWithTax`\n | `taxSettings.taxType`\n | `currency`\n | `currencySymbol`\n | {\n [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;\n }[AppPlansNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ appIds: appIds });\n\n const reqOpts = ambassadorWixAppmarketV1AppPlans.listAppPlansByAppId(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: { appIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appIds']\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 resolveWixAppmarketAppPlansV1AppsPlansUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-market/apps-plans',\n destPath: '/api',\n },\n {\n srcPath: '/api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n {\n srcPath: '/_api/apps-plans',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps-plans',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-plans';\n\n/**\n * Retrieves plans for the given apps.\n *\n *\n * Also returns tax settings and currency details. Wix calculates this information\n * based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\n * format that you pass in the call's header. If you don't pass a country code in\n * the header, Wix calculates the tax settings and currency details based on the\n * call's IP address. Note that the tax settings and currency details may not resolve\n * properly if you call through a VPN.\n *\n * Prices for plans that are managed outside of Wix aren't returned.\n *\n * Consumers must pay for yearly and multi-yearly plans of your app every month.\n * For these plans this method returns the price that the consumer must pay every\n * month and not the total price for the entire year.\n *\n * > **Notes:**\n * > - The App Plans API doesn't follow any tenancy model. You don't need any permissions to call `List App Plans by App ID`.\n * > - This method only returns app plans that have been activated.\n */\nexport function listAppPlansByAppId(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPlansByAppId({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.appmarket.v1.app_plans',\n method: 'GET' as any,\n methodFqn: 'wix.appmarket.app_plans.v1.AppsPlans.ListAppPlansByAppId',\n packageName: PACKAGE_NAME,\n url: resolveWixAppmarketAppPlansV1AppsPlansUrl({\n protoPath: '/v1/apps-plans/{appIds}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPlans.plans.prices.discount.saleOptions.startDate' },\n { path: 'appPlans.plans.prices.discount.saleOptions.endDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPlansByAppId;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,0CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;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,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAA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,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,QAAQ,OAAO;AAAA,QAC3C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["listAppPlansByAppId","import_rest_modules","payload","SaleType","DiscountType","SourceType","DurationUnit","CycleType","BillingSource","TaxType","listAppPlansByAppId","sdkTransformError"]}
@@ -1,4 +1,5 @@
1
- import { i as ListAppPlansByAppIdRequest$1, L as ListAppPlansByAppIdResponse$1 } from './appmarket-v1-app-plans-app-plans.universal-DIYQWTDw.js';
1
+ import { ListAppPlansByAppIdRequest as ListAppPlansByAppIdRequest$1, ListAppPlansByAppIdResponse as ListAppPlansByAppIdResponse$1 } from './index.typings.js';
2
+ import '@wix/sdk-types';
2
3
 
3
4
  interface AppPlans {
4
5
  /** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */
@@ -1,7 +1,8 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { L as ListAppPlansByAppIdResponse } from './appmarket-v1-app-plans-app-plans.universal-DIYQWTDw.mjs';
3
- export { k as AppPlanInfo, A as AppPlans, B as BillingSource, d as Cycle, C as CycleType, f as Discount, g as DiscountSourceDataOneOf, D as DiscountType, e as Duration, b as DurationUnit, G as GetAvailableAppPlansRequest, l as GetAvailableAppPlansResponse, m as GetPricingPageUrlRequest, n as GetPricingPageUrlResponse, i as ListAppPlansByAppIdRequest, h as Plan, P as Price, c as SaleSource, S as SaleType, a as SourceType, j as TaxSettings, T as TaxType, U as UsageBasedDetails } from './appmarket-v1-app-plans-app-plans.universal-DIYQWTDw.mjs';
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { ListAppPlansByAppIdResponse } from './index.typings.mjs';
3
+ export { AppPlanInfo, AppPlans, BillingSource, Cycle, CycleType, Discount, DiscountSourceDataOneOf, DiscountType, Duration, DurationUnit, GetAvailableAppPlansRequest, GetAvailableAppPlansResponse, GetPricingPageUrlRequest, GetPricingPageUrlResponse, ListAppPlansByAppIdRequest, Plan, Price, SaleSource, SaleType, SourceType, TaxSettings, TaxType, UsageBasedDetails } from './index.typings.mjs';
4
4
 
5
+ type AppPlansNonNullablePaths = `_id` | `plans` | `plans.${number}._id` | `plans.${number}.vendorId` | `plans.${number}.name`;
5
6
  declare function listAppPlansByAppId$1(httpClient: HttpClient): ListAppPlansByAppIdSignature;
6
7
  interface ListAppPlansByAppIdSignature {
7
8
  /**
@@ -29,7 +30,9 @@ interface ListAppPlansByAppIdSignature {
29
30
  * Min: 1 app ID
30
31
  * Max: 100 app IDs
31
32
  */
32
- (appIds: string[]): Promise<ListAppPlansByAppIdResponse>;
33
+ (appIds: string[]): Promise<NonNullablePaths<ListAppPlansByAppIdResponse, `taxSettings.showPriceWithTax` | `taxSettings.taxType` | `currency` | `currencySymbol` | {
34
+ [P in AppPlansNonNullablePaths]: `appPlans.${number}.${P}`;
35
+ }[AppPlansNonNullablePaths]>>;
33
36
  }
34
37
 
35
38
  declare const listAppPlansByAppId: MaybeContext<BuildRESTFunction<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1>;