@wix/auto_sdk_ecom_totals-calculator 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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  11. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js +23 -0
  12. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  13. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  14. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js +144 -0
  15. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  16. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  17. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js +47 -0
  18. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  20. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js +28 -0
  21. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1365 -0
  23. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js +144 -0
  24. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1434 -0
  26. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js +271 -0
  27. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  39. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.js +5 -0
  40. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  41. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  42. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.js +140 -0
  43. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  44. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  45. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js +20 -0
  46. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  47. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  48. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.js +9 -0
  49. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  50. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1365 -0
  51. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.js +141 -0
  52. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  53. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1434 -0
  54. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js +244 -0
  55. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  66. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js +23 -0
  67. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  69. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js +144 -0
  70. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  72. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js +47 -0
  73. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  75. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js +28 -0
  76. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1372 -0
  78. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js +144 -0
  79. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1499 -0
  81. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js +271 -0
  82. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  93. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.js +5 -0
  94. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  96. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.js +140 -0
  97. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  99. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js +20 -0
  100. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  102. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.js +9 -0
  103. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1372 -0
  105. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.js +141 -0
  106. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1499 -0
  108. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js +244 -0
  109. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,244 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
+ import * as ambassadorWixEcomV1TotalsCalculation from './ecom-v1-totals-calculation-totals-calculator.http.js';
4
+ import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
5
+ import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
6
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
7
+ /** Frequency unit of recurring payment */
8
+ export var SubscriptionFrequency;
9
+ (function (SubscriptionFrequency) {
10
+ SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
11
+ SubscriptionFrequency["DAY"] = "DAY";
12
+ SubscriptionFrequency["WEEK"] = "WEEK";
13
+ SubscriptionFrequency["MONTH"] = "MONTH";
14
+ SubscriptionFrequency["YEAR"] = "YEAR";
15
+ })(SubscriptionFrequency || (SubscriptionFrequency = {}));
16
+ /** Type of selected payment option for catalog item */
17
+ export var PaymentOptionType;
18
+ (function (PaymentOptionType) {
19
+ /** The entire payment for this item happens as part of the checkout. */
20
+ PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
21
+ /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
22
+ PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
23
+ /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
24
+ PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
25
+ /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
26
+ PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
27
+ /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
28
+ PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
29
+ })(PaymentOptionType || (PaymentOptionType = {}));
30
+ export var ItemTypeItemType;
31
+ (function (ItemTypeItemType) {
32
+ ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
33
+ ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
34
+ ItemTypeItemType["DIGITAL"] = "DIGITAL";
35
+ ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
36
+ ItemTypeItemType["SERVICE"] = "SERVICE";
37
+ })(ItemTypeItemType || (ItemTypeItemType = {}));
38
+ export var TaxableAddressType;
39
+ (function (TaxableAddressType) {
40
+ TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
41
+ TaxableAddressType["BUSINESS"] = "BUSINESS";
42
+ TaxableAddressType["BILLING"] = "BILLING";
43
+ TaxableAddressType["SHIPPING"] = "SHIPPING";
44
+ })(TaxableAddressType || (TaxableAddressType = {}));
45
+ export var PickupMethod;
46
+ (function (PickupMethod) {
47
+ PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
48
+ PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
49
+ PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
50
+ })(PickupMethod || (PickupMethod = {}));
51
+ export var ChargeType;
52
+ (function (ChargeType) {
53
+ ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
54
+ ChargeType["INSURANCE"] = "INSURANCE";
55
+ })(ChargeType || (ChargeType = {}));
56
+ export var DiscountType;
57
+ (function (DiscountType) {
58
+ DiscountType["GLOBAL"] = "GLOBAL";
59
+ DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
60
+ DiscountType["SHIPPING"] = "SHIPPING";
61
+ })(DiscountType || (DiscountType = {}));
62
+ export var DataFetchType;
63
+ (function (DataFetchType) {
64
+ DataFetchType["SHIPPING"] = "SHIPPING";
65
+ DataFetchType["DISCOUNT"] = "DISCOUNT";
66
+ DataFetchType["ADDITIONAL_FEES"] = "ADDITIONAL_FEES";
67
+ DataFetchType["ORDER_VALIDATION"] = "ORDER_VALIDATION";
68
+ })(DataFetchType || (DataFetchType = {}));
69
+ /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
70
+ export var JurisdictionType;
71
+ (function (JurisdictionType) {
72
+ JurisdictionType["UNDEFINED"] = "UNDEFINED";
73
+ JurisdictionType["COUNTRY"] = "COUNTRY";
74
+ JurisdictionType["STATE"] = "STATE";
75
+ JurisdictionType["COUNTY"] = "COUNTY";
76
+ JurisdictionType["CITY"] = "CITY";
77
+ JurisdictionType["SPECIAL"] = "SPECIAL";
78
+ })(JurisdictionType || (JurisdictionType = {}));
79
+ export var RateType;
80
+ (function (RateType) {
81
+ /** no tax being collected for this request due to location of purchase */
82
+ RateType["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
83
+ /** manual rate used for calculation */
84
+ RateType["MANUAL_RATE"] = "MANUAL_RATE";
85
+ /** autotax rate used for calculation */
86
+ RateType["AUTO_RATE"] = "AUTO_RATE";
87
+ /** fallback rate used for calculation */
88
+ RateType["FALLBACK_RATE"] = "FALLBACK_RATE";
89
+ })(RateType || (RateType = {}));
90
+ export var ManualCalculationReason;
91
+ (function (ManualCalculationReason) {
92
+ /** user set calculator in Business Manager to be Manual */
93
+ ManualCalculationReason["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
94
+ /** specific region is on manual even though Global setting is Auto-tax */
95
+ ManualCalculationReason["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
96
+ })(ManualCalculationReason || (ManualCalculationReason = {}));
97
+ export var FallbackReason;
98
+ (function (FallbackReason) {
99
+ /** auto-tax failed to be calculated */
100
+ FallbackReason["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
101
+ /** auto-tax was temporarily deactivated on a system-level */
102
+ FallbackReason["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
103
+ })(FallbackReason || (FallbackReason = {}));
104
+ export var RuleType;
105
+ (function (RuleType) {
106
+ RuleType["VALIDATION"] = "VALIDATION";
107
+ RuleType["OTHER"] = "OTHER";
108
+ RuleType["MAX"] = "MAX";
109
+ RuleType["MIN"] = "MIN";
110
+ RuleType["MAX_LENGTH"] = "MAX_LENGTH";
111
+ RuleType["MIN_LENGTH"] = "MIN_LENGTH";
112
+ RuleType["MAX_SIZE"] = "MAX_SIZE";
113
+ RuleType["MIN_SIZE"] = "MIN_SIZE";
114
+ RuleType["FORMAT"] = "FORMAT";
115
+ RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
116
+ RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
117
+ RuleType["DECIMAL_LT"] = "DECIMAL_LT";
118
+ RuleType["DECIMAL_GT"] = "DECIMAL_GT";
119
+ RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
120
+ RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
121
+ RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
122
+ RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
123
+ RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
124
+ RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
125
+ RuleType["EXACT_SIZE"] = "EXACT_SIZE";
126
+ RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
127
+ })(RuleType || (RuleType = {}));
128
+ export var WeightUnit;
129
+ (function (WeightUnit) {
130
+ /** Weight unit can't be classified, due to an error */
131
+ WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
132
+ /** Kilograms */
133
+ WeightUnit["KG"] = "KG";
134
+ /** Pounds */
135
+ WeightUnit["LB"] = "LB";
136
+ })(WeightUnit || (WeightUnit = {}));
137
+ export var AdditionalFeeSource;
138
+ (function (AdditionalFeeSource) {
139
+ AdditionalFeeSource["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
140
+ /** The additional fee was added by an additional fee service plugin */
141
+ AdditionalFeeSource["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
142
+ /** The additional fee was added on the item either via the catalog or on custom line item */
143
+ AdditionalFeeSource["ITEM"] = "ITEM";
144
+ /** The additional fee was added manually on the request */
145
+ AdditionalFeeSource["MANUAL"] = "MANUAL";
146
+ })(AdditionalFeeSource || (AdditionalFeeSource = {}));
147
+ /**
148
+ * Returns a totals calculation for specified line items.
149
+ * @public
150
+ * @documentationMaturity preview
151
+ * @requiredField options.lineItems._id
152
+ * @requiredField options.lineItems.price
153
+ * @requiredField options.lineItems.quantity
154
+ * @requiredField options.merchantDiscounts.amount
155
+ * @requiredField options.selectedMemberships.memberships._id
156
+ * @requiredField options.selectedMemberships.memberships.appId
157
+ * @requiredField options.selectedMemberships.memberships.lineItemIds
158
+ * @requiredField options.selectedShippingOption.code
159
+ * @permissionId ECOM.CALCULATE_TOTALS
160
+ * @permissionScope Manage Stores - all permissions
161
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
162
+ * @permissionScope Manage eCommerce - all permissions
163
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
164
+ * @applicableIdentity APP
165
+ * @applicableIdentity VISITOR
166
+ * @fqn com.wix.ecom.totals_calculator.v1.TotalsCalculator.CalculateTotals
167
+ */
168
+ export async function calculateTotals(options) {
169
+ // @ts-ignore
170
+ const { httpClient, sideEffects } = arguments[1];
171
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
172
+ calculationId: options?.calculationId,
173
+ lineItems: options?.lineItems,
174
+ shippingAddress: options?.shippingAddress,
175
+ billingAddress: options?.billingAddress,
176
+ selectedShippingOption: options?.selectedShippingOption,
177
+ couponId: options?.couponId,
178
+ couponCode: options?.couponCode,
179
+ giftCardId: options?.giftCardId,
180
+ giftCardCode: options?.giftCardCode,
181
+ merchantDiscounts: options?.merchantDiscounts,
182
+ buyerEmail: options?.buyerEmail,
183
+ memberId: options?.memberId,
184
+ selectedMemberships: options?.selectedMemberships,
185
+ buyerPhone: options?.buyerPhone,
186
+ purchaseFlowId: options?.purchaseFlowId,
187
+ }), [
188
+ {
189
+ transformFn: transformSDKAddressToRESTAddress,
190
+ paths: [
191
+ { path: 'shippingAddress' },
192
+ { path: 'billingAddress' },
193
+ {
194
+ path: 'shippingOptions.shippingOptions.logistics.pickupDetails.address',
195
+ },
196
+ ],
197
+ },
198
+ ]);
199
+ const reqOpts = ambassadorWixEcomV1TotalsCalculation.calculateTotals(payload);
200
+ sideEffects?.onSiteCall?.();
201
+ try {
202
+ const result = await httpClient.request(reqOpts);
203
+ sideEffects?.onSuccess?.(result);
204
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
205
+ {
206
+ transformFn: transformRESTAddressToSDKAddress,
207
+ paths: [
208
+ {
209
+ path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
210
+ },
211
+ {
212
+ path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
213
+ },
214
+ ],
215
+ },
216
+ ]));
217
+ }
218
+ catch (err) {
219
+ const transformedError = sdkTransformError(err, {
220
+ spreadPathsToArguments: {},
221
+ explicitPathsToArguments: {
222
+ calculationId: '$[0].calculationId',
223
+ lineItems: '$[0].lineItems',
224
+ shippingAddress: '$[0].shippingAddress',
225
+ billingAddress: '$[0].billingAddress',
226
+ selectedShippingOption: '$[0].selectedShippingOption',
227
+ couponId: '$[0].couponId',
228
+ couponCode: '$[0].couponCode',
229
+ giftCardId: '$[0].giftCardId',
230
+ giftCardCode: '$[0].giftCardCode',
231
+ merchantDiscounts: '$[0].merchantDiscounts',
232
+ buyerEmail: '$[0].buyerEmail',
233
+ memberId: '$[0].memberId',
234
+ selectedMemberships: '$[0].selectedMemberships',
235
+ buyerPhone: '$[0].buyerPhone',
236
+ purchaseFlowId: '$[0].purchaseFlowId',
237
+ },
238
+ singleArgumentUnchanged: false,
239
+ }, ['options']);
240
+ sideEffects?.onError?.(err);
241
+ throw transformedError;
242
+ }
243
+ }
244
+ //# sourceMappingURL=ecom-v1-totals-calculation-totals-calculator.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-totals-calculation-totals-calculator.universal.js","sourceRoot":"","sources":["../../../src/ecom-v1-totals-calculation-totals-calculator.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,oCAAoC,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAkMlF,0CAA0C;AAC1C,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,gDAAuB,CAAA;IACvB,oCAAW,CAAA;IACX,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,sCAAa,CAAA;AACf,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC;AAED,uDAAuD;AACvD,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,wEAAwE;IACxE,gEAA2C,CAAA;I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B,mBAAmB,EAAE,0BAA0B;gBAC/C,UAAU,EAAE,iBAAiB;gBAC7B,cAAc,EAAE,qBAAqB;aACtC;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-v1-totals-calculation-totals-calculator.context.js';
@@ -0,0 +1,18 @@
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ecom-v1-totals-calculation-totals-calculator.context.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gGAA8E"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-v1-totals-calculation-totals-calculator.universal.js';
@@ -0,0 +1,18 @@
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ecom-v1-totals-calculation-totals-calculator.universal.js"), exports);
18
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kGAAgF"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-v1-totals-calculation-totals-calculator.meta.js';
@@ -0,0 +1,18 @@
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);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ecom-v1-totals-calculation-totals-calculator.meta.js"), exports);
18
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6FAA2E"}
@@ -0,0 +1,5 @@
1
+ import { calculateTotals as publicCalculateTotals } from './ecom-v1-totals-calculation-totals-calculator.public.js';
2
+ import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
+ export declare const calculateTotals: MaybeContext<BuildRESTFunction<typeof publicCalculateTotals> & typeof publicCalculateTotals>;
4
+ export { SubscriptionFrequency, PaymentOptionType, ItemTypeItemType, TaxableAddressType, PickupMethod, ChargeType, DiscountType, DataFetchType, JurisdictionType, RateType, ManualCalculationReason, FallbackReason, RuleType, WeightUnit, AdditionalFeeSource, } from './ecom-v1-totals-calculation-totals-calculator.universal.js';
5
+ export { TotalsCalculationEntity, CalculateTotalsRequest, CalculateTotalsRequestCouponOneOf, CalculateTotalsRequestGiftCardOneOf, LineItem, CatalogReference, PhysicalProperties, Scope, Group, SubscriptionSettings, ServiceProperties, ItemType, ItemTypeItemTypeDataOneOf, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, ApiV1AdditionalFee, V1TaxDetails, Address, StreetAddress, AddressLocation, SelectedShippingOption, MerchantDiscountInput, SelectedMemberships, SelectedMembership, CarrierShippingOption, ShippingOption, DeliveryLogistics, PickupDetails, DeliveryTimeSlot, ShippingPrice, MultiCurrencyPrice, OtherCharge, DeliveryAllocation, Carrier, Region, ApplicableLineItems, AppliedDiscount, AppliedDiscountDiscountSourceOneOf, Coupon, MerchantDiscount, DiscountRule, DiscountRuleName, LineItemDiscount, AdditionalFee, TaxDetails, ExternalReference, CalculateTotalsResponse, CalculatedLineItem, LineItemPricesData, ItemTaxFullDetails, TaxRateBreakdown, TaxBreakdown, PriceSummary, GiftCard, TaxSummary, TaxCalculationDetails, TaxCalculationDetailsCalculationDetailsOneOf, AutoTaxFallbackCalculationDetails, ApplicationError, AggregatedTaxBreakdown, ShippingInformation, ShippingRegion, SelectedCarrierServiceOption, SelectedCarrierServiceOptionPrices, SelectedCarrierServiceOptionOtherCharge, CarrierServiceOption, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, Details, DetailsKindOneOf, ValidationError, FieldViolation, SystemError, CarrierErrors, CarrierError, MembershipOptions, Membership, MembershipName, MembershipPaymentCredits, InvalidMembership, V1AdditionalFee, CalculateTotalsResponseNonNullableFields, CalculateTotalsOptions, } from './ecom-v1-totals-calculation-totals-calculator.universal.js';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdditionalFeeSource = exports.WeightUnit = exports.RuleType = exports.FallbackReason = exports.ManualCalculationReason = exports.RateType = exports.JurisdictionType = exports.DataFetchType = exports.DiscountType = exports.ChargeType = exports.PickupMethod = exports.TaxableAddressType = exports.ItemTypeItemType = exports.PaymentOptionType = exports.SubscriptionFrequency = exports.calculateTotals = void 0;
4
+ const ecom_v1_totals_calculation_totals_calculator_public_js_1 = require("./ecom-v1-totals-calculation-totals-calculator.public.js");
5
+ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
6
+ exports.calculateTotals = (0, rest_modules_1.createRESTModule)(ecom_v1_totals_calculation_totals_calculator_public_js_1.calculateTotals);
7
+ var ecom_v1_totals_calculation_totals_calculator_universal_js_1 = require("./ecom-v1-totals-calculation-totals-calculator.universal.js");
8
+ Object.defineProperty(exports, "SubscriptionFrequency", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.SubscriptionFrequency; } });
9
+ Object.defineProperty(exports, "PaymentOptionType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.PaymentOptionType; } });
10
+ Object.defineProperty(exports, "ItemTypeItemType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.ItemTypeItemType; } });
11
+ Object.defineProperty(exports, "TaxableAddressType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.TaxableAddressType; } });
12
+ Object.defineProperty(exports, "PickupMethod", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.PickupMethod; } });
13
+ Object.defineProperty(exports, "ChargeType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.ChargeType; } });
14
+ Object.defineProperty(exports, "DiscountType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.DiscountType; } });
15
+ Object.defineProperty(exports, "DataFetchType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.DataFetchType; } });
16
+ Object.defineProperty(exports, "JurisdictionType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.JurisdictionType; } });
17
+ Object.defineProperty(exports, "RateType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.RateType; } });
18
+ Object.defineProperty(exports, "ManualCalculationReason", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.ManualCalculationReason; } });
19
+ Object.defineProperty(exports, "FallbackReason", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.FallbackReason; } });
20
+ Object.defineProperty(exports, "RuleType", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.RuleType; } });
21
+ Object.defineProperty(exports, "WeightUnit", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.WeightUnit; } });
22
+ Object.defineProperty(exports, "AdditionalFeeSource", { enumerable: true, get: function () { return ecom_v1_totals_calculation_totals_calculator_universal_js_1.AdditionalFeeSource; } });
23
+ //# sourceMappingURL=ecom-v1-totals-calculation-totals-calculator.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-totals-calculation-totals-calculator.context.js","sourceRoot":"","sources":["../../../../src/ecom-v1-totals-calculation-totals-calculator.context.ts"],"names":[],"mappings":";;;AAAA,qIAAoH;AACpH,gEAAiE;AAGpD,QAAA,eAAe,GAEV,IAAA,+BAAgB,EAAC,wEAAqB,CAAC,CAAC;AAE1D,yIAgBqE;AAfnE,kKAAA,qBAAqB,OAAA;AACrB,8JAAA,iBAAiB,OAAA;AACjB,6JAAA,gBAAgB,OAAA;AAChB,+JAAA,kBAAkB,OAAA;AAClB,yJAAA,YAAY,OAAA;AACZ,uJAAA,UAAU,OAAA;AACV,yJAAA,YAAY,OAAA;AACZ,0JAAA,aAAa,OAAA;AACb,6JAAA,gBAAgB,OAAA;AAChB,qJAAA,QAAQ,OAAA;AACR,oKAAA,uBAAuB,OAAA;AACvB,2JAAA,cAAc,OAAA;AACd,qJAAA,QAAQ,OAAA;AACR,uJAAA,UAAU,OAAA;AACV,gKAAA,mBAAmB,OAAA"}
@@ -0,0 +1,3 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ /** Returns a totals calculation for specified line items. */
3
+ export declare function calculateTotals(payload: object): RequestOptionsFactory<any>;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateTotals = void 0;
4
+ const float_1 = require("@wix/sdk-runtime/transformations/float");
5
+ const float_2 = require("@wix/sdk-runtime/transformations/float");
6
+ const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
7
+ const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
8
+ const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
9
+ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
10
+ function resolveComWixEcomTotalsCalculatorV1TotalsCalculatorUrl(opts) {
11
+ const domainToMappings = {
12
+ 'bo._base_domain_': [
13
+ {
14
+ srcPath: '/totals-calculator',
15
+ destPath: '',
16
+ },
17
+ ],
18
+ 'wixbo.ai': [
19
+ {
20
+ srcPath: '/totals-calculator',
21
+ destPath: '',
22
+ },
23
+ ],
24
+ 'wix-bo.com': [
25
+ {
26
+ srcPath: '/totals-calculator',
27
+ destPath: '',
28
+ },
29
+ ],
30
+ 'www.wixapis.com': [
31
+ {
32
+ srcPath: '/ecom/v1/calculate-totals',
33
+ destPath: '/v1/calculate-totals',
34
+ },
35
+ ],
36
+ _: [
37
+ {
38
+ srcPath: '/_api/totals-calculator',
39
+ destPath: '',
40
+ },
41
+ ],
42
+ '*.dev.wix-code.com': [
43
+ {
44
+ srcPath: '/_api/totals-calculator',
45
+ destPath: '',
46
+ },
47
+ ],
48
+ };
49
+ return (0, rest_modules_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
50
+ }
51
+ const PACKAGE_NAME = '@wix/auto_sdk_ecom_totals-calculator';
52
+ /** Returns a totals calculation for specified line items. */
53
+ function calculateTotals(payload) {
54
+ function __calculateTotals({ host }) {
55
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
56
+ {
57
+ transformFn: float_1.transformSDKFloatToRESTFloat,
58
+ paths: [
59
+ { path: 'lineItems.physicalProperties.weight' },
60
+ { path: 'shippingAddress.geocode.latitude' },
61
+ { path: 'shippingAddress.geocode.longitude' },
62
+ { path: 'billingAddress.geocode.latitude' },
63
+ { path: 'billingAddress.geocode.longitude' },
64
+ {
65
+ path: 'shippingOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
66
+ },
67
+ {
68
+ path: 'shippingOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
69
+ },
70
+ { path: 'appliedDiscounts.merchantDiscount.percentage' },
71
+ ],
72
+ },
73
+ {
74
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
75
+ paths: [
76
+ { path: 'lineItems.serviceProperties.scheduledDate' },
77
+ {
78
+ path: 'shippingOptions.shippingOptions.logistics.deliveryTimeSlot.from',
79
+ },
80
+ {
81
+ path: 'shippingOptions.shippingOptions.logistics.deliveryTimeSlot.to',
82
+ },
83
+ ],
84
+ },
85
+ ]);
86
+ const metadata = {
87
+ entityFqdn: 'wix.ecom.v1.totals_calculation',
88
+ method: 'POST',
89
+ methodFqn: 'com.wix.ecom.totals_calculator.v1.TotalsCalculator.CalculateTotals',
90
+ packageName: PACKAGE_NAME,
91
+ url: resolveComWixEcomTotalsCalculatorV1TotalsCalculatorUrl({
92
+ protoPath: '/v1/calculate-totals',
93
+ data: serializedData,
94
+ host,
95
+ }),
96
+ data: serializedData,
97
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
98
+ {
99
+ transformFn: float_2.transformRESTFloatToSDKFloat,
100
+ paths: [
101
+ {
102
+ path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
103
+ },
104
+ {
105
+ path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
106
+ },
107
+ {
108
+ path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
109
+ },
110
+ {
111
+ path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
112
+ },
113
+ { path: 'appliedDiscounts.merchantDiscount.percentage' },
114
+ ],
115
+ },
116
+ {
117
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
118
+ paths: [
119
+ {
120
+ path: 'shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
121
+ },
122
+ {
123
+ path: 'shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
124
+ },
125
+ {
126
+ path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
127
+ },
128
+ {
129
+ path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
130
+ },
131
+ { path: 'membershipOptions.eligibleMemberships.expirationDate' },
132
+ {
133
+ path: 'membershipOptions.invalidMemberships.membership.expirationDate',
134
+ },
135
+ ],
136
+ },
137
+ ]),
138
+ };
139
+ return metadata;
140
+ }
141
+ return __calculateTotals;
142
+ }
143
+ exports.calculateTotals = calculateTotals;
144
+ //# sourceMappingURL=ecom-v1-totals-calculation-totals-calculator.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-totals-calculation-totals-calculator.http.js","sourceRoot":"","sources":["../../../../src/ecom-v1-totals-calculation-totals-calculator.http.ts"],"names":[],"mappings":";;;AAAA,kEAAsF;AACtF,kEAAsF;AACtF,0EAAkG;AAClG,0EAAkG;AAClG,sFAAkF;AAClF,gEAA2D;AAI3D,SAAS,sDAAsD,CAC7D,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,kBAAkB,EAAE;YAClB;gBACE,OAAO,EAAE,oBAAoB;gBAC7B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,UAAU,EAAE;YACV;gBACE,OAAO,EAAE,oBAAoB;gBAC7B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,YAAY,EAAE;YACZ;gBACE,OAAO,EAAE,oBAAoB;gBAC7B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,sBAAsB;aACjC;SACF;QACD,CAAC,EAAE;YACD;gBACE,OAAO,EAAE,yBAAyB;gBAClC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,oBAAoB,EAAE;YACpB;gBACE,OAAO,EAAE,yBAAyB;gBAClC,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,yBAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAE5D,6DAA6D;AAC7D,SAAgB,eAAe,CAAC,OAAe;IAC7C,SAAS,iBAAiB,CAAC,EAAE,IAAI,EAAO;QACtC,MAAM,cAAc,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE;YAC7C;gBACE,WAAW,EAAE,oCAA4B;gBACzC,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,qCAAqC,EAAE;oBAC/C,EAAE,IAAI,EAAE,kCAAkC,EAAE;oBAC5C,EAAE,IAAI,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E,kFAAkF;yBACzF;wBACD,EAAE,IAAI,EAAE,sDAAsD,EAAE;wBAChE;4BACE,IAAI,EAAE,gEAAgE;yBACvE;qBACF;iBACF;aACF,CAAC;SACL,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AA7FD,0CA6FC"}
@@ -0,0 +1,13 @@
1
+ import * as ambassadorWixEcomV1TotalsCalculationTypes from './ecom-v1-totals-calculation-totals-calculator.types.js';
2
+ import * as ambassadorWixEcomV1TotalsCalculationUniversalTypes from './ecom-v1-totals-calculation-totals-calculator.universal.js';
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
+ getUrl: (context: any) => string;
5
+ httpMethod: K;
6
+ path: string;
7
+ pathParams: M;
8
+ __requestType: T;
9
+ __originalRequestType: S;
10
+ __responseType: Q;
11
+ __originalResponseType: R;
12
+ };
13
+ export declare function calculateTotals(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixEcomV1TotalsCalculationUniversalTypes.CalculateTotalsRequest, ambassadorWixEcomV1TotalsCalculationTypes.CalculateTotalsRequest, ambassadorWixEcomV1TotalsCalculationUniversalTypes.CalculateTotalsResponse & ambassadorWixEcomV1TotalsCalculationUniversalTypes.CalculateTotalsResponseNonNullableFields, ambassadorWixEcomV1TotalsCalculationTypes.CalculateTotalsResponse & ambassadorWixEcomV1TotalsCalculationTypes.CalculateTotalsResponseNonNullableFields>;
@@ -0,0 +1,47 @@
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.calculateTotals = void 0;
27
+ const ambassadorWixEcomV1TotalsCalculation = __importStar(require("./ecom-v1-totals-calculation-totals-calculator.http.js"));
28
+ function calculateTotals() {
29
+ const payload = {};
30
+ const getRequestOptions = ambassadorWixEcomV1TotalsCalculation.calculateTotals(payload);
31
+ const getUrl = (context) => {
32
+ const { url } = getRequestOptions(context);
33
+ return url;
34
+ };
35
+ return {
36
+ getUrl,
37
+ httpMethod: 'POST',
38
+ path: '/v1/calculate-totals',
39
+ pathParams: {},
40
+ __requestType: null,
41
+ __originalRequestType: null,
42
+ __responseType: null,
43
+ __originalResponseType: null,
44
+ };
45
+ }
46
+ exports.calculateTotals = calculateTotals;
47
+ //# sourceMappingURL=ecom-v1-totals-calculation-totals-calculator.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-totals-calculation-totals-calculator.meta.js","sourceRoot":"","sources":["../../../../src/ecom-v1-totals-calculation-totals-calculator.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6HAA+G;AAsB/G,SAAgB,eAAe;IAU7B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,oCAAoC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,0CA8BC"}
@@ -0,0 +1,13 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { CalculateTotalsOptions, CalculateTotalsResponse, CalculateTotalsResponseNonNullableFields } from './ecom-v1-totals-calculation-totals-calculator.universal.js';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function calculateTotals(httpClient: HttpClient): CalculateTotalsSignature;
7
+ interface CalculateTotalsSignature {
8
+ /**
9
+ * Returns a totals calculation for specified line items.
10
+ */
11
+ (options?: CalculateTotalsOptions | undefined): Promise<CalculateTotalsResponse & CalculateTotalsResponseNonNullableFields>;
12
+ }
13
+ export { AdditionalFee, AdditionalFeeSource, Address, AddressLocation, AggregatedTaxBreakdown, ApiV1AdditionalFee, ApplicableLineItems, ApplicationError, AppliedDiscount, AppliedDiscountDiscountSourceOneOf, AutoTaxFallbackCalculationDetails, CalculateTotalsOptions, CalculateTotalsRequest, CalculateTotalsRequestCouponOneOf, CalculateTotalsRequestGiftCardOneOf, CalculateTotalsResponse, CalculateTotalsResponseNonNullableFields, CalculatedLineItem, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, Carrier, CarrierError, CarrierErrors, CarrierServiceOption, CarrierShippingOption, CatalogReference, ChargeType, Coupon, DataFetchType, DeliveryAllocation, DeliveryLogistics, DeliveryTimeSlot, Details, DetailsKindOneOf, DiscountRule, DiscountRuleName, DiscountType, ExternalReference, FallbackReason, FieldViolation, GiftCard, Group, InvalidMembership, ItemTaxFullDetails, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, JurisdictionType, LineItem, LineItemDiscount, LineItemPricesData, ManualCalculationReason, Membership, MembershipName, MembershipOptions, MembershipPaymentCredits, MerchantDiscount, MerchantDiscountInput, MultiCurrencyPrice, OtherCharge, PaymentOptionType, PhysicalProperties, PickupDetails, PickupMethod, PriceSummary, RateType, Region, RuleType, Scope, SelectedCarrierServiceOption, SelectedCarrierServiceOptionOtherCharge, SelectedCarrierServiceOptionPrices, SelectedMembership, SelectedMemberships, SelectedShippingOption, ServiceProperties, ShippingInformation, ShippingOption, ShippingPrice, ShippingRegion, StreetAddress, SubscriptionFrequency, SubscriptionSettings, SystemError, TaxBreakdown, TaxCalculationDetails, TaxCalculationDetailsCalculationDetailsOneOf, TaxDetails, TaxRateBreakdown, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TotalsCalculationEntity, V1AdditionalFee, V1TaxDetails, ValidationError, WeightUnit, } from './ecom-v1-totals-calculation-totals-calculator.universal.js';