@wix/auto_sdk_ecom_tax-regions 1.0.0
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 +446 -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/cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts +805 -0
- 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/package.json +3 -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 +446 -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/es/src/billing-v1-tax-region-tax-regions.universal.d.ts +805 -0
- 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 +446 -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/cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts +805 -0
- 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 +446 -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/es/src/billing-v1-tax-region-tax-regions.universal.d.ts +805 -0
- 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/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.queryTaxRegions = exports.deleteTaxRegion = exports.updateTaxRegion = exports.getTaxRegion = exports.createTaxRegion = exports.WebhookIdentityType = exports.SortOrder = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixBillingV1TaxRegion = __importStar(require("./billing-v1-tax-region-tax-regions.http.js"));
|
|
31
|
+
var SortOrder;
|
|
32
|
+
(function (SortOrder) {
|
|
33
|
+
SortOrder["ASC"] = "ASC";
|
|
34
|
+
SortOrder["DESC"] = "DESC";
|
|
35
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
36
|
+
var WebhookIdentityType;
|
|
37
|
+
(function (WebhookIdentityType) {
|
|
38
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
39
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
40
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
41
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
42
|
+
WebhookIdentityType["APP"] = "APP";
|
|
43
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
44
|
+
/**
|
|
45
|
+
* Creates a tax region.
|
|
46
|
+
*
|
|
47
|
+
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
48
|
+
*
|
|
49
|
+
* Wix uses tax regions to calculate tax.
|
|
50
|
+
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
51
|
+
* @param taxRegion - Tax region to create.
|
|
52
|
+
* @public
|
|
53
|
+
* @documentationMaturity preview
|
|
54
|
+
* @requiredField taxRegion
|
|
55
|
+
* @requiredField taxRegion.appId
|
|
56
|
+
* @requiredField taxRegion.country
|
|
57
|
+
* @requiredField taxRegion.taxIncludedInPrice
|
|
58
|
+
* @permissionId BILLING.TAX_REGION_CREATE
|
|
59
|
+
* @permissionScope Manage Stores - all permissions
|
|
60
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
61
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
62
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
63
|
+
* @permissionScope Manage Orders
|
|
64
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
65
|
+
* @applicableIdentity APP
|
|
66
|
+
* @returns Created tax region.
|
|
67
|
+
* @fqn wix.billing.v1.TaxRegionsService.CreateTaxRegion
|
|
68
|
+
*/
|
|
69
|
+
async function createTaxRegion(taxRegion) {
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
72
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
73
|
+
taxRegion: taxRegion,
|
|
74
|
+
});
|
|
75
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.createTaxRegion(payload);
|
|
76
|
+
sideEffects?.onSiteCall?.();
|
|
77
|
+
try {
|
|
78
|
+
const result = await httpClient.request(reqOpts);
|
|
79
|
+
sideEffects?.onSuccess?.(result);
|
|
80
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
84
|
+
spreadPathsToArguments: {},
|
|
85
|
+
explicitPathsToArguments: { taxRegion: '$[0]' },
|
|
86
|
+
singleArgumentUnchanged: false,
|
|
87
|
+
}, ['taxRegion']);
|
|
88
|
+
sideEffects?.onError?.(err);
|
|
89
|
+
throw transformedError;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.createTaxRegion = createTaxRegion;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves a tax region.
|
|
95
|
+
* @param taxRegionId - ID of the tax region to retrieve.
|
|
96
|
+
* @public
|
|
97
|
+
* @documentationMaturity preview
|
|
98
|
+
* @requiredField taxRegionId
|
|
99
|
+
* @permissionId BILLING.TAX_REGION_READ
|
|
100
|
+
* @permissionScope Manage Stores - all permissions
|
|
101
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
102
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
103
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
104
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
105
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
106
|
+
* @permissionScope Manage Orders
|
|
107
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
108
|
+
* @applicableIdentity APP
|
|
109
|
+
* @applicableIdentity VISITOR
|
|
110
|
+
* @returns Retrieved tax region.
|
|
111
|
+
* @fqn wix.billing.v1.TaxRegionsService.GetTaxRegion
|
|
112
|
+
*/
|
|
113
|
+
async function getTaxRegion(taxRegionId) {
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
116
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
117
|
+
taxRegionId: taxRegionId,
|
|
118
|
+
});
|
|
119
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.getTaxRegion(payload);
|
|
120
|
+
sideEffects?.onSiteCall?.();
|
|
121
|
+
try {
|
|
122
|
+
const result = await httpClient.request(reqOpts);
|
|
123
|
+
sideEffects?.onSuccess?.(result);
|
|
124
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
128
|
+
spreadPathsToArguments: {},
|
|
129
|
+
explicitPathsToArguments: { taxRegionId: '$[0]' },
|
|
130
|
+
singleArgumentUnchanged: false,
|
|
131
|
+
}, ['taxRegionId']);
|
|
132
|
+
sideEffects?.onError?.(err);
|
|
133
|
+
throw transformedError;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.getTaxRegion = getTaxRegion;
|
|
137
|
+
/**
|
|
138
|
+
* Updates a tax region.
|
|
139
|
+
*
|
|
140
|
+
* Each time the tax region is updated, `revision` increments by 1.
|
|
141
|
+
* The current `revision` must be passed when updating the tax region.
|
|
142
|
+
* This ensures you're working with the latest tax region and prevents
|
|
143
|
+
* unintended overwrites.
|
|
144
|
+
* @param _id - Tax region ID.
|
|
145
|
+
* @public
|
|
146
|
+
* @documentationMaturity preview
|
|
147
|
+
* @requiredField _id
|
|
148
|
+
* @requiredField taxRegion
|
|
149
|
+
* @requiredField taxRegion.revision
|
|
150
|
+
* @param taxRegion - Tax region info.
|
|
151
|
+
* @permissionId BILLING.TAX_REGION_UPDATE
|
|
152
|
+
* @permissionScope Manage Stores - all permissions
|
|
153
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
154
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
155
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
156
|
+
* @permissionScope Manage Orders
|
|
157
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
158
|
+
* @applicableIdentity APP
|
|
159
|
+
* @returns Updated tax region.
|
|
160
|
+
* @fqn wix.billing.v1.TaxRegionsService.UpdateTaxRegion
|
|
161
|
+
*/
|
|
162
|
+
async function updateTaxRegion(_id, taxRegion) {
|
|
163
|
+
// @ts-ignore
|
|
164
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
165
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
166
|
+
taxRegion: { ...taxRegion, id: _id },
|
|
167
|
+
});
|
|
168
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.updateTaxRegion(payload);
|
|
169
|
+
sideEffects?.onSiteCall?.();
|
|
170
|
+
try {
|
|
171
|
+
const result = await httpClient.request(reqOpts);
|
|
172
|
+
sideEffects?.onSuccess?.(result);
|
|
173
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
177
|
+
spreadPathsToArguments: { taxRegion: '$[1]' },
|
|
178
|
+
explicitPathsToArguments: { 'taxRegion.id': '$[0]' },
|
|
179
|
+
singleArgumentUnchanged: false,
|
|
180
|
+
}, ['_id', 'taxRegion']);
|
|
181
|
+
sideEffects?.onError?.(err);
|
|
182
|
+
throw transformedError;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.updateTaxRegion = updateTaxRegion;
|
|
186
|
+
/**
|
|
187
|
+
* Deletes a tax region.
|
|
188
|
+
*
|
|
189
|
+
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
190
|
+
* @param taxRegionId - ID of the tax region to delete.
|
|
191
|
+
* @public
|
|
192
|
+
* @documentationMaturity preview
|
|
193
|
+
* @requiredField taxRegionId
|
|
194
|
+
* @permissionId BILLING.TAX_REGION_DELETE
|
|
195
|
+
* @permissionScope Manage Stores - all permissions
|
|
196
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
197
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
198
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
199
|
+
* @permissionScope Manage Orders
|
|
200
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
201
|
+
* @applicableIdentity APP
|
|
202
|
+
* @fqn wix.billing.v1.TaxRegionsService.DeleteTaxRegion
|
|
203
|
+
*/
|
|
204
|
+
async function deleteTaxRegion(taxRegionId) {
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
207
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
208
|
+
taxRegionId: taxRegionId,
|
|
209
|
+
});
|
|
210
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.deleteTaxRegion(payload);
|
|
211
|
+
sideEffects?.onSiteCall?.();
|
|
212
|
+
try {
|
|
213
|
+
const result = await httpClient.request(reqOpts);
|
|
214
|
+
sideEffects?.onSuccess?.(result);
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
218
|
+
spreadPathsToArguments: {},
|
|
219
|
+
explicitPathsToArguments: { taxRegionId: '$[0]' },
|
|
220
|
+
singleArgumentUnchanged: false,
|
|
221
|
+
}, ['taxRegionId']);
|
|
222
|
+
sideEffects?.onError?.(err);
|
|
223
|
+
throw transformedError;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
exports.deleteTaxRegion = deleteTaxRegion;
|
|
227
|
+
/**
|
|
228
|
+
* Creates a query to retrieve a list of tax regions.
|
|
229
|
+
*
|
|
230
|
+
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
231
|
+
*
|
|
232
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
233
|
+
*
|
|
234
|
+
* 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.
|
|
235
|
+
*
|
|
236
|
+
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
237
|
+
* + `ascending("_id")`
|
|
238
|
+
*
|
|
239
|
+
* 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"`.
|
|
240
|
+
*
|
|
241
|
+
* 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`.
|
|
242
|
+
* @public
|
|
243
|
+
* @documentationMaturity preview
|
|
244
|
+
* @permissionScope Manage Stores - all permissions
|
|
245
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
246
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
247
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
248
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
249
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
250
|
+
* @permissionScope Manage Orders
|
|
251
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
252
|
+
* @permissionId BILLING.TAX_REGION_READ
|
|
253
|
+
* @applicableIdentity APP
|
|
254
|
+
* @applicableIdentity VISITOR
|
|
255
|
+
* @fqn wix.billing.v1.TaxRegionsService.QueryTaxRegions
|
|
256
|
+
*/
|
|
257
|
+
function queryTaxRegions() {
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
260
|
+
return (0, query_builder_1.queryBuilder)({
|
|
261
|
+
func: async (payload) => {
|
|
262
|
+
const reqOpts = ambassadorWixBillingV1TaxRegion.queryTaxRegions(payload);
|
|
263
|
+
sideEffects?.onSiteCall?.();
|
|
264
|
+
try {
|
|
265
|
+
const result = await httpClient.request(reqOpts);
|
|
266
|
+
sideEffects?.onSuccess?.(result);
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
catch (err) {
|
|
270
|
+
sideEffects?.onError?.(err);
|
|
271
|
+
throw err;
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
requestTransformer: (query) => {
|
|
275
|
+
const args = [query, {}];
|
|
276
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
277
|
+
...args?.[1],
|
|
278
|
+
query: args?.[0],
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
responseTransformer: ({ data }) => {
|
|
282
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
|
|
283
|
+
return {
|
|
284
|
+
items: transformedData?.taxRegions,
|
|
285
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
286
|
+
};
|
|
287
|
+
},
|
|
288
|
+
errorTransformer: (err) => {
|
|
289
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
290
|
+
spreadPathsToArguments: {},
|
|
291
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
292
|
+
singleArgumentUnchanged: false,
|
|
293
|
+
});
|
|
294
|
+
throw transformedError;
|
|
295
|
+
},
|
|
296
|
+
pagingMethod: 'CURSOR',
|
|
297
|
+
transformationPaths: {},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
exports.queryTaxRegions = queryTaxRegions;
|
|
301
|
+
//# 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,sEAAuF;AACvF,kEAA8D;AAC9D,oFAGiD;AAEjD,6GAA+F;AA4N/F,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA8OD,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AA0JD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,eAAe,CACnC,SAAoB;IAEpB,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC;QACpD,SAAS,EAAE,SAAS;KACrB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,+BAA+B,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAU,CA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AAE,CAAC,MAAM,CAAC,CAAC;gBACjC,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;QACD,kBAAkB,EAAE,CAAC,KAAsC,EAAE,EAAE;YAC7D,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE,CAA0C,CAAC;YAClE,OAAO,IAAA,8DAAqC,EAAC;gBAC3C,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;gBACZ,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;aACjB,CAAC,CAAC;QACL,CAAC;QACD,mBAAmB,EAAE,CAAC,EAAE,IAAI,EAAyC,EAAE,EAAE;YACvE,MAAM,eAAe,GAAG,IAAA,gEAAuC,EAAC,IAAI,CAAC,CAAC;YAEtE,OAAO;gBACL,KAAK,EAAE,eAAe,EAAE,UAAU;gBAClC,cAAc,EAAE,eAAe,EAAE,cAAc;aAChD,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,CAAC,GAAY,EAAE,EAAE;YACjC,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EAAC,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;AArDD,0CAqDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/billing-v1-tax-region-tax-regions.context.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,oDAAoD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/billing-v1-tax-region-tax-regions.universal.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/billing-v1-tax-region-tax-regions.meta.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createTaxRegion as publicCreateTaxRegion, getTaxRegion as publicGetTaxRegion, updateTaxRegion as publicUpdateTaxRegion, deleteTaxRegion as publicDeleteTaxRegion, queryTaxRegions as publicQueryTaxRegions } from './billing-v1-tax-region-tax-regions.public.js';
|
|
2
|
+
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
3
|
+
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
4
|
+
import { onTaxRegionCreated as publicOnTaxRegionCreated } from './billing-v1-tax-region-tax-regions.public.js';
|
|
5
|
+
import { onTaxRegionDeleted as publicOnTaxRegionDeleted } from './billing-v1-tax-region-tax-regions.public.js';
|
|
6
|
+
import { onTaxRegionUpdated as publicOnTaxRegionUpdated } from './billing-v1-tax-region-tax-regions.public.js';
|
|
7
|
+
export declare const createTaxRegion: MaybeContext<BuildRESTFunction<typeof publicCreateTaxRegion> & typeof publicCreateTaxRegion>;
|
|
8
|
+
export declare const getTaxRegion: MaybeContext<BuildRESTFunction<typeof publicGetTaxRegion> & typeof publicGetTaxRegion>;
|
|
9
|
+
export declare const updateTaxRegion: MaybeContext<BuildRESTFunction<typeof publicUpdateTaxRegion> & typeof publicUpdateTaxRegion>;
|
|
10
|
+
export declare const deleteTaxRegion: MaybeContext<BuildRESTFunction<typeof publicDeleteTaxRegion> & typeof publicDeleteTaxRegion>;
|
|
11
|
+
export declare const queryTaxRegions: MaybeContext<BuildRESTFunction<typeof publicQueryTaxRegions> & typeof publicQueryTaxRegions>;
|
|
12
|
+
/** */
|
|
13
|
+
export declare const onTaxRegionCreated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionCreated>>;
|
|
14
|
+
/**
|
|
15
|
+
* Triggered when a tax region is deleted.
|
|
16
|
+
*/
|
|
17
|
+
export declare const onTaxRegionDeleted: ReturnType<typeof createEventModule<typeof publicOnTaxRegionDeleted>>;
|
|
18
|
+
/**
|
|
19
|
+
* Triggered when a tax region is updated.
|
|
20
|
+
*/
|
|
21
|
+
export declare const onTaxRegionUpdated: ReturnType<typeof createEventModule<typeof publicOnTaxRegionUpdated>>;
|
|
22
|
+
export { SortOrder, WebhookIdentityType, } from './billing-v1-tax-region-tax-regions.universal.js';
|
|
23
|
+
export { TaxRegion, CreateTaxRegionRequest, CreateTaxRegionResponse, ConflictErrorDetails, BulkCreateTaxRegionRequest, BulkCreateTaxRegionResponse, BulkCreateTaxRegionResult, ItemMetadata, ApplicationError, BulkActionMetadata, GetTaxRegionRequest, GetTaxRegionResponse, UpdateTaxRegionRequest, UpdateTaxRegionResponse, DeleteTaxRegionRequest, DeleteTaxRegionResponse, QueryTaxRegionsRequest, CursorQuery, CursorQueryPagingMethodOneOf, Sorting, CursorPaging, QueryTaxRegionsResponse, CursorPagingMetadata, Cursors, CreateOrGetTaxRegionWithoutValidationRequest, CreateOrGetTaxRegionWithoutValidationResponse, DeleteTaxRegionWithoutDomainEventsRequest, DeleteTaxRegionWithoutDomainEventsResponse, BulkRestoreTaxRegionsRequest, BulkRestoreTaxRegionsResponse, BulkRestoreTaxRegionsResult, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, TaxRegionNonNullableFields, CreateTaxRegionResponseNonNullableFields, GetTaxRegionResponseNonNullableFields, UpdateTaxRegionResponseNonNullableFields, QueryTaxRegionsResponseNonNullableFields, BaseEventMetadata, EventMetadata, TaxRegionCreatedEnvelope, TaxRegionDeletedEnvelope, TaxRegionUpdatedEnvelope, UpdateTaxRegion, TaxRegionsQueryResult, TaxRegionsQueryBuilder, } from './billing-v1-tax-region-tax-regions.universal.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createTaxRegion as publicCreateTaxRegion, getTaxRegion as publicGetTaxRegion, updateTaxRegion as publicUpdateTaxRegion, deleteTaxRegion as publicDeleteTaxRegion, queryTaxRegions as publicQueryTaxRegions, } from './billing-v1-tax-region-tax-regions.public.js';
|
|
2
|
+
import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
|
|
3
|
+
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
|
|
4
|
+
import { onTaxRegionCreated as publicOnTaxRegionCreated } from './billing-v1-tax-region-tax-regions.public.js';
|
|
5
|
+
import { onTaxRegionDeleted as publicOnTaxRegionDeleted } from './billing-v1-tax-region-tax-regions.public.js';
|
|
6
|
+
import { onTaxRegionUpdated as publicOnTaxRegionUpdated } from './billing-v1-tax-region-tax-regions.public.js';
|
|
7
|
+
export const createTaxRegion = /*#__PURE__*/ createRESTModule(publicCreateTaxRegion);
|
|
8
|
+
export const getTaxRegion = /*#__PURE__*/ createRESTModule(publicGetTaxRegion);
|
|
9
|
+
export const updateTaxRegion = /*#__PURE__*/ createRESTModule(publicUpdateTaxRegion);
|
|
10
|
+
export const deleteTaxRegion = /*#__PURE__*/ createRESTModule(publicDeleteTaxRegion);
|
|
11
|
+
export const queryTaxRegions = /*#__PURE__*/ createRESTModule(publicQueryTaxRegions);
|
|
12
|
+
/** */
|
|
13
|
+
export const onTaxRegionCreated = createEventModule(publicOnTaxRegionCreated);
|
|
14
|
+
/**
|
|
15
|
+
* Triggered when a tax region is deleted.
|
|
16
|
+
*/
|
|
17
|
+
export const onTaxRegionDeleted = createEventModule(publicOnTaxRegionDeleted);
|
|
18
|
+
/**
|
|
19
|
+
* Triggered when a tax region is updated.
|
|
20
|
+
*/
|
|
21
|
+
export const onTaxRegionUpdated = createEventModule(publicOnTaxRegionUpdated);
|
|
22
|
+
export { SortOrder, WebhookIdentityType, } from './billing-v1-tax-region-tax-regions.universal.js';
|
|
23
|
+
//# sourceMappingURL=billing-v1-tax-region-tax-regions.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-v1-tax-region-tax-regions.context.js","sourceRoot":"","sources":["../../../../src/billing-v1-tax-region-tax-regions.context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,IAAI,qBAAqB,EACxC,YAAY,IAAI,kBAAkB,EAClC,eAAe,IAAI,qBAAqB,EACxC,eAAe,IAAI,qBAAqB,EACxC,eAAe,IAAI,qBAAqB,GACzC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAE/G,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAErB,aAAa,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM;AACN,MAAM,CAAC,MAAM,kBAAkB,GAE3B,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;AAChD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAE3B,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;AAChD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAE3B,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;AAEhD,OAAO,EACL,SAAS,EACT,mBAAmB,GACpB,MAAM,kDAAkD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a tax region.
|
|
4
|
+
*
|
|
5
|
+
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
6
|
+
*
|
|
7
|
+
* Wix uses tax regions to calculate tax.
|
|
8
|
+
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
9
|
+
*/
|
|
10
|
+
export declare function createTaxRegion(payload: object): RequestOptionsFactory<any>;
|
|
11
|
+
/** Retrieves a tax region. */
|
|
12
|
+
export declare function getTaxRegion(payload: object): RequestOptionsFactory<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Updates a tax region.
|
|
15
|
+
*
|
|
16
|
+
* Each time the tax region is updated, `revision` increments by 1.
|
|
17
|
+
* The current `revision` must be passed when updating the tax region.
|
|
18
|
+
* This ensures you're working with the latest tax region and prevents
|
|
19
|
+
* unintended overwrites.
|
|
20
|
+
*/
|
|
21
|
+
export declare function updateTaxRegion(payload: object): RequestOptionsFactory<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Deletes a tax region.
|
|
24
|
+
*
|
|
25
|
+
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
26
|
+
*/
|
|
27
|
+
export declare function deleteTaxRegion(payload: object): RequestOptionsFactory<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a query to retrieve a list of tax regions.
|
|
30
|
+
*
|
|
31
|
+
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
32
|
+
*
|
|
33
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
34
|
+
*
|
|
35
|
+
* 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.
|
|
36
|
+
*
|
|
37
|
+
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
38
|
+
* + `ascending("_id")`
|
|
39
|
+
*
|
|
40
|
+
* 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"`.
|
|
41
|
+
*
|
|
42
|
+
* 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`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function queryTaxRegions(payload: object): RequestOptionsFactory<any>;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
|
|
2
|
+
import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
|
|
3
|
+
import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
|
|
4
|
+
import { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';
|
|
5
|
+
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
|
6
|
+
import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
|
|
7
|
+
function resolveWixBillingV1TaxRegionsServiceUrl(opts) {
|
|
8
|
+
const domainToMappings = {
|
|
9
|
+
'www.wixapis.com': [
|
|
10
|
+
{
|
|
11
|
+
srcPath: '/billing/v1/tax-regions',
|
|
12
|
+
destPath: '/v1/tax-regions',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
srcPath: '/billing/v1/bulk/tax-regions',
|
|
16
|
+
destPath: '/v1/bulk/tax-regions',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
'manage._base_domain_': [
|
|
20
|
+
{
|
|
21
|
+
srcPath: '/billing/v1/tax-regions',
|
|
22
|
+
destPath: '/v1/tax-regions',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
srcPath: '/billing/v1/bulk/tax-regions',
|
|
26
|
+
destPath: '/v1/bulk/tax-regions',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
31
|
+
}
|
|
32
|
+
const PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-regions';
|
|
33
|
+
/**
|
|
34
|
+
* Creates a tax region.
|
|
35
|
+
*
|
|
36
|
+
* Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
|
|
37
|
+
*
|
|
38
|
+
* Wix uses tax regions to calculate tax.
|
|
39
|
+
* <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
|
|
40
|
+
*/
|
|
41
|
+
export function createTaxRegion(payload) {
|
|
42
|
+
function __createTaxRegion({ host }) {
|
|
43
|
+
const serializedData = transformPaths(payload, [
|
|
44
|
+
{
|
|
45
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
46
|
+
paths: [
|
|
47
|
+
{ path: 'taxRegion.createdDate' },
|
|
48
|
+
{ path: 'taxRegion.updatedDate' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
const metadata = {
|
|
53
|
+
entityFqdn: 'wix.billing.v1.tax_region',
|
|
54
|
+
method: 'POST',
|
|
55
|
+
methodFqn: 'wix.billing.v1.TaxRegionsService.CreateTaxRegion',
|
|
56
|
+
packageName: PACKAGE_NAME,
|
|
57
|
+
url: resolveWixBillingV1TaxRegionsServiceUrl({
|
|
58
|
+
protoPath: '/v1/tax-regions',
|
|
59
|
+
data: serializedData,
|
|
60
|
+
host,
|
|
61
|
+
}),
|
|
62
|
+
data: serializedData,
|
|
63
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
64
|
+
{
|
|
65
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
66
|
+
paths: [
|
|
67
|
+
{ path: 'taxRegion.createdDate' },
|
|
68
|
+
{ path: 'taxRegion.updatedDate' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
]),
|
|
72
|
+
};
|
|
73
|
+
return metadata;
|
|
74
|
+
}
|
|
75
|
+
return __createTaxRegion;
|
|
76
|
+
}
|
|
77
|
+
/** Retrieves a tax region. */
|
|
78
|
+
export function getTaxRegion(payload) {
|
|
79
|
+
function __getTaxRegion({ host }) {
|
|
80
|
+
const metadata = {
|
|
81
|
+
entityFqdn: 'wix.billing.v1.tax_region',
|
|
82
|
+
method: 'GET',
|
|
83
|
+
methodFqn: 'wix.billing.v1.TaxRegionsService.GetTaxRegion',
|
|
84
|
+
packageName: PACKAGE_NAME,
|
|
85
|
+
url: resolveWixBillingV1TaxRegionsServiceUrl({
|
|
86
|
+
protoPath: '/v1/tax-regions/{taxRegionId}',
|
|
87
|
+
data: payload,
|
|
88
|
+
host,
|
|
89
|
+
}),
|
|
90
|
+
params: toURLSearchParams(payload),
|
|
91
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
92
|
+
{
|
|
93
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
94
|
+
paths: [
|
|
95
|
+
{ path: 'taxRegion.createdDate' },
|
|
96
|
+
{ path: 'taxRegion.updatedDate' },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
]),
|
|
100
|
+
};
|
|
101
|
+
return metadata;
|
|
102
|
+
}
|
|
103
|
+
return __getTaxRegion;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Updates a tax region.
|
|
107
|
+
*
|
|
108
|
+
* Each time the tax region is updated, `revision` increments by 1.
|
|
109
|
+
* The current `revision` must be passed when updating the tax region.
|
|
110
|
+
* This ensures you're working with the latest tax region and prevents
|
|
111
|
+
* unintended overwrites.
|
|
112
|
+
*/
|
|
113
|
+
export function updateTaxRegion(payload) {
|
|
114
|
+
function __updateTaxRegion({ host }) {
|
|
115
|
+
const serializedData = transformPaths(payload, [
|
|
116
|
+
{
|
|
117
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
118
|
+
paths: [{ path: 'fieldMask' }],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
122
|
+
paths: [
|
|
123
|
+
{ path: 'taxRegion.createdDate' },
|
|
124
|
+
{ path: 'taxRegion.updatedDate' },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
]);
|
|
128
|
+
const metadata = {
|
|
129
|
+
entityFqdn: 'wix.billing.v1.tax_region',
|
|
130
|
+
method: 'PATCH',
|
|
131
|
+
methodFqn: 'wix.billing.v1.TaxRegionsService.UpdateTaxRegion',
|
|
132
|
+
packageName: PACKAGE_NAME,
|
|
133
|
+
url: resolveWixBillingV1TaxRegionsServiceUrl({
|
|
134
|
+
protoPath: '/v1/tax-regions/{taxRegion.id}',
|
|
135
|
+
data: serializedData,
|
|
136
|
+
host,
|
|
137
|
+
}),
|
|
138
|
+
data: serializedData,
|
|
139
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
140
|
+
{
|
|
141
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
142
|
+
paths: [
|
|
143
|
+
{ path: 'taxRegion.createdDate' },
|
|
144
|
+
{ path: 'taxRegion.updatedDate' },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
]),
|
|
148
|
+
};
|
|
149
|
+
return metadata;
|
|
150
|
+
}
|
|
151
|
+
return __updateTaxRegion;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Deletes a tax region.
|
|
155
|
+
*
|
|
156
|
+
* When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
|
|
157
|
+
*/
|
|
158
|
+
export function deleteTaxRegion(payload) {
|
|
159
|
+
function __deleteTaxRegion({ host }) {
|
|
160
|
+
const metadata = {
|
|
161
|
+
entityFqdn: 'wix.billing.v1.tax_region',
|
|
162
|
+
method: 'DELETE',
|
|
163
|
+
methodFqn: 'wix.billing.v1.TaxRegionsService.DeleteTaxRegion',
|
|
164
|
+
packageName: PACKAGE_NAME,
|
|
165
|
+
url: resolveWixBillingV1TaxRegionsServiceUrl({
|
|
166
|
+
protoPath: '/v1/tax-regions/{taxRegionId}',
|
|
167
|
+
data: payload,
|
|
168
|
+
host,
|
|
169
|
+
}),
|
|
170
|
+
params: toURLSearchParams(payload),
|
|
171
|
+
};
|
|
172
|
+
return metadata;
|
|
173
|
+
}
|
|
174
|
+
return __deleteTaxRegion;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates a query to retrieve a list of tax regions.
|
|
178
|
+
*
|
|
179
|
+
* The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
|
|
180
|
+
*
|
|
181
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
182
|
+
*
|
|
183
|
+
* 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.
|
|
184
|
+
*
|
|
185
|
+
* `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
|
|
186
|
+
* + `ascending("_id")`
|
|
187
|
+
*
|
|
188
|
+
* 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"`.
|
|
189
|
+
*
|
|
190
|
+
* 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`.
|
|
191
|
+
*/
|
|
192
|
+
export function queryTaxRegions(payload) {
|
|
193
|
+
function __queryTaxRegions({ host }) {
|
|
194
|
+
const metadata = {
|
|
195
|
+
entityFqdn: 'wix.billing.v1.tax_region',
|
|
196
|
+
method: 'POST',
|
|
197
|
+
methodFqn: 'wix.billing.v1.TaxRegionsService.QueryTaxRegions',
|
|
198
|
+
packageName: PACKAGE_NAME,
|
|
199
|
+
url: resolveWixBillingV1TaxRegionsServiceUrl({
|
|
200
|
+
protoPath: '/v1/tax-regions/query',
|
|
201
|
+
data: payload,
|
|
202
|
+
host,
|
|
203
|
+
}),
|
|
204
|
+
data: payload,
|
|
205
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
206
|
+
{
|
|
207
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
208
|
+
paths: [
|
|
209
|
+
{ path: 'taxRegions.createdDate' },
|
|
210
|
+
{ path: 'taxRegions.updatedDate' },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
]),
|
|
214
|
+
};
|
|
215
|
+
return metadata;
|
|
216
|
+
}
|
|
217
|
+
return __queryTaxRegions;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=billing-v1-tax-region-tax-regions.http.js.map
|