@wix/auto_sdk_pricing-plans_top-ups 1.0.2 → 1.0.4

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.
@@ -167,18 +167,18 @@ function queryTopUps(payload) {
167
167
  }
168
168
  return __queryTopUps;
169
169
  }
170
- function getPurchasableTopUpOffers(payload) {
171
- function __getPurchasableTopUpOffers({ host }) {
170
+ function listPurchasableTopUpOffers(payload) {
171
+ function __listPurchasableTopUpOffers({ host }) {
172
172
  const metadata = {
173
173
  entityFqdn: "wix.pricing_plans.v3.top_up",
174
174
  method: "POST",
175
- methodFqn: "wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers",
175
+ methodFqn: "wix.pricing_plans.v3.TopUpService.ListPurchasableTopUpOffers",
176
176
  packageName: PACKAGE_NAME,
177
177
  migrationOptions: {
178
178
  optInTransformResponse: true
179
179
  },
180
180
  url: resolveWixPricingPlansV3TopUpServiceUrl({
181
- protoPath: "/v3/top-ups/get-purchasable-offers",
181
+ protoPath: "/v3/top-ups/list-purchasable-offers",
182
182
  data: payload,
183
183
  host
184
184
  }),
@@ -192,7 +192,7 @@ function getPurchasableTopUpOffers(payload) {
192
192
  };
193
193
  return metadata;
194
194
  }
195
- return __getPurchasableTopUpOffers;
195
+ return __listPurchasableTopUpOffers;
196
196
  }
197
197
 
198
198
  // src/pricing-plans-v3-top-up-top-ups.universal.ts
@@ -309,12 +309,12 @@ async function typedQueryTopUps(query) {
309
309
  var utils = {
310
310
  query: /* @__PURE__ */ createQueryUtils()
311
311
  };
312
- async function getPurchasableTopUpOffers2(planSubscriptionId) {
312
+ async function listPurchasableTopUpOffers2(planSubscriptionId) {
313
313
  const { httpClient, sideEffects } = arguments[1];
314
314
  const payload = renameKeysFromSDKRequestToRESTRequest({
315
315
  planSubscriptionId
316
316
  });
317
- const reqOpts = getPurchasableTopUpOffers(payload);
317
+ const reqOpts = listPurchasableTopUpOffers(payload);
318
318
  sideEffects?.onSiteCall?.();
319
319
  try {
320
320
  const result = await httpClient.request(reqOpts);
@@ -356,8 +356,8 @@ function typedQueryTopUps2(httpClient) {
356
356
  { httpClient }
357
357
  );
358
358
  }
359
- function getPurchasableTopUpOffers3(httpClient) {
360
- return (planSubscriptionId) => getPurchasableTopUpOffers2(
359
+ function listPurchasableTopUpOffers3(httpClient) {
360
+ return (planSubscriptionId) => listPurchasableTopUpOffers2(
361
361
  planSubscriptionId,
362
362
  // @ts-ignore
363
363
  { httpClient }
@@ -379,14 +379,14 @@ function customQueryTopUps(httpClient) {
379
379
  return overloadedQuery;
380
380
  }
381
381
  var getTopUp4 = /* @__PURE__ */ createRESTModule(getTopUp3);
382
- var getPurchasableTopUpOffers4 = /* @__PURE__ */ createRESTModule(getPurchasableTopUpOffers3);
382
+ var listPurchasableTopUpOffers4 = /* @__PURE__ */ createRESTModule(listPurchasableTopUpOffers3);
383
383
  var queryTopUps4 = /* @__PURE__ */ createRESTModule(customQueryTopUps);
384
384
  export {
385
385
  SortOrder,
386
386
  Type,
387
387
  WebhookIdentityType,
388
- getPurchasableTopUpOffers4 as getPurchasableTopUpOffers,
389
388
  getTopUp4 as getTopUp,
389
+ listPurchasableTopUpOffers4 as listPurchasableTopUpOffers,
390
390
  queryTopUps4 as queryTopUps,
391
391
  utils
392
392
  };
@@ -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","../../src/pricing-plans-v3-top-up-top-ups.public.ts","../../src/pricing-plans-v3-top-up-top-ups.context.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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetPurchasableTopUpOffersResponse,\n QueryTopUpsResponse,\n TopUp,\n TopUpQuery,\n TopUpsQueryBuilder,\n getPurchasableTopUpOffers as universalGetPurchasableTopUpOffers,\n getTopUp as universalGetTopUp,\n queryTopUps as universalQueryTopUps,\n typedQueryTopUps as universalTypedQueryTopUps,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/pricing-plans' };\n\nexport function getTopUp(httpClient: HttpClient): GetTopUpSignature {\n return (topUpId: string) =>\n universalGetTopUp(\n topUpId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTopUpSignature {\n /**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n * @param - ID of the top-up to retrieve.\n * @returns Retrieved top-up.\n */\n (topUpId: string): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>>;\n}\n\nexport function queryTopUps(httpClient: HttpClient): QueryTopUpsSignature {\n return () =>\n universalQueryTopUps(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTopUpsSignature {\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 */\n (): TopUpsQueryBuilder;\n}\n\nexport function typedQueryTopUps(\n httpClient: HttpClient\n): TypedQueryTopUpsSignature {\n return (query: TopUpQuery) =>\n universalTypedQueryTopUps(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryTopUpsSignature {\n /** */\n (query: TopUpQuery): Promise<\n NonNullablePaths<QueryTopUpsResponse, `topUps`, 0>\n >;\n}\n\nexport function getPurchasableTopUpOffers(\n httpClient: HttpClient\n): GetPurchasableTopUpOffersSignature {\n return (planSubscriptionId: string) =>\n universalGetPurchasableTopUpOffers(\n planSubscriptionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetPurchasableTopUpOffersSignature {\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 - ID of the plan subscription to retrieve the top-up offers for.\n */\n (planSubscriptionId: string): Promise<\n NonNullablePaths<\n GetPurchasableTopUpOffersResponse,\n `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`,\n 3\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n BalanceAdjustment,\n CreditGrant,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n FlatRateOptions,\n GetPurchasableTopUpOffersRequest,\n GetPurchasableTopUpOffersResponse,\n GetTopUpRequest,\n GetTopUpResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n Perk,\n PlanSubscriptionPool,\n PricingStrategy,\n PricingStrategyStrategyOptionsOneOf,\n QueryTopUpsRequest,\n QueryTopUpsResponse,\n RestoreInfo,\n RolloverConfiguration,\n SortOrder,\n Sorting,\n TopUp,\n TopUpOffer,\n TopUpQuerySpec,\n TopUpsQueryBuilder,\n TopUpsQueryResult,\n Type,\n WebhookIdentityType,\n utils,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n","import {\n getTopUp as publicGetTopUp,\n queryTopUps as publicQueryTopUps,\n typedQueryTopUps as publicTypedQueryTopUps,\n getPurchasableTopUpOffers as publicGetPurchasableTopUpOffers,\n} from './pricing-plans-v3-top-up-top-ups.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n TopUpQuery,\n TopUpsQueryBuilder,\n typedQueryTopUps as universalTypedQueryTopUps,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nfunction customQueryTopUps(httpClient: HttpClient) {\n const router = /*#__PURE__*/ createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryTopUps(httpClient)(),\n typedQueryFunction: (query: TopUpQuery) =>\n publicTypedQueryTopUps(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): TopUpsQueryBuilder;\n function overloadedQuery(\n query: TopUpQuery\n ): ReturnType<typeof universalTypedQueryTopUps>;\n function overloadedQuery(query?: TopUpQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getTopUp: MaybeContext<\n BuildRESTFunction<typeof publicGetTopUp> & typeof publicGetTopUp\n> = /*#__PURE__*/ createRESTModule(publicGetTopUp);\nexport const getPurchasableTopUpOffers: MaybeContext<\n BuildRESTFunction<typeof publicGetPurchasableTopUpOffers> &\n typeof publicGetPurchasableTopUpOffers\n> = /*#__PURE__*/ createRESTModule(publicGetPurchasableTopUpOffers);\nexport const queryTopUps: MaybeContext<\n BuildRESTFunction<typeof customQueryTopUps> & typeof customQueryTopUps\n> = /*#__PURE__*/ createRESTModule(customQueryTopUps);\n\nexport {\n SortOrder,\n Type,\n WebhookIdentityType,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport {\n TopUp,\n BalanceAdjustment,\n GetTopUpRequest,\n GetTopUpResponse,\n QueryTopUpsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryTopUpsResponse,\n CursorPagingMetadata,\n Cursors,\n GetPurchasableTopUpOffersRequest,\n GetPurchasableTopUpOffersResponse,\n PlanSubscriptionPool,\n RolloverConfiguration,\n TopUpOffer,\n FlatRateOptions,\n PricingStrategy,\n PricingStrategyStrategyOptionsOneOf,\n CreditGrant,\n Perk,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n TopUpsQueryResult,\n TopUpsQueryBuilder,\n TopUpQuerySpec,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport { utils } from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport {\n SortOrderWithLiterals,\n TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CommonQueryWithEntityContext,\n TopUpQuery,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\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;AAAA,IACA,yBA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B;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAAyB;AAChD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,YAEK,iCAAiBA,SAAc;AAC1C,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMH,eAEK,iCAAiB,iBAAiB;","names":["payload","transformPaths","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","getPurchasableTopUpOffers","getTopUp","queryTopUps","typedQueryTopUps","getPurchasableTopUpOffers","queryTopUps","typedQueryTopUps","getTopUp","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","../../src/pricing-plans-v3-top-up-top-ups.public.ts","../../src/pricing-plans-v3-top-up-top-ups.context.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 ListPurchasableTopUpOffersRequest {\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 ListPurchasableTopUpOffersResponse {\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 * Supported fields for filtering and sorting: `id`, `planSubscriptionId`, `memberId`, `orderId`, `createdDate`.\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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' | 'orderId',\n value: string\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\n value: any\n ) => TopUpsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'planSubscriptionId'\n | 'memberId'\n | 'orderId',\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' | 'orderId'\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' | 'orderId'\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: [\n '_createdDate',\n '_id',\n 'memberId',\n 'orderId',\n 'planSubscriptionId'\n ];\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:list_purchasable_top_up_offers\n * @fqn wix.pricing_plans.v3.TopUpService.ListPurchasableTopUpOffers\n */\nexport async function listPurchasableTopUpOffers(\n planSubscriptionId: string\n): Promise<\n NonNullablePaths<\n ListPurchasableTopUpOffersResponse,\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.listPurchasableTopUpOffers(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 * Supported fields for filtering and sorting: `id`, `planSubscriptionId`, `memberId`, `orderId`, `createdDate`.\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 listPurchasableTopUpOffers(\n payload: object\n): RequestOptionsFactory<any> {\n function __listPurchasableTopUpOffers({ 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.ListPurchasableTopUpOffers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPricingPlansV3TopUpServiceUrl({\n protoPath: '/v3/top-ups/list-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 __listPurchasableTopUpOffers;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ListPurchasableTopUpOffersResponse,\n QueryTopUpsResponse,\n TopUp,\n TopUpQuery,\n TopUpsQueryBuilder,\n getTopUp as universalGetTopUp,\n listPurchasableTopUpOffers as universalListPurchasableTopUpOffers,\n queryTopUps as universalQueryTopUps,\n typedQueryTopUps as universalTypedQueryTopUps,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/pricing-plans' };\n\nexport function getTopUp(httpClient: HttpClient): GetTopUpSignature {\n return (topUpId: string) =>\n universalGetTopUp(\n topUpId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTopUpSignature {\n /**\n * Retrieves a top-up.\n *\n * Site members can retrieve only their own top-ups.\n * @param - ID of the top-up to retrieve.\n * @returns Retrieved top-up.\n */\n (topUpId: string): Promise<NonNullablePaths<TopUp, `balanceAdjustments`, 0>>;\n}\n\nexport function queryTopUps(httpClient: HttpClient): QueryTopUpsSignature {\n return () =>\n universalQueryTopUps(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTopUpsSignature {\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 * Supported fields for filtering and sorting: `id`, `planSubscriptionId`, `memberId`, `orderId`, `createdDate`.\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 */\n (): TopUpsQueryBuilder;\n}\n\nexport function typedQueryTopUps(\n httpClient: HttpClient\n): TypedQueryTopUpsSignature {\n return (query: TopUpQuery) =>\n universalTypedQueryTopUps(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryTopUpsSignature {\n /** */\n (query: TopUpQuery): Promise<\n NonNullablePaths<QueryTopUpsResponse, `topUps`, 0>\n >;\n}\n\nexport function listPurchasableTopUpOffers(\n httpClient: HttpClient\n): ListPurchasableTopUpOffersSignature {\n return (planSubscriptionId: string) =>\n universalListPurchasableTopUpOffers(\n planSubscriptionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListPurchasableTopUpOffersSignature {\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 - ID of the plan subscription to retrieve the top-up offers for.\n */\n (planSubscriptionId: string): Promise<\n NonNullablePaths<\n ListPurchasableTopUpOffersResponse,\n `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`,\n 3\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n BalanceAdjustment,\n CreditGrant,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n FlatRateOptions,\n GetTopUpRequest,\n GetTopUpResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListPurchasableTopUpOffersRequest,\n ListPurchasableTopUpOffersResponse,\n MessageEnvelope,\n Perk,\n PlanSubscriptionPool,\n PricingStrategy,\n PricingStrategyStrategyOptionsOneOf,\n QueryTopUpsRequest,\n QueryTopUpsResponse,\n RestoreInfo,\n RolloverConfiguration,\n SortOrder,\n Sorting,\n TopUp,\n TopUpOffer,\n TopUpQuerySpec,\n TopUpsQueryBuilder,\n TopUpsQueryResult,\n Type,\n WebhookIdentityType,\n utils,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n","import {\n getTopUp as publicGetTopUp,\n queryTopUps as publicQueryTopUps,\n typedQueryTopUps as publicTypedQueryTopUps,\n listPurchasableTopUpOffers as publicListPurchasableTopUpOffers,\n} from './pricing-plans-v3-top-up-top-ups.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n TopUpQuery,\n TopUpsQueryBuilder,\n typedQueryTopUps as universalTypedQueryTopUps,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\n\nfunction customQueryTopUps(httpClient: HttpClient) {\n const router = /*#__PURE__*/ createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryTopUps(httpClient)(),\n typedQueryFunction: (query: TopUpQuery) =>\n publicTypedQueryTopUps(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): TopUpsQueryBuilder;\n function overloadedQuery(\n query: TopUpQuery\n ): ReturnType<typeof universalTypedQueryTopUps>;\n function overloadedQuery(query?: TopUpQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getTopUp: MaybeContext<\n BuildRESTFunction<typeof publicGetTopUp> & typeof publicGetTopUp\n> = /*#__PURE__*/ createRESTModule(publicGetTopUp);\nexport const listPurchasableTopUpOffers: MaybeContext<\n BuildRESTFunction<typeof publicListPurchasableTopUpOffers> &\n typeof publicListPurchasableTopUpOffers\n> = /*#__PURE__*/ createRESTModule(publicListPurchasableTopUpOffers);\nexport const queryTopUps: MaybeContext<\n BuildRESTFunction<typeof customQueryTopUps> & typeof customQueryTopUps\n> = /*#__PURE__*/ createRESTModule(customQueryTopUps);\n\nexport {\n SortOrder,\n Type,\n WebhookIdentityType,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport {\n TopUp,\n BalanceAdjustment,\n GetTopUpRequest,\n GetTopUpResponse,\n QueryTopUpsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryTopUpsResponse,\n CursorPagingMetadata,\n Cursors,\n ListPurchasableTopUpOffersRequest,\n ListPurchasableTopUpOffersResponse,\n PlanSubscriptionPool,\n RolloverConfiguration,\n TopUpOffer,\n FlatRateOptions,\n PricingStrategy,\n PricingStrategyStrategyOptionsOneOf,\n CreditGrant,\n Perk,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n TopUpsQueryResult,\n TopUpsQueryBuilder,\n TopUpQuerySpec,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport { utils } from './pricing-plans-v3-top-up-top-ups.universal.js';\nexport {\n SortOrderWithLiterals,\n TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CommonQueryWithEntityContext,\n TopUpQuery,\n} from './pricing-plans-v3-top-up-top-ups.universal.js';\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;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT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B;AAChD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,YAEK,iCAAiBA,SAAc;AAC1C,IAAMC,8BAGK,iCAAiBA,2BAAgC;AAC5D,IAAMH,eAEK,iCAAiB,iBAAiB;","names":["payload","transformPaths","SortOrder","Type","WebhookIdentityType","getTopUp","queryTopUps","listPurchasableTopUpOffers","getTopUp","queryTopUps","typedQueryTopUps","listPurchasableTopUpOffers","queryTopUps","typedQueryTopUps","getTopUp","listPurchasableTopUpOffers"]}
@@ -203,14 +203,14 @@ interface Cursors {
203
203
  */
204
204
  prev?: string | null;
205
205
  }
206
- interface GetPurchasableTopUpOffersRequest {
206
+ interface ListPurchasableTopUpOffersRequest {
207
207
  /**
208
208
  * ID of the plan subscription to retrieve the top-up offers for.
209
209
  * @format GUID
210
210
  */
211
211
  planSubscriptionId: string | null;
212
212
  }
213
- interface GetPurchasableTopUpOffersResponse {
213
+ interface ListPurchasableTopUpOffersResponse {
214
214
  /**
215
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
@@ -540,6 +540,8 @@ declare function getTopUp(topUpId: string): Promise<NonNullablePaths<TopUp, `bal
540
540
  *
541
541
  * Site members retrieve only their own top-ups.
542
542
  *
543
+ * Supported fields for filtering and sorting: `id`, `planSubscriptionId`, `memberId`, `orderId`, `createdDate`.
544
+ *
543
545
  * To learn how to query top-ups, see [API Query Language][2].
544
546
  *
545
547
  * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging
@@ -569,49 +571,49 @@ interface TopUpsQueryBuilder {
569
571
  * @param value - Value to compare against.
570
572
  * @documentationMaturity preview
571
573
  */
572
- eq: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
574
+ eq: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
573
575
  /** @param propertyName - Property whose value is compared with `value`.
574
576
  * @param value - Value to compare against.
575
577
  * @documentationMaturity preview
576
578
  */
577
- ne: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
579
+ ne: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
578
580
  /** @param propertyName - Property whose value is compared with `value`.
579
581
  * @param value - Value to compare against.
580
582
  * @documentationMaturity preview
581
583
  */
582
- ge: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
584
+ ge: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
583
585
  /** @param propertyName - Property whose value is compared with `value`.
584
586
  * @param value - Value to compare against.
585
587
  * @documentationMaturity preview
586
588
  */
587
- gt: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
589
+ gt: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
588
590
  /** @param propertyName - Property whose value is compared with `value`.
589
591
  * @param value - Value to compare against.
590
592
  * @documentationMaturity preview
591
593
  */
592
- le: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
594
+ le: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
593
595
  /** @param propertyName - Property whose value is compared with `value`.
594
596
  * @param value - Value to compare against.
595
597
  * @documentationMaturity preview
596
598
  */
597
- lt: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
599
+ lt: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
598
600
  /** @param propertyName - Property whose value is compared with `string`.
599
601
  * @param string - String to compare against. Case-insensitive.
600
602
  * @documentationMaturity preview
601
603
  */
602
- startsWith: (propertyName: '_id' | 'planSubscriptionId' | 'memberId', value: string) => TopUpsQueryBuilder;
604
+ startsWith: (propertyName: '_id' | 'planSubscriptionId' | 'memberId' | 'orderId', value: string) => TopUpsQueryBuilder;
603
605
  /** @documentationMaturity preview */
604
- in: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: any) => TopUpsQueryBuilder;
606
+ in: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: any) => TopUpsQueryBuilder;
605
607
  /** @documentationMaturity preview */
606
- exists: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId', value: boolean) => TopUpsQueryBuilder;
608
+ exists: (propertyName: '_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId', value: boolean) => TopUpsQueryBuilder;
607
609
  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
608
610
  * @documentationMaturity preview
609
611
  */
610
- ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'>) => TopUpsQueryBuilder;
612
+ ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId'>) => TopUpsQueryBuilder;
611
613
  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
612
614
  * @documentationMaturity preview
613
615
  */
614
- descending: (...propertyNames: Array<'_id' | '_createdDate' | 'planSubscriptionId' | 'memberId'>) => TopUpsQueryBuilder;
616
+ descending: (...propertyNames: Array<'_id' | '_createdDate' | 'planSubscriptionId' | 'memberId' | 'orderId'>) => TopUpsQueryBuilder;
615
617
  /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
616
618
  * @documentationMaturity preview
617
619
  */
@@ -633,7 +635,13 @@ interface TopUpQuerySpec extends QuerySpec {
633
635
  paging: 'cursor';
634
636
  wql: [
635
637
  {
636
- fields: ['_createdDate', '_id', 'memberId', 'planSubscriptionId'];
638
+ fields: [
639
+ '_createdDate',
640
+ '_id',
641
+ 'memberId',
642
+ 'orderId',
643
+ 'planSubscriptionId'
644
+ ];
637
645
  operators: '*';
638
646
  sort: 'BOTH';
639
647
  }
@@ -702,10 +710,9 @@ declare const utils: {
702
710
  * @public
703
711
  * @documentationMaturity preview
704
712
  * @requiredField planSubscriptionId
705
- * @permissionId pricing_plans:v3:top_up:get_purchasable_top_up_offers
706
- * @applicableIdentity APP
707
- * @fqn wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers
713
+ * @permissionId pricing_plans:v3:top_up:list_purchasable_top_up_offers
714
+ * @fqn wix.pricing_plans.v3.TopUpService.ListPurchasableTopUpOffers
708
715
  */
709
- declare function getPurchasableTopUpOffers(planSubscriptionId: string): Promise<NonNullablePaths<GetPurchasableTopUpOffersResponse, `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`, 3>>;
716
+ declare function listPurchasableTopUpOffers(planSubscriptionId: string): Promise<NonNullablePaths<ListPurchasableTopUpOffersResponse, `pools` | `topUpOffers` | `topUpOffers.${number}.pricingStrategy.type`, 3>>;
710
717
 
711
- export { type AccountInfo, type ActionEvent, type BalanceAdjustment, type CommonQueryWithEntityContext, type CreditGrant, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FlatRateOptions, type GetPurchasableTopUpOffersRequest, type GetPurchasableTopUpOffersResponse, type GetTopUpRequest, type GetTopUpResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type Perk, type PlanSubscriptionPool, type PricingStrategy, type PricingStrategyStrategyOptionsOneOf, type QueryTopUpsRequest, type QueryTopUpsResponse, type RestoreInfo, type RolloverConfiguration, SortOrder, type SortOrderWithLiterals, type Sorting, type TopUp, type TopUpOffer, type TopUpQuery, type TopUpQuerySpec, type TopUpsQueryBuilder, type TopUpsQueryResult, Type, type TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getPurchasableTopUpOffers, getTopUp, queryTopUps, typedQueryTopUps, utils };
718
+ export { type AccountInfo, type ActionEvent, type BalanceAdjustment, type CommonQueryWithEntityContext, type CreditGrant, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FlatRateOptions, type GetTopUpRequest, type GetTopUpResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListPurchasableTopUpOffersRequest, type ListPurchasableTopUpOffersResponse, type MessageEnvelope, type Perk, type PlanSubscriptionPool, type PricingStrategy, type PricingStrategyStrategyOptionsOneOf, type QueryTopUpsRequest, type QueryTopUpsResponse, type RestoreInfo, type RolloverConfiguration, SortOrder, type SortOrderWithLiterals, type Sorting, type TopUp, type TopUpOffer, type TopUpQuery, type TopUpQuerySpec, type TopUpsQueryBuilder, type TopUpsQueryResult, Type, type TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getTopUp, listPurchasableTopUpOffers, queryTopUps, typedQueryTopUps, utils };
@@ -167,18 +167,18 @@ function queryTopUps(payload) {
167
167
  }
168
168
  return __queryTopUps;
169
169
  }
170
- function getPurchasableTopUpOffers(payload) {
171
- function __getPurchasableTopUpOffers({ host }) {
170
+ function listPurchasableTopUpOffers(payload) {
171
+ function __listPurchasableTopUpOffers({ host }) {
172
172
  const metadata = {
173
173
  entityFqdn: "wix.pricing_plans.v3.top_up",
174
174
  method: "POST",
175
- methodFqn: "wix.pricing_plans.v3.TopUpService.GetPurchasableTopUpOffers",
175
+ methodFqn: "wix.pricing_plans.v3.TopUpService.ListPurchasableTopUpOffers",
176
176
  packageName: PACKAGE_NAME,
177
177
  migrationOptions: {
178
178
  optInTransformResponse: true
179
179
  },
180
180
  url: resolveWixPricingPlansV3TopUpServiceUrl({
181
- protoPath: "/v3/top-ups/get-purchasable-offers",
181
+ protoPath: "/v3/top-ups/list-purchasable-offers",
182
182
  data: payload,
183
183
  host
184
184
  }),
@@ -192,7 +192,7 @@ function getPurchasableTopUpOffers(payload) {
192
192
  };
193
193
  return metadata;
194
194
  }
195
- return __getPurchasableTopUpOffers;
195
+ return __listPurchasableTopUpOffers;
196
196
  }
197
197
 
198
198
  // src/pricing-plans-v3-top-up-top-ups.universal.ts
@@ -309,12 +309,12 @@ async function typedQueryTopUps(query) {
309
309
  var utils = {
310
310
  query: /* @__PURE__ */ createQueryUtils()
311
311
  };
312
- async function getPurchasableTopUpOffers2(planSubscriptionId) {
312
+ async function listPurchasableTopUpOffers2(planSubscriptionId) {
313
313
  const { httpClient, sideEffects } = arguments[1];
314
314
  const payload = renameKeysFromSDKRequestToRESTRequest({
315
315
  planSubscriptionId
316
316
  });
317
- const reqOpts = getPurchasableTopUpOffers(payload);
317
+ const reqOpts = listPurchasableTopUpOffers(payload);
318
318
  sideEffects?.onSiteCall?.();
319
319
  try {
320
320
  const result = await httpClient.request(reqOpts);
@@ -338,8 +338,8 @@ export {
338
338
  SortOrder,
339
339
  Type,
340
340
  WebhookIdentityType,
341
- getPurchasableTopUpOffers2 as getPurchasableTopUpOffers,
342
341
  getTopUp2 as getTopUp,
342
+ listPurchasableTopUpOffers2 as listPurchasableTopUpOffers,
343
343
  queryTopUps2 as queryTopUps,
344
344
  typedQueryTopUps,
345
345
  utils