@wix/auto_sdk_ecom_tax-regions 1.0.5 → 1.0.7
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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.context.d.ts +23 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.context.js +28 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.context.js.map +1 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.http.d.ts +44 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.http.js +227 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.http.js.map +1 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.d.ts +23 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.js +123 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.js.map +1 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.public.d.ts +77 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.public.js +73 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.public.js.map +1 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.types.d.ts +427 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.types.js +17 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.types.js.map +1 -0
- package/build/{billing-v1-tax-region-tax-regions.universal-0Nssv7EX.d.mts → cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts} +229 -53
- package/build/cjs/src/billing-v1-tax-region-tax-regions.universal.js +301 -0
- package/build/cjs/src/billing-v1-tax-region-tax-regions.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.context.d.ts +23 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.context.js +23 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.context.js.map +1 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.http.d.ts +44 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.http.js +219 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.http.js.map +1 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.meta.d.ts +23 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.meta.js +92 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.meta.js.map +1 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.public.d.ts +77 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.public.js +63 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.public.js.map +1 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.types.d.ts +427 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.types.js +14 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.types.js.map +1 -0
- package/build/{billing-v1-tax-region-tax-regions.universal-0Nssv7EX.d.ts → es/src/billing-v1-tax-region-tax-regions.universal.d.ts} +229 -53
- package/build/es/src/billing-v1-tax-region-tax-regions.universal.js +270 -0
- package/build/es/src/billing-v1-tax-region-tax-regions.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.d.ts +23 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.js +28 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.d.ts +44 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.js +227 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.d.ts +23 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.js +123 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.d.ts +77 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.js +73 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.d.ts +427 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.js +17 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.js.map +1 -0
- package/build/internal/{billing-v1-tax-region-tax-regions.universal-0Nssv7EX.d.ts → cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts} +229 -53
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.universal.js +301 -0
- package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.d.ts +23 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.js +23 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.js.map +1 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.d.ts +44 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.js +219 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.js.map +1 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.d.ts +23 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.js +92 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.js.map +1 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.d.ts +77 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.js +63 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.js.map +1 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.d.ts +427 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.js +14 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.js.map +1 -0
- package/build/internal/{billing-v1-tax-region-tax-regions.universal-0Nssv7EX.d.mts → es/src/billing-v1-tax-region-tax-regions.universal.d.ts} +229 -53
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.universal.js +270 -0
- package/build/internal/es/src/billing-v1-tax-region-tax-regions.universal.js.map +1 -0
- package/package.json +13 -14
- package/build/index.d.mts +0 -91
- package/build/index.d.ts +0 -91
- package/build/index.js +0 -493
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -460
- package/build/index.mjs.map +0 -1
- package/build/internal/index.d.mts +0 -91
- package/build/internal/index.d.ts +0 -91
- package/build/internal/index.js +0 -493
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -460
- package/build/internal/index.mjs.map +0 -1
- package/build/internal/meta.d.mts +0 -206
- package/build/internal/meta.d.ts +0 -206
- package/build/internal/meta.js +0 -312
- package/build/internal/meta.js.map +0 -1
- package/build/internal/meta.mjs +0 -281
- package/build/internal/meta.mjs.map +0 -1
- package/build/meta.d.mts +0 -206
- package/build/meta.d.ts +0 -206
- package/build/meta.js +0 -312
- package/build/meta.js.map +0 -1
- package/build/meta.mjs +0 -281
- package/build/meta.mjs.map +0 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
2
|
+
import { queryBuilder } from '@wix/sdk-runtime/query-builder';
|
|
3
|
+
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
4
|
+
import * as ambassadorWixBillingV1TaxRegion from './billing-v1-tax-region-tax-regions.http.js';
|
|
5
|
+
export var SortOrder;
|
|
6
|
+
(function (SortOrder) {
|
|
7
|
+
SortOrder["ASC"] = "ASC";
|
|
8
|
+
SortOrder["DESC"] = "DESC";
|
|
9
|
+
})(SortOrder || (SortOrder = {}));
|
|
10
|
+
export var WebhookIdentityType;
|
|
11
|
+
(function (WebhookIdentityType) {
|
|
12
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
13
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
14
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
15
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
16
|
+
WebhookIdentityType["APP"] = "APP";
|
|
17
|
+
})(WebhookIdentityType || (WebhookIdentityType = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Creates a tax region.
|
|
20
|
+
*
|
|
21
|
+
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
22
|
+
*
|
|
23
|
+
* Wix uses tax regions to calculate tax.
|
|
24
|
+
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
25
|
+
* @param taxRegion - Tax region to create.
|
|
26
|
+
* @public
|
|
27
|
+
* @documentationMaturity preview
|
|
28
|
+
* @requiredField taxRegion
|
|
29
|
+
* @requiredField taxRegion.appId
|
|
30
|
+
* @requiredField taxRegion.country
|
|
31
|
+
* @requiredField taxRegion.taxIncludedInPrice
|
|
32
|
+
* @permissionId BILLING.TAX_REGION_CREATE
|
|
33
|
+
* @permissionScope Manage Stores - all permissions
|
|
34
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
35
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
36
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
37
|
+
* @permissionScope Manage Orders
|
|
38
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
39
|
+
* @applicableIdentity APP
|
|
40
|
+
* @returns Created tax region.
|
|
41
|
+
* @fqn wix.billing.v1.TaxRegionsService.CreateTaxRegion
|
|
42
|
+
*/
|
|
43
|
+
export async function createTaxRegion(taxRegion) {
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
46
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
47
|
+
taxRegion: taxRegion,
|
|
48
|
+
});
|
|
49
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.createTaxRegion(payload);
|
|
50
|
+
sideEffects?.onSiteCall?.();
|
|
51
|
+
try {
|
|
52
|
+
const result = await httpClient.request(reqOpts);
|
|
53
|
+
sideEffects?.onSuccess?.(result);
|
|
54
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion;
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
const transformedError = sdkTransformError(err, {
|
|
58
|
+
spreadPathsToArguments: {},
|
|
59
|
+
explicitPathsToArguments: { taxRegion: '$[0]' },
|
|
60
|
+
singleArgumentUnchanged: false,
|
|
61
|
+
}, ['taxRegion']);
|
|
62
|
+
sideEffects?.onError?.(err);
|
|
63
|
+
throw transformedError;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves a tax region.
|
|
68
|
+
* @param taxRegionId - ID of the tax region to retrieve.
|
|
69
|
+
* @public
|
|
70
|
+
* @documentationMaturity preview
|
|
71
|
+
* @requiredField taxRegionId
|
|
72
|
+
* @permissionId BILLING.TAX_REGION_READ
|
|
73
|
+
* @permissionScope Manage Stores - all permissions
|
|
74
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
75
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
76
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
77
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
78
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
79
|
+
* @permissionScope Manage Orders
|
|
80
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
81
|
+
* @applicableIdentity APP
|
|
82
|
+
* @applicableIdentity VISITOR
|
|
83
|
+
* @returns Retrieved tax region.
|
|
84
|
+
* @fqn wix.billing.v1.TaxRegionsService.GetTaxRegion
|
|
85
|
+
*/
|
|
86
|
+
export async function getTaxRegion(taxRegionId) {
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
89
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
90
|
+
taxRegionId: taxRegionId,
|
|
91
|
+
});
|
|
92
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.getTaxRegion(payload);
|
|
93
|
+
sideEffects?.onSiteCall?.();
|
|
94
|
+
try {
|
|
95
|
+
const result = await httpClient.request(reqOpts);
|
|
96
|
+
sideEffects?.onSuccess?.(result);
|
|
97
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion;
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
const transformedError = sdkTransformError(err, {
|
|
101
|
+
spreadPathsToArguments: {},
|
|
102
|
+
explicitPathsToArguments: { taxRegionId: '$[0]' },
|
|
103
|
+
singleArgumentUnchanged: false,
|
|
104
|
+
}, ['taxRegionId']);
|
|
105
|
+
sideEffects?.onError?.(err);
|
|
106
|
+
throw transformedError;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Updates a tax region.
|
|
111
|
+
*
|
|
112
|
+
* Each time the tax region is updated, `revision` increments by 1.
|
|
113
|
+
* The current `revision` must be passed when updating the tax region.
|
|
114
|
+
* This ensures you're working with the latest tax region and prevents
|
|
115
|
+
* unintended overwrites.
|
|
116
|
+
* @param _id - Tax region ID.
|
|
117
|
+
* @public
|
|
118
|
+
* @documentationMaturity preview
|
|
119
|
+
* @requiredField _id
|
|
120
|
+
* @requiredField taxRegion
|
|
121
|
+
* @requiredField taxRegion.revision
|
|
122
|
+
* @param taxRegion - Tax region info.
|
|
123
|
+
* @permissionId BILLING.TAX_REGION_UPDATE
|
|
124
|
+
* @permissionScope Manage Stores - all permissions
|
|
125
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
126
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
127
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
128
|
+
* @permissionScope Manage Orders
|
|
129
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
130
|
+
* @applicableIdentity APP
|
|
131
|
+
* @returns Updated tax region.
|
|
132
|
+
* @fqn wix.billing.v1.TaxRegionsService.UpdateTaxRegion
|
|
133
|
+
*/
|
|
134
|
+
export async function updateTaxRegion(_id, taxRegion) {
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
137
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
138
|
+
taxRegion: { ...taxRegion, id: _id },
|
|
139
|
+
});
|
|
140
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.updateTaxRegion(payload);
|
|
141
|
+
sideEffects?.onSiteCall?.();
|
|
142
|
+
try {
|
|
143
|
+
const result = await httpClient.request(reqOpts);
|
|
144
|
+
sideEffects?.onSuccess?.(result);
|
|
145
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.taxRegion;
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
const transformedError = sdkTransformError(err, {
|
|
149
|
+
spreadPathsToArguments: { taxRegion: '$[1]' },
|
|
150
|
+
explicitPathsToArguments: { 'taxRegion.id': '$[0]' },
|
|
151
|
+
singleArgumentUnchanged: false,
|
|
152
|
+
}, ['_id', 'taxRegion']);
|
|
153
|
+
sideEffects?.onError?.(err);
|
|
154
|
+
throw transformedError;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Deletes a tax region.
|
|
159
|
+
*
|
|
160
|
+
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
161
|
+
* @param taxRegionId - ID of the tax region to delete.
|
|
162
|
+
* @public
|
|
163
|
+
* @documentationMaturity preview
|
|
164
|
+
* @requiredField taxRegionId
|
|
165
|
+
* @permissionId BILLING.TAX_REGION_DELETE
|
|
166
|
+
* @permissionScope Manage Stores - all permissions
|
|
167
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
168
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
169
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
170
|
+
* @permissionScope Manage Orders
|
|
171
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
172
|
+
* @applicableIdentity APP
|
|
173
|
+
* @fqn wix.billing.v1.TaxRegionsService.DeleteTaxRegion
|
|
174
|
+
*/
|
|
175
|
+
export async function deleteTaxRegion(taxRegionId) {
|
|
176
|
+
// @ts-ignore
|
|
177
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
178
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
179
|
+
taxRegionId: taxRegionId,
|
|
180
|
+
});
|
|
181
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.deleteTaxRegion(payload);
|
|
182
|
+
sideEffects?.onSiteCall?.();
|
|
183
|
+
try {
|
|
184
|
+
const result = await httpClient.request(reqOpts);
|
|
185
|
+
sideEffects?.onSuccess?.(result);
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
const transformedError = sdkTransformError(err, {
|
|
189
|
+
spreadPathsToArguments: {},
|
|
190
|
+
explicitPathsToArguments: { taxRegionId: '$[0]' },
|
|
191
|
+
singleArgumentUnchanged: false,
|
|
192
|
+
}, ['taxRegionId']);
|
|
193
|
+
sideEffects?.onError?.(err);
|
|
194
|
+
throw transformedError;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates a query to retrieve a list of tax regions.
|
|
199
|
+
*
|
|
200
|
+
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
201
|
+
*
|
|
202
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
203
|
+
*
|
|
204
|
+
* You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.
|
|
205
|
+
*
|
|
206
|
+
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
207
|
+
* + `ascending("_id")`
|
|
208
|
+
*
|
|
209
|
+
* The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending("country")` and then `ascending("subdivision")`, the results are sorted first by the `"country"`, and then, if there are multiple results with the same `"country"`, the items are sorted by `"subdivision"`.
|
|
210
|
+
*
|
|
211
|
+
* The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.
|
|
212
|
+
* @public
|
|
213
|
+
* @documentationMaturity preview
|
|
214
|
+
* @permissionScope Manage Stores - all permissions
|
|
215
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
216
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
217
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
218
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
219
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
220
|
+
* @permissionScope Manage Orders
|
|
221
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
222
|
+
* @permissionId BILLING.TAX_REGION_READ
|
|
223
|
+
* @applicableIdentity APP
|
|
224
|
+
* @applicableIdentity VISITOR
|
|
225
|
+
* @fqn wix.billing.v1.TaxRegionsService.QueryTaxRegions
|
|
226
|
+
*/
|
|
227
|
+
export function queryTaxRegions() {
|
|
228
|
+
// @ts-ignore
|
|
229
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
230
|
+
return queryBuilder({
|
|
231
|
+
func: async (payload) => {
|
|
232
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.queryTaxRegions(payload);
|
|
233
|
+
sideEffects?.onSiteCall?.();
|
|
234
|
+
try {
|
|
235
|
+
const result = await httpClient.request(reqOpts);
|
|
236
|
+
sideEffects?.onSuccess?.(result);
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
sideEffects?.onError?.(err);
|
|
241
|
+
throw err;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
requestTransformer: (query) => {
|
|
245
|
+
const args = [query, {}];
|
|
246
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
247
|
+
...args?.[1],
|
|
248
|
+
query: args?.[0],
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
responseTransformer: ({ data }) => {
|
|
252
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(data);
|
|
253
|
+
return {
|
|
254
|
+
items: transformedData?.taxRegions,
|
|
255
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
errorTransformer: (err) => {
|
|
259
|
+
const transformedError = sdkTransformError(err, {
|
|
260
|
+
spreadPathsToArguments: {},
|
|
261
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
262
|
+
singleArgumentUnchanged: false,
|
|
263
|
+
});
|
|
264
|
+
throw transformedError;
|
|
265
|
+
},
|
|
266
|
+
pagingMethod: 'CURSOR',
|
|
267
|
+
transformationPaths: {},
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=billing-v1-tax-region-tax-regions.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-v1-tax-region-tax-regions.universal.js","sourceRoot":"","sources":["../../../../src/billing-v1-tax-region-tax-regions.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,+BAA+B,MAAM,6CAA6C,CAAC;AA4N/F,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA8OD,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAi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,EAAE,cAAc;aAChD,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,CAAC,GAAY,EAAE,EAAE;YACjC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,GAAG,EAAE;gBAC9C,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;gBAC3C,uBAAuB,EAAE,KAAK;aAC/B,CAAC,CAAC;YAEH,MAAM,gBAAgB,CAAC;QACzB,CAAC;QACD,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,EAAE;KACxB,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_ecom_tax-regions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"keywords": [],
|
|
9
9
|
"sideEffects": false,
|
|
10
|
-
"main": "
|
|
11
|
-
"types": "./build/index.d.
|
|
10
|
+
"main": "./build/cjs/index.js",
|
|
11
|
+
"types": "./build/es/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"import": "./build/index.
|
|
15
|
-
"require": "./build/index.js",
|
|
16
|
-
"types": "./build/index.d.
|
|
14
|
+
"import": "./build/es/index.js",
|
|
15
|
+
"require": "./build/cjs/index.js",
|
|
16
|
+
"types": "./build/es/index.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./package.json": "./package.json",
|
|
19
19
|
"./meta": {
|
|
20
|
-
"import": "./build/meta.
|
|
21
|
-
"require": "./build/meta.js",
|
|
22
|
-
"types": "./build/meta.d.
|
|
20
|
+
"import": "./build/es/meta.js",
|
|
21
|
+
"require": "./build/cjs/meta.js",
|
|
22
|
+
"types": "./build/es/meta.d.ts"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
@@ -28,15 +28,14 @@
|
|
|
28
28
|
"service-plugins"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@wix/sdk-runtime": "^0.3.
|
|
32
|
-
"@wix/sdk-types": "^1.13.
|
|
31
|
+
"@wix/sdk-runtime": "^0.3.47",
|
|
32
|
+
"@wix/sdk-types": "^1.13.19"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"tsup": "^8.4.0",
|
|
36
35
|
"typescript": "^5.3.2"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {
|
|
39
|
-
"build": "
|
|
38
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
|
|
40
39
|
"test": ":"
|
|
41
40
|
},
|
|
42
41
|
"wix": {
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"fqdn": "wix.billing.v1.tax_region"
|
|
50
49
|
}
|
|
51
50
|
},
|
|
52
|
-
"falconPackageHash": "
|
|
51
|
+
"falconPackageHash": "eb28d79a206f57a71d554ee6f32c619c45f4b552f98ca78fc05c318f"
|
|
53
52
|
}
|
package/build/index.d.mts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { T as TaxRegion, U as UpdateTaxRegion, a as TaxRegionsQueryBuilder } from './billing-v1-tax-region-tax-regions.universal-0Nssv7EX.mjs';
|
|
3
|
-
export { J as ActionEvent, A as ApplicationError, N as BaseEventMetadata, f as BulkActionMetadata, B as BulkCreateTaxRegionRequest, d as BulkCreateTaxRegionResponse, e as BulkCreateTaxRegionResult, v as BulkRestoreTaxRegionsRequest, w as BulkRestoreTaxRegionsResponse, x as BulkRestoreTaxRegionsResult, c as ConflictErrorDetails, r as CreateOrGetTaxRegionWithoutValidationRequest, s as CreateOrGetTaxRegionWithoutValidationResponse, C as CreateTaxRegionRequest, b as CreateTaxRegionResponse, n as CursorPaging, p as CursorPagingMetadata, k as CursorQuery, l as CursorQueryPagingMethodOneOf, q as Cursors, D as DeleteTaxRegionRequest, j as DeleteTaxRegionResponse, t as DeleteTaxRegionWithoutDomainEventsRequest, u as DeleteTaxRegionWithoutDomainEventsResponse, y as DomainEvent, z as DomainEventBodyOneOf, E as EntityCreatedEvent, H as EntityDeletedEvent, F as EntityUpdatedEvent, O as EventMetadata, G as GetTaxRegionRequest, g as GetTaxRegionResponse, K as IdentificationData, L as IdentificationDataIdOneOf, I as ItemMetadata, M as MessageEnvelope, Q as QueryTaxRegionsRequest, o as QueryTaxRegionsResponse, R as RestoreInfo, S as SortOrder, m as Sorting, P as TaxRegionCreatedEnvelope, V as TaxRegionDeletedEnvelope, X as TaxRegionUpdatedEnvelope, Y as TaxRegionsQueryResult, h as UpdateTaxRegionRequest, i as UpdateTaxRegionResponse, W as WebhookIdentityType } from './billing-v1-tax-region-tax-regions.universal-0Nssv7EX.mjs';
|
|
4
|
-
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
5
|
-
|
|
6
|
-
declare function createTaxRegion$1(httpClient: HttpClient): CreateTaxRegionSignature;
|
|
7
|
-
interface CreateTaxRegionSignature {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a tax region.
|
|
10
|
-
*
|
|
11
|
-
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
12
|
-
*
|
|
13
|
-
* Wix uses tax regions to calculate tax.
|
|
14
|
-
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
15
|
-
* @param - Tax region to create.
|
|
16
|
-
* @returns Created tax region.
|
|
17
|
-
*/
|
|
18
|
-
(taxRegion: TaxRegion): Promise<TaxRegion>;
|
|
19
|
-
}
|
|
20
|
-
declare function getTaxRegion$1(httpClient: HttpClient): GetTaxRegionSignature;
|
|
21
|
-
interface GetTaxRegionSignature {
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a tax region.
|
|
24
|
-
* @param - ID of the tax region to retrieve.
|
|
25
|
-
* @returns Retrieved tax region.
|
|
26
|
-
*/
|
|
27
|
-
(taxRegionId: string): Promise<TaxRegion>;
|
|
28
|
-
}
|
|
29
|
-
declare function updateTaxRegion$1(httpClient: HttpClient): UpdateTaxRegionSignature;
|
|
30
|
-
interface UpdateTaxRegionSignature {
|
|
31
|
-
/**
|
|
32
|
-
* Updates a tax region.
|
|
33
|
-
*
|
|
34
|
-
* Each time the tax region is updated, `revision` increments by 1.
|
|
35
|
-
* The current `revision` must be passed when updating the tax region.
|
|
36
|
-
* This ensures you're working with the latest tax region and prevents
|
|
37
|
-
* unintended overwrites.
|
|
38
|
-
* @param - Tax region ID.
|
|
39
|
-
* @param - Tax region info.
|
|
40
|
-
* @returns Updated tax region.
|
|
41
|
-
*/
|
|
42
|
-
(_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion>;
|
|
43
|
-
}
|
|
44
|
-
declare function deleteTaxRegion$1(httpClient: HttpClient): DeleteTaxRegionSignature;
|
|
45
|
-
interface DeleteTaxRegionSignature {
|
|
46
|
-
/**
|
|
47
|
-
* Deletes a tax region.
|
|
48
|
-
*
|
|
49
|
-
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
50
|
-
* @param - ID of the tax region to delete.
|
|
51
|
-
*/
|
|
52
|
-
(taxRegionId: string): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
declare function queryTaxRegions$1(httpClient: HttpClient): QueryTaxRegionsSignature;
|
|
55
|
-
interface QueryTaxRegionsSignature {
|
|
56
|
-
/**
|
|
57
|
-
* Creates a query to retrieve a list of tax regions.
|
|
58
|
-
*
|
|
59
|
-
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
60
|
-
*
|
|
61
|
-
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
62
|
-
*
|
|
63
|
-
* You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.
|
|
64
|
-
*
|
|
65
|
-
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
66
|
-
* + `ascending("_id")`
|
|
67
|
-
*
|
|
68
|
-
* The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending("country")` and then `ascending("subdivision")`, the results are sorted first by the `"country"`, and then, if there are multiple results with the same `"country"`, the items are sorted by `"subdivision"`.
|
|
69
|
-
*
|
|
70
|
-
* The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.
|
|
71
|
-
*/
|
|
72
|
-
(): TaxRegionsQueryBuilder;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare const createTaxRegion: MaybeContext<BuildRESTFunction<typeof createTaxRegion$1> & typeof createTaxRegion$1>;
|
|
76
|
-
declare const getTaxRegion: MaybeContext<BuildRESTFunction<typeof getTaxRegion$1> & typeof getTaxRegion$1>;
|
|
77
|
-
declare const updateTaxRegion: MaybeContext<BuildRESTFunction<typeof updateTaxRegion$1> & typeof updateTaxRegion$1>;
|
|
78
|
-
declare const deleteTaxRegion: MaybeContext<BuildRESTFunction<typeof deleteTaxRegion$1> & typeof deleteTaxRegion$1>;
|
|
79
|
-
declare const queryTaxRegions: MaybeContext<BuildRESTFunction<typeof queryTaxRegions$1> & typeof queryTaxRegions$1>;
|
|
80
|
-
/** */
|
|
81
|
-
declare const onTaxRegionCreated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionCreated>>;
|
|
82
|
-
/**
|
|
83
|
-
* Triggered when a tax region is deleted.
|
|
84
|
-
*/
|
|
85
|
-
declare const onTaxRegionDeleted: ReturnType<typeof createEventModule<typeof publicOnTaxRegionDeleted>>;
|
|
86
|
-
/**
|
|
87
|
-
* Triggered when a tax region is updated.
|
|
88
|
-
*/
|
|
89
|
-
declare const onTaxRegionUpdated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionUpdated>>;
|
|
90
|
-
|
|
91
|
-
export { TaxRegion, TaxRegionsQueryBuilder, UpdateTaxRegion, createTaxRegion, deleteTaxRegion, getTaxRegion, onTaxRegionCreated, onTaxRegionDeleted, onTaxRegionUpdated, queryTaxRegions, updateTaxRegion };
|
package/build/index.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { T as TaxRegion, U as UpdateTaxRegion, a as TaxRegionsQueryBuilder } from './billing-v1-tax-region-tax-regions.universal-0Nssv7EX.js';
|
|
3
|
-
export { J as ActionEvent, A as ApplicationError, N as BaseEventMetadata, f as BulkActionMetadata, B as BulkCreateTaxRegionRequest, d as BulkCreateTaxRegionResponse, e as BulkCreateTaxRegionResult, v as BulkRestoreTaxRegionsRequest, w as BulkRestoreTaxRegionsResponse, x as BulkRestoreTaxRegionsResult, c as ConflictErrorDetails, r as CreateOrGetTaxRegionWithoutValidationRequest, s as CreateOrGetTaxRegionWithoutValidationResponse, C as CreateTaxRegionRequest, b as CreateTaxRegionResponse, n as CursorPaging, p as CursorPagingMetadata, k as CursorQuery, l as CursorQueryPagingMethodOneOf, q as Cursors, D as DeleteTaxRegionRequest, j as DeleteTaxRegionResponse, t as DeleteTaxRegionWithoutDomainEventsRequest, u as DeleteTaxRegionWithoutDomainEventsResponse, y as DomainEvent, z as DomainEventBodyOneOf, E as EntityCreatedEvent, H as EntityDeletedEvent, F as EntityUpdatedEvent, O as EventMetadata, G as GetTaxRegionRequest, g as GetTaxRegionResponse, K as IdentificationData, L as IdentificationDataIdOneOf, I as ItemMetadata, M as MessageEnvelope, Q as QueryTaxRegionsRequest, o as QueryTaxRegionsResponse, R as RestoreInfo, S as SortOrder, m as Sorting, P as TaxRegionCreatedEnvelope, V as TaxRegionDeletedEnvelope, X as TaxRegionUpdatedEnvelope, Y as TaxRegionsQueryResult, h as UpdateTaxRegionRequest, i as UpdateTaxRegionResponse, W as WebhookIdentityType } from './billing-v1-tax-region-tax-regions.universal-0Nssv7EX.js';
|
|
4
|
-
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
5
|
-
|
|
6
|
-
declare function createTaxRegion$1(httpClient: HttpClient): CreateTaxRegionSignature;
|
|
7
|
-
interface CreateTaxRegionSignature {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a tax region.
|
|
10
|
-
*
|
|
11
|
-
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
12
|
-
*
|
|
13
|
-
* Wix uses tax regions to calculate tax.
|
|
14
|
-
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
15
|
-
* @param - Tax region to create.
|
|
16
|
-
* @returns Created tax region.
|
|
17
|
-
*/
|
|
18
|
-
(taxRegion: TaxRegion): Promise<TaxRegion>;
|
|
19
|
-
}
|
|
20
|
-
declare function getTaxRegion$1(httpClient: HttpClient): GetTaxRegionSignature;
|
|
21
|
-
interface GetTaxRegionSignature {
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a tax region.
|
|
24
|
-
* @param - ID of the tax region to retrieve.
|
|
25
|
-
* @returns Retrieved tax region.
|
|
26
|
-
*/
|
|
27
|
-
(taxRegionId: string): Promise<TaxRegion>;
|
|
28
|
-
}
|
|
29
|
-
declare function updateTaxRegion$1(httpClient: HttpClient): UpdateTaxRegionSignature;
|
|
30
|
-
interface UpdateTaxRegionSignature {
|
|
31
|
-
/**
|
|
32
|
-
* Updates a tax region.
|
|
33
|
-
*
|
|
34
|
-
* Each time the tax region is updated, `revision` increments by 1.
|
|
35
|
-
* The current `revision` must be passed when updating the tax region.
|
|
36
|
-
* This ensures you're working with the latest tax region and prevents
|
|
37
|
-
* unintended overwrites.
|
|
38
|
-
* @param - Tax region ID.
|
|
39
|
-
* @param - Tax region info.
|
|
40
|
-
* @returns Updated tax region.
|
|
41
|
-
*/
|
|
42
|
-
(_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion>;
|
|
43
|
-
}
|
|
44
|
-
declare function deleteTaxRegion$1(httpClient: HttpClient): DeleteTaxRegionSignature;
|
|
45
|
-
interface DeleteTaxRegionSignature {
|
|
46
|
-
/**
|
|
47
|
-
* Deletes a tax region.
|
|
48
|
-
*
|
|
49
|
-
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
50
|
-
* @param - ID of the tax region to delete.
|
|
51
|
-
*/
|
|
52
|
-
(taxRegionId: string): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
declare function queryTaxRegions$1(httpClient: HttpClient): QueryTaxRegionsSignature;
|
|
55
|
-
interface QueryTaxRegionsSignature {
|
|
56
|
-
/**
|
|
57
|
-
* Creates a query to retrieve a list of tax regions.
|
|
58
|
-
*
|
|
59
|
-
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
60
|
-
*
|
|
61
|
-
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
62
|
-
*
|
|
63
|
-
* You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.
|
|
64
|
-
*
|
|
65
|
-
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
66
|
-
* + `ascending("_id")`
|
|
67
|
-
*
|
|
68
|
-
* The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending("country")` and then `ascending("subdivision")`, the results are sorted first by the `"country"`, and then, if there are multiple results with the same `"country"`, the items are sorted by `"subdivision"`.
|
|
69
|
-
*
|
|
70
|
-
* The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.
|
|
71
|
-
*/
|
|
72
|
-
(): TaxRegionsQueryBuilder;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare const createTaxRegion: MaybeContext<BuildRESTFunction<typeof createTaxRegion$1> & typeof createTaxRegion$1>;
|
|
76
|
-
declare const getTaxRegion: MaybeContext<BuildRESTFunction<typeof getTaxRegion$1> & typeof getTaxRegion$1>;
|
|
77
|
-
declare const updateTaxRegion: MaybeContext<BuildRESTFunction<typeof updateTaxRegion$1> & typeof updateTaxRegion$1>;
|
|
78
|
-
declare const deleteTaxRegion: MaybeContext<BuildRESTFunction<typeof deleteTaxRegion$1> & typeof deleteTaxRegion$1>;
|
|
79
|
-
declare const queryTaxRegions: MaybeContext<BuildRESTFunction<typeof queryTaxRegions$1> & typeof queryTaxRegions$1>;
|
|
80
|
-
/** */
|
|
81
|
-
declare const onTaxRegionCreated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionCreated>>;
|
|
82
|
-
/**
|
|
83
|
-
* Triggered when a tax region is deleted.
|
|
84
|
-
*/
|
|
85
|
-
declare const onTaxRegionDeleted: ReturnType<typeof createEventModule<typeof publicOnTaxRegionDeleted>>;
|
|
86
|
-
/**
|
|
87
|
-
* Triggered when a tax region is updated.
|
|
88
|
-
*/
|
|
89
|
-
declare const onTaxRegionUpdated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionUpdated>>;
|
|
90
|
-
|
|
91
|
-
export { TaxRegion, TaxRegionsQueryBuilder, UpdateTaxRegion, createTaxRegion, deleteTaxRegion, getTaxRegion, onTaxRegionCreated, onTaxRegionDeleted, onTaxRegionUpdated, queryTaxRegions, updateTaxRegion };
|