@wix/auto_sdk_pricing-plans_top-ups 1.0.0 → 1.0.2

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 +1 @@
1
- {"version":3,"sources":["../../src/pricing-plans-v3-top-up-top-ups.universal.ts","../../src/pricing-plans-v3-top-up-top-ups.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixPricingPlansV3TopUp from './pricing-plans-v3-top-up-top-ups.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A top-up is the record of credits a member bought for their plan subscription's pools,\n * the pools of the benefit program that grants the plan's benefits to the member.\n *\n * It's created for each top-up offer line item of an approved eCommerce order, after the credits\n * were added to the balances of the plan subscription's pools. The price, discounts and taxes are\n * available in the eCommerce order.\n */\nexport interface TopUp {\n /**\n * Top-up ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the top-up was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the plan subscription whose pools received the credits.\n * @format GUID\n * @readonly\n */\n planSubscriptionId?: string | null;\n /**\n * ID of the member who holds the plan subscription.\n * @format GUID\n * @readonly\n */\n memberId?: string | null;\n /**\n * ID of the top-up offer the member bought.\n * @format GUID\n * @readonly\n */\n topUpOfferId?: string | null;\n /**\n * Number of times the member bought the top-up offer in the line item.\n * @min 1\n * @readonly\n */\n quantity?: number | null;\n /**\n * ID of the eCommerce order.\n * @format GUID\n * @readonly\n */\n orderId?: string | null;\n /**\n * ID of the line item of the eCommerce order.\n * @format GUID\n * @readonly\n */\n lineItemId?: string | null;\n /**\n * Changes made to the balances of the plan subscription's pools, one per pool.\n * @maxSize 10\n * @readonly\n */\n balanceAdjustments?: BalanceAdjustment[];\n}\n\n/** Change made to the balance of one pool. */\nexport interface BalanceAdjustment {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool whose balance was adjusted.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n /**\n * ID of the Benefit Programs transaction that recorded the balance adjustment.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface GetTopUpRequest {\n /**\n * ID of the top-up to retrieve.\n * @format GUID\n */\n topUpId: string;\n}\n\nexport interface GetTopUpResponse {\n /** Retrieved top-up. */\n topUp?: TopUp;\n}\n\nexport interface QueryTopUpsRequest {\n /** WQL expression. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTopUpsResponse {\n /** List of top-ups. */\n topUps?: TopUp[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersRequest {\n /**\n * ID of the plan subscription to retrieve the top-up offers for.\n * @format GUID\n */\n planSubscriptionId: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersResponse {\n /**\n * Active or renewing pools of the plan subscription that have a credit configuration.\n * @maxSize 100\n */\n pools?: PlanSubscriptionPool[];\n /**\n * Top-up offers of the plan subscription's plan whose every pool definition has a pool in `pools`.\n * @maxSize 100\n */\n topUpOffers?: TopUpOffer[];\n}\n\n/** Active or renewing pool of a plan subscription that has a credit configuration, and so can receive credits from top-ups. */\nexport interface PlanSubscriptionPool {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Date and time the current benefit cycle ends, when the pool's credit configuration is applied again.\n * Empty when the plan subscription has no end and no next billing date: the credits are available\n * while the plan subscription is active.\n */\n benefitCycleEndDate?: Date | null;\n /** Whether unused credits roll over to the next benefit cycle, and up to what amount. */\n rolloverConfiguration?: RolloverConfiguration;\n}\n\n/** Rollover settings of a pool. */\nexport interface RolloverConfiguration {\n /** Whether unused credits roll over to the next benefit cycle. */\n enabled?: boolean | null;\n /**\n * Maximum amount of credits that roll over to the next benefit cycle.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n balanceCap?: string | null;\n}\n\n/**\n * A top-up offer is what a Wix user sells to members subscribed to a plan who want extra credits\n * before their current benefit cycle ends. It adds a fixed amount of credits to the balances of\n * the pools created from one or more of the plan's pool definitions, for a price.\n */\nexport interface TopUpOffer {\n /**\n * Top-up offer ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the top-up offer is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the top-up offer.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up offer was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the top-up offer was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the plan whose subscribed members can buy the top-up offer. Set on creation and can't be changed.\n * @format GUID\n * @readonly\n * @immutable\n */\n planId?: string | null;\n /**\n * Top-up offer name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /** How much a member pays for the top-up offer. */\n pricingStrategy?: PricingStrategy;\n /**\n * Credits the top-up offer adds, one grant per pool definition of the plan.\n * Each pool definition can appear only once.\n *\n * Grants are checked against the plan's pool definitions only when the offer is created or its grants are updated.\n * A grant whose pool definition is later deleted, loses its credit configuration, or is removed from the plan stays\n * on the offer. Members can't buy the offer while any of its grants has no active or renewing pool with a credit\n * configuration in their plan subscription.\n * @minSize 1\n * @maxSize 5\n */\n creditGrants?: CreditGrant[];\n /**\n * List of text snippets describing what the top-up offer gives. For display purposes only.\n * @maxSize 3\n */\n perks?: Perk[];\n}\n\n/** Pricing strategy type. */\nexport enum Type {\n /** Fixed price. */\n FLAT_RATE = 'FLAT_RATE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'FLAT_RATE';\n\n/** Options for the `FLAT_RATE` pricing strategy type. */\nexport interface FlatRateOptions {\n /**\n * Price, in the site's currency.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** How much a member pays for a top-up offer. */\nexport interface PricingStrategy extends PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n /** Pricing strategy type. */\n type?: TypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n}\n\n/** Credits a top-up offer adds to the balance of each pool created from one pool definition. */\nexport interface CreditGrant {\n /**\n * ID of a pool definition of the plan that has a credit configuration.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** Text snippet describing what a top-up offer gives. */\nexport interface Perk {\n /**\n * Perk ID.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Perk description.\n * @minLength 1\n * @maxLength 100\n */\n description?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: 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\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n * @param topUpId - ID of the top-up to retrieve.\n * @internal\n * @documentationMaturity preview\n * @requiredField topUpId\n * @permissionId pricing_plans:v3:top_up:get_top_up\n * @applicableIdentity APP\n * @returns Retrieved top-up.\n * @fqn wix.pricing_plans.v3.TopUpService.GetTopUp\n */\nexport async function getTopUp(\n topUpId: string\n): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ topUpId: topUpId });\n\n const reqOpts = ambassadorWixPricingPlansV3TopUp.getTopUp(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.topUp!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { topUpId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['topUpId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n * @internal\n * @documentationMaturity preview\n * @permissionId pricing_plans:v3:top_up:query_top_ups\n * @applicableIdentity APP\n * @fqn wix.pricing_plans.v3.TopUpService.QueryTopUps\n */\nexport function queryTopUps(): TopUpsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<TopUp, 'CURSOR', QueryTopUpsRequest, QueryTopUpsResponse>(\n {\n func: async (payload: QueryTopUpsRequest) => {\n const reqOpts = ambassadorWixPricingPlansV3TopUp.queryTopUps(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryTopUpsRequest['query']) => {\n const args = [query, {}] as [QueryTopUpsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTopUpsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.topUps,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n }\n );\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TopUpsQueryResult extends QueryCursorResult {\n items: TopUp[];\n query: TopUpsQueryBuilder;\n next: () => Promise<TopUpsQueryResult>;\n prev: () => Promise<TopUpsQueryResult>;\n}\n\nexport interface TopUpsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'planSubscriptionId' | 'memberId',\n value: string\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: boolean\n ) => TopUpsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'\n >\n ) => TopUpsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'\n >\n ) => TopUpsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => TopUpsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TopUpsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.pricing_plans.v3.TopUpService.QueryTopUps\n * @requiredField query\n */\nexport async function typedQueryTopUps(\n query: TopUpQuery\n): Promise<NonNullablePaths<QueryTopUpsResponse, `topUps`, 0>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixPricingPlansV3TopUp.queryTopUps(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: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TopUpQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_createdDate', '_id', 'memberId', 'planSubscriptionId'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<TopUp, TopUpQuerySpec>;\nexport type TopUpQuery = {\n /** \n Cursor paging options.\n\n Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<TopUp, TopUpQuerySpec, TopUpQuery>(),\n};\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its\n * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan\n * subscription doesn't exist or isn't active.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions.\n * @param planSubscriptionId - ID of the plan subscription to retrieve the top-up offers for.\n * @internal\n * @documentationMaturity preview\n * @requiredField planSubscriptionId\n * @permissionId pricing_plans:v3:top_up:get_purchasable_top_up_offers\n * @applicableIdentity APP\n * @fqn wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers\n */\nexport async function getPurchasableTopUpOffers(\n planSubscriptionId: string\n): Promise<\n NonNullablePaths<\n GetPurchasableTopUpOffersResponse,\n `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n planSubscriptionId: planSubscriptionId,\n });\n\n const reqOpts =\n ambassadorWixPricingPlansV3TopUp.getPurchasableTopUpOffers(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: { planSubscriptionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['planSubscriptionId']\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\nconst TRANSFORM_PATHS_0 = [\n { path: 'topUp.createdDate' },\n { path: 'topUp.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'topUps.createdDate' },\n { path: 'topUps.updatedDate' },\n];\nconst TRANSFORM_PATHS_2 = [\n { path: 'pools.benefitCycleEndDate' },\n { path: 'topUpOffers.createdDate' },\n { path: 'topUpOffers.updatedDate' },\n];\n\nfunction resolveWixPricingPlansV3TopUpServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/top-ups',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'apps._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/pricing-plans/v3/top-ups',\n destPath: '/v3/top-ups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_top-ups';\n\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n */\nexport function getTopUp(payload: object): RequestOptionsFactory<any> {\n function __getTopUp({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetTopUp',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/{topUpId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTopUp;\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n */\nexport function queryTopUps(payload: object): RequestOptionsFactory<any> {\n function __queryTopUps({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.QueryTopUps',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryTopUps;\n}\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its\n * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan\n * subscription doesn't exist or isn't active.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions.\n */\nexport function getPurchasableTopUpOffers(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPurchasableTopUpOffers({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'POST' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/get-purchasable-offers',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPurchasableTopUpOffers;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;A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AAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,oBAAoB,OAAO;AAAA,QACvD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,oBAAoB;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","getPurchasableTopUpOffers"]}
1
+ {"version":3,"sources":["../../src/pricing-plans-v3-top-up-top-ups.universal.ts","../../src/pricing-plans-v3-top-up-top-ups.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixPricingPlansV3TopUp from './pricing-plans-v3-top-up-top-ups.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A top-up is the record of credits a member bought for their plan subscription's pools,\n * the pools of the benefit program that grants the plan's benefits to the member.\n *\n * It's created for each top-up offer line item of an approved eCommerce order, after the credits\n * were added to the balances of the plan subscription's pools. The price, discounts and taxes are\n * available in the eCommerce order.\n */\nexport interface TopUp {\n /**\n * Top-up ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the top-up was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the plan subscription whose pools received the credits.\n * @format GUID\n * @readonly\n */\n planSubscriptionId?: string | null;\n /**\n * ID of the member who holds the plan subscription.\n * @format GUID\n * @readonly\n */\n memberId?: string | null;\n /**\n * ID of the top-up offer the member bought.\n * @format GUID\n * @readonly\n */\n topUpOfferId?: string | null;\n /**\n * Number of times the member bought the top-up offer in the line item.\n * @min 1\n * @readonly\n */\n quantity?: number | null;\n /**\n * ID of the eCommerce order.\n * @format GUID\n * @readonly\n */\n orderId?: string | null;\n /**\n * ID of the line item of the eCommerce order.\n * @format GUID\n * @readonly\n */\n lineItemId?: string | null;\n /**\n * Changes made to the balances of the plan subscription's pools, one per pool.\n * @maxSize 10\n * @readonly\n */\n balanceAdjustments?: BalanceAdjustment[];\n}\n\n/** Change made to the balance of one pool. */\nexport interface BalanceAdjustment {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool whose balance was adjusted.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n /**\n * ID of the Benefit Programs transaction that recorded the balance adjustment.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface GetTopUpRequest {\n /**\n * ID of the top-up to retrieve.\n * @format GUID\n */\n topUpId: string;\n}\n\nexport interface GetTopUpResponse {\n /** Retrieved top-up. */\n topUp?: TopUp;\n}\n\nexport interface QueryTopUpsRequest {\n /** WQL expression. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTopUpsResponse {\n /** List of top-ups. */\n topUps?: TopUp[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersRequest {\n /**\n * ID of the plan subscription to retrieve the top-up offers for.\n * @format GUID\n */\n planSubscriptionId: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersResponse {\n /**\n * Active or renewing pools of the plan subscription that have a credit configuration, for the pool definitions of the plan's top-up offers.\n * @maxSize 100\n */\n pools?: PlanSubscriptionPool[];\n /**\n * Top-up offers of the plan subscription's plan whose every pool definition has a pool in `pools`.\n * @maxSize 100\n */\n topUpOffers?: TopUpOffer[];\n}\n\n/** Active or renewing pool of a plan subscription that has a credit configuration, and so can be topped up. */\nexport interface PlanSubscriptionPool {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Date and time the current benefit cycle ends, when the pool's credit configuration is applied again.\n * Empty when the plan subscription has no end and no next billing date: the credits are available\n * while the plan subscription is active.\n */\n benefitCycleEndDate?: Date | null;\n /** Whether unused credits roll over to the next benefit cycle, and up to what amount. */\n rolloverConfiguration?: RolloverConfiguration;\n}\n\n/** Rollover settings of a pool. */\nexport interface RolloverConfiguration {\n /** Whether unused credits roll over to the next benefit cycle. */\n enabled?: boolean | null;\n /**\n * Maximum amount of credits that roll over to the next benefit cycle.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n balanceCap?: string | null;\n}\n\n/**\n * A top-up offer is what a Wix user sells to members subscribed to a plan who want extra credits\n * before their current benefit cycle ends. It adds a fixed amount of credits to the balances of\n * the pools created from one or more of the plan's pool definitions, for a price.\n */\nexport interface TopUpOffer {\n /**\n * Top-up offer ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the top-up offer is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the top-up offer.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up offer was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the top-up offer was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the plan whose subscribed members can buy the top-up offer. Set on creation and can't be changed.\n * @format GUID\n * @readonly\n * @immutable\n */\n planId?: string | null;\n /**\n * Top-up offer name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /** How much a member pays for the top-up offer. */\n pricingStrategy?: PricingStrategy;\n /**\n * Credits the top-up offer adds, one grant per pool definition of the plan.\n * Each pool definition can appear only once.\n *\n * Grants are checked against the plan's pool definitions only when the offer is created or its grants are updated.\n * A grant whose pool definition is later deleted, loses its credit configuration, or is removed from the plan stays\n * on the offer. Members can't buy the offer while any of its grants has no active or renewing pool with a credit\n * configuration in their plan subscription.\n * @minSize 1\n * @maxSize 5\n */\n creditGrants?: CreditGrant[];\n /**\n * List of text snippets describing what the top-up offer gives. For display purposes only.\n * @maxSize 3\n */\n perks?: Perk[];\n}\n\n/** Pricing strategy type. */\nexport enum Type {\n /** Fixed price. */\n FLAT_RATE = 'FLAT_RATE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'FLAT_RATE';\n\n/** Options for the `FLAT_RATE` pricing strategy type. */\nexport interface FlatRateOptions {\n /**\n * Price, in the site's currency.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** How much a member pays for a top-up offer. */\nexport interface PricingStrategy extends PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n /** Pricing strategy type. */\n type?: TypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n}\n\n/** Credits a top-up offer adds to the balance of each pool created from one pool definition. */\nexport interface CreditGrant {\n /**\n * ID of a pool definition of the plan that has a credit configuration.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** Text snippet describing what a top-up offer gives. */\nexport interface Perk {\n /**\n * Perk ID.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Perk description.\n * @minLength 1\n * @maxLength 100\n */\n description?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: 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\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n * @param topUpId - ID of the top-up to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField topUpId\n * @permissionId pricing_plans:v3:top_up:get_top_up\n * @applicableIdentity APP\n * @returns Retrieved top-up.\n * @fqn wix.pricing_plans.v3.TopUpService.GetTopUp\n */\nexport async function getTopUp(\n topUpId: string\n): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ topUpId: topUpId });\n\n const reqOpts = ambassadorWixPricingPlansV3TopUp.getTopUp(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.topUp!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { topUpId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['topUpId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n * @public\n * @documentationMaturity preview\n * @permissionId pricing_plans:v3:top_up:query_top_ups\n * @applicableIdentity APP\n * @fqn wix.pricing_plans.v3.TopUpService.QueryTopUps\n */\nexport function queryTopUps(): TopUpsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<TopUp, 'CURSOR', QueryTopUpsRequest, QueryTopUpsResponse>(\n {\n func: async (payload: QueryTopUpsRequest) => {\n const reqOpts = ambassadorWixPricingPlansV3TopUp.queryTopUps(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryTopUpsRequest['query']) => {\n const args = [query, {}] as [QueryTopUpsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTopUpsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.topUps,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n }\n );\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TopUpsQueryResult extends QueryCursorResult {\n items: TopUp[];\n query: TopUpsQueryBuilder;\n next: () => Promise<TopUpsQueryResult>;\n prev: () => Promise<TopUpsQueryResult>;\n}\n\nexport interface TopUpsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'planSubscriptionId' | 'memberId',\n value: string\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId',\n value: boolean\n ) => TopUpsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'\n >\n ) => TopUpsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'\n >\n ) => TopUpsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => TopUpsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TopUpsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.pricing_plans.v3.TopUpService.QueryTopUps\n * @requiredField query\n */\nexport async function typedQueryTopUps(\n query: TopUpQuery\n): Promise<NonNullablePaths<QueryTopUpsResponse, `topUps`, 0>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixPricingPlansV3TopUp.queryTopUps(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: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TopUpQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_createdDate', '_id', 'memberId', 'planSubscriptionId'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<TopUp, TopUpQuerySpec>;\nexport type TopUpQuery = {\n /** \n Cursor paging options.\n\n Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<TopUp, TopUpQuerySpec, TopUpQuery>(),\n};\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan\n * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of\n * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist\n * and the caller can retrieve the top-up offers of any plan subscription.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`\n * error for a plan subscription that doesn't exist or belongs to another member.\n * @param planSubscriptionId - ID of the plan subscription to retrieve the top-up offers for.\n * @public\n * @documentationMaturity preview\n * @requiredField planSubscriptionId\n * @permissionId pricing_plans:v3:top_up:get_purchasable_top_up_offers\n * @applicableIdentity APP\n * @fqn wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers\n */\nexport async function getPurchasableTopUpOffers(\n planSubscriptionId: string\n): Promise<\n NonNullablePaths<\n GetPurchasableTopUpOffersResponse,\n `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n planSubscriptionId: planSubscriptionId,\n });\n\n const reqOpts =\n ambassadorWixPricingPlansV3TopUp.getPurchasableTopUpOffers(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: { planSubscriptionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['planSubscriptionId']\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\nconst TRANSFORM_PATHS_0 = [\n { path: 'topUp.createdDate' },\n { path: 'topUp.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'topUps.createdDate' },\n { path: 'topUps.updatedDate' },\n];\nconst TRANSFORM_PATHS_2 = [\n { path: 'pools.benefitCycleEndDate' },\n { path: 'topUpOffers.createdDate' },\n { path: 'topUpOffers.updatedDate' },\n];\n\nfunction resolveWixPricingPlansV3TopUpServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/top-ups',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'apps._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/pricing-plans/v3/top-ups',\n destPath: '/v3/top-ups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_top-ups';\n\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n */\nexport function getTopUp(payload: object): RequestOptionsFactory<any> {\n function __getTopUp({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetTopUp',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/{topUpId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTopUp;\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n */\nexport function queryTopUps(payload: object): RequestOptionsFactory<any> {\n function __queryTopUps({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.QueryTopUps',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryTopUps;\n}\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan\n * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of\n * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist\n * and the caller can retrieve the top-up offers of any plan subscription.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`\n * error for a plan subscription that doesn't exist or belongs to another member.\n */\nexport function getPurchasableTopUpOffers(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPurchasableTopUpOffers({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'POST' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/get-purchasable-offers',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPurchasableTopUpOffers;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,oBAAoB;AAAA,EAC5B,EAAE,MAAM,oBAAoB;AAC9B;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,qBAAqB;AAAA,EAC7B,EAAE,MAAM,qBAAqB;AAC/B;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,4BAA4B;AAAA,EACpC,EAAE,MAAM,0BAA0B;AAAA,EAClC,EAAE,MAAM,0BAA0B;AACpC;AAEA,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;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;AAAA,IACA,wBAAwB;AAAA,MACtB;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,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AA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;AAAA,EACnB,OAAqB,iCAAoD;AAC3E;AAoBA,eAAsBM,2BACpB,oBAOA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAC6B,0BAA0B,OAAO;AAEpE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,oBAAoB,OAAO;AAAA,QACvD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,oBAAoB;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","getPurchasableTopUpOffers"]}
@@ -212,7 +212,7 @@ interface GetPurchasableTopUpOffersRequest {
212
212
  }
