@wix/auto_sdk_billing_tax-calculation 1.0.10 → 1.0.12

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.
Files changed (119) hide show
  1. package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → cjs/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.ts} +50 -23
  2. package/build/cjs/index.d.ts +41 -1
  3. package/build/cjs/index.js +208 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +407 -1
  6. package/build/cjs/meta.js +135 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/es/{src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.mts} +50 -23
  9. package/build/{internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → es/index.d.mts} +11 -8
  10. package/build/es/index.mjs +185 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → es/meta.d.mts} +35 -22
  13. package/build/es/meta.mjs +110 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/cjs/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.ts +421 -0
  16. package/build/internal/cjs/index.d.ts +41 -1
  17. package/build/internal/cjs/index.js +208 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +407 -1
  20. package/build/internal/cjs/meta.js +135 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/internal/es/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.mts +421 -0
  23. package/build/internal/es/{src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.mts} +11 -8
  24. package/build/internal/es/index.mjs +185 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → es/meta.d.mts} +35 -22
  27. package/build/internal/es/meta.mjs +110 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +10 -9
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  34. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  35. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  36. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  37. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  38. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  39. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  40. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  41. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  42. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts +0 -38
  43. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  44. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  45. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  46. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  47. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  48. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  49. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  60. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  61. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  62. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  63. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  64. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  65. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  66. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  67. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  68. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts +0 -38
  69. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  70. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  71. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  72. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  73. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  74. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  75. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  76. package/build/internal/cjs/index.typings.d.ts +0 -1
  77. package/build/internal/cjs/index.typings.js +0 -18
  78. package/build/internal/cjs/index.typings.js.map +0 -1
  79. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  80. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  81. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  82. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  83. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  84. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  85. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  86. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  87. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  88. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  89. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  90. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  91. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  92. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  93. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  94. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  95. package/build/internal/es/index.d.ts +0 -1
  96. package/build/internal/es/index.js +0 -2
  97. package/build/internal/es/index.js.map +0 -1
  98. package/build/internal/es/index.typings.d.ts +0 -1
  99. package/build/internal/es/index.typings.js +0 -2
  100. package/build/internal/es/index.typings.js.map +0 -1
  101. package/build/internal/es/meta.d.ts +0 -1
  102. package/build/internal/es/meta.js +0 -2
  103. package/build/internal/es/meta.js.map +0 -1
  104. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  105. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  106. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  107. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  108. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  109. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  110. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  111. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  112. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  113. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  114. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  115. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  116. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  117. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  118. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  119. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
