@wix/auto_sdk_ecom_current-cart 1.0.190 → 1.0.191

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.
@@ -14,6 +14,131 @@ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transform
14
14
  import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
15
15
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
16
16
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
17
+ var TRANSFORM_PATHS_0 = [
18
+ { path: "cart.createdDate" },
19
+ { path: "cart.updatedDate" },
20
+ { path: "cart.lineItems.image.urlExpirationDate" },
21
+ {
22
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
23
+ },
24
+ { path: "cart.lineItems.serviceProperties.scheduledDate" },
25
+ { path: "cart.lineItems.serviceProperties.endDate" }
26
+ ];
27
+ var TRANSFORM_PATHS_1 = [
28
+ { path: "cart.lineItems.image.focalPoint.x" },
29
+ { path: "cart.lineItems.image.focalPoint.y" },
30
+ { path: "cart.lineItems.physicalProperties.weight" },
31
+ { path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight" },
32
+ { path: "cart.contactInfo.address.geocode.latitude" },
33
+ { path: "cart.contactInfo.address.geocode.longitude" }
34
+ ];
35
+ var TRANSFORM_PATHS_2 = [{ path: "cartFieldmask" }];
36
+ var TRANSFORM_PATHS_3 = [
37
+ { path: "cartInfo.createdDate" },
38
+ { path: "cartInfo.updatedDate" },
39
+ { path: "cartInfo.lineItems.image.urlExpirationDate" },
40
+ {
41
+ path: "cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
42
+ },
43
+ { path: "cartInfo.lineItems.serviceProperties.scheduledDate" },
44
+ { path: "cartInfo.lineItems.serviceProperties.endDate" },
45
+ { path: "lineItems.image.urlExpirationDate" },
46
+ { path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate" },
47
+ { path: "lineItems.serviceProperties.scheduledDate" },
48
+ { path: "lineItems.serviceProperties.endDate" },
49
+ {
50
+ path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
51
+ },
52
+ { path: "customLineItems.serviceProperties.scheduledDate" },
53
+ { path: "customLineItems.serviceProperties.endDate" }
54
+ ];
55
+ var TRANSFORM_PATHS_4 = [
56
+ { path: "cartInfo.lineItems.image.focalPoint.x" },
57
+ { path: "cartInfo.lineItems.image.focalPoint.y" },
58
+ { path: "lineItems.image.focalPoint.x" },
59
+ { path: "lineItems.image.focalPoint.y" },
60
+ { path: "cartInfo.lineItems.physicalProperties.weight" },
61
+ {
62
+ path: "cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight"
63
+ },
64
+ { path: "cartInfo.contactInfo.address.geocode.latitude" },
65
+ { path: "cartInfo.contactInfo.address.geocode.longitude" },
66
+ { path: "lineItems.physicalProperties.weight" },
67
+ { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
68
+ { path: "customLineItems.physicalProperties.weight" }
69
+ ];
70
+ var TRANSFORM_PATHS_5 = [
71
+ { path: "lineItems.image.urlExpirationDate" },
72
+ { path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate" },
73
+ { path: "lineItems.serviceProperties.scheduledDate" },
74
+ { path: "lineItems.serviceProperties.endDate" },
75
+ {
76
+ path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
77
+ },
78
+ { path: "customLineItems.serviceProperties.scheduledDate" },
79
+ { path: "customLineItems.serviceProperties.endDate" }
80
+ ];
81
+ var TRANSFORM_PATHS_6 = [
82
+ { path: "lineItems.image.focalPoint.x" },
83
+ { path: "lineItems.image.focalPoint.y" },
84
+ { path: "lineItems.physicalProperties.weight" },
85
+ { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
86
+ { path: "customLineItems.physicalProperties.weight" }
87
+ ];
88
+ var TRANSFORM_PATHS_7 = [
89
+ { path: "shippingAddress.geocode.latitude" },
90
+ { path: "shippingAddress.geocode.longitude" },
91
+ { path: "billingAddress.geocode.latitude" },
92
+ { path: "billingAddress.geocode.longitude" }
93
+ ];
94
+ var TRANSFORM_PATHS_8 = [
95
+ { path: "cart.createdDate" },
96
+ { path: "cart.updatedDate" },
97
+ { path: "cart.lineItems.image.urlExpirationDate" },
98
+ {
99
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
100
+ },
101
+ { path: "cart.lineItems.serviceProperties.scheduledDate" },
102
+ { path: "cart.lineItems.serviceProperties.endDate" },
103
+ {
104
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
105
+ },
106
+ {
107
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
108
+ },
109
+ {
110
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
111
+ },
112
+ {
113
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
114
+ },
115
+ { path: "membershipOptions.eligibleMemberships.expirationDate" },
116
+ { path: "membershipOptions.invalidMemberships.membership.expirationDate" },
117
+ {
118
+ path: "membershipOptions.validatedExistingMemberships.memberships.membership.expirationDate"
119
+ }
120
+ ];
121
+ var TRANSFORM_PATHS_9 = [
122
+ { path: "cart.lineItems.image.focalPoint.x" },
123
+ { path: "cart.lineItems.image.focalPoint.y" },
124
+ { path: "cart.lineItems.physicalProperties.weight" },
125
+ { path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight" },
126
+ { path: "cart.contactInfo.address.geocode.latitude" },
127
+ { path: "cart.contactInfo.address.geocode.longitude" },
128
+ {
129
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
130
+ },
131
+ {
132
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
133
+ },
134
+ {
135
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
136
+ },
137
+ {
138
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
139
+ },
140
+ { path: "appliedDiscounts.merchantDiscount.percentage" }
141
+ ];
17
142
  function resolveComWixEcomCartApiV1CurrentCartServiceUrl(opts) {
18
143
  const domainToMappings = {
19
144
  "www.wixapis.com": [
@@ -143,29 +268,11 @@ function currentCartGetCurrentCart(payload) {
143
268
  transformResponse: (payload2) => transformPaths(payload2, [
144
269
  {
145
270
  transformFn: transformRESTTimestampToSDKTimestamp,
146
- paths: [
147
- { path: "cart.createdDate" },
148
- { path: "cart.updatedDate" },
149
- { path: "cart.lineItems.image.urlExpirationDate" },
150
- {
151
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
152
- },
153
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
154
- { path: "cart.lineItems.serviceProperties.endDate" }
155
- ]
271
+ paths: TRANSFORM_PATHS_0
156
272
  },
157
273
  {
158
274
  transformFn: transformRESTFloatToSDKFloat,
159
- paths: [
160
- { path: "cart.lineItems.image.focalPoint.x" },
161
- { path: "cart.lineItems.image.focalPoint.y" },
162
- { path: "cart.lineItems.physicalProperties.weight" },
163
- {
164
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
165
- },
166
- { path: "cart.contactInfo.address.geocode.latitude" },
167
- { path: "cart.contactInfo.address.geocode.longitude" }
168
- ]
275
+ paths: TRANSFORM_PATHS_1
169
276
  }
170
277
  ])
171
278
  };
@@ -178,49 +285,15 @@ function updateCurrentCart(payload) {
178
285
  const serializedData = transformPaths(payload, [
179
286
  {
180
287
  transformFn: transformSDKFieldMaskToRESTFieldMask,
181
- paths: [{ path: "cartFieldmask" }]
288
+ paths: TRANSFORM_PATHS_2
182
289
  },
183
290
  {
184
291
  transformFn: transformSDKTimestampToRESTTimestamp,
185
- paths: [
186
- { path: "cartInfo.createdDate" },
187
- { path: "cartInfo.updatedDate" },
188
- { path: "cartInfo.lineItems.image.urlExpirationDate" },
189
- {
190
- path: "cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
191
- },
192
- { path: "cartInfo.lineItems.serviceProperties.scheduledDate" },
193
- { path: "cartInfo.lineItems.serviceProperties.endDate" },
194
- { path: "lineItems.image.urlExpirationDate" },
195
- {
196
- path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
197
- },
198
- { path: "lineItems.serviceProperties.scheduledDate" },
199
- { path: "lineItems.serviceProperties.endDate" },
200
- {
201
- path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
202
- },
203
- { path: "customLineItems.serviceProperties.scheduledDate" },
204
- { path: "customLineItems.serviceProperties.endDate" }
205
- ]
292
+ paths: TRANSFORM_PATHS_3
206
293
  },
207
294
  {
208
295
  transformFn: transformSDKFloatToRESTFloat,
209
- paths: [
210
- { path: "cartInfo.lineItems.image.focalPoint.x" },
211
- { path: "cartInfo.lineItems.image.focalPoint.y" },
212
- { path: "lineItems.image.focalPoint.x" },
213
- { path: "lineItems.image.focalPoint.y" },
214
- { path: "cartInfo.lineItems.physicalProperties.weight" },
215
- {
216
- path: "cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight"
217
- },
218
- { path: "cartInfo.contactInfo.address.geocode.latitude" },
219
- { path: "cartInfo.contactInfo.address.geocode.longitude" },
220
- { path: "lineItems.physicalProperties.weight" },
221
- { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
222
- { path: "customLineItems.physicalProperties.weight" }
223
- ]
296
+ paths: TRANSFORM_PATHS_4
224
297
  }
225
298
  ]);
226
299
  const metadata = {
@@ -240,29 +313,11 @@ function updateCurrentCart(payload) {
240
313
  transformResponse: (payload2) => transformPaths(payload2, [
241
314
  {
242
315
  transformFn: transformRESTTimestampToSDKTimestamp,
243
- paths: [
244
- { path: "cart.createdDate" },
245
- { path: "cart.updatedDate" },
246
- { path: "cart.lineItems.image.urlExpirationDate" },
247
- {
248
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
249
- },
250
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
251
- { path: "cart.lineItems.serviceProperties.endDate" }
252
- ]
316
+ paths: TRANSFORM_PATHS_0
253
317
  },
254
318
  {
255
319
  transformFn: transformRESTFloatToSDKFloat,
256
- paths: [
257
- { path: "cart.lineItems.image.focalPoint.x" },
258
- { path: "cart.lineItems.image.focalPoint.y" },
259
- { path: "cart.lineItems.physicalProperties.weight" },
260
- {
261
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
262
- },
263
- { path: "cart.contactInfo.address.geocode.latitude" },
264
- { path: "cart.contactInfo.address.geocode.longitude" }
265
- ]
320
+ paths: TRANSFORM_PATHS_1
266
321
  }
267
322
  ])
268
323
  };
@@ -275,29 +330,11 @@ function addToCurrentCart(payload) {
275
330
  const serializedData = transformPaths(payload, [
276
331
  {
277
332
  transformFn: transformSDKTimestampToRESTTimestamp,
278
- paths: [
279
- { path: "lineItems.image.urlExpirationDate" },
280
- {
281
- path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
282
- },
283
- { path: "lineItems.serviceProperties.scheduledDate" },
284
- { path: "lineItems.serviceProperties.endDate" },
285
- {
286
- path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
287
- },
288
- { path: "customLineItems.serviceProperties.scheduledDate" },
289
- { path: "customLineItems.serviceProperties.endDate" }
290
- ]
333
+ paths: TRANSFORM_PATHS_5
291
334
  },
292
335
  {
293
336
  transformFn: transformSDKFloatToRESTFloat,
294
- paths: [
295
- { path: "lineItems.image.focalPoint.x" },
296
- { path: "lineItems.image.focalPoint.y" },
297
- { path: "lineItems.physicalProperties.weight" },
298
- { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
299
- { path: "customLineItems.physicalProperties.weight" }
300
- ]
337
+ paths: TRANSFORM_PATHS_6
301
338
  }
302
339
  ]);
303
340
  const metadata = {
@@ -317,29 +354,11 @@ function addToCurrentCart(payload) {
317
354
  transformResponse: (payload2) => transformPaths(payload2, [
318
355
  {
319
356
  transformFn: transformRESTTimestampToSDKTimestamp,
320
- paths: [
321
- { path: "cart.createdDate" },
322
- { path: "cart.updatedDate" },
323
- { path: "cart.lineItems.image.urlExpirationDate" },
324
- {
325
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
326
- },
327
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
328
- { path: "cart.lineItems.serviceProperties.endDate" }
329
- ]
357
+ paths: TRANSFORM_PATHS_0
330
358
  },
331
359
  {
332
360
  transformFn: transformRESTFloatToSDKFloat,
333
- paths: [
334
- { path: "cart.lineItems.image.focalPoint.x" },
335
- { path: "cart.lineItems.image.focalPoint.y" },
336
- { path: "cart.lineItems.physicalProperties.weight" },
337
- {
338
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
339
- },
340
- { path: "cart.contactInfo.address.geocode.latitude" },
341
- { path: "cart.contactInfo.address.geocode.longitude" }
342
- ]
361
+ paths: TRANSFORM_PATHS_1
343
362
  }
344
363
  ])
345
364
  };
@@ -366,29 +385,11 @@ function removeLineItemsFromCurrentCart(payload) {
366
385
  transformResponse: (payload2) => transformPaths(payload2, [
367
386
  {
368
387
  transformFn: transformRESTTimestampToSDKTimestamp,
369
- paths: [
370
- { path: "cart.createdDate" },
371
- { path: "cart.updatedDate" },
372
- { path: "cart.lineItems.image.urlExpirationDate" },
373
- {
374
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
375
- },
376
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
377
- { path: "cart.lineItems.serviceProperties.endDate" }
378
- ]
388
+ paths: TRANSFORM_PATHS_0
379
389
  },
380
390
  {
381
391
  transformFn: transformRESTFloatToSDKFloat,
382
- paths: [
383
- { path: "cart.lineItems.image.focalPoint.x" },
384
- { path: "cart.lineItems.image.focalPoint.y" },
385
- { path: "cart.lineItems.physicalProperties.weight" },
386
- {
387
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
388
- },
389
- { path: "cart.contactInfo.address.geocode.latitude" },
390
- { path: "cart.contactInfo.address.geocode.longitude" }
391
- ]
392
+ paths: TRANSFORM_PATHS_1
392
393
  }
393
394
  ])
394
395
  };
@@ -401,12 +402,7 @@ function createCheckoutFromCurrentCart(payload) {
401
402
  const serializedData = transformPaths(payload, [
402
403
  {
403
404
  transformFn: transformSDKFloatToRESTFloat,
404
- paths: [
405
- { path: "shippingAddress.geocode.latitude" },
406
- { path: "shippingAddress.geocode.longitude" },
407
- { path: "billingAddress.geocode.latitude" },
408
- { path: "billingAddress.geocode.longitude" }
409
- ]
405
+ paths: TRANSFORM_PATHS_7
410
406
  }
411
407
  ]);
412
408
  const metadata = {
@@ -447,29 +443,11 @@ function removeCouponFromCurrentCart(payload) {
447
443
  transformResponse: (payload2) => transformPaths(payload2, [
448
444
  {
449
445
  transformFn: transformRESTTimestampToSDKTimestamp,
450
- paths: [
451
- { path: "cart.createdDate" },
452
- { path: "cart.updatedDate" },
453
- { path: "cart.lineItems.image.urlExpirationDate" },
454
- {
455
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
456
- },
457
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
458
- { path: "cart.lineItems.serviceProperties.endDate" }
459
- ]
446
+ paths: TRANSFORM_PATHS_0
460
447
  },
461
448
  {
462
449
  transformFn: transformRESTFloatToSDKFloat,
463
- paths: [
464
- { path: "cart.lineItems.image.focalPoint.x" },
465
- { path: "cart.lineItems.image.focalPoint.y" },
466
- { path: "cart.lineItems.physicalProperties.weight" },
467
- {
468
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
469
- },
470
- { path: "cart.contactInfo.address.geocode.latitude" },
471
- { path: "cart.contactInfo.address.geocode.longitude" }
472
- ]
450
+ paths: TRANSFORM_PATHS_1
473
451
  }
474
452
  ])
475
453
  };
@@ -496,29 +474,11 @@ function updateCurrentCartLineItemQuantity(payload) {
496
474
  transformResponse: (payload2) => transformPaths(payload2, [
497
475
  {
498
476
  transformFn: transformRESTTimestampToSDKTimestamp,
499
- paths: [
500
- { path: "cart.createdDate" },
501
- { path: "cart.updatedDate" },
502
- { path: "cart.lineItems.image.urlExpirationDate" },
503
- {
504
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
505
- },
506
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
507
- { path: "cart.lineItems.serviceProperties.endDate" }
508
- ]
477
+ paths: TRANSFORM_PATHS_0
509
478
  },
510
479
  {
511
480
  transformFn: transformRESTFloatToSDKFloat,
512
- paths: [
513
- { path: "cart.lineItems.image.focalPoint.x" },
514
- { path: "cart.lineItems.image.focalPoint.y" },
515
- { path: "cart.lineItems.physicalProperties.weight" },
516
- {
517
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
518
- },
519
- { path: "cart.contactInfo.address.geocode.latitude" },
520
- { path: "cart.contactInfo.address.geocode.longitude" }
521
- ]
481
+ paths: TRANSFORM_PATHS_1
522
482
  }
523
483
  ])
524
484
  };
@@ -531,12 +491,7 @@ function estimateCurrentCartTotals(payload) {
531
491
  const serializedData = transformPaths(payload, [
532
492
  {
533
493
  transformFn: transformSDKFloatToRESTFloat,
534
- paths: [
535
- { path: "shippingAddress.geocode.latitude" },
536
- { path: "shippingAddress.geocode.longitude" },
537
- { path: "billingAddress.geocode.latitude" },
538
- { path: "billingAddress.geocode.longitude" }
539
- ]
494
+ paths: TRANSFORM_PATHS_7
540
495
  }
541
496
  ]);
542
497
  const metadata = {
@@ -556,61 +511,11 @@ function estimateCurrentCartTotals(payload) {
556
511
  transformResponse: (payload2) => transformPaths(payload2, [
557
512
  {
558
513
  transformFn: transformRESTTimestampToSDKTimestamp,
559
- paths: [
560
- { path: "cart.createdDate" },
561
- { path: "cart.updatedDate" },
562
- { path: "cart.lineItems.image.urlExpirationDate" },
563
- {
564
- path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
565
- },
566
- { path: "cart.lineItems.serviceProperties.scheduledDate" },
567
- { path: "cart.lineItems.serviceProperties.endDate" },
568
- {
569
- path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
570
- },
571
- {
572
- path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
573
- },
574
- {
575
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
576
- },
577
- {
578
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
579
- },
580
- { path: "membershipOptions.eligibleMemberships.expirationDate" },
581
- {
582
- path: "membershipOptions.invalidMemberships.membership.expirationDate"
583
- },
584
- {
585
- path: "membershipOptions.validatedExistingMemberships.memberships.membership.expirationDate"
586
- }
587
- ]
514
+ paths: TRANSFORM_PATHS_8
588
515
  },
589
516
  {
590
517
  transformFn: transformRESTFloatToSDKFloat,
591
- paths: [
592
- { path: "cart.lineItems.image.focalPoint.x" },
593
- { path: "cart.lineItems.image.focalPoint.y" },
594
- { path: "cart.lineItems.physicalProperties.weight" },
595
- {
596
- path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
597
- },
598
- { path: "cart.contactInfo.address.geocode.latitude" },
599
- { path: "cart.contactInfo.address.geocode.longitude" },
600
- {
601
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
602
- },
603
- {
604
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
605
- },
606
- {
607
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
608
- },
609
- {
610
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
611
- },
612
- { path: "appliedDiscounts.merchantDiscount.percentage" }
613
- ]
518
+ paths: TRANSFORM_PATHS_9
614
519
  }
615
520
  ])
616
521
  };
@@ -648,6 +553,47 @@ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/i
648
553
  import { transformSDKPageURLV2ToRESTPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
649
554
  import { transformRESTPageURLV2ToSDKPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
650
555
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
556
+ var TRANSFORM_PATHS_02 = [{ path: "cart.lineItems.url" }];
557
+ var TRANSFORM_PATHS_12 = [
558
+ { path: "cart.lineItems.image" },
559
+ { path: "cart.lineItems.catalogOverrideFields.image" }
560
+ ];
561
+ var TRANSFORM_PATHS_22 = [{ path: "cart.contactInfo.address" }];
562
+ var TRANSFORM_PATHS_32 = [
563
+ { path: "cartInfo.lineItems.url" },
564
+ { path: "lineItems.url" },
565
+ { path: "customLineItems.url" }
566
+ ];
567
+ var TRANSFORM_PATHS_42 = [
568
+ { path: "cartInfo.lineItems.image" },
569
+ { path: "cartInfo.lineItems.catalogOverrideFields.image" },
570
+ { path: "lineItems.image" },
571
+ { path: "lineItems.catalogOverrideFields.image" },
572
+ { path: "customLineItems.media" }
573
+ ];
574
+ var TRANSFORM_PATHS_52 = [{ path: "cartInfo.contactInfo.address" }];
575
+ var TRANSFORM_PATHS_62 = [
576
+ { path: "lineItems.url" },
577
+ { path: "customLineItems.url" }
578
+ ];
579
+ var TRANSFORM_PATHS_72 = [
580
+ { path: "lineItems.image" },
581
+ { path: "lineItems.catalogOverrideFields.image" },
582
+ { path: "customLineItems.media" }
583
+ ];
584
+ var TRANSFORM_PATHS_82 = [
585
+ { path: "shippingAddress" },
586
+ { path: "billingAddress" }
587
+ ];
588
+ var TRANSFORM_PATHS_92 = [
589
+ { path: "cart.contactInfo.address" },
590
+ {
591
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
592
+ },
593
+ {
594
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
595
+ }
596
+ ];
651
597
  var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
652
598
  DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
653
599
  DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
@@ -891,18 +837,15 @@ async function getCurrentCart() {
891
837
  transformPaths2(result.data, [
892
838
  {
893
839
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
894
- paths: [{ path: "cart.lineItems.url" }]
840
+ paths: TRANSFORM_PATHS_02
895
841
  },
896
842
  {
897
843
  transformFn: transformRESTImageToSDKImage,
898
- paths: [
899
- { path: "cart.lineItems.image" },
900
- { path: "cart.lineItems.catalogOverrideFields.image" }
901
- ]
844
+ paths: TRANSFORM_PATHS_12
902
845
  },
903
846
  {
904
847
  transformFn: transformRESTAddressToSDKAddress,
905
- paths: [{ path: "cart.contactInfo.address" }]
848
+ paths: TRANSFORM_PATHS_22
906
849
  }
907
850
  ])
908
851
  )?.cart;
@@ -932,25 +875,15 @@ async function updateCurrentCart2(options) {
932
875
  [
933
876
  {
934
877
  transformFn: transformSDKPageURLV2ToRESTPageURLV2,
935
- paths: [
936
- { path: "cartInfo.lineItems.url" },
937
- { path: "lineItems.url" },
938
- { path: "customLineItems.url" }
939
- ]
878
+ paths: TRANSFORM_PATHS_32
940
879
  },
941
880
  {
942
881
  transformFn: transformSDKImageToRESTImage,
943
- paths: [
944
- { path: "cartInfo.lineItems.image" },
945
- { path: "cartInfo.lineItems.catalogOverrideFields.image" },
946
- { path: "lineItems.image" },
947
- { path: "lineItems.catalogOverrideFields.image" },
948
- { path: "customLineItems.media" }
949
- ]
882
+ paths: TRANSFORM_PATHS_42
950
883
  },
951
884
  {
952
885
  transformFn: transformSDKAddressToRESTAddress,
953
- paths: [{ path: "cartInfo.contactInfo.address" }]
886
+ paths: TRANSFORM_PATHS_52
954
887
  }
955
888
  ]
956
889
  );
@@ -963,18 +896,15 @@ async function updateCurrentCart2(options) {
963
896
  transformPaths2(result.data, [
964
897
  {
965
898
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
966
- paths: [{ path: "cart.lineItems.url" }]
899
+ paths: TRANSFORM_PATHS_02
967
900
  },
968
901
  {
969
902
  transformFn: transformRESTImageToSDKImage,
970
- paths: [
971
- { path: "cart.lineItems.image" },
972
- { path: "cart.lineItems.catalogOverrideFields.image" }
973
- ]
903
+ paths: TRANSFORM_PATHS_12
974
904
  },
975
905
  {
976
906
  transformFn: transformRESTAddressToSDKAddress,
977
- paths: [{ path: "cart.contactInfo.address" }]
907
+ paths: TRANSFORM_PATHS_22
978
908
  }
979
909
  ])
980
910
  )?.cart;
@@ -1008,15 +938,11 @@ async function addToCurrentCart2(options) {
1008
938
  [
1009
939
  {
1010
940
  transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1011
- paths: [{ path: "lineItems.url" }, { path: "customLineItems.url" }]
941
+ paths: TRANSFORM_PATHS_62
1012
942
  },
1013
943
  {
1014
944
  transformFn: transformSDKImageToRESTImage,
1015
- paths: [
1016
- { path: "lineItems.image" },
1017
- { path: "lineItems.catalogOverrideFields.image" },
1018
- { path: "customLineItems.media" }
1019
- ]
945
+ paths: TRANSFORM_PATHS_72
1020
946
  }
1021
947
  ]
1022
948
  );
@@ -1029,18 +955,15 @@ async function addToCurrentCart2(options) {
1029
955
  transformPaths2(result.data, [
1030
956
  {
1031
957
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1032
- paths: [{ path: "cart.lineItems.url" }]
958
+ paths: TRANSFORM_PATHS_02
1033
959
  },
1034
960
  {
1035
961
  transformFn: transformRESTImageToSDKImage,
1036
- paths: [
1037
- { path: "cart.lineItems.image" },
1038
- { path: "cart.lineItems.catalogOverrideFields.image" }
1039
- ]
962
+ paths: TRANSFORM_PATHS_12
1040
963
  },
1041
964
  {
1042
965
  transformFn: transformRESTAddressToSDKAddress,
1043
- paths: [{ path: "cart.contactInfo.address" }]
966
+ paths: TRANSFORM_PATHS_22
1044
967
  }
1045
968
  ])
1046
969
  );
@@ -1076,18 +999,15 @@ async function removeLineItemsFromCurrentCart2(lineItemIds) {
1076
999
  transformPaths2(result.data, [
1077
1000
  {
1078
1001
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1079
- paths: [{ path: "cart.lineItems.url" }]
1002
+ paths: TRANSFORM_PATHS_02
1080
1003
  },
1081
1004
  {
1082
1005
  transformFn: transformRESTImageToSDKImage,
1083
- paths: [
1084
- { path: "cart.lineItems.image" },
1085
- { path: "cart.lineItems.catalogOverrideFields.image" }
1086
- ]
1006
+ paths: TRANSFORM_PATHS_12
1087
1007
  },
1088
1008
  {
1089
1009
  transformFn: transformRESTAddressToSDKAddress,
1090
- paths: [{ path: "cart.contactInfo.address" }]
1010
+ paths: TRANSFORM_PATHS_22
1091
1011
  }
1092
1012
  ])
1093
1013
  );
@@ -1118,7 +1038,7 @@ async function createCheckoutFromCurrentCart2(options) {
1118
1038
  [
1119
1039
  {
1120
1040
  transformFn: transformSDKAddressToRESTAddress,
1121
- paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
1041
+ paths: TRANSFORM_PATHS_82
1122
1042
  }
1123
1043
  ]
1124
1044
  );
@@ -1160,18 +1080,15 @@ async function removeCouponFromCurrentCart2() {
1160
1080
  transformPaths2(result.data, [
1161
1081
  {
1162
1082
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1163
- paths: [{ path: "cart.lineItems.url" }]
1083
+ paths: TRANSFORM_PATHS_02
1164
1084
  },
1165
1085
  {
1166
1086
  transformFn: transformRESTImageToSDKImage,
1167
- paths: [
1168
- { path: "cart.lineItems.image" },
1169
- { path: "cart.lineItems.catalogOverrideFields.image" }
1170
- ]
1087
+ paths: TRANSFORM_PATHS_12
1171
1088
  },
1172
1089
  {
1173
1090
  transformFn: transformRESTAddressToSDKAddress,
1174
- paths: [{ path: "cart.contactInfo.address" }]
1091
+ paths: TRANSFORM_PATHS_22
1175
1092
  }
1176
1093
  ])
1177
1094
  );
@@ -1203,18 +1120,15 @@ async function updateCurrentCartLineItemQuantity2(lineItems) {
1203
1120
  transformPaths2(result.data, [
1204
1121
  {
1205
1122
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1206
- paths: [{ path: "cart.lineItems.url" }]
1123
+ paths: TRANSFORM_PATHS_02
1207
1124
  },
1208
1125
  {
1209
1126
  transformFn: transformRESTImageToSDKImage,
1210
- paths: [
1211
- { path: "cart.lineItems.image" },
1212
- { path: "cart.lineItems.catalogOverrideFields.image" }
1213
- ]
1127
+ paths: TRANSFORM_PATHS_12
1214
1128
  },
1215
1129
  {
1216
1130
  transformFn: transformRESTAddressToSDKAddress,
1217
- paths: [{ path: "cart.contactInfo.address" }]
1131
+ paths: TRANSFORM_PATHS_22
1218
1132
  }
1219
1133
  ])
1220
1134
  );
@@ -1247,7 +1161,7 @@ async function estimateCurrentCartTotals2(options) {
1247
1161
  [
1248
1162
  {
1249
1163
  transformFn: transformSDKAddressToRESTAddress,
1250
- paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
1164
+ paths: TRANSFORM_PATHS_82
1251
1165
  }
1252
1166
  ]
1253
1167
  );
@@ -1260,26 +1174,15 @@ async function estimateCurrentCartTotals2(options) {
1260
1174
  transformPaths2(result.data, [
1261
1175
  {
1262
1176
  transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1263
- paths: [{ path: "cart.lineItems.url" }]
1177
+ paths: TRANSFORM_PATHS_02
1264
1178
  },
1265
1179
  {
1266
1180
  transformFn: transformRESTImageToSDKImage,
1267
- paths: [
1268
- { path: "cart.lineItems.image" },
1269
- { path: "cart.lineItems.catalogOverrideFields.image" }
1270
- ]
1181
+ paths: TRANSFORM_PATHS_12
1271
1182
  },
1272
1183
  {
1273
1184
  transformFn: transformRESTAddressToSDKAddress,
1274
- paths: [
1275
- { path: "cart.contactInfo.address" },
1276
- {
1277
- path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
1278
- },
1279
- {
1280
- path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
1281
- }
1282
- ]
1185
+ paths: TRANSFORM_PATHS_92
1283
1186
  }
1284
1187
  ])
1285
1188
  );