213
213
  interface GetPurchasableTopUpOffersResponse {
214
214
  /**
215
- * Active or renewing pools of the plan subscription that have a credit configuration.
215
+ * Active or renewing pools of the plan subscription that have a credit configuration, for the pool definitions of the plan's top-up offers.
216
216
  * @maxSize 100
217
217
  */
218
218
  pools?: PlanSubscriptionPool[];
@@ -222,7 +222,7 @@ interface GetPurchasableTopUpOffersResponse {
222
222
  */
223
223
  topUpOffers?: TopUpOffer[];
224
224
  }
225
- /** Active or renewing pool of a plan subscription that has a credit configuration, and so can receive credits from top-ups. */
225
+ /** Active or renewing pool of a plan subscription that has a credit configuration, and so can be topped up. */
226
226
  interface PlanSubscriptionPool {
227
227
  /**
228
228
  * ID of the pool definition the pool was created from.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pricing-plans-v3-top-up-top-ups.http.ts","../../src/pricing-plans-v3-top-up-top-ups.types.ts","../../src/pricing-plans-v3-top-up-top-ups.meta.ts"],"sourcesContent":["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\nconst TRANSFORM_PATHS_0 = [\n { path: 'topUp.createdDate' },\n { path: 'topUp.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'topUps.createdDate' },\n { path: 'topUps.updatedDate' },\n];\nconst TRANSFORM_PATHS_2 = [\n { path: 'pools.benefitCycleEndDate' },\n { path: 'topUpOffers.createdDate' },\n { path: 'topUpOffers.updatedDate' },\n];\n\nfunction resolveWixPricingPlansV3TopUpServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/top-ups',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'apps._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/pricing-plans/v3/top-ups',\n destPath: '/v3/top-ups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_top-ups';\n\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n */\nexport function getTopUp(payload: object): RequestOptionsFactory<any> {\n function __getTopUp({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetTopUp',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/{topUpId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTopUp;\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n */\nexport function queryTopUps(payload: object): RequestOptionsFactory<any> {\n function __queryTopUps({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.QueryTopUps',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryTopUps;\n}\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its\n * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan\n * subscription doesn't exist or isn't active.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions.\n */\nexport function getPurchasableTopUpOffers(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPurchasableTopUpOffers({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'POST' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/get-purchasable-offers',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPurchasableTopUpOffers;\n}\n","/**\n * A top-up is the record of credits a member bought for their plan subscription's pools,\n * the pools of the benefit program that grants the plan's benefits to the member.\n *\n * It's created for each top-up offer line item of an approved eCommerce order, after the credits\n * were added to the balances of the plan subscription's pools. The price, discounts and taxes are\n * available in the eCommerce order.\n */\nexport interface TopUp {\n /**\n * Top-up ID.\n * @format GUID\n * @readonly\n */\n id?: string | null;\n /**\n * Revision number.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up was created.\n * @readonly\n */\n createdDate?: Date | null;\n /**\n * Date and time the top-up was last updated.\n * @readonly\n */\n updatedDate?: Date | null;\n /**\n * ID of the plan subscription whose pools received the credits.\n * @format GUID\n * @readonly\n */\n planSubscriptionId?: string | null;\n /**\n * ID of the member who holds the plan subscription.\n * @format GUID\n * @readonly\n */\n memberId?: string | null;\n /**\n * ID of the top-up offer the member bought.\n * @format GUID\n * @readonly\n */\n topUpOfferId?: string | null;\n /**\n * Number of times the member bought the top-up offer in the line item.\n * @min 1\n * @readonly\n */\n quantity?: number | null;\n /**\n * ID of the eCommerce order.\n * @format GUID\n * @readonly\n */\n orderId?: string | null;\n /**\n * ID of the line item of the eCommerce order.\n * @format GUID\n * @readonly\n */\n lineItemId?: string | null;\n /**\n * Changes made to the balances of the plan subscription's pools, one per pool.\n * @maxSize 10\n * @readonly\n */\n balanceAdjustments?: BalanceAdjustment[];\n}\n\n/** Change made to the balance of one pool. */\nexport interface BalanceAdjustment {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool whose balance was adjusted.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n /**\n * ID of the Benefit Programs transaction that recorded the balance adjustment.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface GetTopUpRequest {\n /**\n * ID of the top-up to retrieve.\n * @format GUID\n */\n topUpId: string;\n}\n\nexport interface GetTopUpResponse {\n /** Retrieved top-up. */\n topUp?: TopUp;\n}\n\nexport interface QueryTopUpsRequest {\n /** WQL expression. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTopUpsResponse {\n /** List of top-ups. */\n topUps?: TopUp[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersRequest {\n /**\n * ID of the plan subscription to retrieve the top-up offers for.\n * @format GUID\n */\n planSubscriptionId: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersResponse {\n /**\n * Active or renewing pools of the plan subscription that have a credit configuration.\n * @maxSize 100\n */\n pools?: PlanSubscriptionPool[];\n /**\n * Top-up offers of the plan subscription's plan whose every pool definition has a pool in `pools`.\n * @maxSize 100\n */\n topUpOffers?: TopUpOffer[];\n}\n\n/** Active or renewing pool of a plan subscription that has a credit configuration, and so can receive credits from top-ups. */\nexport interface PlanSubscriptionPool {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Date and time the current benefit cycle ends, when the pool's credit configuration is applied again.\n * Empty when the plan subscription has no end and no next billing date: the credits are available\n * while the plan subscription is active.\n */\n benefitCycleEndDate?: Date | null;\n /** Whether unused credits roll over to the next benefit cycle, and up to what amount. */\n rolloverConfiguration?: RolloverConfiguration;\n}\n\n/** Rollover settings of a pool. */\nexport interface RolloverConfiguration {\n /** Whether unused credits roll over to the next benefit cycle. */\n enabled?: boolean | null;\n /**\n * Maximum amount of credits that roll over to the next benefit cycle.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n balanceCap?: string | null;\n}\n\n/**\n * A top-up offer is what a Wix user sells to members subscribed to a plan who want extra credits\n * before their current benefit cycle ends. It adds a fixed amount of credits to the balances of\n * the pools created from one or more of the plan's pool definitions, for a price.\n */\nexport interface TopUpOffer {\n /**\n * Top-up offer ID.\n * @format GUID\n * @readonly\n */\n id?: string | null;\n /**\n * Revision number, which increments by 1 each time the top-up offer is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the top-up offer.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up offer was created.\n * @readonly\n */\n createdDate?: Date | null;\n /**\n * Date and time the top-up offer was last updated.\n * @readonly\n */\n updatedDate?: Date | null;\n /**\n * ID of the plan whose subscribed members can buy the top-up offer. Set on creation and can't be changed.\n * @format GUID\n * @readonly\n * @immutable\n */\n planId?: string | null;\n /**\n * Top-up offer name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /** How much a member pays for the top-up offer. */\n pricingStrategy?: PricingStrategy;\n /**\n * Credits the top-up offer adds, one grant per pool definition of the plan.\n * Each pool definition can appear only once.\n *\n * Grants are checked against the plan's pool definitions only when the offer is created or its grants are updated.\n * A grant whose pool definition is later deleted, loses its credit configuration, or is removed from the plan stays\n * on the offer. Members can't buy the offer while any of its grants has no active or renewing pool with a credit\n * configuration in their plan subscription.\n * @minSize 1\n * @maxSize 5\n */\n creditGrants?: CreditGrant[];\n /**\n * List of text snippets describing what the top-up offer gives. For display purposes only.\n * @maxSize 3\n */\n perks?: Perk[];\n}\n\n/** Pricing strategy type. */\nexport enum Type {\n /** Fixed price. */\n FLAT_RATE = 'FLAT_RATE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'FLAT_RATE';\n\n/** Options for the `FLAT_RATE` pricing strategy type. */\nexport interface FlatRateOptions {\n /**\n * Price, in the site's currency.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** How much a member pays for a top-up offer. */\nexport interface PricingStrategy extends PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n /** Pricing strategy type. */\n type?: TypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n}\n\n/** Credits a top-up offer adds to the balance of each pool created from one pool definition. */\nexport interface CreditGrant {\n /**\n * ID of a pool definition of the plan that has a credit configuration.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** Text snippet describing what a top-up offer gives. */\nexport interface Perk {\n /**\n * Perk ID.\n * @format GUID\n */\n id?: string | null;\n /**\n * Perk description.\n * @minLength 1\n * @maxLength 100\n */\n description?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entityAsJson?: string;\n /**\n * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity\n * @internal\n */\n triggeredByUndelete?: boolean | null;\n /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */\n restoreInfo?: RestoreInfo;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntityAsJson?: string;\n /**\n * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard\n * wont populate it / have any reference to it in the API.\n * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,\n * the developer should send only the new (current) entity.\n * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big\n * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.\n * @internal\n * @deprecated\n */\n previousEntityAsJson?: string | null;\n /**\n * Map of fully qualified field paths to their previous values for fields that changed.\n * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format)\n * @internal\n */\n modifiedFields?: Record<string, any>;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface EntityDeletedEvent {\n /**\n * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled\n * @internal\n */\n movedToTrash?: boolean | null;\n /** Entity that was deleted. */\n deletedEntityAsJson?: string | null;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface ActionEvent {\n bodyAsJson?: 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","import * as ambassadorWixPricingPlansV3TopUp from './pricing-plans-v3-top-up-top-ups.http.js';\nimport * as ambassadorWixPricingPlansV3TopUpTypes from './pricing-plans-v3-top-up-top-ups.types.js';\nimport * as ambassadorWixPricingPlansV3TopUpUniversalTypes from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getTopUp(): __PublicMethodMetaInfo<\n 'GET',\n { topUpId: string },\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetTopUpRequest,\n ambassadorWixPricingPlansV3TopUpTypes.GetTopUpRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetTopUpResponse,\n ambassadorWixPricingPlansV3TopUpTypes.GetTopUpResponse\n> {\n const payload = { topUpId: ':topUpId' } as any;\n\n const getRequestOptions = ambassadorWixPricingPlansV3TopUp.getTopUp(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v3/top-ups/{topUpId}',\n pathParams: { topUpId: 'topUpId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function queryTopUps(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixPricingPlansV3TopUpUniversalTypes.QueryTopUpsRequest,\n ambassadorWixPricingPlansV3TopUpTypes.QueryTopUpsRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.QueryTopUpsResponse,\n ambassadorWixPricingPlansV3TopUpTypes.QueryTopUpsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPricingPlansV3TopUp.queryTopUps(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v3/top-ups/query',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getPurchasableTopUpOffers(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetPurchasableTopUpOffersRequest,\n ambassadorWixPricingPlansV3TopUpTypes.GetPurchasableTopUpOffersRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetPurchasableTopUpOffersResponse,\n ambassadorWixPricingPlansV3TopUpTypes.GetPurchasableTopUpOffersResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPricingPlansV3TopUp.getPurchasableTopUpOffers(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/top-ups/get-purchasable-offers',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n TopUp as TopUpOriginal,\n BalanceAdjustment as BalanceAdjustmentOriginal,\n GetTopUpRequest as GetTopUpRequestOriginal,\n GetTopUpResponse as GetTopUpResponseOriginal,\n QueryTopUpsRequest as QueryTopUpsRequestOriginal,\n CursorQuery as CursorQueryOriginal,\n CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal,\n Sorting as SortingOriginal,\n SortOrder as SortOrderOriginal,\n SortOrderWithLiterals as SortOrderWithLiteralsOriginal,\n CursorPaging as CursorPagingOriginal,\n QueryTopUpsResponse as QueryTopUpsResponseOriginal,\n CursorPagingMetadata as CursorPagingMetadataOriginal,\n Cursors as CursorsOriginal,\n GetPurchasableTopUpOffersRequest as GetPurchasableTopUpOffersRequestOriginal,\n GetPurchasableTopUpOffersResponse as GetPurchasableTopUpOffersResponseOriginal,\n PlanSubscriptionPool as PlanSubscriptionPoolOriginal,\n RolloverConfiguration as RolloverConfigurationOriginal,\n TopUpOffer as TopUpOfferOriginal,\n Type as TypeOriginal,\n TypeWithLiterals as TypeWithLiteralsOriginal,\n FlatRateOptions as FlatRateOptionsOriginal,\n PricingStrategy as PricingStrategyOriginal,\n PricingStrategyStrategyOptionsOneOf as PricingStrategyStrategyOptionsOneOfOriginal,\n CreditGrant as CreditGrantOriginal,\n Perk as PerkOriginal,\n DomainEvent as DomainEventOriginal,\n DomainEventBodyOneOf as DomainEventBodyOneOfOriginal,\n EntityCreatedEvent as EntityCreatedEventOriginal,\n RestoreInfo as RestoreInfoOriginal,\n EntityUpdatedEvent as EntityUpdatedEventOriginal,\n EntityDeletedEvent as EntityDeletedEventOriginal,\n ActionEvent as ActionEventOriginal,\n MessageEnvelope as MessageEnvelopeOriginal,\n IdentificationData as IdentificationDataOriginal,\n IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal,\n WebhookIdentityType as WebhookIdentityTypeOriginal,\n WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal,\n AccountInfo as AccountInfoOriginal,\n} from './pricing-plans-v3-top-up-top-ups.types.js';\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,oBAAoB;AAAA,EAC5B,EAAE,MAAM,oBAAoB;AAC9B;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,qBAAqB;AAAA,EAC7B,EAAE,MAAM,qBAAqB;AAC/B;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,4BAA4B;AAAA,EACpC,EAAE,MAAM,0BAA0B;AAAA,EAClC,EAAE,MAAM,0BAA0B;AACpC;AAEA,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;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;AAAA,IACA,wBA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ChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,6BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,0BAA0B,OAAO;AAEpE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","getPurchasableTopUpOffers"]}
1
+ {"version":3,"sources":["../../src/pricing-plans-v3-top-up-top-ups.http.ts","../../src/pricing-plans-v3-top-up-top-ups.types.ts","../../src/pricing-plans-v3-top-up-top-ups.meta.ts"],"sourcesContent":["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\nconst TRANSFORM_PATHS_0 = [\n { path: 'topUp.createdDate' },\n { path: 'topUp.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'topUps.createdDate' },\n { path: 'topUps.updatedDate' },\n];\nconst TRANSFORM_PATHS_2 = [\n { path: 'pools.benefitCycleEndDate' },\n { path: 'topUpOffers.createdDate' },\n { path: 'topUpOffers.updatedDate' },\n];\n\nfunction resolveWixPricingPlansV3TopUpServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/top-ups',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'apps._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/top-ups',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/pricing-plans/v3/top-ups',\n destPath: '/v3/top-ups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_top-ups';\n\n/**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n */\nexport function getTopUp(payload: object): RequestOptionsFactory<any> {\n function __getTopUp({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetTopUp',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/{topUpId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTopUp;\n}\n\n/**\n * Retrieves a list of top-ups, given the provided [paging, filtering, and sorting][1].\n *\n * Site members retrieve only their own top-ups.\n *\n * To learn how to query top-ups, see [API Query Language][2].\n *\n * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging\n * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language\n */\nexport function queryTopUps(payload: object): RequestOptionsFactory<any> {\n function __queryTopUps({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'GET' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.QueryTopUps',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryTopUps;\n}\n\n/**\n * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.\n *\n * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan\n * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of\n * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist\n * and the caller can retrieve the top-up offers of any plan subscription.\n *\n * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`\n * error for a plan subscription that doesn't exist or belongs to another member.\n */\nexport function getPurchasableTopUpOffers(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPurchasableTopUpOffers({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.pricing_plans.v3.top_up',\n method: 'POST' as any,\n methodFqn: 'wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/get-purchasable-offers',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPurchasableTopUpOffers;\n}\n","/**\n * A top-up is the record of credits a member bought for their plan subscription's pools,\n * the pools of the benefit program that grants the plan's benefits to the member.\n *\n * It's created for each top-up offer line item of an approved eCommerce order, after the credits\n * were added to the balances of the plan subscription's pools. The price, discounts and taxes are\n * available in the eCommerce order.\n */\nexport interface TopUp {\n /**\n * Top-up ID.\n * @format GUID\n * @readonly\n */\n id?: string | null;\n /**\n * Revision number.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up was created.\n * @readonly\n */\n createdDate?: Date | null;\n /**\n * Date and time the top-up was last updated.\n * @readonly\n */\n updatedDate?: Date | null;\n /**\n * ID of the plan subscription whose pools received the credits.\n * @format GUID\n * @readonly\n */\n planSubscriptionId?: string | null;\n /**\n * ID of the member who holds the plan subscription.\n * @format GUID\n * @readonly\n */\n memberId?: string | null;\n /**\n * ID of the top-up offer the member bought.\n * @format GUID\n * @readonly\n */\n topUpOfferId?: string | null;\n /**\n * Number of times the member bought the top-up offer in the line item.\n * @min 1\n * @readonly\n */\n quantity?: number | null;\n /**\n * ID of the eCommerce order.\n * @format GUID\n * @readonly\n */\n orderId?: string | null;\n /**\n * ID of the line item of the eCommerce order.\n * @format GUID\n * @readonly\n */\n lineItemId?: string | null;\n /**\n * Changes made to the balances of the plan subscription's pools, one per pool.\n * @maxSize 10\n * @readonly\n */\n balanceAdjustments?: BalanceAdjustment[];\n}\n\n/** Change made to the balance of one pool. */\nexport interface BalanceAdjustment {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool whose balance was adjusted.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n /**\n * ID of the Benefit Programs transaction that recorded the balance adjustment.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface GetTopUpRequest {\n /**\n * ID of the top-up to retrieve.\n * @format GUID\n */\n topUpId: string;\n}\n\nexport interface GetTopUpResponse {\n /** Retrieved top-up. */\n topUp?: TopUp;\n}\n\nexport interface QueryTopUpsRequest {\n /** WQL expression. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTopUpsResponse {\n /** List of top-ups. */\n topUps?: TopUp[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersRequest {\n /**\n * ID of the plan subscription to retrieve the top-up offers for.\n * @format GUID\n */\n planSubscriptionId: string | null;\n}\n\nexport interface GetPurchasableTopUpOffersResponse {\n /**\n * Active or renewing pools of the plan subscription that have a credit configuration, for the pool definitions of the plan's top-up offers.\n * @maxSize 100\n */\n pools?: PlanSubscriptionPool[];\n /**\n * Top-up offers of the plan subscription's plan whose every pool definition has a pool in `pools`.\n * @maxSize 100\n */\n topUpOffers?: TopUpOffer[];\n}\n\n/** Active or renewing pool of a plan subscription that has a credit configuration, and so can be topped up. */\nexport interface PlanSubscriptionPool {\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the pool.\n * @format GUID\n */\n poolId?: string | null;\n /**\n * Date and time the current benefit cycle ends, when the pool's credit configuration is applied again.\n * Empty when the plan subscription has no end and no next billing date: the credits are available\n * while the plan subscription is active.\n */\n benefitCycleEndDate?: Date | null;\n /** Whether unused credits roll over to the next benefit cycle, and up to what amount. */\n rolloverConfiguration?: RolloverConfiguration;\n}\n\n/** Rollover settings of a pool. */\nexport interface RolloverConfiguration {\n /** Whether unused credits roll over to the next benefit cycle. */\n enabled?: boolean | null;\n /**\n * Maximum amount of credits that roll over to the next benefit cycle.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n balanceCap?: string | null;\n}\n\n/**\n * A top-up offer is what a Wix user sells to members subscribed to a plan who want extra credits\n * before their current benefit cycle ends. It adds a fixed amount of credits to the balances of\n * the pools created from one or more of the plan's pool definitions, for a price.\n */\nexport interface TopUpOffer {\n /**\n * Top-up offer ID.\n * @format GUID\n * @readonly\n */\n id?: string | null;\n /**\n * Revision number, which increments by 1 each time the top-up offer is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the top-up offer.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the top-up offer was created.\n * @readonly\n */\n createdDate?: Date | null;\n /**\n * Date and time the top-up offer was last updated.\n * @readonly\n */\n updatedDate?: Date | null;\n /**\n * ID of the plan whose subscribed members can buy the top-up offer. Set on creation and can't be changed.\n * @format GUID\n * @readonly\n * @immutable\n */\n planId?: string | null;\n /**\n * Top-up offer name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /** How much a member pays for the top-up offer. */\n pricingStrategy?: PricingStrategy;\n /**\n * Credits the top-up offer adds, one grant per pool definition of the plan.\n * Each pool definition can appear only once.\n *\n * Grants are checked against the plan's pool definitions only when the offer is created or its grants are updated.\n * A grant whose pool definition is later deleted, loses its credit configuration, or is removed from the plan stays\n * on the offer. Members can't buy the offer while any of its grants has no active or renewing pool with a credit\n * configuration in their plan subscription.\n * @minSize 1\n * @maxSize 5\n */\n creditGrants?: CreditGrant[];\n /**\n * List of text snippets describing what the top-up offer gives. For display purposes only.\n * @maxSize 3\n */\n perks?: Perk[];\n}\n\n/** Pricing strategy type. */\nexport enum Type {\n /** Fixed price. */\n FLAT_RATE = 'FLAT_RATE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'FLAT_RATE';\n\n/** Options for the `FLAT_RATE` pricing strategy type. */\nexport interface FlatRateOptions {\n /**\n * Price, in the site's currency.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** How much a member pays for a top-up offer. */\nexport interface PricingStrategy extends PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n /** Pricing strategy type. */\n type?: TypeWithLiterals;\n}\n\n/** @oneof */\nexport interface PricingStrategyStrategyOptionsOneOf {\n /** Options for the `FLAT_RATE` pricing strategy type. */\n flatRateOptions?: FlatRateOptions;\n}\n\n/** Credits a top-up offer adds to the balance of each pool created from one pool definition. */\nexport interface CreditGrant {\n /**\n * ID of a pool definition of the plan that has a credit configuration.\n * @format GUID\n */\n poolDefinitionId?: string | null;\n /**\n * Amount of credits added to the pool's balance.\n * @decimalValue options { gt:0, maxScale:4 }\n */\n amount?: string | null;\n}\n\n/** Text snippet describing what a top-up offer gives. */\nexport interface Perk {\n /**\n * Perk ID.\n * @format GUID\n */\n id?: string | null;\n /**\n * Perk description.\n * @minLength 1\n * @maxLength 100\n */\n description?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entityAsJson?: string;\n /**\n * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity\n * @internal\n */\n triggeredByUndelete?: boolean | null;\n /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */\n restoreInfo?: RestoreInfo;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntityAsJson?: string;\n /**\n * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard\n * wont populate it / have any reference to it in the API.\n * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,\n * the developer should send only the new (current) entity.\n * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big\n * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.\n * @internal\n * @deprecated\n */\n previousEntityAsJson?: string | null;\n /**\n * Map of fully qualified field paths to their previous values for fields that changed.\n * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format)\n * @internal\n */\n modifiedFields?: Record<string, any>;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface EntityDeletedEvent {\n /**\n * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled\n * @internal\n */\n movedToTrash?: boolean | null;\n /** Entity that was deleted. */\n deletedEntityAsJson?: string | null;\n /**\n * Optional domain-specific metadata defined by the API owner, encoded as JSON.\n * @internal\n */\n additionalMetadataAsJson?: string | null;\n}\n\nexport interface ActionEvent {\n bodyAsJson?: 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","import * as ambassadorWixPricingPlansV3TopUp from './pricing-plans-v3-top-up-top-ups.http.js';\nimport * as ambassadorWixPricingPlansV3TopUpTypes from './pricing-plans-v3-top-up-top-ups.types.js';\nimport * as ambassadorWixPricingPlansV3TopUpUniversalTypes from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getTopUp(): __PublicMethodMetaInfo<\n 'GET',\n { topUpId: string },\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetTopUpRequest,\n ambassadorWixPricingPlansV3TopUpTypes.GetTopUpRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetTopUpResponse,\n ambassadorWixPricingPlansV3TopUpTypes.GetTopUpResponse\n> {\n const payload = { topUpId: ':topUpId' } as any;\n\n const getRequestOptions = ambassadorWixPricingPlansV3TopUp.getTopUp(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v3/top-ups/{topUpId}',\n pathParams: { topUpId: 'topUpId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function queryTopUps(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixPricingPlansV3TopUpUniversalTypes.QueryTopUpsRequest,\n ambassadorWixPricingPlansV3TopUpTypes.QueryTopUpsRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.QueryTopUpsResponse,\n ambassadorWixPricingPlansV3TopUpTypes.QueryTopUpsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPricingPlansV3TopUp.queryTopUps(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v3/top-ups/query',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getPurchasableTopUpOffers(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetPurchasableTopUpOffersRequest,\n ambassadorWixPricingPlansV3TopUpTypes.GetPurchasableTopUpOffersRequest,\n ambassadorWixPricingPlansV3TopUpUniversalTypes.GetPurchasableTopUpOffersResponse,\n ambassadorWixPricingPlansV3TopUpTypes.GetPurchasableTopUpOffersResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPricingPlansV3TopUp.getPurchasableTopUpOffers(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v3/top-ups/get-purchasable-offers',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n TopUp as TopUpOriginal,\n BalanceAdjustment as BalanceAdjustmentOriginal,\n GetTopUpRequest as GetTopUpRequestOriginal,\n GetTopUpResponse as GetTopUpResponseOriginal,\n QueryTopUpsRequest as QueryTopUpsRequestOriginal,\n CursorQuery as CursorQueryOriginal,\n CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal,\n Sorting as SortingOriginal,\n SortOrder as SortOrderOriginal,\n SortOrderWithLiterals as SortOrderWithLiteralsOriginal,\n CursorPaging as CursorPagingOriginal,\n QueryTopUpsResponse as QueryTopUpsResponseOriginal,\n CursorPagingMetadata as CursorPagingMetadataOriginal,\n Cursors as CursorsOriginal,\n GetPurchasableTopUpOffersRequest as GetPurchasableTopUpOffersRequestOriginal,\n GetPurchasableTopUpOffersResponse as GetPurchasableTopUpOffersResponseOriginal,\n PlanSubscriptionPool as PlanSubscriptionPoolOriginal,\n RolloverConfiguration as RolloverConfigurationOriginal,\n TopUpOffer as TopUpOfferOriginal,\n Type as TypeOriginal,\n TypeWithLiterals as TypeWithLiteralsOriginal,\n FlatRateOptions as FlatRateOptionsOriginal,\n PricingStrategy as PricingStrategyOriginal,\n PricingStrategyStrategyOptionsOneOf as PricingStrategyStrategyOptionsOneOfOriginal,\n CreditGrant as CreditGrantOriginal,\n Perk as PerkOriginal,\n DomainEvent as DomainEventOriginal,\n DomainEventBodyOneOf as DomainEventBodyOneOfOriginal,\n EntityCreatedEvent as EntityCreatedEventOriginal,\n RestoreInfo as RestoreInfoOriginal,\n EntityUpdatedEvent as EntityUpdatedEventOriginal,\n EntityDeletedEvent as EntityDeletedEventOriginal,\n ActionEvent as ActionEventOriginal,\n MessageEnvelope as MessageEnvelopeOriginal,\n IdentificationData as IdentificationDataOriginal,\n IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal,\n WebhookIdentityType as WebhookIdentityTypeOriginal,\n WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal,\n AccountInfo as AccountInfoOriginal,\n} from './pricing-plans-v3-top-up-top-ups.types.js';\n"],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,oBAAqD,SAAS,OAAO;AAE3E,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,SAAS,UAAU;AAAA,IACjC,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,eAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,YAAY,OAAO;AAEtD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,6BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6B,0BAA0B,OAAO;AAEpE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","getPurchasableTopUpOffers"]}
@@ -2,7 +2,6 @@ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@
2
2
  import { TopUp, GetPurchasableTopUpOffersResponse, TopUpsQueryBuilder, TopUpQuery, typedQueryTopUps } from './index.typings.js';
3
3
  export { AccountInfo, ActionEvent, BalanceAdjustment, CommonQueryWithEntityContext, CreditGrant, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FlatRateOptions, GetPurchasableTopUpOffersRequest, GetTopUpRequest, GetTopUpResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, Perk, PlanSubscriptionPool, PricingStrategy, PricingStrategyStrategyOptionsOneOf, QueryTopUpsRequest, QueryTopUpsResponse, RestoreInfo, RolloverConfiguration, SortOrder, SortOrderWithLiterals, Sorting, TopUpOffer, TopUpQuerySpec, TopUpsQueryResult, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
4
 
5
- /** @internal */
6
5
  declare function getTopUp$1(httpClient: HttpClient): GetTopUpSignature;
7
6
  interface GetTopUpSignature {
8
7
  /**
@@ -14,17 +13,18 @@ interface GetTopUpSignature {
14
13
  */
15
14
  (topUpId: string): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>>;
16
15
  }
17
- /** @internal */
18
16
  declare function getPurchasableTopUpOffers$1(httpClient: HttpClient): GetPurchasableTopUpOffersSignature;
19
17
  interface GetPurchasableTopUpOffersSignature {
20
18
  /**
21
19
  * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.
22
20
  *
23
- * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its
24
- * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan
25
- * subscription doesn't exist or isn't active.
21
+ * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan
22
+ * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of
23
+ * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist
24
+ * and the caller can retrieve the top-up offers of any plan subscription.
26
25
  *
27
- * Site members can retrieve only the top-up offers of their own plan subscriptions.
26
+ * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`
27
+ * error for a plan subscription that doesn't exist or belongs to another member.
28
28
  * @param - ID of the plan subscription to retrieve the top-up offers for.
29
29
  */
30
30
  (planSubscriptionId: string): Promise<NonNullablePaths<GetPurchasableTopUpOffersResponse, `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`, 3>>;
@@ -34,9 +34,7 @@ declare function customQueryTopUps(httpClient: HttpClient): {
34
34
  (): TopUpsQueryBuilder;
35
35
  (query: TopUpQuery): ReturnType<typeof typedQueryTopUps>;
36
36
  };
37
- /** @internal */
38
37
  declare const getTopUp: MaybeContext<BuildRESTFunction<typeof getTopUp$1> & typeof getTopUp$1>;
39
- /** @internal */
40
38
  declare const getPurchasableTopUpOffers: MaybeContext<BuildRESTFunction<typeof getPurchasableTopUpOffers$1> & typeof getPurchasableTopUpOffers$1>;
41
39
  declare const queryTopUps: MaybeContext<BuildRESTFunction<typeof customQueryTopUps> & typeof customQueryTopUps>;
42
40
 
@@ -212,7 +212,7 @@ interface GetPurchasableTopUpOffersRequest {
212
212
  }
213
213
  interface GetPurchasableTopUpOffersResponse {
214
214
  /**
215
- * Active or renewing pools of the plan subscription that have a credit configuration.
215
+ * Active or renewing pools of the plan subscription that have a credit configuration, for the pool definitions of the plan's top-up offers.
216
216
  * @maxSize 100
217
217
  */
218
218
  pools?: PlanSubscriptionPool[];
@@ -222,7 +222,7 @@ interface GetPurchasableTopUpOffersResponse {
222
222
  */
223
223
  topUpOffers?: TopUpOffer[];
224
224
  }
225
- /** Active or renewing pool of a plan subscription that has a credit configuration, and so can receive credits from top-ups. */
225
+ /** Active or renewing pool of a plan subscription that has a credit configuration, and so can be topped up. */
226
226
  interface PlanSubscriptionPool {
227
227
  /**
228
228
  * ID of the pool definition the pool was created from.
@@ -526,7 +526,7 @@ interface AccountInfo {
526
526
  *
527
527
  * Site members can retrieve only their own top-ups.
528
528
  * @param topUpId - ID of the top-up to retrieve.
529
- * @internal
529
+ * @public
530
530
  * @documentationMaturity preview
531
531
  * @requiredField topUpId
532
532
  * @permissionId pricing_plans:v3:top_up:get_top_up
@@ -544,7 +544,7 @@ declare function getTopUp(topUpId: string): Promise<NonNullablePaths<TopUp, `bal
544
544
  *
545
545
  * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging
546
546
  * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language
547
- * @internal
547
+ * @public
548
548
  * @documentationMaturity preview
549
549
  * @permissionId pricing_plans:v3:top_up:query_top_ups
550
550
  * @applicableIdentity APP
@@ -691,13 +691,15 @@ declare const utils: {
691
691
  /**
692
692
  * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.
693
693
  *
694
- * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its
695
- * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan
696
- * subscription doesn't exist or isn't active.
694
+ * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan
695
+ * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of
696
+ * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist
697
+ * and the caller can retrieve the top-up offers of any plan subscription.
697
698
  *
698
- * Site members can retrieve only the top-up offers of their own plan subscriptions.
699
+ * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`
700
+ * error for a plan subscription that doesn't exist or belongs to another member.
699
701
  * @param planSubscriptionId - ID of the plan subscription to retrieve the top-up offers for.
700
- * @internal
702
+ * @public
701
703
  * @documentationMaturity preview
702
704
  * @requiredField planSubscriptionId
703
705
  * @permissionId pricing_plans:v3:top_up:get_purchasable_top_up_offers
@@ -212,7 +212,7 @@ interface GetPurchasableTopUpOffersRequest {
212
212
  }
213
213
  interface GetPurchasableTopUpOffersResponse {
214
214
  /**
215
- * Active or renewing pools of the plan subscription that have a credit configuration.
215
+ * Active or renewing pools of the plan subscription that have a credit configuration, for the pool definitions of the plan's top-up offers.
216
216
  * @maxSize 100
217
217
  */
218
218
  pools?: PlanSubscriptionPool[];
@@ -222,7 +222,7 @@ interface GetPurchasableTopUpOffersResponse {
222
222
  */
223
223
  topUpOffers?: TopUpOffer[];
224
224
  }
225
- /** Active or renewing pool of a plan subscription that has a credit configuration, and so can receive credits from top-ups. */
225
+ /** Active or renewing pool of a plan subscription that has a credit configuration, and so can be topped up. */
226
226
  interface PlanSubscriptionPool {
227
227
  /**
228
228
  * ID of the pool definition the pool was created from.
@@ -2,7 +2,6 @@ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@
2
2
  import { TopUp, GetPurchasableTopUpOffersResponse, TopUpsQueryBuilder, TopUpQuery, typedQueryTopUps } from './index.typings.mjs';
3
3
  export { AccountInfo, ActionEvent, BalanceAdjustment, CommonQueryWithEntityContext, CreditGrant, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FlatRateOptions, GetPurchasableTopUpOffersRequest, GetTopUpRequest, GetTopUpResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, Perk, PlanSubscriptionPool, PricingStrategy, PricingStrategyStrategyOptionsOneOf, QueryTopUpsRequest, QueryTopUpsResponse, RestoreInfo, RolloverConfiguration, SortOrder, SortOrderWithLiterals, Sorting, TopUpOffer, TopUpQuerySpec, TopUpsQueryResult, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.mjs';
4
4
 
5
- /** @internal */
6
5
  declare function getTopUp$1(httpClient: HttpClient): GetTopUpSignature;
7
6
  interface GetTopUpSignature {
8
7
  /**
@@ -14,17 +13,18 @@ interface GetTopUpSignature {
14
13
  */
15
14
  (topUpId: string): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>>;
16
15
  }
17
- /** @internal */
18
16
  declare function getPurchasableTopUpOffers$1(httpClient: HttpClient): GetPurchasableTopUpOffersSignature;
19
17
  interface GetPurchasableTopUpOffersSignature {
20
18
  /**
21
19
  * Retrieves the top-up offers the member who holds a plan subscription can buy, with the pools that receive their credits.
22
20
  *
23
- * Returns the plan subscription's active or renewing pools that have a credit configuration, and the offers of its
24
- * plan that add credits only to pool definitions with such a pool. Returns no pools and no offers when the plan
25
- * subscription doesn't exist or isn't active.
21
+ * Returns the offers of the plan subscription's plan that add credits only to pool definitions where the plan
22
+ * subscription has an active or renewing pool with a credit configuration, and those pools for the pool definitions of
23
+ * the plan's offers. Returns no pools and no offers when the plan subscription isn't active, or when it doesn't exist
24
+ * and the caller can retrieve the top-up offers of any plan subscription.
26
25
  *
27
- * Site members can retrieve only the top-up offers of their own plan subscriptions.
26
+ * Site members can retrieve only the top-up offers of their own plan subscriptions. They get a `PERMISSION_DENIED`
27
+ * error for a plan subscription that doesn't exist or belongs to another member.
28
28
  * @param - ID of the plan subscription to retrieve the top-up offers for.
29
29
  */
30
30
  (planSubscriptionId: string): Promise<NonNullablePaths<GetPurchasableTopUpOffersResponse, `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`, 3>>;
@@ -34,9 +34,7 @@ declare function customQueryTopUps(httpClient: HttpClient): {
34
34
  (): TopUpsQueryBuilder;
35
35
  (query: TopUpQuery): ReturnType<typeof typedQueryTopUps>;
36
36
  };
37
- /** @internal */
38
37
  declare const getTopUp: MaybeContext<BuildRESTFunction<typeof getTopUp$1> & typeof getTopUp$1>;
39
- /** @internal */
40
38
  declare const getPurchasableTopUpOffers: MaybeContext<BuildRESTFunction<typeof getPurchasableTopUpOffers$1> & typeof getPurchasableTopUpOffers$1>;
41
39
  declare const queryTopUps: MaybeContext<BuildRESTFunction<typeof customQueryTopUps> & typeof customQueryTopUps>;
42
40