@wix/auto_sdk_benefit-programs_balances 1.0.46 → 1.0.47

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.
@@ -499,9 +499,7 @@ async function typedQueryBalances(query) {
499
499
  }
500
500
  }
501
501
  var utils = {
502
- query: {
503
- ...(0, import_query_builder_utils.createQueryUtils)()
504
- }
502
+ ...(0, import_query_builder_utils.createQueryUtils)()
505
503
  };
506
504
  async function changeBalance2(poolId, idempotencyKey, options) {
507
505
  const { httpClient, sideEffects } = arguments[3];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/benefit-programs-v1-balance-balances.universal.ts","../../src/benefit-programs-v1-balance-balances.http.ts","../../src/benefit-programs-v1-balance-balances.public.ts","../../src/benefit-programs-v1-balance-balances.context.ts"],"sourcesContent":["export * from './src/benefit-programs-v1-balance-balances.context.js';\n","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 ambassadorWixBenefitProgramsV1Balance from './benefit-programs-v1-balance-balances.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface Balance {\n /**\n * Balance ID. This is the same as the associated pool's ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string;\n /**\n * Revision number, which increments by 1 each time the balance is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the balance.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the balance was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the balance was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Beneficiary of the associated pool.\n * @readonly\n * @immutable\n */\n beneficiary?: CommonIdentificationData;\n /**\n * Available credits.\n * @readonly\n */\n amount?: BalanceAmount;\n /**\n * Associated pool information.\n * @readonly\n */\n poolInfo?: PoolInfo;\n /**\n * Custom field data for the balance object.\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n /**\n * ID of the transaction associated with the most recent change to the balance.\n * @format GUID\n * @readonly\n */\n lastTransactionId?: string | null;\n}\n\nexport interface CommonIdentificationData\n extends CommonIdentificationDataIdOneOf {\n /**\n * ID of a site visitor that hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site member.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user.\n * @format GUID\n */\n wixUserId?: string;\n}\n\n/** @oneof */\nexport interface CommonIdentificationDataIdOneOf {\n /**\n * ID of a site visitor that hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site member.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user.\n * @format GUID\n */\n wixUserId?: string;\n}\n\nexport enum IdentityType {\n /** Unknown type. This value is not used. */\n UNKNOWN = 'UNKNOWN',\n /** A site visitor who has not logged in. */\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n /** A logged-in site member. */\n MEMBER = 'MEMBER',\n /** A Wix account holder, such as a site owner or contributor. */\n WIX_USER = 'WIX_USER',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n | IdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER';\n\nexport interface BalanceAmount {\n /**\n * number of available credits.\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n available?: string;\n /**\n * number of reserved credits.\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n reserved?: string;\n}\n\nexport interface PoolInfo {\n /**\n * Pool ID.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n * @readonly\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the program definition the pool was created from.\n * @format GUID\n * @readonly\n */\n programDefinitionId?: string | null;\n /**\n * ID of the program that contains the pool.\n * @format GUID\n * @readonly\n */\n programId?: string | null;\n /**\n * Available credits.\n * @decimalValue options { gte:0, maxScale:4 }\n * @readonly\n */\n creditAmount?: string | null;\n /**\n * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created.\n * @minLength 1\n * @maxLength 20\n * @readonly\n */\n namespace?: string | null;\n /**\n * External ID of the program definition the pool was created from.\n * @format GUID\n * @readonly\n */\n externalProgramDefinitionId?: string | null;\n /**\n * External ID of the program that contains the pool.\n * @format GUID\n * @readonly\n */\n externalProgramId?: string | null;\n /**\n * Credit rollover configuration information for the pool.\n * @readonly\n */\n creditRolloverConfiguration?: RolloverConfigurationInfo;\n /**\n * Pool status\n * @readonly\n */\n status?: PoolStatusWithLiterals;\n}\n\nexport interface RolloverConfigurationInfo {\n /**\n * Whether unused credits roll over to a new cycle when a program renews.\n * @readonly\n */\n enabled?: boolean | null;\n /**\n * Maximum number of credits that can roll over to the next cycle when a program renews.\n * @decimalValue options { gte:0, maxScale:4 }\n * @readonly\n */\n balanceCap?: string | null;\n}\n\nexport enum PoolStatus {\n /** Undefined pool status. */\n UNDEFINED = 'UNDEFINED',\n /** Pool is active. */\n ACTIVE = 'ACTIVE',\n /** Pool is paused. It can be resumed. */\n PAUSED = 'PAUSED',\n /** Pool is ended. It can't be resumed. */\n ENDED = 'ENDED',\n /** Pool provisioning is in progress. This status exists for a short time during processing. */\n PROVISIONING = 'PROVISIONING',\n /** Pool renewing is in progress. This status exists for a short time during processing. */\n RENEWING = 'RENEWING',\n /** Pool is pending */\n PENDING = 'PENDING',\n}\n\n/** @enumType */\nexport type PoolStatusWithLiterals =\n | PoolStatus\n | 'UNDEFINED'\n | 'ACTIVE'\n | 'PAUSED'\n | 'ENDED'\n | 'PROVISIONING'\n | 'RENEWING'\n | 'PENDING';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface GetBalanceRequest {\n /**\n * ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @format GUID\n */\n poolId: string;\n}\n\nexport interface GetBalanceResponse {\n /** Retrieved balance. */\n balance?: Balance;\n}\n\nexport interface ListBalancesRequest {\n /**\n * List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.\n * @format GUID\n * @maxSize 100\n */\n poolIds?: string[];\n /** Cursor paging. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return.\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 ListBalancesResponse {\n /**\n * Retrieved balances.\n * @maxSize 100\n */\n balances?: Balance[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\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 QueryBalancesRequest {\n /** Filter, sort, and paging to apply to the query. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n * See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\n * for more information.\n */\n filter?: Record<string, any> | null;\n /**\n * List of sort objects.\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /**\n * Sort order. Use `ASC` for ascending order or `DESC` for descending order.\n *\n * Default: `ASC`\n */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Ascending sort order. */\n ASC = 'ASC',\n /** Descending sort order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface QueryBalancesResponse {\n /** List of retrieved balances. */\n balances?: Balance[];\n /** Metadata for the paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface BalanceChangeBalanceRequest\n extends BalanceChangeBalanceRequestOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n /**\n * ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @format GUID\n */\n poolId: string;\n /**\n * Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @maxLength 200\n */\n idempotencyKey: string;\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: ChangeBalanceRequestTypeWithLiterals;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface BalanceChangeBalanceRequestOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n}\n\nexport enum ChangeBalanceRequestType {\n /** Unknown balance change type. */\n UNKNOWN_OPERATION = 'UNKNOWN_OPERATION',\n /** Use with `adjustOptions`. */\n ADJUST = 'ADJUST',\n /** Use with `setOptions`. */\n SET = 'SET',\n}\n\n/** @enumType */\nexport type ChangeBalanceRequestTypeWithLiterals =\n | ChangeBalanceRequestType\n | 'UNKNOWN_OPERATION'\n | 'ADJUST'\n | 'SET';\n\nexport interface AdjustOptions {\n /**\n * Amount to change the balance's available credits by.\n * - To increase the balance, specify a positive number.\n * - To decrease the balance, specify a negative number.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Beneficiary of the associated pool. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport enum LimitRule {\n /** Unknown limit rule */\n UNKNOWN_LIMIT_RULE = 'UNKNOWN_LIMIT_RULE',\n /** If the limit is exceeded, the operation will fail */\n FAIL = 'FAIL',\n /** If the limit is exceeded, the operation will succeed but the balance never goes beyond the provided limits. For balance that was already outside of provided limits, it will not be changed. */\n SOFT_ENFORCE = 'SOFT_ENFORCE',\n /** If the limit is exceeded, the operation will succeed but the balance will be adjusted so that it satisfies the provided limits. If the resulting balance is below the lower_limit, it will be set to the lower_limit. If the resulting balance is above the upper_limit, it will be set to the upper_limit. */\n HARD_ENFORCE = 'HARD_ENFORCE',\n}\n\n/** @enumType */\nexport type LimitRuleWithLiterals =\n | LimitRule\n | 'UNKNOWN_LIMIT_RULE'\n | 'FAIL'\n | 'SOFT_ENFORCE'\n | 'HARD_ENFORCE';\n\nexport enum BalanceType {\n UNDEFINED = 'UNDEFINED',\n /** In a pool's balance. */\n AVAILABLE = 'AVAILABLE',\n /** Outside a pool's balance. */\n EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type BalanceTypeWithLiterals =\n | BalanceType\n | 'UNDEFINED'\n | 'AVAILABLE'\n | 'EXTERNAL';\n\nexport interface SetOptions {\n /**\n * Amount to set the balance's available credits to.\n *\n * If this is the same as the current value, no transaction is created.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Beneficiary of the associated pool. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport interface SetInitialOptions {\n /**\n * Set the available balance to the provided amount.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Benefit pool owner associated with this balance. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport interface TransactionDetails {\n /**\n * Item associated with the transaction.\n * @readonly\n */\n item?: Item;\n /** Amount of items associated with the transaction. */\n itemCount?: number | null;\n /**\n * Date and time the transaction was created.\n * @readonly\n */\n effectiveDate?: Date | null;\n /**\n * Reason for the transaction. For example, `Redemption`.\n * @readonly\n * @maxLength 256\n */\n reason?: string | null;\n /**\n * Benefit key associated with the transaction.\n * @maxLength 64\n * @immutable\n */\n benefitKey?: string | null;\n}\n\nexport interface Item {\n /**\n * Item ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Item external ID.\n * @format GUID\n * @readonly\n */\n externalId?: string | null;\n /**\n * Item category.\n * @maxLength 20\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID.\n * @format GUID\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Item name.\n * @maxLength 64\n * @readonly\n */\n displayName?: string | null;\n /**\n * Provider app id\n * @format GUID\n * @readonly\n */\n providerAppId?: string | null;\n}\n\nexport interface ChangeBalanceResponse {\n /** Updated balance. */\n balance?: Balance;\n /**\n * ID of the transaction associated with this change in balance.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface BalanceExceededLimits {\n /** Current balance */\n balance?: BalanceAmount;\n /**\n * The requested amount\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n requested?: string;\n /**\n * Lower limit\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n lowerLimit?: string | null;\n /**\n * Upper limit\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n upperLimit?: string | null;\n /** Source balance type */\n sourceBalanceType?: BalanceTypeWithLiterals;\n /** Target balance type */\n targetBalanceType?: BalanceTypeWithLiterals;\n}\n\nexport interface BulkChangeBalancesRequest {\n /**\n * List of balances to change.\n * @minSize 1\n * @maxSize 100\n */\n requests?: ChangeBalanceRequest[];\n /**\n * Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @maxLength 200\n */\n idempotencyKey?: string;\n /** Whether to return the full balance entities in the response. */\n returnEntity?: boolean;\n}\n\nexport enum Type {\n /** Unknown balance change type. */\n UNKNOWN_OPERATION = 'UNKNOWN_OPERATION',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNKNOWN_OPERATION';\n\nexport interface ChangeBalanceRequest\n extends ChangeBalanceRequestOperationOneOf {\n /**\n * ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @format GUID\n */\n poolId?: string;\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: TypeWithLiterals;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface ChangeBalanceRequestOperationOneOf {}\n\nexport interface BulkChangeBalancesResponse {\n /**\n * Updated item and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkChangeBalanceResult[];\n /** Metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkChangeBalanceResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Updated item. */\n balance?: Balance;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface RevertBalanceChangeRequest {\n /**\n * ID of the transaction associated with the balance change to revert.\n * @format GUID\n */\n transactionId: string;\n /**\n * Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @maxLength 200\n * @deprecated Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @targetRemovalDate 2026-01-31\n */\n idempotencyKey: string;\n /** Identity reverting the balance change. */\n instructingParty?: CommonIdentificationData;\n}\n\nexport interface RevertBalanceChangeResponse {\n /**\n * ID of the transaction associated with the balance reversion.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface ChangeAlreadyReverted {\n /**\n * The id of the transaction which was already reverted\n * @format GUID\n */\n originalTransactionId?: string;\n /**\n * The id of the transaction which reverted the original transaction\n * @format GUID\n */\n revertedTransactionId?: string;\n}\n\nexport interface NotEnoughBalance {\n /** Current balance */\n balance?: BalanceAmount;\n /**\n * The requested amount\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n requested?: string;\n}\n\nexport interface GetTransactionReversibilityRequest {\n /**\n * Id of the transaction to get the reversibility\n * @format GUID\n */\n transactionId?: string;\n}\n\nexport interface GetTransactionReversibilityResponse {\n /** The result of transaction reversibility validation */\n transactionReversibility?: TransactionReversibilityWithLiterals;\n}\n\n/** Transaction reversibility results */\nexport enum TransactionReversibility {\n /** Transaction is allowed to be reverted */\n TRANSACTION_IS_REVERSIBLE = 'TRANSACTION_IS_REVERSIBLE',\n /** Transaction isn't allowed to be reverted, because it was already reverted */\n TRANSACTION_ALREADY_REVERSED = 'TRANSACTION_ALREADY_REVERSED',\n}\n\n/** @enumType */\nexport type TransactionReversibilityWithLiterals =\n | TransactionReversibility\n | 'TRANSACTION_IS_REVERSIBLE'\n | 'TRANSACTION_ALREADY_REVERSED';\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/** @docsIgnore */\nexport type ChangeBalanceApplicationErrors =\n | {\n code?: 'ALREADY_EXECUTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'BALANCE_EXCEEDED_LIMITS';\n description?: string;\n data?: BalanceExceededLimits;\n };\n/** @docsIgnore */\nexport type RevertBalanceChangeApplicationErrors =\n | {\n code?: 'CHANGE_ALREADY_REVERTED';\n description?: string;\n data?: ChangeAlreadyReverted;\n }\n | {\n code?: 'NOT_ENOUGH_BALANCE';\n description?: string;\n data?: NotEnoughBalance;\n }\n | {\n code?: 'TRANSACTION_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a balance.\n * @param poolId - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @public\n * @requiredField poolId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @returns Retrieved balance.\n * @fqn wix.benefit_programs.v1.balance.BalanceService.GetBalance\n */\nexport async function getBalance(\n poolId: string\n): Promise<\n NonNullablePaths<\n Balance,\n | `_id`\n | `beneficiary.anonymousVisitorId`\n | `beneficiary.memberId`\n | `beneficiary.wixUserId`\n | `amount.available`\n | `amount.reserved`\n | `poolInfo._id`\n | `poolInfo.status`,\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({ poolId: poolId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.getBalance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.balance!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { poolId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['poolId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of balances.\n * @public\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.ListBalances\n */\nexport async function listBalances(\n options?: ListBalancesOptions\n): Promise<\n NonNullablePaths<\n ListBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\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 poolIds: options?.poolIds,\n cursorPaging: options?.cursorPaging,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.listBalances(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n poolIds: '$[0].poolIds',\n cursorPaging: '$[0].cursorPaging',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListBalancesOptions {\n /**\n * List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.\n * @format GUID\n * @maxSize 100\n */\n poolIds?: string[];\n /** Cursor paging. */\n cursorPaging?: CursorPaging;\n}\n\n/**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n * @public\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.QueryBalances\n */\nexport function queryBalances(): BalancesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Balance,\n 'CURSOR',\n QueryBalancesRequest,\n QueryBalancesResponse\n >({\n func: async (payload: QueryBalancesRequest) => {\n const reqOpts =\n ambassadorWixBenefitProgramsV1Balance.queryBalances(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: QueryBalancesRequest['query']) => {\n const args = [query, {}] as [QueryBalancesRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryBalancesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.balances,\n pagingMetadata: transformedData?.metadata,\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\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface BalancesQueryResult extends QueryCursorResult {\n items: Balance[];\n query: BalancesQueryBuilder;\n next: () => Promise<BalancesQueryResult>;\n prev: () => Promise<BalancesQueryResult>;\n}\n\nexport interface BalancesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'beneficiary.memberId' | 'beneficiary.wixUserId',\n value: string\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any[]\n ) => BalancesQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: boolean\n ) => BalancesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'beneficiary.memberId' | 'beneficiary.wixUserId'\n >\n ) => BalancesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'beneficiary.memberId' | 'beneficiary.wixUserId'\n >\n ) => BalancesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => BalancesQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => BalancesQueryBuilder;\n find: () => Promise<BalancesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.benefit_programs.v1.balance.BalanceService.QueryBalances\n * @requiredField query\n */\nexport async function typedQueryBalances(\n query: BalanceQuery\n): Promise<\n NonNullablePaths<\n QueryBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n> {\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 = ambassadorWixBenefitProgramsV1Balance.queryBalances(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 BalanceQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n 'beneficiary.memberId',\n 'beneficiary.wixUserId'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Balance,\n BalanceQuerySpec\n>;\nexport type BalanceQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return. \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 See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\n for more information. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n List of sort objects. \n @maxSize: 5 \n */\n sort?: {\n /** \n Field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. Use `ASC` for ascending order or `DESC` for descending order.\n\n Default: `ASC` \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: {\n ...createQueryUtils<Balance, BalanceQuerySpec, BalanceQuery>(),\n },\n};\n\n/**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n * @param poolId - ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @param idempotencyKey - Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @public\n * @requiredField idempotencyKey\n * @requiredField options.operation\n * @requiredField poolId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.ChangeBalance\n */\nexport async function changeBalance(\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n): Promise<\n NonNullablePaths<\n ChangeBalanceResponse,\n | `balance._id`\n | `balance.beneficiary.anonymousVisitorId`\n | `balance.beneficiary.memberId`\n | `balance.beneficiary.wixUserId`\n | `balance.amount.available`\n | `balance.amount.reserved`\n | `balance.poolInfo._id`\n | `balance.poolInfo.status`,\n 4\n > & {\n __applicationErrorsType?: ChangeBalanceApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n poolId: poolId,\n idempotencyKey: idempotencyKey,\n instructingParty: options?.instructingParty,\n type: options?.type,\n adjustOptions: options?.adjustOptions,\n setOptions: options?.setOptions,\n transactionDetails: options?.transactionDetails,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.changeBalance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n poolId: '$[0]',\n idempotencyKey: '$[1]',\n instructingParty: '$[2].instructingParty',\n type: '$[2].type',\n adjustOptions: '$[2].adjustOptions',\n setOptions: '$[2].setOptions',\n transactionDetails: '$[2].transactionDetails',\n },\n singleArgumentUnchanged: false,\n },\n ['poolId', 'idempotencyKey', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ChangeBalanceOptions\n extends ChangeBalanceOptionsOperationOneOf {\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: ChangeBalanceRequestTypeWithLiterals;\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface ChangeBalanceOptionsOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n}\n\n/**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n * @param transactionId - ID of the transaction associated with the balance change to revert.\n * @param idempotencyKey - Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @public\n * @requiredField idempotencyKey\n * @requiredField transactionId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.RevertBalanceChange\n */\nexport async function revertBalanceChange(\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n): Promise<\n RevertBalanceChangeResponse & {\n __applicationErrorsType?: RevertBalanceChangeApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n transactionId: transactionId,\n idempotencyKey: idempotencyKey,\n instructingParty: options?.instructingParty,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1Balance.revertBalanceChange(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n transactionId: '$[0]',\n idempotencyKey: '$[1]',\n instructingParty: '$[2].instructingParty',\n },\n singleArgumentUnchanged: false,\n },\n ['transactionId', 'idempotencyKey', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RevertBalanceChangeOptions {\n /** Identity reverting the balance change. */\n instructingParty?: CommonIdentificationData;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBenefitProgramsV1BalanceBalanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/pool-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_balances';\n\n/** Retrieves a balance. */\nexport function getBalance(payload: object): RequestOptionsFactory<any> {\n function __getBalance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.GetBalance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/{poolId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balance.createdDate' },\n { path: 'balance.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getBalance;\n}\n\n/** Retrieves a list of balances. */\nexport function listBalances(payload: object): RequestOptionsFactory<any> {\n function __listBalances({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.ListBalances',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balances.createdDate' },\n { path: 'balances.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listBalances;\n}\n\n/**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n */\nexport function queryBalances(payload: object): RequestOptionsFactory<any> {\n function __queryBalances({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.QueryBalances',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balances.createdDate' },\n { path: 'balances.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryBalances;\n}\n\n/**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n */\nexport function changeBalance(payload: object): RequestOptionsFactory<any> {\n function __changeBalance({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'transactionDetails.effectiveDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.ChangeBalance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/{poolId}/change',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balance.createdDate' },\n { path: 'balance.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __changeBalance;\n}\n\n/**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n */\nexport function revertBalanceChange(\n payload: object\n): RequestOptionsFactory<any> {\n function __revertBalanceChange({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.balance.BalanceService.RevertBalanceChange',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/changes/{transactionId}/revert',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __revertBalanceChange;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Balance,\n BalanceQuery,\n BalancesQueryBuilder,\n ChangeBalanceApplicationErrors,\n ChangeBalanceOptions,\n ChangeBalanceResponse,\n ListBalancesOptions,\n ListBalancesResponse,\n QueryBalancesResponse,\n RevertBalanceChangeApplicationErrors,\n RevertBalanceChangeOptions,\n RevertBalanceChangeResponse,\n changeBalance as universalChangeBalance,\n getBalance as universalGetBalance,\n listBalances as universalListBalances,\n queryBalances as universalQueryBalances,\n revertBalanceChange as universalRevertBalanceChange,\n typedQueryBalances as universalTypedQueryBalances,\n} from './benefit-programs-v1-balance-balances.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/benefit-programs' };\n\nexport function getBalance(httpClient: HttpClient): GetBalanceSignature {\n return (poolId: string) =>\n universalGetBalance(\n poolId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetBalanceSignature {\n /**\n * Retrieves a balance.\n * @param - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @returns Retrieved balance.\n */\n (poolId: string): Promise<\n NonNullablePaths<\n Balance,\n | `_id`\n | `beneficiary.anonymousVisitorId`\n | `beneficiary.memberId`\n | `beneficiary.wixUserId`\n | `amount.available`\n | `amount.reserved`\n | `poolInfo._id`\n | `poolInfo.status`,\n 3\n >\n >;\n}\n\nexport function listBalances(httpClient: HttpClient): ListBalancesSignature {\n return (options?: ListBalancesOptions) =>\n universalListBalances(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListBalancesSignature {\n /**\n * Retrieves a list of balances.\n */\n (options?: ListBalancesOptions): Promise<\n NonNullablePaths<\n ListBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n >;\n}\n\nexport function queryBalances(httpClient: HttpClient): QueryBalancesSignature {\n return () =>\n universalQueryBalances(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryBalancesSignature {\n /**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n */\n (): BalancesQueryBuilder;\n}\n\nexport function typedQueryBalances(\n httpClient: HttpClient\n): TypedQueryBalancesSignature {\n return (query: BalanceQuery) =>\n universalTypedQueryBalances(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryBalancesSignature {\n /** */\n (query: BalanceQuery): Promise<\n NonNullablePaths<\n QueryBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n >;\n}\n\nexport function changeBalance(httpClient: HttpClient): ChangeBalanceSignature {\n return (\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n ) =>\n universalChangeBalance(\n poolId,\n idempotencyKey,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ChangeBalanceSignature {\n /**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n * @param - ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @param - Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n */\n (\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n ): Promise<\n NonNullablePaths<\n ChangeBalanceResponse,\n | `balance._id`\n | `balance.beneficiary.anonymousVisitorId`\n | `balance.beneficiary.memberId`\n | `balance.beneficiary.wixUserId`\n | `balance.amount.available`\n | `balance.amount.reserved`\n | `balance.poolInfo._id`\n | `balance.poolInfo.status`,\n 4\n > & {\n __applicationErrorsType?: ChangeBalanceApplicationErrors;\n }\n >;\n}\n\nexport function revertBalanceChange(\n httpClient: HttpClient\n): RevertBalanceChangeSignature {\n return (\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n ) =>\n universalRevertBalanceChange(\n transactionId,\n idempotencyKey,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RevertBalanceChangeSignature {\n /**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n * @param - ID of the transaction associated with the balance change to revert.\n * @param - Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n */\n (\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n ): Promise<\n RevertBalanceChangeResponse & {\n __applicationErrorsType?: RevertBalanceChangeApplicationErrors;\n }\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n AdjustOptions,\n ApplicationError,\n Balance,\n BalanceAmount,\n BalanceChangeBalanceRequest,\n BalanceChangeBalanceRequestOperationOneOf,\n BalanceExceededLimits,\n BalanceQuerySpec,\n BalanceType,\n BalancesQueryBuilder,\n BalancesQueryResult,\n BulkActionMetadata,\n BulkChangeBalanceResult,\n BulkChangeBalancesRequest,\n BulkChangeBalancesResponse,\n ChangeAlreadyReverted,\n ChangeBalanceOptions,\n ChangeBalanceOptionsOperationOneOf,\n ChangeBalanceRequest,\n ChangeBalanceRequestOperationOneOf,\n ChangeBalanceRequestType,\n ChangeBalanceResponse,\n CommonIdentificationData,\n CommonIdentificationDataIdOneOf,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExtendedFields,\n GetBalanceRequest,\n GetBalanceResponse,\n GetTransactionReversibilityRequest,\n GetTransactionReversibilityResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n IdentityType,\n Item,\n ItemMetadata,\n LimitRule,\n ListBalancesOptions,\n ListBalancesRequest,\n ListBalancesResponse,\n MessageEnvelope,\n NotEnoughBalance,\n PoolInfo,\n PoolStatus,\n QueryBalancesRequest,\n QueryBalancesResponse,\n RestoreInfo,\n RevertBalanceChangeOptions,\n RevertBalanceChangeRequest,\n RevertBalanceChangeResponse,\n RolloverConfigurationInfo,\n SetInitialOptions,\n SetOptions,\n SortOrder,\n Sorting,\n TransactionDetails,\n TransactionReversibility,\n Type,\n WebhookIdentityType,\n utils,\n} from './benefit-programs-v1-balance-balances.universal.js';\n","import {\n getBalance as publicGetBalance,\n listBalances as publicListBalances,\n queryBalances as publicQueryBalances,\n typedQueryBalances as publicTypedQueryBalances,\n changeBalance as publicChangeBalance,\n revertBalanceChange as publicRevertBalanceChange,\n} from './benefit-programs-v1-balance-balances.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 BalanceQuery,\n BalancesQueryBuilder,\n typedQueryBalances as universalTypedQueryBalances,\n} from './benefit-programs-v1-balance-balances.universal.js';\n\nfunction customQueryBalances(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryBalances(httpClient)(),\n typedQueryFunction: (query: BalanceQuery) =>\n publicTypedQueryBalances(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): BalancesQueryBuilder;\n function overloadedQuery(\n query: BalanceQuery\n ): ReturnType<typeof universalTypedQueryBalances>;\n function overloadedQuery(query?: BalanceQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getBalance: MaybeContext<\n BuildRESTFunction<typeof publicGetBalance> & typeof publicGetBalance\n> = /*#__PURE__*/ createRESTModule(publicGetBalance);\nexport const listBalances: MaybeContext<\n BuildRESTFunction<typeof publicListBalances> & typeof publicListBalances\n> = /*#__PURE__*/ createRESTModule(publicListBalances);\nexport const changeBalance: MaybeContext<\n BuildRESTFunction<typeof publicChangeBalance> & typeof publicChangeBalance\n> = /*#__PURE__*/ createRESTModule(publicChangeBalance);\nexport const revertBalanceChange: MaybeContext<\n BuildRESTFunction<typeof publicRevertBalanceChange> &\n typeof publicRevertBalanceChange\n> = /*#__PURE__*/ createRESTModule(publicRevertBalanceChange);\nexport const queryBalances: MaybeContext<\n BuildRESTFunction<typeof customQueryBalances> & typeof customQueryBalances\n> = /*#__PURE__*/ createRESTModule(customQueryBalances);\n\nexport {\n IdentityType,\n PoolStatus,\n SortOrder,\n ChangeBalanceRequestType,\n LimitRule,\n BalanceType,\n Type,\n TransactionReversibility,\n WebhookIdentityType,\n} from './benefit-programs-v1-balance-balances.universal.js';\nexport {\n Balance,\n CommonIdentificationData,\n CommonIdentificationDataIdOneOf,\n BalanceAmount,\n PoolInfo,\n RolloverConfigurationInfo,\n ExtendedFields,\n GetBalanceRequest,\n GetBalanceResponse,\n ListBalancesRequest,\n CursorPaging,\n ListBalancesResponse,\n CursorPagingMetadata,\n Cursors,\n QueryBalancesRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n QueryBalancesResponse,\n BalanceChangeBalanceRequest,\n BalanceChangeBalanceRequestOperationOneOf,\n AdjustOptions,\n SetOptions,\n SetInitialOptions,\n TransactionDetails,\n Item,\n ChangeBalanceResponse,\n BalanceExceededLimits,\n BulkChangeBalancesRequest,\n ChangeBalanceRequest,\n ChangeBalanceRequestOperationOneOf,\n BulkChangeBalancesResponse,\n ItemMetadata,\n ApplicationError,\n BulkChangeBalanceResult,\n BulkActionMetadata,\n RevertBalanceChangeRequest,\n RevertBalanceChangeResponse,\n ChangeAlreadyReverted,\n NotEnoughBalance,\n GetTransactionReversibilityRequest,\n GetTransactionReversibilityResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ListBalancesOptions,\n BalancesQueryResult,\n BalancesQueryBuilder,\n BalanceQuerySpec,\n ChangeBalanceOptions,\n ChangeBalanceOptionsOperationOneOf,\n RevertBalanceChangeOptions,\n} from './benefit-programs-v1-balance-balances.universal.js';\nexport { utils } from './benefit-programs-v1-balance-balances.universal.js';\nexport {\n IdentityTypeWithLiterals,\n PoolStatusWithLiterals,\n SortOrderWithLiterals,\n ChangeBalanceRequestTypeWithLiterals,\n LimitRuleWithLiterals,\n BalanceTypeWithLiterals,\n TypeWithLiterals,\n TransactionReversibilityWithLiterals,\n WebhookIdentityTypeWithLiterals,\n ChangeBalanceApplicationErrors,\n RevertBalanceChangeApplicationErrors,\n CommonQueryWithEntityContext,\n BalanceQuery,\n} from './benefit-programs-v1-balance-balances.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,2BAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;A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BAAmB;","names":["changeBalance","getBalance","listBalances","queryBalances","revertBalanceChange","import_timestamp","import_rest_modules","payload","import_transform_paths","IdentityType","PoolStatus","SortOrder","ChangeBalanceRequestType","LimitRule","BalanceType","Type","TransactionReversibility","WebhookIdentityType","getBalance","sdkTransformError","listBalances","queryBalances","changeBalance","revertBalanceChange","getBalance","listBalances","queryBalances","typedQueryBalances","changeBalance","revertBalanceChange","import_rest_modules","queryBalances","typedQueryBalances","getBalance","listBalances","changeBalance","revertBalanceChange"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/benefit-programs-v1-balance-balances.universal.ts","../../src/benefit-programs-v1-balance-balances.http.ts","../../src/benefit-programs-v1-balance-balances.public.ts","../../src/benefit-programs-v1-balance-balances.context.ts"],"sourcesContent":["export * from './src/benefit-programs-v1-balance-balances.context.js';\n","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 ambassadorWixBenefitProgramsV1Balance from './benefit-programs-v1-balance-balances.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface Balance {\n /**\n * Balance ID. This is the same as the associated pool's ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string;\n /**\n * Revision number, which increments by 1 each time the balance is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the balance.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the balance was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the balance was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Beneficiary of the associated pool.\n * @readonly\n * @immutable\n */\n beneficiary?: CommonIdentificationData;\n /**\n * Available credits.\n * @readonly\n */\n amount?: BalanceAmount;\n /**\n * Associated pool information.\n * @readonly\n */\n poolInfo?: PoolInfo;\n /**\n * Custom field data for the balance object.\n * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.\n */\n extendedFields?: ExtendedFields;\n /**\n * ID of the transaction associated with the most recent change to the balance.\n * @format GUID\n * @readonly\n */\n lastTransactionId?: string | null;\n}\n\nexport interface CommonIdentificationData\n extends CommonIdentificationDataIdOneOf {\n /**\n * ID of a site visitor that hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site member.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user.\n * @format GUID\n */\n wixUserId?: string;\n}\n\n/** @oneof */\nexport interface CommonIdentificationDataIdOneOf {\n /**\n * ID of a site visitor that hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site member.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user.\n * @format GUID\n */\n wixUserId?: string;\n}\n\nexport enum IdentityType {\n /** Unknown type. This value is not used. */\n UNKNOWN = 'UNKNOWN',\n /** A site visitor who has not logged in. */\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n /** A logged-in site member. */\n MEMBER = 'MEMBER',\n /** A Wix account holder, such as a site owner or contributor. */\n WIX_USER = 'WIX_USER',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n | IdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER';\n\nexport interface BalanceAmount {\n /**\n * number of available credits.\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n available?: string;\n /**\n * number of reserved credits.\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n reserved?: string;\n}\n\nexport interface PoolInfo {\n /**\n * Pool ID.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * ID of the pool definition the pool was created from.\n * @format GUID\n * @readonly\n */\n poolDefinitionId?: string | null;\n /**\n * ID of the program definition the pool was created from.\n * @format GUID\n * @readonly\n */\n programDefinitionId?: string | null;\n /**\n * ID of the program that contains the pool.\n * @format GUID\n * @readonly\n */\n programId?: string | null;\n /**\n * Available credits.\n * @decimalValue options { gte:0, maxScale:4 }\n * @readonly\n */\n creditAmount?: string | null;\n /**\n * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created.\n * @minLength 1\n * @maxLength 20\n * @readonly\n */\n namespace?: string | null;\n /**\n * External ID of the program definition the pool was created from.\n * @format GUID\n * @readonly\n */\n externalProgramDefinitionId?: string | null;\n /**\n * External ID of the program that contains the pool.\n * @format GUID\n * @readonly\n */\n externalProgramId?: string | null;\n /**\n * Credit rollover configuration information for the pool.\n * @readonly\n */\n creditRolloverConfiguration?: RolloverConfigurationInfo;\n /**\n * Pool status\n * @readonly\n */\n status?: PoolStatusWithLiterals;\n}\n\nexport interface RolloverConfigurationInfo {\n /**\n * Whether unused credits roll over to a new cycle when a program renews.\n * @readonly\n */\n enabled?: boolean | null;\n /**\n * Maximum number of credits that can roll over to the next cycle when a program renews.\n * @decimalValue options { gte:0, maxScale:4 }\n * @readonly\n */\n balanceCap?: string | null;\n}\n\nexport enum PoolStatus {\n /** Undefined pool status. */\n UNDEFINED = 'UNDEFINED',\n /** Pool is active. */\n ACTIVE = 'ACTIVE',\n /** Pool is paused. It can be resumed. */\n PAUSED = 'PAUSED',\n /** Pool is ended. It can't be resumed. */\n ENDED = 'ENDED',\n /** Pool provisioning is in progress. This status exists for a short time during processing. */\n PROVISIONING = 'PROVISIONING',\n /** Pool renewing is in progress. This status exists for a short time during processing. */\n RENEWING = 'RENEWING',\n /** Pool is pending */\n PENDING = 'PENDING',\n}\n\n/** @enumType */\nexport type PoolStatusWithLiterals =\n | PoolStatus\n | 'UNDEFINED'\n | 'ACTIVE'\n | 'PAUSED'\n | 'ENDED'\n | 'PROVISIONING'\n | 'RENEWING'\n | 'PENDING';\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface GetBalanceRequest {\n /**\n * ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @format GUID\n */\n poolId: string;\n}\n\nexport interface GetBalanceResponse {\n /** Retrieved balance. */\n balance?: Balance;\n}\n\nexport interface ListBalancesRequest {\n /**\n * List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.\n * @format GUID\n * @maxSize 100\n */\n poolIds?: string[];\n /** Cursor paging. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return.\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 ListBalancesResponse {\n /**\n * Retrieved balances.\n * @maxSize 100\n */\n balances?: Balance[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\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 QueryBalancesRequest {\n /** Filter, sort, and paging to apply to the query. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n * See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\n * for more information.\n */\n filter?: Record<string, any> | null;\n /**\n * List of sort objects.\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /**\n * Sort order. Use `ASC` for ascending order or `DESC` for descending order.\n *\n * Default: `ASC`\n */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Ascending sort order. */\n ASC = 'ASC',\n /** Descending sort order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface QueryBalancesResponse {\n /** List of retrieved balances. */\n balances?: Balance[];\n /** Metadata for the paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface BalanceChangeBalanceRequest\n extends BalanceChangeBalanceRequestOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n /**\n * ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @format GUID\n */\n poolId: string;\n /**\n * Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @maxLength 200\n */\n idempotencyKey: string;\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: ChangeBalanceRequestTypeWithLiterals;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface BalanceChangeBalanceRequestOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n}\n\nexport enum ChangeBalanceRequestType {\n /** Unknown balance change type. */\n UNKNOWN_OPERATION = 'UNKNOWN_OPERATION',\n /** Use with `adjustOptions`. */\n ADJUST = 'ADJUST',\n /** Use with `setOptions`. */\n SET = 'SET',\n}\n\n/** @enumType */\nexport type ChangeBalanceRequestTypeWithLiterals =\n | ChangeBalanceRequestType\n | 'UNKNOWN_OPERATION'\n | 'ADJUST'\n | 'SET';\n\nexport interface AdjustOptions {\n /**\n * Amount to change the balance's available credits by.\n * - To increase the balance, specify a positive number.\n * - To decrease the balance, specify a negative number.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Beneficiary of the associated pool. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport enum LimitRule {\n /** Unknown limit rule */\n UNKNOWN_LIMIT_RULE = 'UNKNOWN_LIMIT_RULE',\n /** If the limit is exceeded, the operation will fail */\n FAIL = 'FAIL',\n /** If the limit is exceeded, the operation will succeed but the balance never goes beyond the provided limits. For balance that was already outside of provided limits, it will not be changed. */\n SOFT_ENFORCE = 'SOFT_ENFORCE',\n /** If the limit is exceeded, the operation will succeed but the balance will be adjusted so that it satisfies the provided limits. If the resulting balance is below the lower_limit, it will be set to the lower_limit. If the resulting balance is above the upper_limit, it will be set to the upper_limit. */\n HARD_ENFORCE = 'HARD_ENFORCE',\n}\n\n/** @enumType */\nexport type LimitRuleWithLiterals =\n | LimitRule\n | 'UNKNOWN_LIMIT_RULE'\n | 'FAIL'\n | 'SOFT_ENFORCE'\n | 'HARD_ENFORCE';\n\nexport enum BalanceType {\n UNDEFINED = 'UNDEFINED',\n /** In a pool's balance. */\n AVAILABLE = 'AVAILABLE',\n /** Outside a pool's balance. */\n EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type BalanceTypeWithLiterals =\n | BalanceType\n | 'UNDEFINED'\n | 'AVAILABLE'\n | 'EXTERNAL';\n\nexport interface SetOptions {\n /**\n * Amount to set the balance's available credits to.\n *\n * If this is the same as the current value, no transaction is created.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Beneficiary of the associated pool. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport interface SetInitialOptions {\n /**\n * Set the available balance to the provided amount.\n * @decimalValue options { maxScale:4 }\n */\n value?: string;\n /** Benefit pool owner associated with this balance. */\n beneficiary?: CommonIdentificationData;\n}\n\nexport interface TransactionDetails {\n /**\n * Item associated with the transaction.\n * @readonly\n */\n item?: Item;\n /** Amount of items associated with the transaction. */\n itemCount?: number | null;\n /**\n * Date and time the transaction was created.\n * @readonly\n */\n effectiveDate?: Date | null;\n /**\n * Reason for the transaction. For example, `Redemption`.\n * @readonly\n * @maxLength 256\n */\n reason?: string | null;\n /**\n * Benefit key associated with the transaction.\n * @maxLength 64\n * @immutable\n */\n benefitKey?: string | null;\n}\n\nexport interface Item {\n /**\n * Item ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Item external ID.\n * @format GUID\n * @readonly\n */\n externalId?: string | null;\n /**\n * Item category.\n * @maxLength 20\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID.\n * @format GUID\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Item name.\n * @maxLength 64\n * @readonly\n */\n displayName?: string | null;\n /**\n * Provider app id\n * @format GUID\n * @readonly\n */\n providerAppId?: string | null;\n}\n\nexport interface ChangeBalanceResponse {\n /** Updated balance. */\n balance?: Balance;\n /**\n * ID of the transaction associated with this change in balance.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface BalanceExceededLimits {\n /** Current balance */\n balance?: BalanceAmount;\n /**\n * The requested amount\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n requested?: string;\n /**\n * Lower limit\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n lowerLimit?: string | null;\n /**\n * Upper limit\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n upperLimit?: string | null;\n /** Source balance type */\n sourceBalanceType?: BalanceTypeWithLiterals;\n /** Target balance type */\n targetBalanceType?: BalanceTypeWithLiterals;\n}\n\nexport interface BulkChangeBalancesRequest {\n /**\n * List of balances to change.\n * @minSize 1\n * @maxSize 100\n */\n requests?: ChangeBalanceRequest[];\n /**\n * Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @maxLength 200\n */\n idempotencyKey?: string;\n /** Whether to return the full balance entities in the response. */\n returnEntity?: boolean;\n}\n\nexport enum Type {\n /** Unknown balance change type. */\n UNKNOWN_OPERATION = 'UNKNOWN_OPERATION',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNKNOWN_OPERATION';\n\nexport interface ChangeBalanceRequest\n extends ChangeBalanceRequestOperationOneOf {\n /**\n * ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @format GUID\n */\n poolId?: string;\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: TypeWithLiterals;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface ChangeBalanceRequestOperationOneOf {}\n\nexport interface BulkChangeBalancesResponse {\n /**\n * Updated item and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkChangeBalanceResult[];\n /** Metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkChangeBalanceResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Updated item. */\n balance?: Balance;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface RevertBalanceChangeRequest {\n /**\n * ID of the transaction associated with the balance change to revert.\n * @format GUID\n */\n transactionId: string;\n /**\n * Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @maxLength 200\n * @deprecated Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @targetRemovalDate 2026-01-31\n */\n idempotencyKey: string;\n /** Identity reverting the balance change. */\n instructingParty?: CommonIdentificationData;\n}\n\nexport interface RevertBalanceChangeResponse {\n /**\n * ID of the transaction associated with the balance reversion.\n * @format GUID\n */\n transactionId?: string | null;\n}\n\nexport interface ChangeAlreadyReverted {\n /**\n * The id of the transaction which was already reverted\n * @format GUID\n */\n originalTransactionId?: string;\n /**\n * The id of the transaction which reverted the original transaction\n * @format GUID\n */\n revertedTransactionId?: string;\n}\n\nexport interface NotEnoughBalance {\n /** Current balance */\n balance?: BalanceAmount;\n /**\n * The requested amount\n * @decimalValue options { maxScale:4 }\n * @readonly\n */\n requested?: string;\n}\n\nexport interface GetTransactionReversibilityRequest {\n /**\n * Id of the transaction to get the reversibility\n * @format GUID\n */\n transactionId?: string;\n}\n\nexport interface GetTransactionReversibilityResponse {\n /** The result of transaction reversibility validation */\n transactionReversibility?: TransactionReversibilityWithLiterals;\n}\n\n/** Transaction reversibility results */\nexport enum TransactionReversibility {\n /** Transaction is allowed to be reverted */\n TRANSACTION_IS_REVERSIBLE = 'TRANSACTION_IS_REVERSIBLE',\n /** Transaction isn't allowed to be reverted, because it was already reverted */\n TRANSACTION_ALREADY_REVERSED = 'TRANSACTION_ALREADY_REVERSED',\n}\n\n/** @enumType */\nexport type TransactionReversibilityWithLiterals =\n | TransactionReversibility\n | 'TRANSACTION_IS_REVERSIBLE'\n | 'TRANSACTION_ALREADY_REVERSED';\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/** @docsIgnore */\nexport type ChangeBalanceApplicationErrors =\n | {\n code?: 'ALREADY_EXECUTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'BALANCE_EXCEEDED_LIMITS';\n description?: string;\n data?: BalanceExceededLimits;\n };\n/** @docsIgnore */\nexport type RevertBalanceChangeApplicationErrors =\n | {\n code?: 'CHANGE_ALREADY_REVERTED';\n description?: string;\n data?: ChangeAlreadyReverted;\n }\n | {\n code?: 'NOT_ENOUGH_BALANCE';\n description?: string;\n data?: NotEnoughBalance;\n }\n | {\n code?: 'TRANSACTION_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a balance.\n * @param poolId - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @public\n * @requiredField poolId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @returns Retrieved balance.\n * @fqn wix.benefit_programs.v1.balance.BalanceService.GetBalance\n */\nexport async function getBalance(\n poolId: string\n): Promise<\n NonNullablePaths<\n Balance,\n | `_id`\n | `beneficiary.anonymousVisitorId`\n | `beneficiary.memberId`\n | `beneficiary.wixUserId`\n | `amount.available`\n | `amount.reserved`\n | `poolInfo._id`\n | `poolInfo.status`,\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({ poolId: poolId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.getBalance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.balance!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { poolId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['poolId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of balances.\n * @public\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.ListBalances\n */\nexport async function listBalances(\n options?: ListBalancesOptions\n): Promise<\n NonNullablePaths<\n ListBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\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 poolIds: options?.poolIds,\n cursorPaging: options?.cursorPaging,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.listBalances(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n poolIds: '$[0].poolIds',\n cursorPaging: '$[0].cursorPaging',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListBalancesOptions {\n /**\n * List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.\n * @format GUID\n * @maxSize 100\n */\n poolIds?: string[];\n /** Cursor paging. */\n cursorPaging?: CursorPaging;\n}\n\n/**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n * @public\n * @permissionId BENEFIT_PROGRAMS.BALANCE_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.QueryBalances\n */\nexport function queryBalances(): BalancesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Balance,\n 'CURSOR',\n QueryBalancesRequest,\n QueryBalancesResponse\n >({\n func: async (payload: QueryBalancesRequest) => {\n const reqOpts =\n ambassadorWixBenefitProgramsV1Balance.queryBalances(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: QueryBalancesRequest['query']) => {\n const args = [query, {}] as [QueryBalancesRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryBalancesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.balances,\n pagingMetadata: transformedData?.metadata,\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\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface BalancesQueryResult extends QueryCursorResult {\n items: Balance[];\n query: BalancesQueryBuilder;\n next: () => Promise<BalancesQueryResult>;\n prev: () => Promise<BalancesQueryResult>;\n}\n\nexport interface BalancesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'beneficiary.memberId' | 'beneficiary.wixUserId',\n value: string\n ) => BalancesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any[]\n ) => BalancesQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: any\n ) => BalancesQueryBuilder;\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'beneficiary.memberId'\n | 'beneficiary.wixUserId',\n value: boolean\n ) => BalancesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'beneficiary.memberId' | 'beneficiary.wixUserId'\n >\n ) => BalancesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<\n '_id' | '_createdDate' | 'beneficiary.memberId' | 'beneficiary.wixUserId'\n >\n ) => BalancesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => BalancesQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => BalancesQueryBuilder;\n find: () => Promise<BalancesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.benefit_programs.v1.balance.BalanceService.QueryBalances\n * @requiredField query\n */\nexport async function typedQueryBalances(\n query: BalanceQuery\n): Promise<\n NonNullablePaths<\n QueryBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n> {\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 = ambassadorWixBenefitProgramsV1Balance.queryBalances(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 BalanceQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n 'beneficiary.memberId',\n 'beneficiary.wixUserId'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Balance,\n BalanceQuerySpec\n>;\nexport type BalanceQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return. \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 See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\n for more information. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n List of sort objects. \n @maxSize: 5 \n */\n sort?: {\n /** \n Field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. Use `ASC` for ascending order or `DESC` for descending order.\n\n Default: `ASC` \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n ...createQueryUtils<Balance, BalanceQuerySpec, BalanceQuery>(),\n};\n\n/**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n * @param poolId - ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @param idempotencyKey - Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n * @public\n * @requiredField idempotencyKey\n * @requiredField options.operation\n * @requiredField poolId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.ChangeBalance\n */\nexport async function changeBalance(\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n): Promise<\n NonNullablePaths<\n ChangeBalanceResponse,\n | `balance._id`\n | `balance.beneficiary.anonymousVisitorId`\n | `balance.beneficiary.memberId`\n | `balance.beneficiary.wixUserId`\n | `balance.amount.available`\n | `balance.amount.reserved`\n | `balance.poolInfo._id`\n | `balance.poolInfo.status`,\n 4\n > & {\n __applicationErrorsType?: ChangeBalanceApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n poolId: poolId,\n idempotencyKey: idempotencyKey,\n instructingParty: options?.instructingParty,\n type: options?.type,\n adjustOptions: options?.adjustOptions,\n setOptions: options?.setOptions,\n transactionDetails: options?.transactionDetails,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Balance.changeBalance(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n poolId: '$[0]',\n idempotencyKey: '$[1]',\n instructingParty: '$[2].instructingParty',\n type: '$[2].type',\n adjustOptions: '$[2].adjustOptions',\n setOptions: '$[2].setOptions',\n transactionDetails: '$[2].transactionDetails',\n },\n singleArgumentUnchanged: false,\n },\n ['poolId', 'idempotencyKey', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ChangeBalanceOptions\n extends ChangeBalanceOptionsOperationOneOf {\n /** Identity changing the balance. */\n instructingParty?: CommonIdentificationData;\n /** Balance change type. */\n type?: ChangeBalanceRequestTypeWithLiterals;\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n /** Details to send to the transaction created from this balance change. */\n transactionDetails?: TransactionDetails;\n}\n\n/** @oneof */\nexport interface ChangeBalanceOptionsOperationOneOf {\n /** Adjust the balance by a specific number of credits. */\n adjustOptions?: AdjustOptions;\n /** Set the balance to a specific number of credits. */\n setOptions?: SetOptions;\n}\n\n/**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n * @param transactionId - ID of the transaction associated with the balance change to revert.\n * @param idempotencyKey - Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n * @public\n * @requiredField idempotencyKey\n * @requiredField transactionId\n * @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.balance.BalanceService.RevertBalanceChange\n */\nexport async function revertBalanceChange(\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n): Promise<\n RevertBalanceChangeResponse & {\n __applicationErrorsType?: RevertBalanceChangeApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n transactionId: transactionId,\n idempotencyKey: idempotencyKey,\n instructingParty: options?.instructingParty,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1Balance.revertBalanceChange(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n transactionId: '$[0]',\n idempotencyKey: '$[1]',\n instructingParty: '$[2].instructingParty',\n },\n singleArgumentUnchanged: false,\n },\n ['transactionId', 'idempotencyKey', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RevertBalanceChangeOptions {\n /** Identity reverting the balance change. */\n instructingParty?: CommonIdentificationData;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBenefitProgramsV1BalanceBalanceServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/pool-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-pool-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/benefit-programs/v1/balances',\n destPath: '/v1/balances',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/balances',\n destPath: '/v1/bulk/balances',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_balances';\n\n/** Retrieves a balance. */\nexport function getBalance(payload: object): RequestOptionsFactory<any> {\n function __getBalance({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.GetBalance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/{poolId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balance.createdDate' },\n { path: 'balance.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getBalance;\n}\n\n/** Retrieves a list of balances. */\nexport function listBalances(payload: object): RequestOptionsFactory<any> {\n function __listBalances({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.ListBalances',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balances.createdDate' },\n { path: 'balances.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listBalances;\n}\n\n/**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n */\nexport function queryBalances(payload: object): RequestOptionsFactory<any> {\n function __queryBalances({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.QueryBalances',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balances.createdDate' },\n { path: 'balances.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryBalances;\n}\n\n/**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n */\nexport function changeBalance(payload: object): RequestOptionsFactory<any> {\n function __changeBalance({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'transactionDetails.effectiveDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.balance.BalanceService.ChangeBalance',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/{poolId}/change',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'balance.createdDate' },\n { path: 'balance.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __changeBalance;\n}\n\n/**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n */\nexport function revertBalanceChange(\n payload: object\n): RequestOptionsFactory<any> {\n function __revertBalanceChange({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.balance',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.balance.BalanceService.RevertBalanceChange',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1BalanceBalanceServiceUrl({\n protoPath: '/v1/balances/changes/{transactionId}/revert',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __revertBalanceChange;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Balance,\n BalanceQuery,\n BalancesQueryBuilder,\n ChangeBalanceApplicationErrors,\n ChangeBalanceOptions,\n ChangeBalanceResponse,\n ListBalancesOptions,\n ListBalancesResponse,\n QueryBalancesResponse,\n RevertBalanceChangeApplicationErrors,\n RevertBalanceChangeOptions,\n RevertBalanceChangeResponse,\n changeBalance as universalChangeBalance,\n getBalance as universalGetBalance,\n listBalances as universalListBalances,\n queryBalances as universalQueryBalances,\n revertBalanceChange as universalRevertBalanceChange,\n typedQueryBalances as universalTypedQueryBalances,\n} from './benefit-programs-v1-balance-balances.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/benefit-programs' };\n\nexport function getBalance(httpClient: HttpClient): GetBalanceSignature {\n return (poolId: string) =>\n universalGetBalance(\n poolId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetBalanceSignature {\n /**\n * Retrieves a balance.\n * @param - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.\n * @returns Retrieved balance.\n */\n (poolId: string): Promise<\n NonNullablePaths<\n Balance,\n | `_id`\n | `beneficiary.anonymousVisitorId`\n | `beneficiary.memberId`\n | `beneficiary.wixUserId`\n | `amount.available`\n | `amount.reserved`\n | `poolInfo._id`\n | `poolInfo.status`,\n 3\n >\n >;\n}\n\nexport function listBalances(httpClient: HttpClient): ListBalancesSignature {\n return (options?: ListBalancesOptions) =>\n universalListBalances(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListBalancesSignature {\n /**\n * Retrieves a list of balances.\n */\n (options?: ListBalancesOptions): Promise<\n NonNullablePaths<\n ListBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n >;\n}\n\nexport function queryBalances(httpClient: HttpClient): QueryBalancesSignature {\n return () =>\n universalQueryBalances(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryBalancesSignature {\n /**\n * Creates a query to retrieve a list of balances.\n *\n * The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.\n *\n * Query Balances has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.\n */\n (): BalancesQueryBuilder;\n}\n\nexport function typedQueryBalances(\n httpClient: HttpClient\n): TypedQueryBalancesSignature {\n return (query: BalanceQuery) =>\n universalTypedQueryBalances(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryBalancesSignature {\n /** */\n (query: BalanceQuery): Promise<\n NonNullablePaths<\n QueryBalancesResponse,\n | `balances`\n | `balances.${number}._id`\n | `balances.${number}.beneficiary.anonymousVisitorId`\n | `balances.${number}.beneficiary.memberId`\n | `balances.${number}.beneficiary.wixUserId`\n | `balances.${number}.amount.available`\n | `balances.${number}.amount.reserved`\n | `balances.${number}.poolInfo._id`\n | `balances.${number}.poolInfo.status`,\n 5\n >\n >;\n}\n\nexport function changeBalance(httpClient: HttpClient): ChangeBalanceSignature {\n return (\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n ) =>\n universalChangeBalance(\n poolId,\n idempotencyKey,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ChangeBalanceSignature {\n /**\n * Changes the number of available credits in a balance.\n *\n * You can adjust or set the number of available credits.\n * @param - ID of the pool associated with the balance to change. This is also the ID of the balance.\n * @param - Unique identifier, generated by the client.\n * Used to recognize repeated attempts to make the same request.\n */\n (\n poolId: string,\n idempotencyKey: string,\n options?: ChangeBalanceOptions\n ): Promise<\n NonNullablePaths<\n ChangeBalanceResponse,\n | `balance._id`\n | `balance.beneficiary.anonymousVisitorId`\n | `balance.beneficiary.memberId`\n | `balance.beneficiary.wixUserId`\n | `balance.amount.available`\n | `balance.amount.reserved`\n | `balance.poolInfo._id`\n | `balance.poolInfo.status`,\n 4\n > & {\n __applicationErrorsType?: ChangeBalanceApplicationErrors;\n }\n >;\n}\n\nexport function revertBalanceChange(\n httpClient: HttpClient\n): RevertBalanceChangeSignature {\n return (\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n ) =>\n universalRevertBalanceChange(\n transactionId,\n idempotencyKey,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RevertBalanceChangeSignature {\n /**\n * Reverts a transaction created by calling Change Balance.\n *\n * For example, if a transaction increased a balance's available credits by 5,\n * calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.\n *\n * > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.\n * @param - ID of the transaction associated with the balance change to revert.\n * @param - Ignored value, kept for backward compatibility. Idempotency is now handled by the system.\n */\n (\n transactionId: string,\n idempotencyKey: string,\n options?: RevertBalanceChangeOptions\n ): Promise<\n RevertBalanceChangeResponse & {\n __applicationErrorsType?: RevertBalanceChangeApplicationErrors;\n }\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n AdjustOptions,\n ApplicationError,\n Balance,\n BalanceAmount,\n BalanceChangeBalanceRequest,\n BalanceChangeBalanceRequestOperationOneOf,\n BalanceExceededLimits,\n BalanceQuerySpec,\n BalanceType,\n BalancesQueryBuilder,\n BalancesQueryResult,\n BulkActionMetadata,\n BulkChangeBalanceResult,\n BulkChangeBalancesRequest,\n BulkChangeBalancesResponse,\n ChangeAlreadyReverted,\n ChangeBalanceOptions,\n ChangeBalanceOptionsOperationOneOf,\n ChangeBalanceRequest,\n ChangeBalanceRequestOperationOneOf,\n ChangeBalanceRequestType,\n ChangeBalanceResponse,\n CommonIdentificationData,\n CommonIdentificationDataIdOneOf,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExtendedFields,\n GetBalanceRequest,\n GetBalanceResponse,\n GetTransactionReversibilityRequest,\n GetTransactionReversibilityResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n IdentityType,\n Item,\n ItemMetadata,\n LimitRule,\n ListBalancesOptions,\n ListBalancesRequest,\n ListBalancesResponse,\n MessageEnvelope,\n NotEnoughBalance,\n PoolInfo,\n PoolStatus,\n QueryBalancesRequest,\n QueryBalancesResponse,\n RestoreInfo,\n RevertBalanceChangeOptions,\n RevertBalanceChangeRequest,\n RevertBalanceChangeResponse,\n RolloverConfigurationInfo,\n SetInitialOptions,\n SetOptions,\n SortOrder,\n Sorting,\n TransactionDetails,\n TransactionReversibility,\n Type,\n WebhookIdentityType,\n utils,\n} from './benefit-programs-v1-balance-balances.universal.js';\n","import {\n getBalance as publicGetBalance,\n listBalances as publicListBalances,\n queryBalances as publicQueryBalances,\n typedQueryBalances as publicTypedQueryBalances,\n changeBalance as publicChangeBalance,\n revertBalanceChange as publicRevertBalanceChange,\n} from './benefit-programs-v1-balance-balances.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 BalanceQuery,\n BalancesQueryBuilder,\n typedQueryBalances as universalTypedQueryBalances,\n} from './benefit-programs-v1-balance-balances.universal.js';\n\nfunction customQueryBalances(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryBalances(httpClient)(),\n typedQueryFunction: (query: BalanceQuery) =>\n publicTypedQueryBalances(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): BalancesQueryBuilder;\n function overloadedQuery(\n query: BalanceQuery\n ): ReturnType<typeof universalTypedQueryBalances>;\n function overloadedQuery(query?: BalanceQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getBalance: MaybeContext<\n BuildRESTFunction<typeof publicGetBalance> & typeof publicGetBalance\n> = /*#__PURE__*/ createRESTModule(publicGetBalance);\nexport const listBalances: MaybeContext<\n BuildRESTFunction<typeof publicListBalances> & typeof publicListBalances\n> = /*#__PURE__*/ createRESTModule(publicListBalances);\nexport const changeBalance: MaybeContext<\n BuildRESTFunction<typeof publicChangeBalance> & typeof publicChangeBalance\n> = /*#__PURE__*/ createRESTModule(publicChangeBalance);\nexport const revertBalanceChange: MaybeContext<\n BuildRESTFunction<typeof publicRevertBalanceChange> &\n typeof publicRevertBalanceChange\n> = /*#__PURE__*/ createRESTModule(publicRevertBalanceChange);\nexport const queryBalances: MaybeContext<\n BuildRESTFunction<typeof customQueryBalances> & typeof customQueryBalances\n> = /*#__PURE__*/ createRESTModule(customQueryBalances);\n\nexport {\n IdentityType,\n PoolStatus,\n SortOrder,\n ChangeBalanceRequestType,\n LimitRule,\n BalanceType,\n Type,\n TransactionReversibility,\n WebhookIdentityType,\n} from './benefit-programs-v1-balance-balances.universal.js';\nexport {\n Balance,\n CommonIdentificationData,\n CommonIdentificationDataIdOneOf,\n BalanceAmount,\n PoolInfo,\n RolloverConfigurationInfo,\n ExtendedFields,\n GetBalanceRequest,\n GetBalanceResponse,\n ListBalancesRequest,\n CursorPaging,\n ListBalancesResponse,\n CursorPagingMetadata,\n Cursors,\n QueryBalancesRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n QueryBalancesResponse,\n BalanceChangeBalanceRequest,\n BalanceChangeBalanceRequestOperationOneOf,\n AdjustOptions,\n SetOptions,\n SetInitialOptions,\n TransactionDetails,\n Item,\n ChangeBalanceResponse,\n BalanceExceededLimits,\n BulkChangeBalancesRequest,\n ChangeBalanceRequest,\n ChangeBalanceRequestOperationOneOf,\n BulkChangeBalancesResponse,\n ItemMetadata,\n ApplicationError,\n BulkChangeBalanceResult,\n BulkActionMetadata,\n RevertBalanceChangeRequest,\n RevertBalanceChangeResponse,\n ChangeAlreadyReverted,\n NotEnoughBalance,\n GetTransactionReversibilityRequest,\n GetTransactionReversibilityResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ListBalancesOptions,\n BalancesQueryResult,\n BalancesQueryBuilder,\n BalanceQuerySpec,\n ChangeBalanceOptions,\n ChangeBalanceOptionsOperationOneOf,\n RevertBalanceChangeOptions,\n} from './benefit-programs-v1-balance-balances.universal.js';\nexport { utils } from './benefit-programs-v1-balance-balances.universal.js';\nexport {\n IdentityTypeWithLiterals,\n PoolStatusWithLiterals,\n SortOrderWithLiterals,\n ChangeBalanceRequestTypeWithLiterals,\n LimitRuleWithLiterals,\n BalanceTypeWithLiterals,\n TypeWithLiterals,\n TransactionReversibilityWithLiterals,\n WebhookIdentityTypeWithLiterals,\n ChangeBalanceApplicationErrors,\n RevertBalanceChangeApplicationErrors,\n CommonQueryWithEntityContext,\n BalanceQuery,\n} from './benefit-programs-v1-balance-balances.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,2BAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AA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AA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAwBO,SAASC,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,eAAc,YAAgD;AAC5E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAmBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,CAAC,UACN;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CACL,QACA,gBACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAiCO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CACL,eACA,gBACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjMA,IAAAC,uBAAiC;AAGjC,iCAA0C;AAO1C,SAAS,oBAAoB,YAAwB;AACnD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,MAAMC,eAAoB,UAAU,EAAE;AAAA,IAC5D,oBAAoB,CAAC,UACnBC,oBAAyB,UAAU,EAAE,KAAK;AAAA,IAC5C,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA2B;AAClD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAML,iBAEK,2DAAiB,mBAAmB;","names":["changeBalance","getBalance","listBalances","queryBalances","revertBalanceChange","import_timestamp","import_rest_modules","payload","import_transform_paths","IdentityType","PoolStatus","SortOrder","ChangeBalanceRequestType","LimitRule","BalanceType","Type","TransactionReversibility","WebhookIdentityType","getBalance","sdkTransformError","listBalances","queryBalances","changeBalance","revertBalanceChange","getBalance","listBalances","queryBalances","typedQueryBalances","changeBalance","revertBalanceChange","import_rest_modules","queryBalances","typedQueryBalances","getBalance","listBalances","changeBalance","revertBalanceChange"]}
@@ -1025,11 +1025,9 @@ type BalanceQuery = {
1025
1025
  }[];
1026
1026
  };
1027
1027
  declare const utils: {
1028
- query: {
1029
- QueryBuilder: () => _wix_sdk_types.QueryBuilder<Balance, BalanceQuerySpec, BalanceQuery>;
1030
- Filter: _wix_sdk_types.FilterFactory<Balance, BalanceQuerySpec>;
1031
- Sort: _wix_sdk_types.SortFactory<BalanceQuerySpec>;
1032
- };
1028
+ QueryBuilder: () => _wix_sdk_types.QueryBuilder<Balance, BalanceQuerySpec, BalanceQuery>;
1029
+ Filter: _wix_sdk_types.FilterFactory<Balance, BalanceQuerySpec>;
1030
+ Sort: _wix_sdk_types.SortFactory<BalanceQuerySpec>;
1033
1031
  };
1034
1032
  /**
1035
1033
  * Changes the number of available credits in a balance.
@@ -500,9 +500,7 @@ async function typedQueryBalances(query) {
500
500
  }
501
501
  }
502
502
  var utils = {
503
- query: {
504
- ...(0, import_query_builder_utils.createQueryUtils)()
505
- }
503
+ ...(0, import_query_builder_utils.createQueryUtils)()
506
504
  };
507
505
  async function changeBalance2(poolId, idempotencyKey, options) {
508
506
  const { httpClient, sideEffects } = arguments[3];