@wix/auto_sdk_ecom_tax-calculation 1.0.3 → 1.0.4
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/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.mts +419 -0
- package/build/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.ts +419 -0
- package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.mts} +11 -8
- package/build/{es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.ts} +11 -8
- package/build/index.js +211 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +185 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.mts +419 -0
- package/build/internal/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.ts +419 -0
- package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → internal/index.d.mts} +11 -8
- package/build/internal/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.ts} +11 -8
- package/build/internal/index.js +211 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +185 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → meta.d.mts} +34 -21
- package/build/{es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → internal/meta.d.ts} +34 -21
- package/build/internal/meta.js +138 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +110 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → meta.d.mts} +34 -21
- package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → meta.d.ts} +34 -21
- package/build/meta.js +138 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +110 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -478
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
- package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -478
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
- package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -478
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
- package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -478
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
- package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export interface CalculateTaxRequest {
|
|
1
|
+
import { b as CalculateTaxRequest$1, a as CalculateTaxResponse$1, l as ListTaxCalculatorsRequest$1, L as ListTaxCalculatorsResponse$1 } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.js';
|
|
2
|
+
|
|
3
|
+
interface CalculateTaxRequest {
|
|
6
4
|
/**
|
|
7
5
|
* Optional ID of the entity that tax is being calculated for. For example, a cart ID.
|
|
8
6
|
* @format GUID
|
|
@@ -28,7 +26,7 @@ export interface CalculateTaxRequest {
|
|
|
28
26
|
lineItems: LineItem[];
|
|
29
27
|
}
|
|
30
28
|
/** Wix common address format for physical address to use if you plan to store addresses in your service. */
|
|
31
|
-
|
|
29
|
+
interface Address {
|
|
32
30
|
/**
|
|
33
31
|
* 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.
|
|
34
32
|
* @format COUNTRY
|
|
@@ -61,7 +59,7 @@ export interface Address {
|
|
|
61
59
|
addressLine2?: string | null;
|
|
62
60
|
}
|
|
63
61
|
/** Line items to calculate tax for. */
|
|
64
|
-
|
|
62
|
+
interface LineItem {
|
|
65
63
|
/**
|
|
66
64
|
* Line item ID.
|
|
67
65
|
* @minLength 1
|
|
@@ -113,7 +111,7 @@ export interface LineItem {
|
|
|
113
111
|
addressIndex?: AddressIndex;
|
|
114
112
|
}
|
|
115
113
|
/** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
|
|
116
|
-
|
|
114
|
+
interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
|
|
117
115
|
/** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
|
|
118
116
|
singleAddress?: number;
|
|
119
117
|
/**
|
|
@@ -123,7 +121,7 @@ export interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
|
|
|
123
121
|
multipleAddresses?: MultipleAddresses;
|
|
124
122
|
}
|
|
125
123
|
/** @oneof */
|
|
126
|
-
|
|
124
|
+
interface AddressIndexAddressIndexOptionsOneOf {
|
|
127
125
|
/** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
|
|
128
126
|
singleAddress?: number;
|
|
129
127
|
/**
|
|
@@ -136,13 +134,13 @@ export interface AddressIndexAddressIndexOptionsOneOf {
|
|
|
136
134
|
* Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item
|
|
137
135
|
* is shipped from, as well as the address the item is shipped to.
|
|
138
136
|
*/
|
|
139
|
-
|
|
137
|
+
interface MultipleAddresses {
|
|
140
138
|
/** Index of the origin address. */
|
|
141
139
|
origin?: number;
|
|
142
140
|
/** Index of the destination address. */
|
|
143
141
|
destination?: number;
|
|
144
142
|
}
|
|
145
|
-
|
|
143
|
+
interface CalculateTaxResponse {
|
|
146
144
|
/**
|
|
147
145
|
* Optional ID of the entity that tax is being calculated for. For example, a cart ID.
|
|
148
146
|
* @format GUID
|
|
@@ -174,7 +172,7 @@ export interface CalculateTaxResponse {
|
|
|
174
172
|
*/
|
|
175
173
|
errors?: ApplicationError[];
|
|
176
174
|
}
|
|
177
|
-
|
|
175
|
+
interface TaxSummary {
|
|
178
176
|
/**
|
|
179
177
|
* Total price for all line items.
|
|
180
178
|
* @format DECIMAL_VALUE
|
|
@@ -214,7 +212,7 @@ export interface TaxSummary {
|
|
|
214
212
|
* e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%,
|
|
215
213
|
* then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$.
|
|
216
214
|
*/
|
|
217
|
-
|
|
215
|
+
interface AggregatedTaxBreakdown {
|
|
218
216
|
/**
|
|
219
217
|
* Name of the tax that was calculated.
|
|
220
218
|
* @maxLength 200
|
|
@@ -245,7 +243,7 @@ export interface AggregatedTaxBreakdown {
|
|
|
245
243
|
aggregatedTaxAmount?: string;
|
|
246
244
|
}
|
|
247
245
|
/** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */
|
|
248
|
-
|
|
246
|
+
declare enum JurisdictionType {
|
|
249
247
|
UNDEFINED = "UNDEFINED",
|
|
250
248
|
COUNTRY = "COUNTRY",
|
|
251
249
|
STATE = "STATE",
|
|
@@ -254,7 +252,7 @@ export declare enum JurisdictionType {
|
|
|
254
252
|
SPECIAL = "SPECIAL"
|
|
255
253
|
}
|
|
256
254
|
/** Tax details for a specific line item. */
|
|
257
|
-
|
|
255
|
+
interface LineItemTaxDetails {
|
|
258
256
|
/**
|
|
259
257
|
* Line item ID.
|
|
260
258
|
* @minLength 1
|
|
@@ -285,7 +283,7 @@ export interface LineItemTaxDetails {
|
|
|
285
283
|
taxIncludedInPrice?: boolean;
|
|
286
284
|
}
|
|
287
285
|
/** A detailed description of all the tax authorities applied on this item. */
|
|
288
|
-
|
|
286
|
+
interface TaxBreakdown {
|
|
289
287
|
/**
|
|
290
288
|
* Jurisdiction that taxes were calculated for.
|
|
291
289
|
* @maxLength 200
|
|
@@ -328,7 +326,7 @@ export interface TaxBreakdown {
|
|
|
328
326
|
/** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */
|
|
329
327
|
jurisdictionType?: JurisdictionType;
|
|
330
328
|
}
|
|
331
|
-
|
|
329
|
+
interface LineItemTaxSummary {
|
|
332
330
|
/**
|
|
333
331
|
* Total price for this line item.
|
|
334
332
|
* To determine the price for each individual unit of this line item, divide by `quantity`.
|
|
@@ -354,7 +352,7 @@ export interface LineItemTaxSummary {
|
|
|
354
352
|
*/
|
|
355
353
|
appId?: string | null;
|
|
356
354
|
}
|
|
357
|
-
|
|
355
|
+
interface ApplicationError {
|
|
358
356
|
/** Error code. */
|
|
359
357
|
code?: string;
|
|
360
358
|
/** Description of the error. */
|
|
@@ -362,16 +360,16 @@ export interface ApplicationError {
|
|
|
362
360
|
/** Data related to the error. */
|
|
363
361
|
data?: Record<string, any> | null;
|
|
364
362
|
}
|
|
365
|
-
|
|
363
|
+
interface ListTaxCalculatorsRequest {
|
|
366
364
|
}
|
|
367
|
-
|
|
365
|
+
interface ListTaxCalculatorsResponse {
|
|
368
366
|
/**
|
|
369
367
|
* Retrieved tax calculators.
|
|
370
368
|
* @maxSize 10
|
|
371
369
|
*/
|
|
372
370
|
taxCalculatorDetails?: TaxCalculatorDetails[];
|
|
373
371
|
}
|
|
374
|
-
|
|
372
|
+
interface TaxCalculatorDetails {
|
|
375
373
|
/**
|
|
376
374
|
* ID of the tax calculator.
|
|
377
375
|
* @format GUID
|
|
@@ -390,3 +388,18 @@ export interface TaxCalculatorDetails {
|
|
|
390
388
|
*/
|
|
391
389
|
unsupportedCountries?: string[];
|
|
392
390
|
}
|
|
391
|
+
|
|
392
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
393
|
+
getUrl: (context: any) => string;
|
|
394
|
+
httpMethod: K;
|
|
395
|
+
path: string;
|
|
396
|
+
pathParams: M;
|
|
397
|
+
__requestType: T;
|
|
398
|
+
__originalRequestType: S;
|
|
399
|
+
__responseType: Q;
|
|
400
|
+
__originalResponseType: R;
|
|
401
|
+
};
|
|
402
|
+
declare function calculateTax(): __PublicMethodMetaInfo<'POST', {}, CalculateTaxRequest$1, CalculateTaxRequest, CalculateTaxResponse$1, CalculateTaxResponse>;
|
|
403
|
+
declare function listTaxCalculators(): __PublicMethodMetaInfo<'GET', {}, ListTaxCalculatorsRequest$1, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse$1, ListTaxCalculatorsResponse>;
|
|
404
|
+
|
|
405
|
+
export { type __PublicMethodMetaInfo, calculateTax, listTaxCalculators };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// meta.ts
|
|
21
|
+
var meta_exports = {};
|
|
22
|
+
__export(meta_exports, {
|
|
23
|
+
calculateTax: () => calculateTax2,
|
|
24
|
+
listTaxCalculators: () => listTaxCalculators2
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(meta_exports);
|
|
27
|
+
|
|
28
|
+
// src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts
|
|
29
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
30
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
31
|
+
function resolveWixBillingV1TaxCalculationUrl(opts) {
|
|
32
|
+
const domainToMappings = {
|
|
33
|
+
"manage._base_domain_": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/billing/v1/calculate-tax",
|
|
36
|
+
destPath: "/v1/calculate-tax"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
srcPath: "/billing/v1/list-tax-calculators",
|
|
40
|
+
destPath: "/v1/list-tax-calculators"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"www.wixapis.com": [
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/billing/v1/calculate-tax",
|
|
46
|
+
destPath: "/v1/calculate-tax"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
srcPath: "/billing/v1/list-tax-calculators",
|
|
50
|
+
destPath: "/v1/list-tax-calculators"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
55
|
+
}
|
|
56
|
+
var PACKAGE_NAME = "@wix/auto_sdk_ecom_tax-calculation";
|
|
57
|
+
function calculateTax(payload) {
|
|
58
|
+
function __calculateTax({ host }) {
|
|
59
|
+
const metadata = {
|
|
60
|
+
entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
|
|
61
|
+
method: "POST",
|
|
62
|
+
methodFqn: "wix.billing.v1.TaxCalculation.CalculateTax",
|
|
63
|
+
packageName: PACKAGE_NAME,
|
|
64
|
+
url: resolveWixBillingV1TaxCalculationUrl({
|
|
65
|
+
protoPath: "/v1/calculate-tax",
|
|
66
|
+
data: payload,
|
|
67
|
+
host
|
|
68
|
+
}),
|
|
69
|
+
data: payload
|
|
70
|
+
};
|
|
71
|
+
return metadata;
|
|
72
|
+
}
|
|
73
|
+
return __calculateTax;
|
|
74
|
+
}
|
|
75
|
+
function listTaxCalculators(payload) {
|
|
76
|
+
function __listTaxCalculators({ host }) {
|
|
77
|
+
const metadata = {
|
|
78
|
+
entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
|
|
79
|
+
method: "GET",
|
|
80
|
+
methodFqn: "wix.billing.v1.TaxCalculation.ListTaxCalculators",
|
|
81
|
+
packageName: PACKAGE_NAME,
|
|
82
|
+
url: resolveWixBillingV1TaxCalculationUrl({
|
|
83
|
+
protoPath: "/v1/list-tax-calculators",
|
|
84
|
+
data: payload,
|
|
85
|
+
host
|
|
86
|
+
}),
|
|
87
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
88
|
+
};
|
|
89
|
+
return metadata;
|
|
90
|
+
}
|
|
91
|
+
return __listTaxCalculators;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.ts
|
|
95
|
+
function calculateTax2() {
|
|
96
|
+
const payload = {};
|
|
97
|
+
const getRequestOptions = calculateTax(payload);
|
|
98
|
+
const getUrl = (context) => {
|
|
99
|
+
const { url } = getRequestOptions(context);
|
|
100
|
+
return url;
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
getUrl,
|
|
104
|
+
httpMethod: "POST",
|
|
105
|
+
path: "/v1/calculate-tax",
|
|
106
|
+
pathParams: {},
|
|
107
|
+
__requestType: null,
|
|
108
|
+
__originalRequestType: null,
|
|
109
|
+
__responseType: null,
|
|
110
|
+
__originalResponseType: null
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function listTaxCalculators2() {
|
|
114
|
+
const payload = {};
|
|
115
|
+
const getRequestOptions = listTaxCalculators(
|
|
116
|
+
payload
|
|
117
|
+
);
|
|
118
|
+
const getUrl = (context) => {
|
|
119
|
+
const { url } = getRequestOptions(context);
|
|
120
|
+
return url;
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
getUrl,
|
|
124
|
+
httpMethod: "GET",
|
|
125
|
+
path: "/v1/list-tax-calculators",
|
|
126
|
+
pathParams: {},
|
|
127
|
+
__requestType: null,
|
|
128
|
+
__originalRequestType: null,
|
|
129
|
+
__responseType: null,
|
|
130
|
+
__originalResponseType: null
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
calculateTax,
|
|
136
|
+
listTaxCalculators
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts","../../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.ts"],"sourcesContent":["export * from './src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBillingV1TaxCalculationUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/calculate-tax',\n destPath: '/v1/calculate-tax',\n },\n {\n srcPath: '/billing/v1/list-tax-calculators',\n destPath: '/v1/list-tax-calculators',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/calculate-tax',\n destPath: '/v1/calculate-tax',\n },\n {\n srcPath: '/billing/v1/list-tax-calculators',\n destPath: '/v1/list-tax-calculators',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-calculation';\n\n/**\n * Calculates tax for the provided line items.\n *\n * Tax is calculated for each line item based on the tax region\n * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for\n * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the\n * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.\n *\n * The tax is calculated by a tax calculator app installed on the site.\n * Call List Tax Calculators to see which tax calculators are available.\n * To provide your own tax calculations, use the Tax Calculation service plugin.\n *\n * The breakdown of calculated tax returned, includes:\n * + `taxSummary`: The overall total tax calculated.\n * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.\n * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.\n * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.\n */\nexport function calculateTax(payload: object): RequestOptionsFactory<any> {\n function __calculateTax({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxCalculation.CalculateTax',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxCalculationUrl({\n protoPath: '/v1/calculate-tax',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __calculateTax;\n}\n\n/**\n * Retrieves a list of installed tax calculators.\n *\n * Wix uses these calculators to calculate tax.\n */\nexport function listTaxCalculators(\n payload: object\n): RequestOptionsFactory<any> {\n function __listTaxCalculators({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxCalculation.ListTaxCalculators',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxCalculationUrl({\n protoPath: '/v1/list-tax-calculators',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listTaxCalculators;\n}\n","import * as ambassadorWixGatewaysBillingV1TaxCalculationGateway from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js';\nimport * as ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js';\nimport * as ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function calculateTax(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.CalculateTaxRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.CalculateTaxRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.CalculateTaxResponse,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.CalculateTaxResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixGatewaysBillingV1TaxCalculationGateway.calculateTax(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/calculate-tax',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function listTaxCalculators(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.ListTaxCalculatorsRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.ListTaxCalculatorsRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.ListTaxCalculatorsResponse,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.ListTaxCalculatorsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixGatewaysBillingV1TaxCalculationGateway.listTaxCalculators(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/list-tax-calculators',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,qCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;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;AAoBd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qCAAqC;AAAA,QACxC,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAOO,SAAS,mBACd,SAC4B;AAC5B,WAAS,qBAAqB,EAAE,KAAK,GAAQ;AAC3C,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qCAAqC;AAAA,QACxC,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC/EO,SAASC,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgD,aAAa,OAAO;AAE1E,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,sBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgD;AAAA,IAClD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["calculateTax","listTaxCalculators","import_rest_modules","calculateTax","listTaxCalculators"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts
|
|
2
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
3
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
4
|
+
function resolveWixBillingV1TaxCalculationUrl(opts) {
|
|
5
|
+
const domainToMappings = {
|
|
6
|
+
"manage._base_domain_": [
|
|
7
|
+
{
|
|
8
|
+
srcPath: "/billing/v1/calculate-tax",
|
|
9
|
+
destPath: "/v1/calculate-tax"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
srcPath: "/billing/v1/list-tax-calculators",
|
|
13
|
+
destPath: "/v1/list-tax-calculators"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"www.wixapis.com": [
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/billing/v1/calculate-tax",
|
|
19
|
+
destPath: "/v1/calculate-tax"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/billing/v1/list-tax-calculators",
|
|
23
|
+
destPath: "/v1/list-tax-calculators"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
28
|
+
}
|
|
29
|
+
var PACKAGE_NAME = "@wix/auto_sdk_ecom_tax-calculation";
|
|
30
|
+
function calculateTax(payload) {
|
|
31
|
+
function __calculateTax({ host }) {
|
|
32
|
+
const metadata = {
|
|
33
|
+
entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
|
|
34
|
+
method: "POST",
|
|
35
|
+
methodFqn: "wix.billing.v1.TaxCalculation.CalculateTax",
|
|
36
|
+
packageName: PACKAGE_NAME,
|
|
37
|
+
url: resolveWixBillingV1TaxCalculationUrl({
|
|
38
|
+
protoPath: "/v1/calculate-tax",
|
|
39
|
+
data: payload,
|
|
40
|
+
host
|
|
41
|
+
}),
|
|
42
|
+
data: payload
|
|
43
|
+
};
|
|
44
|
+
return metadata;
|
|
45
|
+
}
|
|
46
|
+
return __calculateTax;
|
|
47
|
+
}
|
|
48
|
+
function listTaxCalculators(payload) {
|
|
49
|
+
function __listTaxCalculators({ host }) {
|
|
50
|
+
const metadata = {
|
|
51
|
+
entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
|
|
52
|
+
method: "GET",
|
|
53
|
+
methodFqn: "wix.billing.v1.TaxCalculation.ListTaxCalculators",
|
|
54
|
+
packageName: PACKAGE_NAME,
|
|
55
|
+
url: resolveWixBillingV1TaxCalculationUrl({
|
|
56
|
+
protoPath: "/v1/list-tax-calculators",
|
|
57
|
+
data: payload,
|
|
58
|
+
host
|
|
59
|
+
}),
|
|
60
|
+
params: toURLSearchParams(payload)
|
|
61
|
+
};
|
|
62
|
+
return metadata;
|
|
63
|
+
}
|
|
64
|
+
return __listTaxCalculators;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.ts
|
|
68
|
+
function calculateTax2() {
|
|
69
|
+
const payload = {};
|
|
70
|
+
const getRequestOptions = calculateTax(payload);
|
|
71
|
+
const getUrl = (context) => {
|
|
72
|
+
const { url } = getRequestOptions(context);
|
|
73
|
+
return url;
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
getUrl,
|
|
77
|
+
httpMethod: "POST",
|
|
78
|
+
path: "/v1/calculate-tax",
|
|
79
|
+
pathParams: {},
|
|
80
|
+
__requestType: null,
|
|
81
|
+
__originalRequestType: null,
|
|
82
|
+
__responseType: null,
|
|
83
|
+
__originalResponseType: null
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function listTaxCalculators2() {
|
|
87
|
+
const payload = {};
|
|
88
|
+
const getRequestOptions = listTaxCalculators(
|
|
89
|
+
payload
|
|
90
|
+
);
|
|
91
|
+
const getUrl = (context) => {
|
|
92
|
+
const { url } = getRequestOptions(context);
|
|
93
|
+
return url;
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
getUrl,
|
|
97
|
+
httpMethod: "GET",
|
|
98
|
+
path: "/v1/list-tax-calculators",
|
|
99
|
+
pathParams: {},
|
|
100
|
+
__requestType: null,
|
|
101
|
+
__originalRequestType: null,
|
|
102
|
+
__responseType: null,
|
|
103
|
+
__originalResponseType: null
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
calculateTax2 as calculateTax,
|
|
108
|
+
listTaxCalculators2 as listTaxCalculators
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts","../../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBillingV1TaxCalculationUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/billing/v1/calculate-tax',\n destPath: '/v1/calculate-tax',\n },\n {\n srcPath: '/billing/v1/list-tax-calculators',\n destPath: '/v1/list-tax-calculators',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/billing/v1/calculate-tax',\n destPath: '/v1/calculate-tax',\n },\n {\n srcPath: '/billing/v1/list-tax-calculators',\n destPath: '/v1/list-tax-calculators',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-calculation';\n\n/**\n * Calculates tax for the provided line items.\n *\n * Tax is calculated for each line item based on the tax region\n * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for\n * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the\n * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.\n *\n * The tax is calculated by a tax calculator app installed on the site.\n * Call List Tax Calculators to see which tax calculators are available.\n * To provide your own tax calculations, use the Tax Calculation service plugin.\n *\n * The breakdown of calculated tax returned, includes:\n * + `taxSummary`: The overall total tax calculated.\n * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.\n * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.\n * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.\n */\nexport function calculateTax(payload: object): RequestOptionsFactory<any> {\n function __calculateTax({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n method: 'POST' as any,\n methodFqn: 'wix.billing.v1.TaxCalculation.CalculateTax',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxCalculationUrl({\n protoPath: '/v1/calculate-tax',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __calculateTax;\n}\n\n/**\n * Retrieves a list of installed tax calculators.\n *\n * Wix uses these calculators to calculate tax.\n */\nexport function listTaxCalculators(\n payload: object\n): RequestOptionsFactory<any> {\n function __listTaxCalculators({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n method: 'GET' as any,\n methodFqn: 'wix.billing.v1.TaxCalculation.ListTaxCalculators',\n packageName: PACKAGE_NAME,\n url: resolveWixBillingV1TaxCalculationUrl({\n protoPath: '/v1/list-tax-calculators',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listTaxCalculators;\n}\n","import * as ambassadorWixGatewaysBillingV1TaxCalculationGateway from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js';\nimport * as ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js';\nimport * as ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function calculateTax(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.CalculateTaxRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.CalculateTaxRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.CalculateTaxResponse,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.CalculateTaxResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixGatewaysBillingV1TaxCalculationGateway.calculateTax(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/calculate-tax',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function listTaxCalculators(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.ListTaxCalculatorsRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.ListTaxCalculatorsRequest,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayUniversalTypes.ListTaxCalculatorsResponse,\n ambassadorWixGatewaysBillingV1TaxCalculationGatewayTypes.ListTaxCalculatorsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixGatewaysBillingV1TaxCalculationGateway.listTaxCalculators(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/list-tax-calculators',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,qCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAoBd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qCAAqC;AAAA,QACxC,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAOO,SAAS,mBACd,SAC4B;AAC5B,WAAS,qBAAqB,EAAE,KAAK,GAAQ;AAC3C,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qCAAqC;AAAA,QACxC,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC/EO,SAASA,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgD,aAAa,OAAO;AAE1E,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,sBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgD;AAAA,IAClD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["calculateTax","listTaxCalculators"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export interface CalculateTaxRequest {
|
|
1
|
+
import { b as CalculateTaxRequest$1, a as CalculateTaxResponse$1, l as ListTaxCalculatorsRequest$1, L as ListTaxCalculatorsResponse$1 } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.mjs';
|
|
2
|
+
|
|
3
|
+
interface CalculateTaxRequest {
|
|
6
4
|
/**
|
|
7
5
|
* Optional ID of the entity that tax is being calculated for. For example, a cart ID.
|
|
8
6
|
* @format GUID
|
|
@@ -28,7 +26,7 @@ export interface CalculateTaxRequest {
|
|
|
28
26
|
lineItems: LineItem[];
|
|
29
27
|
}
|
|
30
28
|
/** Wix common address format for physical address to use if you plan to store addresses in your service. */
|
|
31
|
-
|
|
29
|
+
interface Address {
|
|
32
30
|
/**
|
|
33
31
|
* 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.
|
|
34
32
|
* @format COUNTRY
|
|
@@ -61,7 +59,7 @@ export interface Address {
|
|
|
61
59
|
addressLine2?: string | null;
|
|
62
60
|
}
|
|
63
61
|
/** Line items to calculate tax for. */
|
|
64
|
-
|
|
62
|
+
interface LineItem {
|
|
65
63
|
/**
|
|
66
64
|
* Line item ID.
|
|
67
65
|
* @minLength 1
|
|
@@ -113,7 +111,7 @@ export interface LineItem {
|
|
|
113
111
|
addressIndex?: AddressIndex;
|
|
114
112
|
}
|
|
115
113
|
/** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
|
|
116
|
-
|
|
114
|
+
interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
|
|
117
115
|
/** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
|
|
118
116
|
singleAddress?: number;
|
|
119
117
|
/**
|
|
@@ -123,7 +121,7 @@ export interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
|
|
|
123
121
|
multipleAddresses?: MultipleAddresses;
|
|
124
122
|
}
|
|
125
123
|
/** @oneof */
|
|
126
|
-
|
|
124
|
+
interface AddressIndexAddressIndexOptionsOneOf {
|
|
127
125
|
/** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
|
|
128
126
|
singleAddress?: number;
|
|
129
127
|
/**
|
|
@@ -136,13 +134,13 @@ export interface AddressIndexAddressIndexOptionsOneOf {
|
|
|
136
134
|
* Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item
|
|
137
135
|
* is shipped from, as well as the address the item is shipped to.
|
|
138
136
|
*/
|
|
139
|
-
|
|
137
|
+
interface MultipleAddresses {
|
|
140
138
|
/** Index of the origin address. */
|
|
141
139
|
origin?: number;
|
|
142
140
|
/** Index of the destination address. */
|
|
143
141
|
destination?: number;
|
|
144
142
|
}
|
|
145
|
-
|
|
143
|
+
interface CalculateTaxResponse {
|
|
146
144
|
/**
|
|
147
145
|
* Optional ID of the entity that tax is being calculated for. For example, a cart ID.
|
|
148
146
|
* @format GUID
|
|
@@ -174,7 +172,7 @@ export interface CalculateTaxResponse {
|
|
|
174
172
|
*/
|
|
175
173
|
errors?: ApplicationError[];
|
|
176
174
|
}
|
|
177
|
-
|
|
175
|
+
interface TaxSummary {
|
|
178
176
|
/**
|
|
179
177
|
* Total price for all line items.
|
|
180
178
|
* @format DECIMAL_VALUE
|
|
@@ -214,7 +212,7 @@ export interface TaxSummary {
|
|
|
214
212
|
* e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%,
|
|
215
213
|
* then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$.
|
|
216
214
|
*/
|
|
217
|
-
|
|
215
|
+
interface AggregatedTaxBreakdown {
|
|
218
216
|
/**
|
|
219
217
|
* Name of the tax that was calculated.
|
|
220
218
|
* @maxLength 200
|
|
@@ -245,7 +243,7 @@ export interface AggregatedTaxBreakdown {
|
|
|
245
243
|
aggregatedTaxAmount?: string;
|
|
246
244
|
}
|
|
247
245
|
/** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */
|
|
248
|
-
|
|
246
|
+
declare enum JurisdictionType {
|
|
249
247
|
UNDEFINED = "UNDEFINED",
|
|
250
248
|
COUNTRY = "COUNTRY",
|
|
251
249
|
STATE = "STATE",
|
|
@@ -254,7 +252,7 @@ export declare enum JurisdictionType {
|
|
|
254
252
|
SPECIAL = "SPECIAL"
|
|
255
253
|
}
|
|
256
254
|
/** Tax details for a specific line item. */
|
|
257
|
-
|
|
255
|
+
interface LineItemTaxDetails {
|
|
258
256
|
/**
|
|
259
257
|
* Line item ID.
|
|
260
258
|
* @minLength 1
|
|
@@ -285,7 +283,7 @@ export interface LineItemTaxDetails {
|
|
|
285
283
|
taxIncludedInPrice?: boolean;
|
|
286
284
|
}
|
|
287
285
|
/** A detailed description of all the tax authorities applied on this item. */
|
|
288
|
-
|
|
286
|
+
interface TaxBreakdown {
|
|
289
287
|
/**
|
|
290
288
|
* Jurisdiction that taxes were calculated for.
|
|
291
289
|
* @maxLength 200
|
|
@@ -328,7 +326,7 @@ export interface TaxBreakdown {
|
|
|
328
326
|
/** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */
|
|
329
327
|
jurisdictionType?: JurisdictionType;
|
|
330
328
|
}
|
|
331
|
-
|
|
329
|
+
interface LineItemTaxSummary {
|
|
332
330
|
/**
|
|
333
331
|
* Total price for this line item.
|
|
334
332
|
* To determine the price for each individual unit of this line item, divide by `quantity`.
|
|
@@ -354,7 +352,7 @@ export interface LineItemTaxSummary {
|
|
|
354
352
|
*/
|
|
355
353
|
appId?: string | null;
|
|
356
354
|
}
|
|
357
|
-
|
|
355
|
+
interface ApplicationError {
|
|
358
356
|
/** Error code. */
|
|
359
357
|
code?: string;
|
|
360
358
|
/** Description of the error. */
|
|
@@ -362,16 +360,16 @@ export interface ApplicationError {
|
|
|
362
360
|
/** Data related to the error. */
|
|
363
361
|
data?: Record<string, any> | null;
|
|
364
362
|
}
|
|
365
|
-
|
|
363
|
+
interface ListTaxCalculatorsRequest {
|
|
366
364
|
}
|
|
367
|
-
|
|
365
|
+
interface ListTaxCalculatorsResponse {
|
|
368
366
|
/**
|
|
369
367
|
* Retrieved tax calculators.
|
|
370
368
|
* @maxSize 10
|
|
371
369
|
*/
|
|
372
370
|
taxCalculatorDetails?: TaxCalculatorDetails[];
|
|
373
371
|
}
|
|
374
|
-
|
|
372
|
+
interface TaxCalculatorDetails {
|
|
375
373
|
/**
|
|
376
374
|
* ID of the tax calculator.
|
|
377
375
|
* @format GUID
|
|
@@ -390,3 +388,18 @@ export interface TaxCalculatorDetails {
|
|
|
390
388
|
*/
|
|
391
389
|
unsupportedCountries?: string[];
|
|
392
390
|
}
|
|
391
|
+
|
|
392
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
393
|
+
getUrl: (context: any) => string;
|
|
394
|
+
httpMethod: K;
|
|
395
|
+
path: string;
|
|
396
|
+
pathParams: M;
|
|
397
|
+
__requestType: T;
|
|
398
|
+
__originalRequestType: S;
|
|
399
|
+
__responseType: Q;
|
|
400
|
+
__originalResponseType: R;
|
|
401
|
+
};
|
|
402
|
+
declare function calculateTax(): __PublicMethodMetaInfo<'POST', {}, CalculateTaxRequest$1, CalculateTaxRequest, CalculateTaxResponse$1, CalculateTaxResponse>;
|
|
403
|
+
declare function listTaxCalculators(): __PublicMethodMetaInfo<'GET', {}, ListTaxCalculatorsRequest$1, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse$1, ListTaxCalculatorsResponse>;
|
|
404
|
+
|
|
405
|
+
export { type __PublicMethodMetaInfo, calculateTax, listTaxCalculators };
|