@wix/auto_sdk_ecom_tax-regions 1.0.17 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { T as TaxRegion, U as UpdateTaxRegion, a as TaxRegionsQueryBuilder, b as TaxRegionCreatedEnvelope, c as TaxRegionDeletedEnvelope, d as TaxRegionUpdatedEnvelope } from './billing-v1-tax-region-tax-regions.universal-CFuTcGx3.js';
3
- export { M as ActionEvent, A as ApplicationError, V as BaseEventMetadata, i as BulkActionMetadata, B as BulkCreateTaxRegionRequest, g as BulkCreateTaxRegionResponse, h as BulkCreateTaxRegionResult, y as BulkRestoreTaxRegionsRequest, z as BulkRestoreTaxRegionsResponse, E as BulkRestoreTaxRegionsResult, f as ConflictErrorDetails, u as CreateOrGetTaxRegionWithoutValidationRequest, v as CreateOrGetTaxRegionWithoutValidationResponse, C as CreateTaxRegionRequest, e as CreateTaxRegionResponse, q as CursorPaging, s as CursorPagingMetadata, n as CursorQuery, o as CursorQueryPagingMethodOneOf, t as Cursors, D as DeleteTaxRegionRequest, m as DeleteTaxRegionResponse, w as DeleteTaxRegionWithoutDomainEventsRequest, x as DeleteTaxRegionWithoutDomainEventsResponse, F as DomainEvent, H as DomainEventBodyOneOf, J as EntityCreatedEvent, L as EntityDeletedEvent, K as EntityUpdatedEvent, X as EventMetadata, G as GetTaxRegionRequest, j as GetTaxRegionResponse, O as IdentificationData, P as IdentificationDataIdOneOf, I as ItemMetadata, N as MessageEnvelope, Q as QueryTaxRegionsRequest, r as QueryTaxRegionsResponse, R as RestoreInfo, S as SortOrder, p as Sorting, Y as TaxRegionsQueryResult, k as UpdateTaxRegionRequest, l as UpdateTaxRegionResponse, W as WebhookIdentityType } from './billing-v1-tax-region-tax-regions.universal-CFuTcGx3.js';
2
+ import { TaxRegion, CreateTaxRegionApplicationErrors, UpdateTaxRegion, UpdateTaxRegionApplicationErrors, TaxRegionsQueryBuilder, TaxRegionCreatedEnvelope, TaxRegionDeletedEnvelope, TaxRegionUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkCreateTaxRegionRequest, BulkCreateTaxRegionResponse, BulkCreateTaxRegionResult, BulkRestoreTaxRegionsRequest, BulkRestoreTaxRegionsResponse, BulkRestoreTaxRegionsResult, ConflictErrorDetails, CreateOrGetTaxRegionWithoutValidationRequest, CreateOrGetTaxRegionWithoutValidationResponse, CreateTaxRegionRequest, CreateTaxRegionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteTaxRegionRequest, DeleteTaxRegionResponse, DeleteTaxRegionWithoutDomainEventsRequest, DeleteTaxRegionWithoutDomainEventsResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetTaxRegionRequest, GetTaxRegionResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, MessageEnvelope, QueryTaxRegionsRequest, QueryTaxRegionsResponse, RestoreInfo, SortOrder, Sorting, TaxRegionsQueryResult, UpdateTaxRegionRequest, UpdateTaxRegionResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function createTaxRegion$1(httpClient: HttpClient): CreateTaxRegionSignature;
6
6
  interface CreateTaxRegionSignature {
@@ -14,7 +14,9 @@ interface CreateTaxRegionSignature {
14
14
  * @param - Tax region to create.
15
15
  * @returns Created tax region.
16
16
  */
17
- (taxRegion: TaxRegion): Promise<TaxRegion>;
17
+ (taxRegion: TaxRegion): Promise<TaxRegion & {
18
+ __applicationErrorsType?: CreateTaxRegionApplicationErrors | undefined;
19
+ }>;
18
20
  }
19
21
  declare function getTaxRegion$1(httpClient: HttpClient): GetTaxRegionSignature;
20
22
  interface GetTaxRegionSignature {
@@ -38,7 +40,9 @@ interface UpdateTaxRegionSignature {
38
40
  * @param - Tax region info.
39
41
  * @returns Updated tax region.
40
42
  */
41
- (_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion>;
43
+ (_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion & {
44
+ __applicationErrorsType?: UpdateTaxRegionApplicationErrors | undefined;
45
+ }>;
42
46
  }
43
47
  declare function deleteTaxRegion$1(httpClient: HttpClient): DeleteTaxRegionSignature;
44
48
  interface DeleteTaxRegionSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/billing-v1-tax-region-tax-regions.public.ts","../../src/billing-v1-tax-region-tax-regions.universal.ts","../../src/billing-v1-tax-region-tax-regions.http.ts","../../src/billing-v1-tax-region-tax-regions.context.ts"],"sourcesContent":["export * from './src/billing-v1-tax-region-tax-regions.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n TaxRegion,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n TaxRegionsQueryBuilder,\n UpdateTaxRegion,\n createTaxRegion as universalCreateTaxRegion,\n deleteTaxRegion as universalDeleteTaxRegion,\n getTaxRegion as universalGetTaxRegion,\n queryTaxRegions as universalQueryTaxRegions,\n updateTaxRegion as universalUpdateTaxRegion,\n} from './billing-v1-tax-region-tax-regions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function createTaxRegion(\n httpClient: HttpClient\n): CreateTaxRegionSignature {\n return (\n taxRegion: NonNullablePaths<\n TaxRegion,\n `appId` | `country` | `taxIncludedInPrice`\n >\n ) =>\n universalCreateTaxRegion(\n taxRegion,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateTaxRegionSignature {\n /**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n * @param - Tax region to create.\n * @returns Created tax region.\n */\n (taxRegion: TaxRegion): Promise<TaxRegion>;\n}\n\nexport function getTaxRegion(httpClient: HttpClient): GetTaxRegionSignature {\n return (taxRegionId: string) =>\n universalGetTaxRegion(\n taxRegionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTaxRegionSignature {\n /**\n * Retrieves a tax region.\n * @param - ID of the tax region to retrieve.\n * @returns Retrieved tax region.\n */\n (taxRegionId: string): Promise<TaxRegion>;\n}\n\nexport function updateTaxRegion(\n httpClient: HttpClient\n): UpdateTaxRegionSignature {\n return (\n _id: string,\n taxRegion: NonNullablePaths<UpdateTaxRegion, `revision`>\n ) =>\n universalUpdateTaxRegion(\n _id,\n taxRegion,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateTaxRegionSignature {\n /**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n * @param - Tax region ID.\n * @param - Tax region info.\n * @returns Updated tax region.\n */\n (_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion>;\n}\n\nexport function deleteTaxRegion(\n httpClient: HttpClient\n): DeleteTaxRegionSignature {\n return (taxRegionId: string) =>\n universalDeleteTaxRegion(\n taxRegionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteTaxRegionSignature {\n /**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n * @param - ID of the tax region to delete.\n */\n (taxRegionId: string): Promise<void>;\n}\n\nexport function queryTaxRegions(\n httpClient: HttpClient\n): QueryTaxRegionsSignature {\n return () =>\n universalQueryTaxRegions(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTaxRegionsSignature {\n /**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n */\n (): TaxRegionsQueryBuilder;\n}\n\nexport const onTaxRegionCreated = EventDefinition(\n 'wix.billing.v1.tax_region_created',\n true,\n (event: TaxRegionCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionCreatedEnvelope>();\nexport const onTaxRegionDeleted = EventDefinition(\n 'wix.billing.v1.tax_region_deleted',\n true,\n (event: TaxRegionDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionDeletedEnvelope>();\nexport const onTaxRegionUpdated = EventDefinition(\n 'wix.billing.v1.tax_region_updated',\n true,\n (event: TaxRegionUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateTaxRegionRequest,\n BulkCreateTaxRegionResponse,\n BulkCreateTaxRegionResult,\n BulkRestoreTaxRegionsRequest,\n BulkRestoreTaxRegionsResponse,\n BulkRestoreTaxRegionsResult,\n ConflictErrorDetails,\n CreateOrGetTaxRegionWithoutValidationRequest,\n CreateOrGetTaxRegionWithoutValidationResponse,\n CreateTaxRegionRequest,\n CreateTaxRegionResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteTaxRegionRequest,\n DeleteTaxRegionResponse,\n DeleteTaxRegionWithoutDomainEventsRequest,\n DeleteTaxRegionWithoutDomainEventsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetTaxRegionRequest,\n GetTaxRegionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n MessageEnvelope,\n QueryTaxRegionsRequest,\n QueryTaxRegionsResponse,\n RestoreInfo,\n SortOrder,\n Sorting,\n TaxRegion,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n TaxRegionsQueryBuilder,\n TaxRegionsQueryResult,\n UpdateTaxRegion,\n UpdateTaxRegionRequest,\n UpdateTaxRegionResponse,\n WebhookIdentityType,\n} from './billing-v1-tax-region-tax-regions.universal.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 { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBillingV1TaxRegion from './billing-v1-tax-region-tax-regions.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A tax region uses a location to define a specific tax treatment.\n * A location is defined by `country` and `subdivision`. The tax region also\n * dictates whether or not tax is included in the displayed price.\n */\nexport interface TaxRegion {\n /**\n * Tax region ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.\n * @format COUNTRY\n * @minLength 2\n */\n country?: string;\n /**\n * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.\n * @maxLength 50\n */\n subdivision?: string;\n /**\n * The tax calculator ID to use to calculate tax for this region.\n *\n * Call List Tax Calculators to retrieve a list of available calculators for a site.\n * @format GUID\n */\n appId?: string;\n /** Whether tax is included in the price. */\n taxIncludedInPrice?: boolean;\n /**\n * Revision number, which increments by 1 each time the tax region is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the tax region.\n *\n * Ignored when creating a tax region.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax region was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax region was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface CreateTaxRegionRequest {\n /** Tax region to create. */\n taxRegion: TaxRegion;\n}\n\nexport interface CreateTaxRegionResponse {\n /** Created tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface ConflictErrorDetails {\n /**\n * Conflict details.\n * @maxLength 1000\n */\n reasonForConflict?: string;\n}\n\nexport interface BulkCreateTaxRegionRequest {\n /**\n * Tax regions to create.\n * @minSize 1\n * @maxSize 100\n */\n taxRegions?: TaxRegion[];\n /**\n * Whether to return the full tax region objects in the response.\n *\n * Default: `true`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateTaxRegionResponse {\n /**\n * Tax regions created by bulk action.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkCreateTaxRegionResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkCreateTaxRegionResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /**\n * Tax region.\n *\n * This field is returned if the operation was successful and\n * `returnEntity` is set to `true`.\n */\n item?: TaxRegion;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\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 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 GetTaxRegionRequest {\n /**\n * ID of the tax region to retrieve.\n * @format GUID\n */\n taxRegionId: string;\n}\n\nexport interface GetTaxRegionResponse {\n /** Retrieved tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface UpdateTaxRegionRequest {\n /** Tax region info to update. */\n taxRegion: TaxRegion;\n}\n\nexport interface UpdateTaxRegionResponse {\n /** Updated tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface DeleteTaxRegionRequest {\n /**\n * ID of the tax region to delete.\n * @format GUID\n */\n taxRegionId: string;\n}\n\nexport interface DeleteTaxRegionResponse {}\n\nexport interface QueryTaxRegionsRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTaxRegionsResponse {\n /** Retrieved tax regions. */\n taxRegions?: TaxRegion[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface CreateOrGetTaxRegionWithoutValidationRequest {\n /** Tax region to create. */\n taxRegion?: TaxRegion;\n}\n\nexport interface CreateOrGetTaxRegionWithoutValidationResponse {\n /** Created tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface DeleteTaxRegionWithoutDomainEventsRequest {\n /**\n * ID of the tax region to delete.\n * @format GUID\n */\n taxRegionId?: string;\n}\n\nexport interface DeleteTaxRegionWithoutDomainEventsResponse {}\n\nexport interface BulkRestoreTaxRegionsRequest {\n /**\n * Tax region IDs to restore.\n * @format GUID\n * @minSize 1\n * @maxSize 200\n */\n taxRegionIds?: string[];\n}\n\nexport interface BulkRestoreTaxRegionsResponse {\n /**\n * Restored tax regions result\n * @minSize 1\n * @maxSize 200\n */\n results?: BulkRestoreTaxRegionsResult[];\n}\n\nexport interface BulkRestoreTaxRegionsResult {\n itemMetadata?: ItemMetadata;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\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 BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\nexport interface TaxRegionCreatedEnvelope {\n entity: TaxRegion;\n metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_created\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionCreated(\n handler: (event: TaxRegionCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxRegionDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax region is deleted.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_deleted\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionDeleted(\n handler: (event: TaxRegionDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxRegionUpdatedEnvelope {\n entity: TaxRegion;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax region is updated.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_updated\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionUpdated(\n handler: (event: TaxRegionUpdatedEnvelope) => void | Promise<void>\n): void;\n\ntype TaxRegionNonNullablePaths =\n | `country`\n | `subdivision`\n | `appId`\n | `taxIncludedInPrice`;\n\n/**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n * @param taxRegion - Tax region to create.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegion\n * @requiredField taxRegion.appId\n * @requiredField taxRegion.country\n * @requiredField taxRegion.taxIncludedInPrice\n * @permissionId BILLING.TAX_REGION_CREATE\n * @applicableIdentity APP\n * @returns Created tax region.\n * @fqn wix.billing.v1.TaxRegionsService.CreateTaxRegion\n */\nexport async function createTaxRegion(\n taxRegion: NonNullablePaths<\n TaxRegion,\n `appId` | `country` | `taxIncludedInPrice`\n >\n): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegion: taxRegion,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.createTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegion: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegion']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a tax region.\n * @param taxRegionId - ID of the tax region to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegionId\n * @permissionId BILLING.TAX_REGION_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns Retrieved tax region.\n * @fqn wix.billing.v1.TaxRegionsService.GetTaxRegion\n */\nexport async function getTaxRegion(\n taxRegionId: string\n): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegionId: taxRegionId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.getTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n * @param _id - Tax region ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField taxRegion\n * @requiredField taxRegion.revision\n * @param taxRegion - Tax region info.\n * @permissionId BILLING.TAX_REGION_UPDATE\n * @applicableIdentity APP\n * @returns Updated tax region.\n * @fqn wix.billing.v1.TaxRegionsService.UpdateTaxRegion\n */\nexport async function updateTaxRegion(\n _id: string,\n taxRegion: NonNullablePaths<UpdateTaxRegion, `revision`>\n): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegion: { ...taxRegion, id: _id },\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.updateTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { taxRegion: '$[1]' },\n explicitPathsToArguments: { 'taxRegion.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'taxRegion']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTaxRegion {\n /**\n * Tax region ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.\n * @format COUNTRY\n * @minLength 2\n */\n country?: string;\n /**\n * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.\n * @maxLength 50\n */\n subdivision?: string;\n /**\n * The tax calculator ID to use to calculate tax for this region.\n *\n * Call List Tax Calculators to retrieve a list of available calculators for a site.\n * @format GUID\n */\n appId?: string;\n /** Whether tax is included in the price. */\n taxIncludedInPrice?: boolean;\n /**\n * Revision number, which increments by 1 each time the tax region is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the tax region.\n *\n * Ignored when creating a tax region.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax region was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax region was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\n/**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n * @param taxRegionId - ID of the tax region to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegionId\n * @permissionId BILLING.TAX_REGION_DELETE\n * @applicableIdentity APP\n * @fqn wix.billing.v1.TaxRegionsService.DeleteTaxRegion\n */\nexport async function deleteTaxRegion(taxRegionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegionId: taxRegionId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.deleteTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_REGION_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxRegionsService.QueryTaxRegions\n */\nexport function queryTaxRegions(): TaxRegionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n TaxRegion,\n 'CURSOR',\n QueryTaxRegionsRequest,\n QueryTaxRegionsResponse\n >({\n func: async (payload: QueryTaxRegionsRequest) => {\n const reqOpts = ambassadorWixBillingV1TaxRegion.queryTaxRegions(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: QueryTaxRegionsRequest['query']) => {\n const args = [query, {}] as [QueryTaxRegionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTaxRegionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.taxRegions,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TaxRegionsQueryResult extends QueryCursorResult {\n items: TaxRegion[];\n query: TaxRegionsQueryBuilder;\n next: () => Promise<TaxRegionsQueryResult>;\n prev: () => Promise<TaxRegionsQueryResult>;\n}\n\nexport interface TaxRegionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'country' | 'subdivision' | 'appId',\n value: string\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n * @documentationMaturity preview\n */\n hasSome: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any[]\n ) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: boolean\n ) => TaxRegionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate'\n >\n ) => TaxRegionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate'\n >\n ) => TaxRegionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => TaxRegionsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TaxRegionsQueryResult>;\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 { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixBillingV1TaxRegionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/tax-regions',\n destPath: '/v1/tax-regions',\n },\n {\n srcPath: '/billing/v1/bulk/tax-regions',\n destPath: '/v1/bulk/tax-regions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/tax-regions',\n destPath: '/v1/tax-regions',\n },\n {\n srcPath: '/billing/v1/bulk/tax-regions',\n destPath: '/v1/bulk/tax-regions',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-regions';\n\n/**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n */\nexport function createTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __createTaxRegion({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.CreateTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTaxRegion;\n}\n\n/** Retrieves a tax region. */\nexport function getTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __getTaxRegion({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.GetTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegionId}',\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: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTaxRegion;\n}\n\n/**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n */\nexport function updateTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __updateTaxRegion({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'PATCH' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.UpdateTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegion.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTaxRegion;\n}\n\n/**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n */\nexport function deleteTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __deleteTaxRegion({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'DELETE' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.DeleteTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTaxRegion;\n}\n\n/**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n */\nexport function queryTaxRegions(payload: object): RequestOptionsFactory<any> {\n function __queryTaxRegions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.QueryTaxRegions',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/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: 'taxRegions.createdDate' },\n { path: 'taxRegions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTaxRegions;\n}\n","import {\n createTaxRegion as publicCreateTaxRegion,\n getTaxRegion as publicGetTaxRegion,\n updateTaxRegion as publicUpdateTaxRegion,\n deleteTaxRegion as publicDeleteTaxRegion,\n queryTaxRegions as publicQueryTaxRegions,\n} from './billing-v1-tax-region-tax-regions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onTaxRegionCreated as publicOnTaxRegionCreated } from './billing-v1-tax-region-tax-regions.public.js';\nimport { onTaxRegionDeleted as publicOnTaxRegionDeleted } from './billing-v1-tax-region-tax-regions.public.js';\nimport { onTaxRegionUpdated as publicOnTaxRegionUpdated } from './billing-v1-tax-region-tax-regions.public.js';\n\nexport const createTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicCreateTaxRegion> & typeof publicCreateTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicCreateTaxRegion);\nexport const getTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicGetTaxRegion> & typeof publicGetTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicGetTaxRegion);\nexport const updateTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicUpdateTaxRegion> & typeof publicUpdateTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicUpdateTaxRegion);\nexport const deleteTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicDeleteTaxRegion> & typeof publicDeleteTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicDeleteTaxRegion);\nexport const queryTaxRegions: MaybeContext<\n BuildRESTFunction<typeof publicQueryTaxRegions> & typeof publicQueryTaxRegions\n> = /*#__PURE__*/ createRESTModule(publicQueryTaxRegions);\n/** */\nexport const onTaxRegionCreated: BuildEventDefinition<\n typeof publicOnTaxRegionCreated\n> = createEventModule(publicOnTaxRegionCreated);\n/**\n * Triggered when a tax region is deleted.\n */\nexport const onTaxRegionDeleted: BuildEventDefinition<\n typeof publicOnTaxRegionDeleted\n> = createEventModule(publicOnTaxRegionDeleted);\n/**\n * Triggered when a tax region is updated.\n */\nexport const onTaxRegionUpdated: BuildEventDefinition<\n typeof publicOnTaxRegionUpdated\n> = createEventModule(publicOnTaxRegionUpdated);\n\nexport {\n SortOrder,\n WebhookIdentityType,\n} from './billing-v1-tax-region-tax-regions.universal.js';\nexport {\n TaxRegion,\n CreateTaxRegionRequest,\n CreateTaxRegionResponse,\n ConflictErrorDetails,\n BulkCreateTaxRegionRequest,\n BulkCreateTaxRegionResponse,\n BulkCreateTaxRegionResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n GetTaxRegionRequest,\n GetTaxRegionResponse,\n UpdateTaxRegionRequest,\n UpdateTaxRegionResponse,\n DeleteTaxRegionRequest,\n DeleteTaxRegionResponse,\n QueryTaxRegionsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryTaxRegionsResponse,\n CursorPagingMetadata,\n Cursors,\n CreateOrGetTaxRegionWithoutValidationRequest,\n CreateOrGetTaxRegionWithoutValidationResponse,\n DeleteTaxRegionWithoutDomainEventsRequest,\n DeleteTaxRegionWithoutDomainEventsResponse,\n BulkRestoreTaxRegionsRequest,\n BulkRestoreTaxRegionsResponse,\n BulkRestoreTaxRegionsResult,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n UpdateTaxRegion,\n TaxRegionsQueryResult,\n TaxRegionsQueryBuilder,\n} from './billing-v1-tax-region-tax-regions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA,uBAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA,uBAAA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M5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,IAAMC,0BAET,mDAAkB,kBAAwB;AAIvC,IAAMC,0BAET,mDAAkB,kBAAwB;AAIvC,IAAMC,0BAET,mDAAkB,kBAAwB;","names":["createTaxRegion","deleteTaxRegion","getTaxRegion","onTaxRegionCreated","onTaxRegionDeleted","onTaxRegionUpdated","queryTaxRegions","updateTaxRegion","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","SortOrder","WebhookIdentityType","createTaxRegion","sdkTransformError","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","createTaxRegion","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","import_rest_modules","createTaxRegion","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","onTaxRegionCreated","onTaxRegionDeleted","onTaxRegionUpdated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/billing-v1-tax-region-tax-regions.public.ts","../../src/billing-v1-tax-region-tax-regions.universal.ts","../../src/billing-v1-tax-region-tax-regions.http.ts","../../src/billing-v1-tax-region-tax-regions.context.ts"],"sourcesContent":["export * from './src/billing-v1-tax-region-tax-regions.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateTaxRegionApplicationErrors,\n TaxRegion,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n TaxRegionsQueryBuilder,\n UpdateTaxRegion,\n UpdateTaxRegionApplicationErrors,\n createTaxRegion as universalCreateTaxRegion,\n deleteTaxRegion as universalDeleteTaxRegion,\n getTaxRegion as universalGetTaxRegion,\n queryTaxRegions as universalQueryTaxRegions,\n updateTaxRegion as universalUpdateTaxRegion,\n} from './billing-v1-tax-region-tax-regions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function createTaxRegion(\n httpClient: HttpClient\n): CreateTaxRegionSignature {\n return (\n taxRegion: NonNullablePaths<\n TaxRegion,\n `appId` | `country` | `taxIncludedInPrice`\n >\n ) =>\n universalCreateTaxRegion(\n taxRegion,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateTaxRegionSignature {\n /**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n * @param - Tax region to create.\n * @returns Created tax region.\n */\n (taxRegion: TaxRegion): Promise<\n TaxRegion & {\n __applicationErrorsType?: CreateTaxRegionApplicationErrors | undefined;\n }\n >;\n}\n\nexport function getTaxRegion(httpClient: HttpClient): GetTaxRegionSignature {\n return (taxRegionId: string) =>\n universalGetTaxRegion(\n taxRegionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTaxRegionSignature {\n /**\n * Retrieves a tax region.\n * @param - ID of the tax region to retrieve.\n * @returns Retrieved tax region.\n */\n (taxRegionId: string): Promise<TaxRegion>;\n}\n\nexport function updateTaxRegion(\n httpClient: HttpClient\n): UpdateTaxRegionSignature {\n return (\n _id: string,\n taxRegion: NonNullablePaths<UpdateTaxRegion, `revision`>\n ) =>\n universalUpdateTaxRegion(\n _id,\n taxRegion,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateTaxRegionSignature {\n /**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n * @param - Tax region ID.\n * @param - Tax region info.\n * @returns Updated tax region.\n */\n (_id: string, taxRegion: UpdateTaxRegion): Promise<\n TaxRegion & {\n __applicationErrorsType?: UpdateTaxRegionApplicationErrors | undefined;\n }\n >;\n}\n\nexport function deleteTaxRegion(\n httpClient: HttpClient\n): DeleteTaxRegionSignature {\n return (taxRegionId: string) =>\n universalDeleteTaxRegion(\n taxRegionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteTaxRegionSignature {\n /**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n * @param - ID of the tax region to delete.\n */\n (taxRegionId: string): Promise<void>;\n}\n\nexport function queryTaxRegions(\n httpClient: HttpClient\n): QueryTaxRegionsSignature {\n return () =>\n universalQueryTaxRegions(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTaxRegionsSignature {\n /**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n */\n (): TaxRegionsQueryBuilder;\n}\n\nexport const onTaxRegionCreated = EventDefinition(\n 'wix.billing.v1.tax_region_created',\n true,\n (event: TaxRegionCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionCreatedEnvelope>();\nexport const onTaxRegionDeleted = EventDefinition(\n 'wix.billing.v1.tax_region_deleted',\n true,\n (event: TaxRegionDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionDeletedEnvelope>();\nexport const onTaxRegionUpdated = EventDefinition(\n 'wix.billing.v1.tax_region_updated',\n true,\n (event: TaxRegionUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<TaxRegionUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateTaxRegionRequest,\n BulkCreateTaxRegionResponse,\n BulkCreateTaxRegionResult,\n BulkRestoreTaxRegionsRequest,\n BulkRestoreTaxRegionsResponse,\n BulkRestoreTaxRegionsResult,\n ConflictErrorDetails,\n CreateOrGetTaxRegionWithoutValidationRequest,\n CreateOrGetTaxRegionWithoutValidationResponse,\n CreateTaxRegionRequest,\n CreateTaxRegionResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteTaxRegionRequest,\n DeleteTaxRegionResponse,\n DeleteTaxRegionWithoutDomainEventsRequest,\n DeleteTaxRegionWithoutDomainEventsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetTaxRegionRequest,\n GetTaxRegionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n MessageEnvelope,\n QueryTaxRegionsRequest,\n QueryTaxRegionsResponse,\n RestoreInfo,\n SortOrder,\n Sorting,\n TaxRegion,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n TaxRegionsQueryBuilder,\n TaxRegionsQueryResult,\n UpdateTaxRegion,\n UpdateTaxRegionRequest,\n UpdateTaxRegionResponse,\n WebhookIdentityType,\n} from './billing-v1-tax-region-tax-regions.universal.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 { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBillingV1TaxRegion from './billing-v1-tax-region-tax-regions.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A tax region uses a location to define a specific tax treatment.\n * A location is defined by `country` and `subdivision`. The tax region also\n * dictates whether or not tax is included in the displayed price.\n */\nexport interface TaxRegion {\n /**\n * Tax region ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.\n * @format COUNTRY\n * @minLength 2\n */\n country?: string;\n /**\n * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.\n * @maxLength 50\n */\n subdivision?: string;\n /**\n * The tax calculator ID to use to calculate tax for this region.\n *\n * Call List Tax Calculators to retrieve a list of available calculators for a site.\n * @format GUID\n */\n appId?: string;\n /** Whether tax is included in the price. */\n taxIncludedInPrice?: boolean;\n /**\n * Revision number, which increments by 1 each time the tax region is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the tax region.\n *\n * Ignored when creating a tax region.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax region was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax region was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface CreateTaxRegionRequest {\n /** Tax region to create. */\n taxRegion: TaxRegion;\n}\n\nexport interface CreateTaxRegionResponse {\n /** Created tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface ConflictErrorDetails {\n /**\n * Conflict details.\n * @maxLength 1000\n */\n reasonForConflict?: string;\n}\n\nexport interface BulkCreateTaxRegionRequest {\n /**\n * Tax regions to create.\n * @minSize 1\n * @maxSize 100\n */\n taxRegions?: TaxRegion[];\n /**\n * Whether to return the full tax region objects in the response.\n *\n * Default: `true`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateTaxRegionResponse {\n /**\n * Tax regions created by bulk action.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkCreateTaxRegionResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkCreateTaxRegionResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /**\n * Tax region.\n *\n * This field is returned if the operation was successful and\n * `returnEntity` is set to `true`.\n */\n item?: TaxRegion;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\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 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 GetTaxRegionRequest {\n /**\n * ID of the tax region to retrieve.\n * @format GUID\n */\n taxRegionId: string;\n}\n\nexport interface GetTaxRegionResponse {\n /** Retrieved tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface UpdateTaxRegionRequest {\n /** Tax region info to update. */\n taxRegion: TaxRegion;\n}\n\nexport interface UpdateTaxRegionResponse {\n /** Updated tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface DeleteTaxRegionRequest {\n /**\n * ID of the tax region to delete.\n * @format GUID\n */\n taxRegionId: string;\n}\n\nexport interface DeleteTaxRegionResponse {}\n\nexport interface QueryTaxRegionsRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryTaxRegionsResponse {\n /** Retrieved tax regions. */\n taxRegions?: TaxRegion[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface CreateOrGetTaxRegionWithoutValidationRequest {\n /** Tax region to create. */\n taxRegion?: TaxRegion;\n}\n\nexport interface CreateOrGetTaxRegionWithoutValidationResponse {\n /** Created tax region. */\n taxRegion?: TaxRegion;\n}\n\nexport interface DeleteTaxRegionWithoutDomainEventsRequest {\n /**\n * ID of the tax region to delete.\n * @format GUID\n */\n taxRegionId?: string;\n}\n\nexport interface DeleteTaxRegionWithoutDomainEventsResponse {}\n\nexport interface BulkRestoreTaxRegionsRequest {\n /**\n * Tax region IDs to restore.\n * @format GUID\n * @minSize 1\n * @maxSize 200\n */\n taxRegionIds?: string[];\n}\n\nexport interface BulkRestoreTaxRegionsResponse {\n /**\n * Restored tax regions result\n * @minSize 1\n * @maxSize 200\n */\n results?: BulkRestoreTaxRegionsResult[];\n}\n\nexport interface BulkRestoreTaxRegionsResult {\n itemMetadata?: ItemMetadata;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\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';\nexport type CreateTaxRegionApplicationErrors =\n | {\n code?: 'ALREADY_EXISTS';\n description?: string;\n data?: ConflictErrorDetails;\n }\n | {\n code?: 'CALCULATOR_ID_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'CALCULATOR_IS_NOT_SUPPORTED_FOR_THIS_TAX_REGION';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_SUBDIVISION_FORMAT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY';\n description?: string;\n data?: Record<string, any>;\n };\nexport type UpdateTaxRegionApplicationErrors =\n | {\n code?: 'CALCULATOR_ID_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'CALCULATOR_IS_NOT_SUPPORTED_FOR_THIS_TAX_REGION';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'INVALID_SUBDIVISION_FORMAT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY';\n description?: string;\n data?: Record<string, any>;\n };\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\nexport interface TaxRegionCreatedEnvelope {\n entity: TaxRegion;\n metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_created\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionCreated(\n handler: (event: TaxRegionCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxRegionDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax region is deleted.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_deleted\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionDeleted(\n handler: (event: TaxRegionDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxRegionUpdatedEnvelope {\n entity: TaxRegion;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax region is updated.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId BILLING.TAX_REGION_READ\n * @webhook\n * @eventType wix.billing.v1.tax_region_updated\n * @serviceIdentifier wix.billing.v1.TaxRegionsService\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onTaxRegionUpdated(\n handler: (event: TaxRegionUpdatedEnvelope) => void | Promise<void>\n): void;\n\ntype TaxRegionNonNullablePaths =\n | `country`\n | `subdivision`\n | `appId`\n | `taxIncludedInPrice`;\n\n/**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n * @param taxRegion - Tax region to create.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegion\n * @requiredField taxRegion.appId\n * @requiredField taxRegion.country\n * @requiredField taxRegion.taxIncludedInPrice\n * @permissionId BILLING.TAX_REGION_CREATE\n * @applicableIdentity APP\n * @returns Created tax region.\n * @fqn wix.billing.v1.TaxRegionsService.CreateTaxRegion\n */\nexport async function createTaxRegion(\n taxRegion: NonNullablePaths<\n TaxRegion,\n `appId` | `country` | `taxIncludedInPrice`\n >\n): Promise<\n NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths> & {\n __applicationErrorsType?: CreateTaxRegionApplicationErrors;\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 taxRegion: taxRegion,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.createTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegion: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegion']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a tax region.\n * @param taxRegionId - ID of the tax region to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegionId\n * @permissionId BILLING.TAX_REGION_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns Retrieved tax region.\n * @fqn wix.billing.v1.TaxRegionsService.GetTaxRegion\n */\nexport async function getTaxRegion(\n taxRegionId: string\n): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegionId: taxRegionId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.getTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n * @param _id - Tax region ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField taxRegion\n * @requiredField taxRegion.revision\n * @param taxRegion - Tax region info.\n * @permissionId BILLING.TAX_REGION_UPDATE\n * @applicableIdentity APP\n * @returns Updated tax region.\n * @fqn wix.billing.v1.TaxRegionsService.UpdateTaxRegion\n */\nexport async function updateTaxRegion(\n _id: string,\n taxRegion: NonNullablePaths<UpdateTaxRegion, `revision`>\n): Promise<\n NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths> & {\n __applicationErrorsType?: UpdateTaxRegionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegion: { ...taxRegion, id: _id },\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.updateTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { taxRegion: '$[1]' },\n explicitPathsToArguments: { 'taxRegion.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'taxRegion']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTaxRegion {\n /**\n * Tax region ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.\n * @format COUNTRY\n * @minLength 2\n */\n country?: string;\n /**\n * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.\n * @maxLength 50\n */\n subdivision?: string;\n /**\n * The tax calculator ID to use to calculate tax for this region.\n *\n * Call List Tax Calculators to retrieve a list of available calculators for a site.\n * @format GUID\n */\n appId?: string;\n /** Whether tax is included in the price. */\n taxIncludedInPrice?: boolean;\n /**\n * Revision number, which increments by 1 each time the tax region is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the tax region.\n *\n * Ignored when creating a tax region.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax region was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax region was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\n/**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n * @param taxRegionId - ID of the tax region to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField taxRegionId\n * @permissionId BILLING.TAX_REGION_DELETE\n * @applicableIdentity APP\n * @fqn wix.billing.v1.TaxRegionsService.DeleteTaxRegion\n */\nexport async function deleteTaxRegion(taxRegionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxRegionId: taxRegionId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxRegion.deleteTaxRegion(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxRegionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxRegionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_REGION_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxRegionsService.QueryTaxRegions\n */\nexport function queryTaxRegions(): TaxRegionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n TaxRegion,\n 'CURSOR',\n QueryTaxRegionsRequest,\n QueryTaxRegionsResponse\n >({\n func: async (payload: QueryTaxRegionsRequest) => {\n const reqOpts = ambassadorWixBillingV1TaxRegion.queryTaxRegions(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: QueryTaxRegionsRequest['query']) => {\n const args = [query, {}] as [QueryTaxRegionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTaxRegionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.taxRegions,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TaxRegionsQueryResult extends QueryCursorResult {\n items: TaxRegion[];\n query: TaxRegionsQueryBuilder;\n next: () => Promise<TaxRegionsQueryResult>;\n prev: () => Promise<TaxRegionsQueryResult>;\n}\n\nexport interface TaxRegionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName: '_id' | 'country' | 'subdivision' | 'appId',\n value: string\n ) => TaxRegionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n * @documentationMaturity preview\n */\n hasSome: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any[]\n ) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate',\n value: boolean\n ) => TaxRegionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate'\n >\n ) => TaxRegionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | 'country'\n | 'subdivision'\n | 'appId'\n | '_createdDate'\n | '_updatedDate'\n >\n ) => TaxRegionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => TaxRegionsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TaxRegionsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TaxRegionsQueryResult>;\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 { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixBillingV1TaxRegionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/tax-regions',\n destPath: '/v1/tax-regions',\n },\n {\n srcPath: '/billing/v1/bulk/tax-regions',\n destPath: '/v1/bulk/tax-regions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/tax-regions',\n destPath: '/v1/tax-regions',\n },\n {\n srcPath: '/billing/v1/bulk/tax-regions',\n destPath: '/v1/bulk/tax-regions',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-regions';\n\n/**\n * Creates a tax region.\n *\n * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.\n *\n * Wix uses tax regions to calculate tax.\n * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->\n */\nexport function createTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __createTaxRegion({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.CreateTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTaxRegion;\n}\n\n/** Retrieves a tax region. */\nexport function getTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __getTaxRegion({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.GetTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegionId}',\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: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTaxRegion;\n}\n\n/**\n * Updates a tax region.\n *\n * Each time the tax region is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax region.\n * This ensures you're working with the latest tax region and prevents\n * unintended overwrites.\n */\nexport function updateTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __updateTaxRegion({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'PATCH' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.UpdateTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegion.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxRegion.createdDate' },\n { path: 'taxRegion.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTaxRegion;\n}\n\n/**\n * Deletes a tax region.\n *\n * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.\n */\nexport function deleteTaxRegion(payload: object): RequestOptionsFactory<any> {\n function __deleteTaxRegion({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'DELETE' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.DeleteTaxRegion',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/{taxRegionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTaxRegion;\n}\n\n/**\n * Creates a query to retrieve a list of tax regions.\n *\n * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` function.\n *\n * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.\n *\n * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending(\"country\")` and then `ascending(\"subdivision\")`, the results are sorted first by the `\"country\"`, and then, if there are multiple results with the same `\"country\"`, the items are sorted by `\"subdivision\"`.\n *\n * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.\n */\nexport function queryTaxRegions(payload: object): RequestOptionsFactory<any> {\n function __queryTaxRegions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_region',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxRegionsService.QueryTaxRegions',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxRegionsServiceUrl({\n protoPath: '/v1/tax-regions/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: 'taxRegions.createdDate' },\n { path: 'taxRegions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTaxRegions;\n}\n","import {\n createTaxRegion as publicCreateTaxRegion,\n getTaxRegion as publicGetTaxRegion,\n updateTaxRegion as publicUpdateTaxRegion,\n deleteTaxRegion as publicDeleteTaxRegion,\n queryTaxRegions as publicQueryTaxRegions,\n} from './billing-v1-tax-region-tax-regions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onTaxRegionCreated as publicOnTaxRegionCreated } from './billing-v1-tax-region-tax-regions.public.js';\nimport { onTaxRegionDeleted as publicOnTaxRegionDeleted } from './billing-v1-tax-region-tax-regions.public.js';\nimport { onTaxRegionUpdated as publicOnTaxRegionUpdated } from './billing-v1-tax-region-tax-regions.public.js';\n\nexport const createTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicCreateTaxRegion> & typeof publicCreateTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicCreateTaxRegion);\nexport const getTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicGetTaxRegion> & typeof publicGetTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicGetTaxRegion);\nexport const updateTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicUpdateTaxRegion> & typeof publicUpdateTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicUpdateTaxRegion);\nexport const deleteTaxRegion: MaybeContext<\n BuildRESTFunction<typeof publicDeleteTaxRegion> & typeof publicDeleteTaxRegion\n> = /*#__PURE__*/ createRESTModule(publicDeleteTaxRegion);\nexport const queryTaxRegions: MaybeContext<\n BuildRESTFunction<typeof publicQueryTaxRegions> & typeof publicQueryTaxRegions\n> = /*#__PURE__*/ createRESTModule(publicQueryTaxRegions);\n/** */\nexport const onTaxRegionCreated: BuildEventDefinition<\n typeof publicOnTaxRegionCreated\n> = createEventModule(publicOnTaxRegionCreated);\n/**\n * Triggered when a tax region is deleted.\n */\nexport const onTaxRegionDeleted: BuildEventDefinition<\n typeof publicOnTaxRegionDeleted\n> = createEventModule(publicOnTaxRegionDeleted);\n/**\n * Triggered when a tax region is updated.\n */\nexport const onTaxRegionUpdated: BuildEventDefinition<\n typeof publicOnTaxRegionUpdated\n> = createEventModule(publicOnTaxRegionUpdated);\n\nexport {\n SortOrder,\n WebhookIdentityType,\n} from './billing-v1-tax-region-tax-regions.universal.js';\nexport {\n TaxRegion,\n CreateTaxRegionRequest,\n CreateTaxRegionResponse,\n ConflictErrorDetails,\n BulkCreateTaxRegionRequest,\n BulkCreateTaxRegionResponse,\n BulkCreateTaxRegionResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n GetTaxRegionRequest,\n GetTaxRegionResponse,\n UpdateTaxRegionRequest,\n UpdateTaxRegionResponse,\n DeleteTaxRegionRequest,\n DeleteTaxRegionResponse,\n QueryTaxRegionsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryTaxRegionsResponse,\n CursorPagingMetadata,\n Cursors,\n CreateOrGetTaxRegionWithoutValidationRequest,\n CreateOrGetTaxRegionWithoutValidationResponse,\n DeleteTaxRegionWithoutDomainEventsRequest,\n DeleteTaxRegionWithoutDomainEventsResponse,\n BulkRestoreTaxRegionsRequest,\n BulkRestoreTaxRegionsResponse,\n BulkRestoreTaxRegionsResult,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n TaxRegionCreatedEnvelope,\n TaxRegionDeletedEnvelope,\n TaxRegionUpdatedEnvelope,\n UpdateTaxRegion,\n TaxRegionsQueryResult,\n TaxRegionsQueryBuilder,\n} from './billing-v1-tax-region-tax-regions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA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AAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AG1M5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,IAAMC,0BAET,mDAAkB,kBAAwB;AAIvC,IAAMC,0BAET,mDAAkB,kBAAwB;AAIvC,IAAMC,0BAET,mDAAkB,kBAAwB;","names":["createTaxRegion","deleteTaxRegion","getTaxRegion","onTaxRegionCreated","onTaxRegionDeleted","onTaxRegionUpdated","queryTaxRegions","updateTaxRegion","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","SortOrder","WebhookIdentityType","createTaxRegion","sdkTransformError","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","createTaxRegion","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","import_rest_modules","createTaxRegion","getTaxRegion","updateTaxRegion","deleteTaxRegion","queryTaxRegions","onTaxRegionCreated","onTaxRegionDeleted","onTaxRegionUpdated"]}
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /**
2
4
  * A tax region uses a location to define a specific tax treatment.
3
5
  * A location is defined by `country` and `subdivision`. The tax region also
@@ -419,6 +421,44 @@ declare enum WebhookIdentityType {
419
421
  }
420
422
  /** @enumType */
421
423
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
424
+ type CreateTaxRegionApplicationErrors = {
425
+ code?: 'ALREADY_EXISTS';
426
+ description?: string;
427
+ data?: ConflictErrorDetails;
428
+ } | {
429
+ code?: 'CALCULATOR_ID_NOT_FOUND';
430
+ description?: string;
431
+ data?: Record<string, any>;
432
+ } | {
433
+ code?: 'CALCULATOR_IS_NOT_SUPPORTED_FOR_THIS_TAX_REGION';
434
+ description?: string;
435
+ data?: Record<string, any>;
436
+ } | {
437
+ code?: 'INVALID_SUBDIVISION_FORMAT';
438
+ description?: string;
439
+ data?: Record<string, any>;
440
+ } | {
441
+ code?: 'SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY';
442
+ description?: string;
443
+ data?: Record<string, any>;
444
+ };
445
+ type UpdateTaxRegionApplicationErrors = {
446
+ code?: 'CALCULATOR_ID_NOT_FOUND';
447
+ description?: string;
448
+ data?: Record<string, any>;
449
+ } | {
450
+ code?: 'CALCULATOR_IS_NOT_SUPPORTED_FOR_THIS_TAX_REGION';
451
+ description?: string;
452
+ data?: Record<string, any>;
453
+ } | {
454
+ code?: 'INVALID_SUBDIVISION_FORMAT';
455
+ description?: string;
456
+ data?: Record<string, any>;
457
+ } | {
458
+ code?: 'SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY';
459
+ description?: string;
460
+ data?: Record<string, any>;
461
+ };
422
462
  interface BaseEventMetadata {
423
463
  /**
424
464
  * App instance ID.
@@ -467,13 +507,129 @@ interface TaxRegionCreatedEnvelope {
467
507
  entity: TaxRegion;
468
508
  metadata: EventMetadata;
469
509
  }
510
+ /** @permissionScope Manage Stores - all permissions
511
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
512
+ * @permissionScope Manage Stores
513
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
514
+ * @permissionScope Manage Restaurants - all permissions
515
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
516
+ * @permissionScope Manage eCommerce - all permissions
517
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
518
+ * @permissionScope Manage Orders
519
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
520
+ * @permissionId BILLING.TAX_REGION_READ
521
+ * @webhook
522
+ * @eventType wix.billing.v1.tax_region_created
523
+ * @serviceIdentifier wix.billing.v1.TaxRegionsService
524
+ * @slug created
525
+ * @documentationMaturity preview
526
+ */
527
+ declare function onTaxRegionCreated(handler: (event: TaxRegionCreatedEnvelope) => void | Promise<void>): void;
470
528
  interface TaxRegionDeletedEnvelope {
471
529
  metadata: EventMetadata;
472
530
  }
531
+ /**
532
+ * Triggered when a tax region is deleted.
533
+ * @permissionScope Manage Stores - all permissions
534
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
535
+ * @permissionScope Manage Stores
536
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
537
+ * @permissionScope Manage Restaurants - all permissions
538
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
539
+ * @permissionScope Manage eCommerce - all permissions
540
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
541
+ * @permissionScope Manage Orders
542
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
543
+ * @permissionId BILLING.TAX_REGION_READ
544
+ * @webhook
545
+ * @eventType wix.billing.v1.tax_region_deleted
546
+ * @serviceIdentifier wix.billing.v1.TaxRegionsService
547
+ * @slug deleted
548
+ * @documentationMaturity preview
549
+ */
550
+ declare function onTaxRegionDeleted(handler: (event: TaxRegionDeletedEnvelope) => void | Promise<void>): void;
473
551
  interface TaxRegionUpdatedEnvelope {
474
552
  entity: TaxRegion;
475
553
  metadata: EventMetadata;
476
554
  }
555
+ /**
556
+ * Triggered when a tax region is updated.
557
+ * @permissionScope Manage Stores - all permissions
558
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
559
+ * @permissionScope Manage Stores
560
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
561
+ * @permissionScope Manage Restaurants - all permissions
562
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
563
+ * @permissionScope Manage eCommerce - all permissions
564
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
565
+ * @permissionScope Manage Orders
566
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
567
+ * @permissionId BILLING.TAX_REGION_READ
568
+ * @webhook
569
+ * @eventType wix.billing.v1.tax_region_updated
570
+ * @serviceIdentifier wix.billing.v1.TaxRegionsService
571
+ * @slug updated
572
+ * @documentationMaturity preview
573
+ */
574
+ declare function onTaxRegionUpdated(handler: (event: TaxRegionUpdatedEnvelope) => void | Promise<void>): void;
575
+ type TaxRegionNonNullablePaths = `country` | `subdivision` | `appId` | `taxIncludedInPrice`;
576
+ /**
577
+ * Creates a tax region.
578
+ *
579
+ * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
580
+ *
581
+ * Wix uses tax regions to calculate tax.
582
+ * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
583
+ * @param taxRegion - Tax region to create.
584
+ * @public
585
+ * @documentationMaturity preview
586
+ * @requiredField taxRegion
587
+ * @requiredField taxRegion.appId
588
+ * @requiredField taxRegion.country
589
+ * @requiredField taxRegion.taxIncludedInPrice
590
+ * @permissionId BILLING.TAX_REGION_CREATE
591
+ * @applicableIdentity APP
592
+ * @returns Created tax region.
593
+ * @fqn wix.billing.v1.TaxRegionsService.CreateTaxRegion
594
+ */
595
+ declare function createTaxRegion(taxRegion: NonNullablePaths<TaxRegion, `appId` | `country` | `taxIncludedInPrice`>): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths> & {
596
+ __applicationErrorsType?: CreateTaxRegionApplicationErrors;
597
+ }>;
598
+ /**
599
+ * Retrieves a tax region.
600
+ * @param taxRegionId - ID of the tax region to retrieve.
601
+ * @public
602
+ * @documentationMaturity preview
603
+ * @requiredField taxRegionId
604
+ * @permissionId BILLING.TAX_REGION_READ
605
+ * @applicableIdentity APP
606
+ * @applicableIdentity VISITOR
607
+ * @returns Retrieved tax region.
608
+ * @fqn wix.billing.v1.TaxRegionsService.GetTaxRegion
609
+ */
610
+ declare function getTaxRegion(taxRegionId: string): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths>>;
611
+ /**
612
+ * Updates a tax region.
613
+ *
614
+ * Each time the tax region is updated, `revision` increments by 1.
615
+ * The current `revision` must be passed when updating the tax region.
616
+ * This ensures you're working with the latest tax region and prevents
617
+ * unintended overwrites.
618
+ * @param _id - Tax region ID.
619
+ * @public
620
+ * @documentationMaturity preview
621
+ * @requiredField _id
622
+ * @requiredField taxRegion
623
+ * @requiredField taxRegion.revision
624
+ * @param taxRegion - Tax region info.
625
+ * @permissionId BILLING.TAX_REGION_UPDATE
626
+ * @applicableIdentity APP
627
+ * @returns Updated tax region.
628
+ * @fqn wix.billing.v1.TaxRegionsService.UpdateTaxRegion
629
+ */
630
+ declare function updateTaxRegion(_id: string, taxRegion: NonNullablePaths<UpdateTaxRegion, `revision`>): Promise<NonNullablePaths<TaxRegion, TaxRegionNonNullablePaths> & {
631
+ __applicationErrorsType?: UpdateTaxRegionApplicationErrors;
632
+ }>;
477
633
  interface UpdateTaxRegion {
478
634
  /**
479
635
  * Tax region ID.
@@ -520,6 +676,42 @@ interface UpdateTaxRegion {
520
676
  */
521
677
  _updatedDate?: Date | null;
522
678
  }
679
+ /**
680
+ * Deletes a tax region.
681
+ *
682
+ * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
683
+ * @param taxRegionId - ID of the tax region to delete.
684
+ * @public
685
+ * @documentationMaturity preview
686
+ * @requiredField taxRegionId
687
+ * @permissionId BILLING.TAX_REGION_DELETE
688
+ * @applicableIdentity APP
689
+ * @fqn wix.billing.v1.TaxRegionsService.DeleteTaxRegion
690
+ */
691
+ declare function deleteTaxRegion(taxRegionId: string): Promise<void>;
692
+ /**
693
+ * Creates a query to retrieve a list of tax regions.
694
+ *
695
+ * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
696
+ *
697
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
698
+ *
699
+ * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.
700
+ *
701
+ * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
702
+ * + `ascending("_id")`
703
+ *
704
+ * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending("country")` and then `ascending("subdivision")`, the results are sorted first by the `"country"`, and then, if there are multiple results with the same `"country"`, the items are sorted by `"subdivision"`.
705
+ *
706
+ * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.
707
+ * @public
708
+ * @documentationMaturity preview
709
+ * @permissionId BILLING.TAX_REGION_READ
710
+ * @applicableIdentity APP
711
+ * @applicableIdentity VISITOR
712
+ * @fqn wix.billing.v1.TaxRegionsService.QueryTaxRegions
713
+ */
714
+ declare function queryTaxRegions(): TaxRegionsQueryBuilder;
523
715
  interface QueryCursorResult {
524
716
  cursors: Cursors;
525
717
  hasNext: () => boolean;
@@ -598,4 +790,4 @@ interface TaxRegionsQueryBuilder {
598
790
  find: () => Promise<TaxRegionsQueryResult>;
599
791
  }
600
792
 
601
- export { type ApplicationError as A, type BulkCreateTaxRegionRequest as B, type CreateTaxRegionRequest as C, type DeleteTaxRegionRequest as D, type BulkRestoreTaxRegionsResult as E, type DomainEvent as F, type GetTaxRegionRequest as G, type DomainEventBodyOneOf as H, type ItemMetadata as I, type EntityCreatedEvent as J, type EntityUpdatedEvent as K, type EntityDeletedEvent as L, type ActionEvent as M, type MessageEnvelope as N, type IdentificationData as O, type IdentificationDataIdOneOf as P, type QueryTaxRegionsRequest as Q, type RestoreInfo as R, SortOrder as S, type TaxRegion as T, type UpdateTaxRegion as U, type BaseEventMetadata as V, WebhookIdentityType as W, type EventMetadata as X, type TaxRegionsQueryResult as Y, type TaxRegionsQueryBuilder as a, type TaxRegionCreatedEnvelope as b, type TaxRegionDeletedEnvelope as c, type TaxRegionUpdatedEnvelope as d, type CreateTaxRegionResponse as e, type ConflictErrorDetails as f, type BulkCreateTaxRegionResponse as g, type BulkCreateTaxRegionResult as h, type BulkActionMetadata as i, type GetTaxRegionResponse as j, type UpdateTaxRegionRequest as k, type UpdateTaxRegionResponse as l, type DeleteTaxRegionResponse as m, type CursorQuery as n, type CursorQueryPagingMethodOneOf as o, type Sorting as p, type CursorPaging as q, type QueryTaxRegionsResponse as r, type CursorPagingMetadata as s, type Cursors as t, type CreateOrGetTaxRegionWithoutValidationRequest as u, type CreateOrGetTaxRegionWithoutValidationResponse as v, type DeleteTaxRegionWithoutDomainEventsRequest as w, type DeleteTaxRegionWithoutDomainEventsResponse as x, type BulkRestoreTaxRegionsRequest as y, type BulkRestoreTaxRegionsResponse as z };
793
+ export { type ActionEvent, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateTaxRegionRequest, type BulkCreateTaxRegionResponse, type BulkCreateTaxRegionResult, type BulkRestoreTaxRegionsRequest, type BulkRestoreTaxRegionsResponse, type BulkRestoreTaxRegionsResult, type ConflictErrorDetails, type CreateOrGetTaxRegionWithoutValidationRequest, type CreateOrGetTaxRegionWithoutValidationResponse, type CreateTaxRegionApplicationErrors, type CreateTaxRegionRequest, type CreateTaxRegionResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteTaxRegionRequest, type DeleteTaxRegionResponse, type DeleteTaxRegionWithoutDomainEventsRequest, type DeleteTaxRegionWithoutDomainEventsResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetTaxRegionRequest, type GetTaxRegionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type QueryTaxRegionsRequest, type QueryTaxRegionsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type TaxRegion, type TaxRegionCreatedEnvelope, type TaxRegionDeletedEnvelope, type TaxRegionUpdatedEnvelope, type TaxRegionsQueryBuilder, type TaxRegionsQueryResult, type UpdateTaxRegion, type UpdateTaxRegionApplicationErrors, type UpdateTaxRegionRequest, type UpdateTaxRegionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createTaxRegion, deleteTaxRegion, getTaxRegion, onTaxRegionCreated, onTaxRegionDeleted, onTaxRegionUpdated, queryTaxRegions, updateTaxRegion };