@wix/auto_sdk_ecom_totals-calculator 1.0.119 → 1.0.121

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.
@@ -55,6 +55,60 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
55
55
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
56
56
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
57
57
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
58
+ var TRANSFORM_PATHS_0 = [
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
+ var TRANSFORM_PATHS_1 = [
73
+ { path: "lineItems.serviceProperties.scheduledDate" },
74
+ { path: "lineItems.serviceProperties.endDate" },
75
+ { path: "shippingOptions.shippingOptions.logistics.deliveryTimeSlot.from" },
76
+ { path: "shippingOptions.shippingOptions.logistics.deliveryTimeSlot.to" }
77
+ ];
78
+ var TRANSFORM_PATHS_2 = [
79
+ {
80
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
81
+ },
82
+ {
83
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
84
+ },
85
+ {
86
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
87
+ },
88
+ {
89
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
90
+ },
91
+ { path: "appliedDiscounts.merchantDiscount.percentage" }
92
+ ];
93
+ var TRANSFORM_PATHS_3 = [
94
+ {
95
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
96
+ },
97
+ {
98
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
99
+ },
100
+ {
101
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
102
+ },
103
+ {
104
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
105
+ },
106
+ { path: "membershipOptions.eligibleMemberships.expirationDate" },
107
+ { path: "membershipOptions.invalidMemberships.membership.expirationDate" },
108
+ {
109
+ path: "membershipOptions.validatedExistingMemberships.memberships.membership.expirationDate"
110
+ }
111
+ ];
58
112
  function resolveComWixEcomTotalsCalculatorV1TotalsCalculatorUrl(opts) {
59
113
  const domainToMappings = {
60
114
  "bo._base_domain_": [
@@ -102,33 +156,11 @@ function calculateTotals(payload) {
102
156
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
103
157
  {
104
158
  transformFn: import_float.transformSDKFloatToRESTFloat,
105
- paths: [
106
- { path: "lineItems.physicalProperties.weight" },
107
- { path: "shippingAddress.geocode.latitude" },
108
- { path: "shippingAddress.geocode.longitude" },
109
- { path: "billingAddress.geocode.latitude" },
110
- { path: "billingAddress.geocode.longitude" },
111
- {
112
- path: "shippingOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
113
- },
114
- {
115
- path: "shippingOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
116
- },
117
- { path: "appliedDiscounts.merchantDiscount.percentage" }
118
- ]
159
+ paths: TRANSFORM_PATHS_0
119
160
  },
120
161
  {
121
162
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
122
- paths: [
123
- { path: "lineItems.serviceProperties.scheduledDate" },
124
- { path: "lineItems.serviceProperties.endDate" },
125
- {
126
- path: "shippingOptions.shippingOptions.logistics.deliveryTimeSlot.from"
127
- },
128
- {
129
- path: "shippingOptions.shippingOptions.logistics.deliveryTimeSlot.to"
130
- }
131
- ]
163
+ paths: TRANSFORM_PATHS_1
132
164
  }
133
165
  ]);
134
166
  const metadata = {
@@ -148,45 +180,11 @@ function calculateTotals(payload) {
148
180
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
149
181
  {
150
182
  transformFn: import_float2.transformRESTFloatToSDKFloat,
151
- paths: [
152
- {
153
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
154
- },
155
- {
156
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
157
- },
158
- {
159
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
160
- },
161
- {
162
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
163
- },
164
- { path: "appliedDiscounts.merchantDiscount.percentage" }
165
- ]
183
+ paths: TRANSFORM_PATHS_2
166
184
  },
167
185
  {
168
186
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
169
- paths: [
170
- {
171
- path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
172
- },
173
- {
174
- path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
175
- },
176
- {
177
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
178
- },
179
- {
180
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
181
- },
182
- { path: "membershipOptions.eligibleMemberships.expirationDate" },
183
- {
184
- path: "membershipOptions.invalidMemberships.membership.expirationDate"
185
- },
186
- {
187
- path: "membershipOptions.validatedExistingMemberships.memberships.membership.expirationDate"
188
- }
189
- ]
187
+ paths: TRANSFORM_PATHS_3
190
188
  }
191
189
  ])
192
190
  };
@@ -199,6 +197,19 @@ function calculateTotals(payload) {
199
197
  var import_address = require("@wix/sdk-runtime/transformations/address");
200
198
  var import_address2 = require("@wix/sdk-runtime/transformations/address");
201
199
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
200
+ var TRANSFORM_PATHS_02 = [
201
+ { path: "shippingAddress" },
202
+ { path: "billingAddress" },
203
+ { path: "shippingOptions.shippingOptions.logistics.pickupDetails.address" }
204
+ ];
205
+ var TRANSFORM_PATHS_12 = [
206
+ {
207
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
208
+ },
209
+ {
210
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
211
+ }
212
+ ];
202
213
  var DimensionsUnit = /* @__PURE__ */ ((DimensionsUnit2) => {
203
214
  DimensionsUnit2["UNKNOWN_DIMENSIONS_UNIT"] = "UNKNOWN_DIMENSIONS_UNIT";
204
215
  DimensionsUnit2["MM"] = "MM";
@@ -379,13 +390,7 @@ async function calculateTotals2(options) {
379
390
  [
380
391
  {
381
392
  transformFn: import_address.transformSDKAddressToRESTAddress,
382
- paths: [
383
- { path: "shippingAddress" },
384
- { path: "billingAddress" },
385
- {
386
- path: "shippingOptions.shippingOptions.logistics.pickupDetails.address"
387
- }
388
- ]
393
+ paths: TRANSFORM_PATHS_02
389
394
  }
390
395
  ]
391
396
  );
@@ -398,14 +403,7 @@ async function calculateTotals2(options) {
398
403
  (0, import_transform_paths2.transformPaths)(result.data, [
399
404
  {
400
405
  transformFn: import_address2.transformRESTAddressToSDKAddress,
401
- paths: [
402
- {
403
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
404
- },
405
- {
406
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
407
- }
408
- ]
406
+ paths: TRANSFORM_PATHS_12
409
407
  }
410
408
  ])
411
409
  );