@@ -1 +1,407 @@
1
- export * from './src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js';
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-Cina_f0e.js';
2
+
3
+ interface CalculateTaxRequest {
4
+ /**
5
+ * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
6
+ * @format GUID
7
+ * @immutable
8
+ */
9
+ externalId?: string | null;
10
+ /**
11
+ * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
12
+ * @format CURRENCY
13
+ */
14
+ currency?: string;
15
+ /**
16
+ * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
17
+ * @minSize 1
18
+ * @maxSize 3
19
+ */
20
+ addresses: Address[];
21
+ /**
22
+ * Line items to calculate tax for.
23
+ * @minSize 1
24
+ * @maxSize 300
25
+ */
26
+ lineItems: LineItem[];
27
+ }
28
+ /** Wix common address format for physical address to use if you plan to store addresses in your service. */
29
+ interface Address {
30
+ /**
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.
32
+ * @format COUNTRY
33
+ */
34
+ country?: string | null;
35
+ /**
36
+ * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
37
+ * @maxLength 50
38
+ */
39
+ subdivision?: string | null;
40
+ /**
41
+ * City name.
42
+ * @maxLength 100
43
+ */
44
+ city?: string | null;
45
+ /**
46
+ * Postal or zip code.
47
+ * @maxLength 50
48
+ */
49
+ postalCode?: string | null;
50
+ /**
51
+ * Main address line, usually street and number as free text.
52
+ * @maxLength 200
53
+ */
54
+ addressLine?: string | null;
55
+ /**
56
+ * Free text providing more detailed address information, such as apartment, suite, or floor.
57
+ * @maxLength 200
58
+ */
59
+ addressLine2?: string | null;
60
+ }
61
+ /** Line items to calculate tax for. */
62
+ interface LineItem {
63
+ /**
64
+ * Line item ID.
65
+ * @minLength 1
66
+ * @maxLength 100
67
+ */
68
+ id?: string;
69
+ /**
70
+ * Line item name to display.
71
+ * @maxLength 250
72
+ */
73
+ itemName?: string | null;
74
+ /**
75
+ * Line item quantity.
76
+ * @min 1
77
+ * @max 100000
78
+ */
79
+ quantity?: number;
80
+ /**
81
+ * Line item price.
82
+ * @format DECIMAL_VALUE
83
+ * @decimalValue options { lte:1000000000000000 }
84
+ */
85
+ price?: string;
86
+ /**
87
+ * Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).
88
+ * @maxLength 40
89
+ */
90
+ itemCode?: string | null;
91
+ /**
92
+ * Tax group ID for this line item. If not provided, the default tax group applies.
93
+ * @format GUID
94
+ */
95
+ taxGroupId?: string | null;
96
+ /**
97
+ * ID of the app providing the catalog for this line item.
98
+ *
99
+ * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
100
+ *
101
+ * For items from Wix catalogs, the following values always apply:
102
+ * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
103
+ * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
104
+ * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
105
+ * @format GUID
106
+ */
107
+ appId?: string | null;
108
+ /** Whether tax is included in the price. */
109
+ taxIncludedInPrice?: boolean | null;
110
+ /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
111
+ addressIndex?: AddressIndex;
112
+ }
113
+ /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
114
+ interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
115
+ /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
116
+ singleAddress?: number;
117
+ /**
118
+ * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,
119
+ * as well as the address the item is shipped to.
120
+ */
121
+ multipleAddresses?: MultipleAddresses;
122
+ }
123
+ /** @oneof */
124
+ interface AddressIndexAddressIndexOptionsOneOf {
125
+ /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
126
+ singleAddress?: number;
127
+ /**
128
+ * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,
129
+ * as well as the address the item is shipped to.
130
+ */
131
+ multipleAddresses?: MultipleAddresses;
132
+ }
133
+ /**
134
+ * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item
135
+ * is shipped from, as well as the address the item is shipped to.
136
+ */
137
+ interface MultipleAddresses {
138
+ /** Index of the origin address. */
139
+ origin?: number;
140
+ /** Index of the destination address. */
141
+ destination?: number;
142
+ }
143
+ interface CalculateTaxResponse {
144
+ /**
145
+ * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
146
+ * @format GUID
147
+ * @immutable
148
+ */
149
+ externalId?: string | null;
150
+ /**
151
+ * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
152
+ * @format CURRENCY
153
+ */
154
+ currency?: string;
155
+ /**
156
+ * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
157
+ * @minSize 1
158
+ * @maxSize 3
159
+ */
160
+ addresses?: Address[];
161
+ /** Summary of the tax calculated. */
162
+ taxSummary?: TaxSummary;
163
+ /**
164
+ * Details of each tax applied to each line item.
165
+ * @minSize 1
166
+ * @maxSize 300
167
+ */
168
+ lineItemTaxDetails?: LineItemTaxDetails[];
169
+ /**
170
+ * Errors that occurred during the tax calculation.
171
+ * @maxSize 100
172
+ */
173
+ errors?: ApplicationError[];
174
+ }
175
+ interface TaxSummary {
176
+ /**
177
+ * Total price for all line items.
178
+ * @format DECIMAL_VALUE
179
+ * @decimalValue options { maxScale:4 }
180
+ */
181
+ totalAmount?: string;
182
+ /**
183
+ * Total amount of tax calculated for all line items.
184
+ * Note that due to rounding, `totalTax` may not equal the sum of `lineItemTaxDetails.taxSummary.taxAmount`.
185
+ * @format DECIMAL_VALUE
186
+ * @decimalValue options { maxScale:4 }
187
+ */
188
+ totalTax?: string;
189
+ /**
190
+ * Total taxable amount for all line items.
191
+ * @format DECIMAL_VALUE
192
+ * @decimalValue options { maxScale:4 }
193
+ */
194
+ totalTaxableAmount?: string;
195
+ /**
196
+ * Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`.
197
+ * @format DECIMAL_VALUE
198
+ * @decimalValue options { maxScale:4 }
199
+ */
200
+ totalTaxIncludedInPrice?: string;
201
+ /**
202
+ * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdictionType"`, `"taxType"`, `"taxName"` and `"rate"`.
203
+ * @maxSize 50
204
+ */
205
+ aggregatedTaxBreakdown?: AggregatedTaxBreakdown[];
206
+ }
207
+ /**
208
+ * The summary of the tax breakdown for all the line items. It will hold for each tax name, the aggregated tax amount paid for it and the tax rate.
209
+ * Tax breakdown is the tax amount split to the tax authorities that applied on the line item.
210
+ *
211
+ * Note: Because that the tax is calculated only on the taxable amount, the tax amount may be looks strange.
212
+ * e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%,
213
+ * then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$.
214
+ */
215
+ interface AggregatedTaxBreakdown {
216
+ /**
217
+ * Name of the tax that was calculated.
218
+ * @maxLength 200
219
+ */
220
+ taxName?: string;
221
+ /**
222
+ * Type of tax that was calculated.
223
+ * @maxLength 200
224
+ */
225
+ taxType?: string;
226
+ /**
227
+ * Jurisdiction that taxes were calculated for.
228
+ * @maxLength 200
229
+ */
230
+ jurisdiction?: string;
231
+ /** Type of jurisdiction that taxes were calculated for. */
232
+ jurisdictionType?: JurisdictionTypeWithLiterals;
233
+ /**
234
+ * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
235
+ * @decimalValue options { gte:0, maxScale:6 }
236
+ */
237
+ rate?: string;
238
+ /**
239
+ * Total amount of this tax for this jurisdiction.
240
+ * @format DECIMAL_VALUE
241
+ * @decimalValue options { maxScale:4 }
242
+ */
243
+ aggregatedTaxAmount?: string;
244
+ }
245
+ /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */
246
+ declare enum JurisdictionType {
247
+ UNDEFINED = "UNDEFINED",
248
+ COUNTRY = "COUNTRY",
249
+ STATE = "STATE",
250
+ COUNTY = "COUNTY",
251
+ CITY = "CITY",
252
+ SPECIAL = "SPECIAL"
253
+ }
254
+ /** @enumType */
255
+ type JurisdictionTypeWithLiterals = JurisdictionType | 'UNDEFINED' | 'COUNTRY' | 'STATE' | 'COUNTY' | 'CITY' | 'SPECIAL';
256
+ /** Tax details for a specific line item. */
257
+ interface LineItemTaxDetails {
258
+ /**
259
+ * Line item ID.
260
+ * @minLength 1
261
+ * @maxLength 100
262
+ */
263
+ id?: string;
264
+ /**
265
+ * Line item name to display.
266
+ * @maxLength 250
267
+ */
268
+ itemName?: string | null;
269
+ /**
270
+ * Line item quantity.
271
+ * @min 1
272
+ * @max 100000
273
+ */
274
+ quantity?: number;
275
+ /**
276
+ * Array of each tax applied, grouped by `jurisdiction`.
277
+ * @maxSize 7
278
+ */
279
+ taxBreakdown?: TaxBreakdown[];
280
+ /** Summary of this line item's total price and tax. */
281
+ taxSummary?: LineItemTaxSummary;
282
+ /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
283
+ addressIndex?: AddressIndex;
284
+ /** Whether tax is included in the price. */
285
+ taxIncludedInPrice?: boolean;
286
+ }
287
+ /** A detailed description of all the tax authorities applied on this item. */
288
+ interface TaxBreakdown {
289
+ /**
290
+ * Jurisdiction that taxes were calculated for.
291
+ * @maxLength 200
292
+ */
293
+ jurisdiction?: string | null;
294
+ /**
295
+ * Non-taxable amount of the price.
296
+ * @format DECIMAL_VALUE
297
+ * @decimalValue options { maxScale:4, gte:0 }
298
+ */
299
+ nonTaxableAmount?: string | null;
300
+ /**
301
+ * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
302
+ * @format DECIMAL_VALUE
303
+ * @decimalValue options { maxScale:6, gte:0 }
304
+ */
305
+ rate?: string | null;
306
+ /**
307
+ * Amount of this tax calculated for this jurisdiction.
308
+ * @format DECIMAL_VALUE
309
+ * @decimalValue options { maxScale:4 }
310
+ */
311
+ taxAmount?: string | null;
312
+ /**
313
+ * Taxable amount of the price.
314
+ * @format DECIMAL_VALUE
315
+ * @decimalValue options { maxScale:4, gte:0 }
316
+ */
317
+ taxableAmount?: string | null;
318
+ /**
319
+ * Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc.
320
+ * @maxLength 200
321
+ */
322
+ taxType?: string | null;
323
+ /**
324
+ * Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc.
325
+ * @maxLength 200
326
+ */
327
+ taxName?: string | null;
328
+ /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */
329
+ jurisdictionType?: JurisdictionTypeWithLiterals;
330
+ }
331
+ interface LineItemTaxSummary {
332
+ /**
333
+ * Total price for this line item.
334
+ * To determine the price for each individual unit of this line item, divide by `quantity`.
335
+ * @format DECIMAL_VALUE
336
+ * @decimalValue options { lte:1000000000000000 }
337
+ */
338
+ fullPrice?: string | null;
339
+ /**
340
+ * Total amount of tax calculated for this line item.
341
+ * @format DECIMAL_VALUE
342
+ * @decimalValue options { maxScale:4 }
343
+ */
344
+ taxAmount?: string;
345
+ /**
346
+ * Total taxable amount for this line item.
347
+ * @format DECIMAL_VALUE
348
+ * @decimalValue options { maxScale:4 }
349
+ */
350
+ taxableAmount?: string;
351
+ /**
352
+ * ID of the calculator app that calculated tax for this line item.
353
+ * @maxLength 50
354
+ */
355
+ appId?: string | null;
356
+ }
357
+ interface ApplicationError {
358
+ /** Error code. */
359
+ code?: string;
360
+ /** Description of the error. */
361
+ description?: string;
362
+ /** Data related to the error. */
363
+ data?: Record<string, any> | null;
364
+ }
365
+ interface ListTaxCalculatorsRequest {
366
+ }
367
+ interface ListTaxCalculatorsResponse {
368
+ /**
369
+ * Retrieved tax calculators.
370
+ * @maxSize 10
371
+ */
372
+ taxCalculatorDetails?: TaxCalculatorDetails[];
373
+ }
374
+ interface TaxCalculatorDetails {
375
+ /**
376
+ * ID of the tax calculator.
377
+ * @format GUID
378
+ */
379
+ appId?: string;
380
+ /**
381
+ * Display name of the tax calculator.
382
+ * @minLength 1
383
+ * @maxLength 200
384
+ */
385
+ displayName?: string;
386
+ /**
387
+ * List of countries, in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format, that the calculator does not support.
388
+ * @format COUNTRY
389
+ * @maxSize 195
390
+ */
391
+ unsupportedCountries?: string[];
392
+ }
393
+
394
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
395
+ getUrl: (context: any) => string;
396
+ httpMethod: K;
397
+ path: string;
398
+ pathParams: M;
399
+ __requestType: T;
400
+ __originalRequestType: S;
401
+ __responseType: Q;
402
+ __originalResponseType: R;
403
+ };
404
+ declare function calculateTax(): __PublicMethodMetaInfo<'POST', {}, CalculateTaxRequest$1, CalculateTaxRequest, CalculateTaxResponse$1, CalculateTaxResponse>;
405
+ declare function listTaxCalculators(): __PublicMethodMetaInfo<'GET', {}, ListTaxCalculatorsRequest$1, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse$1, ListTaxCalculatorsResponse>;
406
+
407
+ export { type __PublicMethodMetaInfo, calculateTax, listTaxCalculators };
package/build/cjs/meta.js CHANGED
@@ -1,18 +1,138 @@
1
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
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 });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js"), exports);
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_billing_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
+ });
18
138
  //# sourceMappingURL=meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4GAA0F"}
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_billing_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"]}