@wix/auto_sdk_ecom_tax-groups 1.0.22 → 1.0.23

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 TaxGroup, U as UpdateTaxGroup, a as TaxGroupsQueryBuilder, L as ListDefaultTaxGroupsResponse, b as ListDefaultTaxGroupsByAppIdsResponse, c as TaxGroupCreatedEnvelope, d as TaxGroupDeletedEnvelope, e as TaxGroupUpdatedEnvelope } from './billing-v1-tax-group-tax-groups.universal-BpLT_NlU.js';
3
- export { y as ActionEvent, A as ApplicationError, H as BaseEventMetadata, B as BulkActionMetadata, C as CreateTaxGroupRequest, f as CreateTaxGroupResponse, n as CursorPaging, p as CursorPagingMetadata, q as Cursors, D as DeleteTaxGroupRequest, j as DeleteTaxGroupResponse, u as DomainEvent, v as DomainEventBodyOneOf, E as EntityCreatedEvent, x as EntityDeletedEvent, w as EntityUpdatedEvent, J as EventMetadata, G as GetTaxGroupRequest, g as GetTaxGroupResponse, z as IdentificationData, F as IdentificationDataIdOneOf, I as ItemMetadata, s as ListDefaultTaxGroupsByAppIdsRequest, t as ListDefaultTaxGroupsByAppIdsResult, r as ListDefaultTaxGroupsRequest, M as MessageEnvelope, P as Paging, Q as QueryTaxGroupsRequest, o as QueryTaxGroupsResponse, k as QueryV2, l as QueryV2PagingMethodOneOf, R as RestoreInfo, S as SortOrder, m as Sorting, K as TaxGroupsQueryResult, h as UpdateTaxGroupRequest, i as UpdateTaxGroupResponse, W as WebhookIdentityType } from './billing-v1-tax-group-tax-groups.universal-BpLT_NlU.js';
2
+ import { TaxGroup, UpdateTaxGroup, UpdateTaxGroupApplicationErrors, TaxGroupsQueryBuilder, ListDefaultTaxGroupsResponse, ListDefaultTaxGroupsByAppIdsResponse, TaxGroupCreatedEnvelope, TaxGroupDeletedEnvelope, TaxGroupUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, ApplicationError, BaseEventMetadata, BulkActionMetadata, CreateTaxGroupRequest, CreateTaxGroupResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteTaxGroupRequest, DeleteTaxGroupResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetTaxGroupRequest, GetTaxGroupResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, ListDefaultTaxGroupsByAppIdsRequest, ListDefaultTaxGroupsByAppIdsResult, ListDefaultTaxGroupsRequest, MessageEnvelope, Paging, QueryTaxGroupsRequest, QueryTaxGroupsResponse, QueryV2, QueryV2PagingMethodOneOf, RestoreInfo, SortOrder, Sorting, TaxGroupsQueryResult, UpdateTaxGroupRequest, UpdateTaxGroupResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function createTaxGroup$1(httpClient: HttpClient): CreateTaxGroupSignature;
6
6
  interface CreateTaxGroupSignature {
@@ -40,7 +40,9 @@ interface UpdateTaxGroupSignature {
40
40
  * @param - Tax group info.
41
41
  * @returns Updated tax group.
42
42
  */
43
- (_id: string, taxGroup: UpdateTaxGroup): Promise<TaxGroup>;
43
+ (_id: string, taxGroup: UpdateTaxGroup): Promise<TaxGroup & {
44
+ __applicationErrorsType?: UpdateTaxGroupApplicationErrors | undefined;
45
+ }>;
44
46
  }
45
47
  declare function deleteTaxGroup$1(httpClient: HttpClient): DeleteTaxGroupSignature;
46
48
  interface DeleteTaxGroupSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/billing-v1-tax-group-tax-groups.public.ts","../../src/billing-v1-tax-group-tax-groups.universal.ts","../../src/billing-v1-tax-group-tax-groups.http.ts","../../src/billing-v1-tax-group-tax-groups.context.ts"],"sourcesContent":["export * from './src/billing-v1-tax-group-tax-groups.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 ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsResponse,\n TaxGroup,\n TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n TaxGroupsQueryBuilder,\n UpdateTaxGroup,\n createTaxGroup as universalCreateTaxGroup,\n deleteTaxGroup as universalDeleteTaxGroup,\n getTaxGroup as universalGetTaxGroup,\n listDefaultTaxGroups as universalListDefaultTaxGroups,\n listDefaultTaxGroupsByAppIds as universalListDefaultTaxGroupsByAppIds,\n queryTaxGroups as universalQueryTaxGroups,\n updateTaxGroup as universalUpdateTaxGroup,\n} from './billing-v1-tax-group-tax-groups.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function createTaxGroup(\n httpClient: HttpClient\n): CreateTaxGroupSignature {\n return (taxGroup: NonNullablePaths<TaxGroup, `name`>) =>\n universalCreateTaxGroup(\n taxGroup,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateTaxGroupSignature {\n /**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n * @param - Tax group to create.\n * @returns Created tax group.\n */\n (taxGroup: TaxGroup): Promise<TaxGroup>;\n}\n\nexport function getTaxGroup(httpClient: HttpClient): GetTaxGroupSignature {\n return (taxGroupId: string) =>\n universalGetTaxGroup(\n taxGroupId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTaxGroupSignature {\n /**\n * Retrieves a tax group.\n * @param - ID of the tax group to retrieve.\n * @returns Retrieved tax group.\n */\n (taxGroupId: string): Promise<TaxGroup>;\n}\n\nexport function updateTaxGroup(\n httpClient: HttpClient\n): UpdateTaxGroupSignature {\n return (\n _id: string,\n taxGroup: NonNullablePaths<UpdateTaxGroup, `name` | `revision`>\n ) =>\n universalUpdateTaxGroup(\n _id,\n taxGroup,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateTaxGroupSignature {\n /**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n * @param - Tax group ID.\n * @param - Tax group info.\n * @returns Updated tax group.\n */\n (_id: string, taxGroup: UpdateTaxGroup): Promise<TaxGroup>;\n}\n\nexport function deleteTaxGroup(\n httpClient: HttpClient\n): DeleteTaxGroupSignature {\n return (taxGroupId: string) =>\n universalDeleteTaxGroup(\n taxGroupId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteTaxGroupSignature {\n /**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n * @param - ID of the tax group to delete.\n */\n (taxGroupId: string): Promise<void>;\n}\n\nexport function queryTaxGroups(\n httpClient: HttpClient\n): QueryTaxGroupsSignature {\n return () =>\n universalQueryTaxGroups(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTaxGroupsSignature {\n /**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n */\n (): TaxGroupsQueryBuilder;\n}\n\nexport function listDefaultTaxGroups(\n httpClient: HttpClient\n): ListDefaultTaxGroupsSignature {\n return () =>\n universalListDefaultTaxGroups(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListDefaultTaxGroupsSignature {\n /**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n */\n (): Promise<ListDefaultTaxGroupsResponse>;\n}\n\nexport function listDefaultTaxGroupsByAppIds(\n httpClient: HttpClient\n): ListDefaultTaxGroupsByAppIdsSignature {\n return (appIds: string[]) =>\n universalListDefaultTaxGroupsByAppIds(\n appIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListDefaultTaxGroupsByAppIdsSignature {\n /**\n * Retrieves default tax groups for specific apps.\n * @param - App IDs to retrieve default tax groups for.\n */\n (appIds: string[]): Promise<ListDefaultTaxGroupsByAppIdsResponse>;\n}\n\nexport const onTaxGroupCreated = EventDefinition(\n 'wix.billing.v1.tax_group_created',\n true,\n (event: TaxGroupCreatedEnvelope) =>\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)<TaxGroupCreatedEnvelope>();\nexport const onTaxGroupDeleted = EventDefinition(\n 'wix.billing.v1.tax_group_deleted',\n true,\n (event: TaxGroupDeletedEnvelope) =>\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)<TaxGroupDeletedEnvelope>();\nexport const onTaxGroupUpdated = EventDefinition(\n 'wix.billing.v1.tax_group_updated',\n true,\n (event: TaxGroupUpdatedEnvelope) =>\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)<TaxGroupUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n CreateTaxGroupRequest,\n CreateTaxGroupResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteTaxGroupRequest,\n DeleteTaxGroupResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetTaxGroupRequest,\n GetTaxGroupResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n ListDefaultTaxGroupsByAppIdsRequest,\n ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsByAppIdsResult,\n ListDefaultTaxGroupsRequest,\n ListDefaultTaxGroupsResponse,\n MessageEnvelope,\n Paging,\n QueryTaxGroupsRequest,\n QueryTaxGroupsResponse,\n QueryV2,\n QueryV2PagingMethodOneOf,\n RestoreInfo,\n SortOrder,\n Sorting,\n TaxGroup,\n TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n TaxGroupsQueryBuilder,\n TaxGroupsQueryResult,\n UpdateTaxGroup,\n UpdateTaxGroupRequest,\n UpdateTaxGroupResponse,\n WebhookIdentityType,\n} from './billing-v1-tax-group-tax-groups.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 ambassadorWixBillingV1TaxGroup from './billing-v1-tax-group-tax-groups.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A tax group is a category of specific line items grouped together based on their tax treatment.\n * You can create new tax groups to apply distinct tax rates and rules.\n */\nexport interface TaxGroup {\n /**\n * Tax group ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Tax group name.\n * @minLength 1\n * @maxLength 200\n */\n name?: string;\n /**\n * Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes,\n * the current revision must be passed when updating the tax group.\n *\n * Ignored when creating a tax group.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax group was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax group was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface CreateTaxGroupRequest {\n /** Tax group to create. */\n taxGroup: TaxGroup;\n}\n\nexport interface CreateTaxGroupResponse {\n /** Created tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface GetTaxGroupRequest {\n /**\n * ID of the tax group to retrieve.\n * @format GUID\n */\n taxGroupId: string;\n}\n\nexport interface GetTaxGroupResponse {\n /** Retrieved tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface UpdateTaxGroupRequest {\n /** Tax group info to update. */\n taxGroup: TaxGroup;\n}\n\nexport interface UpdateTaxGroupResponse {\n /** Updated tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface DeleteTaxGroupRequest {\n /**\n * ID of the tax group to delete.\n * @format GUID\n */\n taxGroupId: string;\n}\n\nexport interface DeleteTaxGroupResponse {}\n\nexport interface QueryTaxGroupsRequest {\n /** Query options. */\n query: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\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 */\n sort?: Sorting[];\n /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */\n fields?: string[];\n /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * 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 Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryTaxGroupsResponse {\n /** Retrieved default tax groups. */\n taxGroups?: TaxGroup[];\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 ListDefaultTaxGroupsRequest {}\n\nexport interface ListDefaultTaxGroupsResponse {\n /** Retrieved default tax groups. */\n taxGroups?: TaxGroup[];\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsRequest {\n /**\n * App IDs to retrieve default tax groups for.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n */\n appIds: string[];\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsResponse {\n /**\n * Retrieved default tax groups.\n * @minSize 1\n * @maxSize 300\n */\n results?: ListDefaultTaxGroupsByAppIdsResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsResult {\n /** Information about success or failure to retrieve default tax groups. */\n taxGroupMetadata?: ItemMetadata;\n /** Retrieved default tax groups. */\n taxGroup?: TaxGroup;\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 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 TaxGroupCreatedEnvelope {\n entity: TaxGroup;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group is created.\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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_created\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupCreated(\n handler: (event: TaxGroupCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxGroupDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group 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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_deleted\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupDeleted(\n handler: (event: TaxGroupDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxGroupUpdatedEnvelope {\n entity: TaxGroup;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group 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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_updated\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupUpdated(\n handler: (event: TaxGroupUpdatedEnvelope) => void | Promise<void>\n): void;\n\ntype TaxGroupNonNullablePaths = `name`;\n\n/**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n * @param taxGroup - Tax group to create.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroup\n * @requiredField taxGroup.name\n * @permissionId BILLING.TAX_GROUP_CREATE\n * @applicableIdentity APP\n * @returns Created tax group.\n * @fqn wix.billing.v1.TaxGroups.CreateTaxGroup\n */\nexport async function createTaxGroup(\n taxGroup: NonNullablePaths<TaxGroup, `name`>\n): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taxGroup: taxGroup });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.createTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxGroup: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroup']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a tax group.\n * @param taxGroupId - ID of the tax group to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroupId\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns Retrieved tax group.\n * @fqn wix.billing.v1.TaxGroups.GetTaxGroup\n */\nexport async function getTaxGroup(\n taxGroupId: string\n): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxGroupId: taxGroupId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.getTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxGroupId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroupId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n * @param _id - Tax group ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField taxGroup\n * @requiredField taxGroup.name\n * @requiredField taxGroup.revision\n * @param taxGroup - Tax group info.\n * @permissionId BILLING.TAX_GROUP_UPDATE\n * @applicableIdentity APP\n * @returns Updated tax group.\n * @fqn wix.billing.v1.TaxGroups.UpdateTaxGroup\n */\nexport async function updateTaxGroup(\n _id: string,\n taxGroup: NonNullablePaths<UpdateTaxGroup, `name` | `revision`>\n): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxGroup: { ...taxGroup, id: _id },\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.updateTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { taxGroup: '$[1]' },\n explicitPathsToArguments: { 'taxGroup.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'taxGroup']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTaxGroup {\n /**\n * Tax group ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Tax group name.\n * @minLength 1\n * @maxLength 200\n */\n name?: string;\n /**\n * Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes,\n * the current revision must be passed when updating the tax group.\n *\n * Ignored when creating a tax group.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax group was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax group was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\n/**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n * @param taxGroupId - ID of the tax group to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroupId\n * @permissionId BILLING.TAX_GROUP_DELETE\n * @applicableIdentity APP\n * @fqn wix.billing.v1.TaxGroups.DeleteTaxGroup\n */\nexport async function deleteTaxGroup(taxGroupId: 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 taxGroupId: taxGroupId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.deleteTaxGroup(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: { taxGroupId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroupId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.QueryTaxGroups\n */\nexport function queryTaxGroups(): TaxGroupsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n TaxGroup,\n 'CURSOR',\n QueryTaxGroupsRequest,\n QueryTaxGroupsResponse\n >({\n func: async (payload: QueryTaxGroupsRequest) => {\n const reqOpts = ambassadorWixBillingV1TaxGroup.queryTaxGroups(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: QueryTaxGroupsRequest['query']) => {\n const args = [query, {}] as [QueryTaxGroupsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTaxGroupsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.taxGroups,\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 TaxGroupsQueryResult extends QueryCursorResult {\n items: TaxGroup[];\n query: TaxGroupsQueryBuilder;\n next: () => Promise<TaxGroupsQueryResult>;\n prev: () => Promise<TaxGroupsQueryResult>;\n}\n\nexport interface TaxGroupsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any[]\n ) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName: '_createdDate' | '_updatedDate',\n value: boolean\n ) => TaxGroupsQueryBuilder;\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<'_id' | 'name' | '_createdDate' | '_updatedDate'>\n ) => TaxGroupsQueryBuilder;\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<'_id' | 'name' | '_createdDate' | '_updatedDate'>\n ) => TaxGroupsQueryBuilder;\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) => TaxGroupsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TaxGroupsQueryResult>;\n}\n\n/**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroups\n */\nexport async function listDefaultTaxGroups(): Promise<\n NonNullablePaths<\n ListDefaultTaxGroupsResponse,\n {\n [P in TaxGroupNonNullablePaths]: `taxGroups.${number}.${P}`;\n }[TaxGroupNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.listDefaultTaxGroups(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves default tax groups for specific apps.\n * @param appIds - App IDs to retrieve default tax groups for.\n * @public\n * @documentationMaturity preview\n * @requiredField appIds\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroupsByAppIds\n */\nexport async function listDefaultTaxGroupsByAppIds(\n appIds: string[]\n): Promise<\n NonNullablePaths<\n ListDefaultTaxGroupsByAppIdsResponse,\n | `results`\n | `results.${number}.taxGroupMetadata.originalIndex`\n | `results.${number}.taxGroupMetadata.success`\n | `results.${number}.taxGroupMetadata.error.code`\n | `results.${number}.taxGroupMetadata.error.description`\n | {\n [P in TaxGroupNonNullablePaths]: `results.${number}.taxGroup.${P}`;\n }[TaxGroupNonNullablePaths]\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ appIds: appIds });\n\n const reqOpts =\n ambassadorWixBillingV1TaxGroup.listDefaultTaxGroupsByAppIds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { 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 resolveWixBillingV1TaxGroupsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/tax-groups',\n destPath: '/v1/tax-groups',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/tax-groups',\n destPath: '/v1/tax-groups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-groups';\n\n/**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n */\nexport function createTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __createTaxGroup({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.CreateTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTaxGroup;\n}\n\n/** Retrieves a tax group. */\nexport function getTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __getTaxGroup({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.GetTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroupId}',\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: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTaxGroup;\n}\n\n/**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n */\nexport function updateTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __updateTaxGroup({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'PATCH' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.UpdateTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroup.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: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTaxGroup;\n}\n\n/**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n */\nexport function deleteTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __deleteTaxGroup({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'DELETE' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.DeleteTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroupId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTaxGroup;\n}\n\n/**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n */\nexport function queryTaxGroups(payload: object): RequestOptionsFactory<any> {\n function __queryTaxGroups({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.QueryTaxGroups',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/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: 'taxGroups.createdDate' },\n { path: 'taxGroups.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTaxGroups;\n}\n\n/**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n */\nexport function listDefaultTaxGroups(\n payload: object\n): RequestOptionsFactory<any> {\n function __listDefaultTaxGroups({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.ListDefaultTaxGroups',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/default-tax-groups',\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: 'taxGroups.createdDate' },\n { path: 'taxGroups.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listDefaultTaxGroups;\n}\n\n/** Retrieves default tax groups for specific apps. */\nexport function listDefaultTaxGroupsByAppIds(\n payload: object\n): RequestOptionsFactory<any> {\n function __listDefaultTaxGroupsByAppIds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.ListDefaultTaxGroupsByAppIds',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/list-default-tax-groups-by-app-ids',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.taxGroup.createdDate' },\n { path: 'results.taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listDefaultTaxGroupsByAppIds;\n}\n","import {\n createTaxGroup as publicCreateTaxGroup,\n getTaxGroup as publicGetTaxGroup,\n updateTaxGroup as publicUpdateTaxGroup,\n deleteTaxGroup as publicDeleteTaxGroup,\n queryTaxGroups as publicQueryTaxGroups,\n listDefaultTaxGroups as publicListDefaultTaxGroups,\n listDefaultTaxGroupsByAppIds as publicListDefaultTaxGroupsByAppIds,\n} from './billing-v1-tax-group-tax-groups.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 { onTaxGroupCreated as publicOnTaxGroupCreated } from './billing-v1-tax-group-tax-groups.public.js';\nimport { onTaxGroupDeleted as publicOnTaxGroupDeleted } from './billing-v1-tax-group-tax-groups.public.js';\nimport { onTaxGroupUpdated as publicOnTaxGroupUpdated } from './billing-v1-tax-group-tax-groups.public.js';\n\nexport const createTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicCreateTaxGroup> & typeof publicCreateTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicCreateTaxGroup);\nexport const getTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicGetTaxGroup> & typeof publicGetTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicGetTaxGroup);\nexport const updateTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicUpdateTaxGroup> & typeof publicUpdateTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicUpdateTaxGroup);\nexport const deleteTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicDeleteTaxGroup> & typeof publicDeleteTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicDeleteTaxGroup);\nexport const queryTaxGroups: MaybeContext<\n BuildRESTFunction<typeof publicQueryTaxGroups> & typeof publicQueryTaxGroups\n> = /*#__PURE__*/ createRESTModule(publicQueryTaxGroups);\nexport const listDefaultTaxGroups: MaybeContext<\n BuildRESTFunction<typeof publicListDefaultTaxGroups> &\n typeof publicListDefaultTaxGroups\n> = /*#__PURE__*/ createRESTModule(publicListDefaultTaxGroups);\nexport const listDefaultTaxGroupsByAppIds: MaybeContext<\n BuildRESTFunction<typeof publicListDefaultTaxGroupsByAppIds> &\n typeof publicListDefaultTaxGroupsByAppIds\n> = /*#__PURE__*/ createRESTModule(publicListDefaultTaxGroupsByAppIds);\n/**\n * Triggered when a tax group is created.\n */\nexport const onTaxGroupCreated: BuildEventDefinition<\n typeof publicOnTaxGroupCreated\n> = createEventModule(publicOnTaxGroupCreated);\n/**\n * Triggered when a tax group is deleted.\n */\nexport const onTaxGroupDeleted: BuildEventDefinition<\n typeof publicOnTaxGroupDeleted\n> = createEventModule(publicOnTaxGroupDeleted);\n/**\n * Triggered when a tax group is updated.\n */\nexport const onTaxGroupUpdated: BuildEventDefinition<\n typeof publicOnTaxGroupUpdated\n> = createEventModule(publicOnTaxGroupUpdated);\n\nexport {\n SortOrder,\n WebhookIdentityType,\n} from './billing-v1-tax-group-tax-groups.universal.js';\nexport {\n TaxGroup,\n CreateTaxGroupRequest,\n CreateTaxGroupResponse,\n GetTaxGroupRequest,\n GetTaxGroupResponse,\n UpdateTaxGroupRequest,\n UpdateTaxGroupResponse,\n DeleteTaxGroupRequest,\n DeleteTaxGroupResponse,\n QueryTaxGroupsRequest,\n QueryV2,\n QueryV2PagingMethodOneOf,\n Sorting,\n Paging,\n CursorPaging,\n QueryTaxGroupsResponse,\n CursorPagingMetadata,\n Cursors,\n ListDefaultTaxGroupsRequest,\n ListDefaultTaxGroupsResponse,\n ListDefaultTaxGroupsByAppIdsRequest,\n ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsByAppIdsResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\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 TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n UpdateTaxGroup,\n TaxGroupsQueryResult,\n TaxGroupsQueryBuilder,\n} from './billing-v1-tax-group-tax-groups.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,gCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAYd,SAAS,eAAe,SAA6C;AAC1E,WAAS,iBAAiB,EAAE,KAAK,GAAQ;AACvC,UAAM,qBAAiB,uCAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,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;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA2B;;;AGxO3B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,gCAGK,2DAAiBA,6BAAkC;AAI9D,IAAMC,yBAET,mDAAkB,iBAAuB;AAItC,IAAMC,yBAET,mDAAkB,iBAAuB;AAItC,IAAMC,yBAET,mDAAkB,iBAAuB;","names":["createTaxGroup","deleteTaxGroup","getTaxGroup","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","onTaxGroupCreated","onTaxGroupDeleted","onTaxGroupUpdated","queryTaxGroups","updateTaxGroup","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","SortOrder","WebhookIdentityType","createTaxGroup","sdkTransformError","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","createTaxGroup","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","import_rest_modules","createTaxGroup","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","onTaxGroupCreated","onTaxGroupDeleted","onTaxGroupUpdated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/billing-v1-tax-group-tax-groups.public.ts","../../src/billing-v1-tax-group-tax-groups.universal.ts","../../src/billing-v1-tax-group-tax-groups.http.ts","../../src/billing-v1-tax-group-tax-groups.context.ts"],"sourcesContent":["export * from './src/billing-v1-tax-group-tax-groups.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 ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsResponse,\n TaxGroup,\n TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n TaxGroupsQueryBuilder,\n UpdateTaxGroup,\n UpdateTaxGroupApplicationErrors,\n createTaxGroup as universalCreateTaxGroup,\n deleteTaxGroup as universalDeleteTaxGroup,\n getTaxGroup as universalGetTaxGroup,\n listDefaultTaxGroups as universalListDefaultTaxGroups,\n listDefaultTaxGroupsByAppIds as universalListDefaultTaxGroupsByAppIds,\n queryTaxGroups as universalQueryTaxGroups,\n updateTaxGroup as universalUpdateTaxGroup,\n} from './billing-v1-tax-group-tax-groups.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function createTaxGroup(\n httpClient: HttpClient\n): CreateTaxGroupSignature {\n return (taxGroup: NonNullablePaths<TaxGroup, `name`>) =>\n universalCreateTaxGroup(\n taxGroup,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateTaxGroupSignature {\n /**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n * @param - Tax group to create.\n * @returns Created tax group.\n */\n (taxGroup: TaxGroup): Promise<TaxGroup>;\n}\n\nexport function getTaxGroup(httpClient: HttpClient): GetTaxGroupSignature {\n return (taxGroupId: string) =>\n universalGetTaxGroup(\n taxGroupId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTaxGroupSignature {\n /**\n * Retrieves a tax group.\n * @param - ID of the tax group to retrieve.\n * @returns Retrieved tax group.\n */\n (taxGroupId: string): Promise<TaxGroup>;\n}\n\nexport function updateTaxGroup(\n httpClient: HttpClient\n): UpdateTaxGroupSignature {\n return (\n _id: string,\n taxGroup: NonNullablePaths<UpdateTaxGroup, `name` | `revision`>\n ) =>\n universalUpdateTaxGroup(\n _id,\n taxGroup,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateTaxGroupSignature {\n /**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n * @param - Tax group ID.\n * @param - Tax group info.\n * @returns Updated tax group.\n */\n (_id: string, taxGroup: UpdateTaxGroup): Promise<\n TaxGroup & {\n __applicationErrorsType?: UpdateTaxGroupApplicationErrors | undefined;\n }\n >;\n}\n\nexport function deleteTaxGroup(\n httpClient: HttpClient\n): DeleteTaxGroupSignature {\n return (taxGroupId: string) =>\n universalDeleteTaxGroup(\n taxGroupId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteTaxGroupSignature {\n /**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n * @param - ID of the tax group to delete.\n */\n (taxGroupId: string): Promise<void>;\n}\n\nexport function queryTaxGroups(\n httpClient: HttpClient\n): QueryTaxGroupsSignature {\n return () =>\n universalQueryTaxGroups(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryTaxGroupsSignature {\n /**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n */\n (): TaxGroupsQueryBuilder;\n}\n\nexport function listDefaultTaxGroups(\n httpClient: HttpClient\n): ListDefaultTaxGroupsSignature {\n return () =>\n universalListDefaultTaxGroups(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListDefaultTaxGroupsSignature {\n /**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n */\n (): Promise<ListDefaultTaxGroupsResponse>;\n}\n\nexport function listDefaultTaxGroupsByAppIds(\n httpClient: HttpClient\n): ListDefaultTaxGroupsByAppIdsSignature {\n return (appIds: string[]) =>\n universalListDefaultTaxGroupsByAppIds(\n appIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListDefaultTaxGroupsByAppIdsSignature {\n /**\n * Retrieves default tax groups for specific apps.\n * @param - App IDs to retrieve default tax groups for.\n */\n (appIds: string[]): Promise<ListDefaultTaxGroupsByAppIdsResponse>;\n}\n\nexport const onTaxGroupCreated = EventDefinition(\n 'wix.billing.v1.tax_group_created',\n true,\n (event: TaxGroupCreatedEnvelope) =>\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)<TaxGroupCreatedEnvelope>();\nexport const onTaxGroupDeleted = EventDefinition(\n 'wix.billing.v1.tax_group_deleted',\n true,\n (event: TaxGroupDeletedEnvelope) =>\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)<TaxGroupDeletedEnvelope>();\nexport const onTaxGroupUpdated = EventDefinition(\n 'wix.billing.v1.tax_group_updated',\n true,\n (event: TaxGroupUpdatedEnvelope) =>\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)<TaxGroupUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n CreateTaxGroupRequest,\n CreateTaxGroupResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteTaxGroupRequest,\n DeleteTaxGroupResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetTaxGroupRequest,\n GetTaxGroupResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n ListDefaultTaxGroupsByAppIdsRequest,\n ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsByAppIdsResult,\n ListDefaultTaxGroupsRequest,\n ListDefaultTaxGroupsResponse,\n MessageEnvelope,\n Paging,\n QueryTaxGroupsRequest,\n QueryTaxGroupsResponse,\n QueryV2,\n QueryV2PagingMethodOneOf,\n RestoreInfo,\n SortOrder,\n Sorting,\n TaxGroup,\n TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n TaxGroupsQueryBuilder,\n TaxGroupsQueryResult,\n UpdateTaxGroup,\n UpdateTaxGroupRequest,\n UpdateTaxGroupResponse,\n WebhookIdentityType,\n} from './billing-v1-tax-group-tax-groups.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 ambassadorWixBillingV1TaxGroup from './billing-v1-tax-group-tax-groups.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A tax group is a category of specific line items grouped together based on their tax treatment.\n * You can create new tax groups to apply distinct tax rates and rules.\n */\nexport interface TaxGroup {\n /**\n * Tax group ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Tax group name.\n * @minLength 1\n * @maxLength 200\n */\n name?: string;\n /**\n * Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes,\n * the current revision must be passed when updating the tax group.\n *\n * Ignored when creating a tax group.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax group was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax group was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface CreateTaxGroupRequest {\n /** Tax group to create. */\n taxGroup: TaxGroup;\n}\n\nexport interface CreateTaxGroupResponse {\n /** Created tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface GetTaxGroupRequest {\n /**\n * ID of the tax group to retrieve.\n * @format GUID\n */\n taxGroupId: string;\n}\n\nexport interface GetTaxGroupResponse {\n /** Retrieved tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface UpdateTaxGroupRequest {\n /** Tax group info to update. */\n taxGroup: TaxGroup;\n}\n\nexport interface UpdateTaxGroupResponse {\n /** Updated tax group. */\n taxGroup?: TaxGroup;\n}\n\nexport interface DeleteTaxGroupRequest {\n /**\n * ID of the tax group to delete.\n * @format GUID\n */\n taxGroupId: string;\n}\n\nexport interface DeleteTaxGroupResponse {}\n\nexport interface QueryTaxGroupsRequest {\n /** Query options. */\n query: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\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 */\n sort?: Sorting[];\n /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */\n fields?: string[];\n /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * 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 Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryTaxGroupsResponse {\n /** Retrieved default tax groups. */\n taxGroups?: TaxGroup[];\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 ListDefaultTaxGroupsRequest {}\n\nexport interface ListDefaultTaxGroupsResponse {\n /** Retrieved default tax groups. */\n taxGroups?: TaxGroup[];\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsRequest {\n /**\n * App IDs to retrieve default tax groups for.\n * @minSize 1\n * @maxSize 300\n * @minLength 1\n */\n appIds: string[];\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsResponse {\n /**\n * Retrieved default tax groups.\n * @minSize 1\n * @maxSize 300\n */\n results?: ListDefaultTaxGroupsByAppIdsResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ListDefaultTaxGroupsByAppIdsResult {\n /** Information about success or failure to retrieve default tax groups. */\n taxGroupMetadata?: ItemMetadata;\n /** Retrieved default tax groups. */\n taxGroup?: TaxGroup;\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 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 UpdateTaxGroupApplicationErrors = {\n code?: 'ILLEGAL_UPDATE_ON_SYSTEM_DEFINED_TAX_GROUP';\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 TaxGroupCreatedEnvelope {\n entity: TaxGroup;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group is created.\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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_created\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupCreated(\n handler: (event: TaxGroupCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxGroupDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group 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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_deleted\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupDeleted(\n handler: (event: TaxGroupDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaxGroupUpdatedEnvelope {\n entity: TaxGroup;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a tax group 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_GROUP_READ\n * @webhook\n * @eventType wix.billing.v1.tax_group_updated\n * @serviceIdentifier wix.billing.v1.TaxGroups\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onTaxGroupUpdated(\n handler: (event: TaxGroupUpdatedEnvelope) => void | Promise<void>\n): void;\n\ntype TaxGroupNonNullablePaths = `name`;\n\n/**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n * @param taxGroup - Tax group to create.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroup\n * @requiredField taxGroup.name\n * @permissionId BILLING.TAX_GROUP_CREATE\n * @applicableIdentity APP\n * @returns Created tax group.\n * @fqn wix.billing.v1.TaxGroups.CreateTaxGroup\n */\nexport async function createTaxGroup(\n taxGroup: NonNullablePaths<TaxGroup, `name`>\n): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taxGroup: taxGroup });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.createTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxGroup: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroup']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a tax group.\n * @param taxGroupId - ID of the tax group to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroupId\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns Retrieved tax group.\n * @fqn wix.billing.v1.TaxGroups.GetTaxGroup\n */\nexport async function getTaxGroup(\n taxGroupId: string\n): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taxGroupId: taxGroupId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.getTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taxGroupId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroupId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n * @param _id - Tax group ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField taxGroup\n * @requiredField taxGroup.name\n * @requiredField taxGroup.revision\n * @param taxGroup - Tax group info.\n * @permissionId BILLING.TAX_GROUP_UPDATE\n * @applicableIdentity APP\n * @returns Updated tax group.\n * @fqn wix.billing.v1.TaxGroups.UpdateTaxGroup\n */\nexport async function updateTaxGroup(\n _id: string,\n taxGroup: NonNullablePaths<UpdateTaxGroup, `name` | `revision`>\n): Promise<\n NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths> & {\n __applicationErrorsType?: UpdateTaxGroupApplicationErrors;\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 taxGroup: { ...taxGroup, id: _id },\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.updateTaxGroup(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxGroup!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { taxGroup: '$[1]' },\n explicitPathsToArguments: { 'taxGroup.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'taxGroup']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTaxGroup {\n /**\n * Tax group ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Tax group name.\n * @minLength 1\n * @maxLength 200\n */\n name?: string;\n /**\n * Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes,\n * the current revision must be passed when updating the tax group.\n *\n * Ignored when creating a tax group.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the tax group was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the tax group was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\n/**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n * @param taxGroupId - ID of the tax group to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField taxGroupId\n * @permissionId BILLING.TAX_GROUP_DELETE\n * @applicableIdentity APP\n * @fqn wix.billing.v1.TaxGroups.DeleteTaxGroup\n */\nexport async function deleteTaxGroup(taxGroupId: 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 taxGroupId: taxGroupId,\n });\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.deleteTaxGroup(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: { taxGroupId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taxGroupId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.QueryTaxGroups\n */\nexport function queryTaxGroups(): TaxGroupsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n TaxGroup,\n 'CURSOR',\n QueryTaxGroupsRequest,\n QueryTaxGroupsResponse\n >({\n func: async (payload: QueryTaxGroupsRequest) => {\n const reqOpts = ambassadorWixBillingV1TaxGroup.queryTaxGroups(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: QueryTaxGroupsRequest['query']) => {\n const args = [query, {}] as [QueryTaxGroupsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTaxGroupsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.taxGroups,\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 TaxGroupsQueryResult extends QueryCursorResult {\n items: TaxGroup[];\n query: TaxGroupsQueryBuilder;\n next: () => Promise<TaxGroupsQueryResult>;\n prev: () => Promise<TaxGroupsQueryResult>;\n}\n\nexport interface TaxGroupsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\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: '_createdDate' | '_updatedDate',\n value: any[]\n ) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate',\n value: any\n ) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName: '_createdDate' | '_updatedDate',\n value: boolean\n ) => TaxGroupsQueryBuilder;\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<'_id' | 'name' | '_createdDate' | '_updatedDate'>\n ) => TaxGroupsQueryBuilder;\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<'_id' | 'name' | '_createdDate' | '_updatedDate'>\n ) => TaxGroupsQueryBuilder;\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) => TaxGroupsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => TaxGroupsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<TaxGroupsQueryResult>;\n}\n\n/**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroups\n */\nexport async function listDefaultTaxGroups(): Promise<\n NonNullablePaths<\n ListDefaultTaxGroupsResponse,\n {\n [P in TaxGroupNonNullablePaths]: `taxGroups.${number}.${P}`;\n }[TaxGroupNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBillingV1TaxGroup.listDefaultTaxGroups(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves default tax groups for specific apps.\n * @param appIds - App IDs to retrieve default tax groups for.\n * @public\n * @documentationMaturity preview\n * @requiredField appIds\n * @permissionId BILLING.TAX_GROUP_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroupsByAppIds\n */\nexport async function listDefaultTaxGroupsByAppIds(\n appIds: string[]\n): Promise<\n NonNullablePaths<\n ListDefaultTaxGroupsByAppIdsResponse,\n | `results`\n | `results.${number}.taxGroupMetadata.originalIndex`\n | `results.${number}.taxGroupMetadata.success`\n | `results.${number}.taxGroupMetadata.error.code`\n | `results.${number}.taxGroupMetadata.error.description`\n | {\n [P in TaxGroupNonNullablePaths]: `results.${number}.taxGroup.${P}`;\n }[TaxGroupNonNullablePaths]\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ appIds: appIds });\n\n const reqOpts =\n ambassadorWixBillingV1TaxGroup.listDefaultTaxGroupsByAppIds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { 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 resolveWixBillingV1TaxGroupsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/tax-groups',\n destPath: '/v1/tax-groups',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/tax-groups',\n destPath: '/v1/tax-groups',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-groups';\n\n/**\n * Creates a tax group.\n *\n * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.\n * Wix uses tax groups to calculate tax.\n *\n * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.\n * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)\n * to create new default tax groups that can be applied directly to an entire catalog of products.\n */\nexport function createTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __createTaxGroup({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.CreateTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTaxGroup;\n}\n\n/** Retrieves a tax group. */\nexport function getTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __getTaxGroup({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.GetTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroupId}',\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: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTaxGroup;\n}\n\n/**\n * Updates a tax group.\n *\n * Each time the tax group is updated, `revision` increments by 1.\n * The current `revision` must be passed when updating the tax group.\n * This ensures you're working with the latest tax group and prevents\n * unintended overwrites.\n */\nexport function updateTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __updateTaxGroup({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'PATCH' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.UpdateTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroup.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: 'taxGroup.createdDate' },\n { path: 'taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTaxGroup;\n}\n\n/**\n * Deletes a tax group.\n *\n * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.\n */\nexport function deleteTaxGroup(payload: object): RequestOptionsFactory<any> {\n function __deleteTaxGroup({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'DELETE' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.DeleteTaxGroup',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/{taxGroupId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTaxGroup;\n}\n\n/**\n * Creates a query to retrieve a list of tax groups.\n *\n * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` 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 `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.\n *\n * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:\n * + `ascending(\"_id\")`\n *\n * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending(\"name\")` and then `ascending(\"_createdDate\")`, the results are sorted first by the `\"name\"`, and then, if there are multiple results with the same `\"name\"`, the items are sorted by `\"_createdDate\"`.\n *\n * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.\n */\nexport function queryTaxGroups(payload: object): RequestOptionsFactory<any> {\n function __queryTaxGroups({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.QueryTaxGroups',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/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: 'taxGroups.createdDate' },\n { path: 'taxGroups.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTaxGroups;\n}\n\n/**\n * Retrieves a list of default tax groups.\n *\n * The default tax groups for a site are inherited by the apps installed on the site.\n * For example, the Wix Stores app includes a `\"Products\"` tax group by default.\n *\n * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).\n */\nexport function listDefaultTaxGroups(\n payload: object\n): RequestOptionsFactory<any> {\n function __listDefaultTaxGroups({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.ListDefaultTaxGroups',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/default-tax-groups',\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: 'taxGroups.createdDate' },\n { path: 'taxGroups.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listDefaultTaxGroups;\n}\n\n/** Retrieves default tax groups for specific apps. */\nexport function listDefaultTaxGroupsByAppIds(\n payload: object\n): RequestOptionsFactory<any> {\n function __listDefaultTaxGroupsByAppIds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.billing.v1.tax_group',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxGroups.ListDefaultTaxGroupsByAppIds',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxGroupsUrl({\n protoPath: '/v1/tax-groups/list-default-tax-groups-by-app-ids',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.taxGroup.createdDate' },\n { path: 'results.taxGroup.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listDefaultTaxGroupsByAppIds;\n}\n","import {\n createTaxGroup as publicCreateTaxGroup,\n getTaxGroup as publicGetTaxGroup,\n updateTaxGroup as publicUpdateTaxGroup,\n deleteTaxGroup as publicDeleteTaxGroup,\n queryTaxGroups as publicQueryTaxGroups,\n listDefaultTaxGroups as publicListDefaultTaxGroups,\n listDefaultTaxGroupsByAppIds as publicListDefaultTaxGroupsByAppIds,\n} from './billing-v1-tax-group-tax-groups.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 { onTaxGroupCreated as publicOnTaxGroupCreated } from './billing-v1-tax-group-tax-groups.public.js';\nimport { onTaxGroupDeleted as publicOnTaxGroupDeleted } from './billing-v1-tax-group-tax-groups.public.js';\nimport { onTaxGroupUpdated as publicOnTaxGroupUpdated } from './billing-v1-tax-group-tax-groups.public.js';\n\nexport const createTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicCreateTaxGroup> & typeof publicCreateTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicCreateTaxGroup);\nexport const getTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicGetTaxGroup> & typeof publicGetTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicGetTaxGroup);\nexport const updateTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicUpdateTaxGroup> & typeof publicUpdateTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicUpdateTaxGroup);\nexport const deleteTaxGroup: MaybeContext<\n BuildRESTFunction<typeof publicDeleteTaxGroup> & typeof publicDeleteTaxGroup\n> = /*#__PURE__*/ createRESTModule(publicDeleteTaxGroup);\nexport const queryTaxGroups: MaybeContext<\n BuildRESTFunction<typeof publicQueryTaxGroups> & typeof publicQueryTaxGroups\n> = /*#__PURE__*/ createRESTModule(publicQueryTaxGroups);\nexport const listDefaultTaxGroups: MaybeContext<\n BuildRESTFunction<typeof publicListDefaultTaxGroups> &\n typeof publicListDefaultTaxGroups\n> = /*#__PURE__*/ createRESTModule(publicListDefaultTaxGroups);\nexport const listDefaultTaxGroupsByAppIds: MaybeContext<\n BuildRESTFunction<typeof publicListDefaultTaxGroupsByAppIds> &\n typeof publicListDefaultTaxGroupsByAppIds\n> = /*#__PURE__*/ createRESTModule(publicListDefaultTaxGroupsByAppIds);\n/**\n * Triggered when a tax group is created.\n */\nexport const onTaxGroupCreated: BuildEventDefinition<\n typeof publicOnTaxGroupCreated\n> = createEventModule(publicOnTaxGroupCreated);\n/**\n * Triggered when a tax group is deleted.\n */\nexport const onTaxGroupDeleted: BuildEventDefinition<\n typeof publicOnTaxGroupDeleted\n> = createEventModule(publicOnTaxGroupDeleted);\n/**\n * Triggered when a tax group is updated.\n */\nexport const onTaxGroupUpdated: BuildEventDefinition<\n typeof publicOnTaxGroupUpdated\n> = createEventModule(publicOnTaxGroupUpdated);\n\nexport {\n SortOrder,\n WebhookIdentityType,\n} from './billing-v1-tax-group-tax-groups.universal.js';\nexport {\n TaxGroup,\n CreateTaxGroupRequest,\n CreateTaxGroupResponse,\n GetTaxGroupRequest,\n GetTaxGroupResponse,\n UpdateTaxGroupRequest,\n UpdateTaxGroupResponse,\n DeleteTaxGroupRequest,\n DeleteTaxGroupResponse,\n QueryTaxGroupsRequest,\n QueryV2,\n QueryV2PagingMethodOneOf,\n Sorting,\n Paging,\n CursorPaging,\n QueryTaxGroupsResponse,\n CursorPagingMetadata,\n Cursors,\n ListDefaultTaxGroupsRequest,\n ListDefaultTaxGroupsResponse,\n ListDefaultTaxGroupsByAppIdsRequest,\n ListDefaultTaxGroupsByAppIdsResponse,\n ListDefaultTaxGroupsByAppIdsResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\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 TaxGroupCreatedEnvelope,\n TaxGroupDeletedEnvelope,\n TaxGroupUpdatedEnvelope,\n UpdateTaxGroup,\n TaxGroupsQueryResult,\n TaxGroupsQueryBuilder,\n} from './billing-v1-tax-group-tax-groups.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,oCAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,gCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SA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AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,wBAAwB;AAAA,UAChC,EAAE,MAAM,wBAAwB;AAAA,UAChC,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA2B;AACpB,IAAM,wBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA2B;;;AG7O3B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,gCAGK,2DAAiBA,6BAAkC;AAI9D,IAAMC,yBAET,mDAAkB,iBAAuB;AAItC,IAAMC,yBAET,mDAAkB,iBAAuB;AAItC,IAAMC,yBAET,mDAAkB,iBAAuB;","names":["createTaxGroup","deleteTaxGroup","getTaxGroup","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","onTaxGroupCreated","onTaxGroupDeleted","onTaxGroupUpdated","queryTaxGroups","updateTaxGroup","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","SortOrder","WebhookIdentityType","createTaxGroup","sdkTransformError","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","createTaxGroup","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","import_rest_modules","createTaxGroup","getTaxGroup","updateTaxGroup","deleteTaxGroup","queryTaxGroups","listDefaultTaxGroups","listDefaultTaxGroupsByAppIds","onTaxGroupCreated","onTaxGroupDeleted","onTaxGroupUpdated"]}
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /**
2
4
  * A tax group is a category of specific line items grouped together based on their tax treatment.
3
5
  * You can create new tax groups to apply distinct tax rates and rules.
@@ -361,6 +363,11 @@ declare enum WebhookIdentityType {
361
363
  }
362
364
  /** @enumType */
363
365
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
366
+ type UpdateTaxGroupApplicationErrors = {
367
+ code?: 'ILLEGAL_UPDATE_ON_SYSTEM_DEFINED_TAX_GROUP';
368
+ description?: string;
369
+ data?: Record<string, any>;
370
+ };
364
371
  interface BaseEventMetadata {
365
372
  /**
366
373
  * App instance ID.
@@ -409,13 +416,130 @@ interface TaxGroupCreatedEnvelope {
409
416
  entity: TaxGroup;
410
417
  metadata: EventMetadata;
411
418
  }
419
+ /**
420
+ * Triggered when a tax group is created.
421
+ * @permissionScope Manage Stores - all permissions
422
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
423
+ * @permissionScope Manage Stores
424
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
425
+ * @permissionScope Manage Restaurants - all permissions
426
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
427
+ * @permissionScope Manage eCommerce - all permissions
428
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
429
+ * @permissionScope Manage Orders
430
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
431
+ * @permissionId BILLING.TAX_GROUP_READ
432
+ * @webhook
433
+ * @eventType wix.billing.v1.tax_group_created
434
+ * @serviceIdentifier wix.billing.v1.TaxGroups
435
+ * @slug created
436
+ * @documentationMaturity preview
437
+ */
438
+ declare function onTaxGroupCreated(handler: (event: TaxGroupCreatedEnvelope) => void | Promise<void>): void;
412
439
  interface TaxGroupDeletedEnvelope {
413
440
  metadata: EventMetadata;
414
441
  }
442
+ /**
443
+ * Triggered when a tax group is deleted.
444
+ * @permissionScope Manage Stores - all permissions
445
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
446
+ * @permissionScope Manage Stores
447
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
448
+ * @permissionScope Manage Restaurants - all permissions
449
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
450
+ * @permissionScope Manage eCommerce - all permissions
451
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
452
+ * @permissionScope Manage Orders
453
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
454
+ * @permissionId BILLING.TAX_GROUP_READ
455
+ * @webhook
456
+ * @eventType wix.billing.v1.tax_group_deleted
457
+ * @serviceIdentifier wix.billing.v1.TaxGroups
458
+ * @slug deleted
459
+ * @documentationMaturity preview
460
+ */
461
+ declare function onTaxGroupDeleted(handler: (event: TaxGroupDeletedEnvelope) => void | Promise<void>): void;
415
462
  interface TaxGroupUpdatedEnvelope {
416
463
  entity: TaxGroup;
417
464
  metadata: EventMetadata;
418
465
  }
466
+ /**
467
+ * Triggered when a tax group is updated.
468
+ * @permissionScope Manage Stores - all permissions
469
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
470
+ * @permissionScope Manage Stores
471
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
472
+ * @permissionScope Manage Restaurants - all permissions
473
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
474
+ * @permissionScope Manage eCommerce - all permissions
475
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
476
+ * @permissionScope Manage Orders
477
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
478
+ * @permissionId BILLING.TAX_GROUP_READ
479
+ * @webhook
480
+ * @eventType wix.billing.v1.tax_group_updated
481
+ * @serviceIdentifier wix.billing.v1.TaxGroups
482
+ * @slug updated
483
+ * @documentationMaturity preview
484
+ */
485
+ declare function onTaxGroupUpdated(handler: (event: TaxGroupUpdatedEnvelope) => void | Promise<void>): void;
486
+ type TaxGroupNonNullablePaths = `name`;
487
+ /**
488
+ * Creates a tax group.
489
+ *
490
+ * Call Stores Update Product to add the `taxGroupId` to specific products to categorize as a group based on distinct tax treatment.
491
+ * Wix uses tax groups to calculate tax.
492
+ *
493
+ * In addition to tax groups you create, default tax groups are already included in all Wix catalogs.
494
+ * Call List Default Tax Groups to retrieve them. You can also use the Tax Groups Integration service plugin (REST only)
495
+ * to create new default tax groups that can be applied directly to an entire catalog of products.
496
+ * @param taxGroup - Tax group to create.
497
+ * @public
498
+ * @documentationMaturity preview
499
+ * @requiredField taxGroup
500
+ * @requiredField taxGroup.name
501
+ * @permissionId BILLING.TAX_GROUP_CREATE
502
+ * @applicableIdentity APP
503
+ * @returns Created tax group.
504
+ * @fqn wix.billing.v1.TaxGroups.CreateTaxGroup
505
+ */
506
+ declare function createTaxGroup(taxGroup: NonNullablePaths<TaxGroup, `name`>): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>>;
507
+ /**
508
+ * Retrieves a tax group.
509
+ * @param taxGroupId - ID of the tax group to retrieve.
510
+ * @public
511
+ * @documentationMaturity preview
512
+ * @requiredField taxGroupId
513
+ * @permissionId BILLING.TAX_GROUP_READ
514
+ * @applicableIdentity APP
515
+ * @applicableIdentity VISITOR
516
+ * @returns Retrieved tax group.
517
+ * @fqn wix.billing.v1.TaxGroups.GetTaxGroup
518
+ */
519
+ declare function getTaxGroup(taxGroupId: string): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths>>;
520
+ /**
521
+ * Updates a tax group.
522
+ *
523
+ * Each time the tax group is updated, `revision` increments by 1.
524
+ * The current `revision` must be passed when updating the tax group.
525
+ * This ensures you're working with the latest tax group and prevents
526
+ * unintended overwrites.
527
+ * @param _id - Tax group ID.
528
+ * @public
529
+ * @documentationMaturity preview
530
+ * @requiredField _id
531
+ * @requiredField taxGroup
532
+ * @requiredField taxGroup.name
533
+ * @requiredField taxGroup.revision
534
+ * @param taxGroup - Tax group info.
535
+ * @permissionId BILLING.TAX_GROUP_UPDATE
536
+ * @applicableIdentity APP
537
+ * @returns Updated tax group.
538
+ * @fqn wix.billing.v1.TaxGroups.UpdateTaxGroup
539
+ */
540
+ declare function updateTaxGroup(_id: string, taxGroup: NonNullablePaths<UpdateTaxGroup, `name` | `revision`>): Promise<NonNullablePaths<TaxGroup, TaxGroupNonNullablePaths> & {
541
+ __applicationErrorsType?: UpdateTaxGroupApplicationErrors;
542
+ }>;
419
543
  interface UpdateTaxGroup {
420
544
  /**
421
545
  * Tax group ID.
@@ -448,6 +572,42 @@ interface UpdateTaxGroup {
448
572
  */
449
573
  _updatedDate?: Date | null;
450
574
  }
575
+ /**
576
+ * Deletes a tax group.
577
+ *
578
+ * If a tax group is deleted but the `taxGroupId` is still assigned to a product (see Stores Products API) then the default tax group is used to calculate tax.
579
+ * @param taxGroupId - ID of the tax group to delete.
580
+ * @public
581
+ * @documentationMaturity preview
582
+ * @requiredField taxGroupId
583
+ * @permissionId BILLING.TAX_GROUP_DELETE
584
+ * @applicableIdentity APP
585
+ * @fqn wix.billing.v1.TaxGroups.DeleteTaxGroup
586
+ */
587
+ declare function deleteTaxGroup(taxGroupId: string): Promise<void>;
588
+ /**
589
+ * Creates a query to retrieve a list of tax groups.
590
+ *
591
+ * The `queryTaxGroups()` function builds a query to retrieve a list of tax groups and returns a `TaxGroupsQueryBuilder` object.
592
+ *
593
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
594
+ *
595
+ * You can refine the query by chaining `TaxGroupsQueryBuilder` functions onto the query. `TaxGroupsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxGroups()` returns.
596
+ *
597
+ * `queryTaxGroups()` runs with the following `TaxGroupsQueryBuilder` default that you can override:
598
+ * + `ascending("_id")`
599
+ *
600
+ * The functions that are chained to `queryTaxGroups()` are applied in the order they are called. For example, if you apply `ascending("name")` and then `ascending("_createdDate")`, the results are sorted first by the `"name"`, and then, if there are multiple results with the same `"name"`, the items are sorted by `"_createdDate"`.
601
+ *
602
+ * The following `TaxGroupsQueryBuilder` functions are supported for the `queryTaxGroups()` function. For a full description of the tax group object, see the object returned for the `items` property in `TaxGroupsQueryResult`.
603
+ * @public
604
+ * @documentationMaturity preview
605
+ * @permissionId BILLING.TAX_GROUP_READ
606
+ * @applicableIdentity APP
607
+ * @applicableIdentity VISITOR
608
+ * @fqn wix.billing.v1.TaxGroups.QueryTaxGroups
609
+ */
610
+ declare function queryTaxGroups(): TaxGroupsQueryBuilder;
451
611
  interface QueryCursorResult {
452
612
  cursors: Cursors;
453
613
  hasNext: () => boolean;
@@ -520,5 +680,36 @@ interface TaxGroupsQueryBuilder {
520
680
  /** @documentationMaturity preview */
521
681
  find: () => Promise<TaxGroupsQueryResult>;
522
682
  }
683
+ /**
684
+ * Retrieves a list of default tax groups.
685
+ *
686
+ * The default tax groups for a site are inherited by the apps installed on the site.
687
+ * For example, the Wix Stores app includes a `"Products"` tax group by default.
688
+ *
689
+ * Add additional default tax groups with the Tax Groups Integration service plugin (REST only).
690
+ * @public
691
+ * @documentationMaturity preview
692
+ * @permissionId BILLING.TAX_GROUP_READ
693
+ * @applicableIdentity APP
694
+ * @applicableIdentity VISITOR
695
+ * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroups
696
+ */
697
+ declare function listDefaultTaxGroups(): Promise<NonNullablePaths<ListDefaultTaxGroupsResponse, {
698
+ [P in TaxGroupNonNullablePaths]: `taxGroups.${number}.${P}`;
699
+ }[TaxGroupNonNullablePaths]>>;
700
+ /**
701
+ * Retrieves default tax groups for specific apps.
702
+ * @param appIds - App IDs to retrieve default tax groups for.
703
+ * @public
704
+ * @documentationMaturity preview
705
+ * @requiredField appIds
706
+ * @permissionId BILLING.TAX_GROUP_READ
707
+ * @applicableIdentity APP
708
+ * @applicableIdentity VISITOR
709
+ * @fqn wix.billing.v1.TaxGroups.ListDefaultTaxGroupsByAppIds
710
+ */
711
+ declare function listDefaultTaxGroupsByAppIds(appIds: string[]): Promise<NonNullablePaths<ListDefaultTaxGroupsByAppIdsResponse, `results` | `results.${number}.taxGroupMetadata.originalIndex` | `results.${number}.taxGroupMetadata.success` | `results.${number}.taxGroupMetadata.error.code` | `results.${number}.taxGroupMetadata.error.description` | {
712
+ [P in TaxGroupNonNullablePaths]: `results.${number}.taxGroup.${P}`;
713
+ }[TaxGroupNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
523
714
 
524
- export { type ApplicationError as A, type BulkActionMetadata as B, type CreateTaxGroupRequest as C, type DeleteTaxGroupRequest as D, type EntityCreatedEvent as E, type IdentificationDataIdOneOf as F, type GetTaxGroupRequest as G, type BaseEventMetadata as H, type ItemMetadata as I, type EventMetadata as J, type TaxGroupsQueryResult as K, type ListDefaultTaxGroupsResponse as L, type MessageEnvelope as M, type Paging as P, type QueryTaxGroupsRequest as Q, type RestoreInfo as R, SortOrder as S, type TaxGroup as T, type UpdateTaxGroup as U, WebhookIdentityType as W, type TaxGroupsQueryBuilder as a, type ListDefaultTaxGroupsByAppIdsResponse as b, type TaxGroupCreatedEnvelope as c, type TaxGroupDeletedEnvelope as d, type TaxGroupUpdatedEnvelope as e, type CreateTaxGroupResponse as f, type GetTaxGroupResponse as g, type UpdateTaxGroupRequest as h, type UpdateTaxGroupResponse as i, type DeleteTaxGroupResponse as j, type QueryV2 as k, type QueryV2PagingMethodOneOf as l, type Sorting as m, type CursorPaging as n, type QueryTaxGroupsResponse as o, type CursorPagingMetadata as p, type Cursors as q, type ListDefaultTaxGroupsRequest as r, type ListDefaultTaxGroupsByAppIdsRequest as s, type ListDefaultTaxGroupsByAppIdsResult as t, type DomainEvent as u, type DomainEventBodyOneOf as v, type EntityUpdatedEvent as w, type EntityDeletedEvent as x, type ActionEvent as y, type IdentificationData as z };
715
+ export { type ActionEvent, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type CreateTaxGroupRequest, type CreateTaxGroupResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteTaxGroupRequest, type DeleteTaxGroupResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetTaxGroupRequest, type GetTaxGroupResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListDefaultTaxGroupsByAppIdsRequest, type ListDefaultTaxGroupsByAppIdsResponse, type ListDefaultTaxGroupsByAppIdsResult, type ListDefaultTaxGroupsRequest, type ListDefaultTaxGroupsResponse, type MessageEnvelope, type Paging, type QueryTaxGroupsRequest, type QueryTaxGroupsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type TaxGroup, type TaxGroupCreatedEnvelope, type TaxGroupDeletedEnvelope, type TaxGroupUpdatedEnvelope, type TaxGroupsQueryBuilder, type TaxGroupsQueryResult, type UpdateTaxGroup, type UpdateTaxGroupApplicationErrors, type UpdateTaxGroupRequest, type UpdateTaxGroupResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createTaxGroup, deleteTaxGroup, getTaxGroup, listDefaultTaxGroups, listDefaultTaxGroupsByAppIds, onTaxGroupCreated, onTaxGroupDeleted, onTaxGroupUpdated, queryTaxGroups, updateTaxGroup };