@wix/auto_sdk_ecom_cart 1.0.13 → 1.0.14

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 (134) hide show
  1. package/build/{cjs/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.mts} +504 -269
  2. package/build/{internal/cjs/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.ts} +504 -269
  3. package/build/index.d.mts +149 -0
  4. package/build/index.d.ts +149 -0
  5. package/build/index.js +1938 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1875 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-CJdmyIWv.d.mts} +668 -269
  10. package/build/{es/src/ecom-v1-cart-cart.types.d.ts → internal/ecom-v1-cart-cart.universal-CJdmyIWv.d.ts} +668 -269
  11. package/build/internal/index.d.mts +160 -0
  12. package/build/internal/index.d.ts +160 -0
  13. package/build/internal/index.js +1938 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1875 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +2050 -0
  18. package/build/internal/meta.d.ts +2050 -0
  19. package/build/internal/meta.js +1027 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +989 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +2050 -0
  24. package/build/meta.d.ts +2050 -0
  25. package/build/meta.js +1027 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +989 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/ecom-v1-cart-cart.context.d.ts +0 -29
  40. package/build/cjs/src/ecom-v1-cart-cart.context.js +0 -59
  41. package/build/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
  43. package/build/cjs/src/ecom-v1-cart-cart.http.js +0 -818
  44. package/build/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  46. package/build/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
  47. package/build/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -129
  49. package/build/cjs/src/ecom-v1-cart-cart.public.js +0 -227
  50. package/build/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-cart-cart.types.js +0 -255
  52. package/build/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
  53. package/build/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
  54. package/build/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
  55. package/build/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/ecom-v1-cart-cart.context.d.ts +0 -29
  67. package/build/es/src/ecom-v1-cart-cart.context.js +0 -31
  68. package/build/es/src/ecom-v1-cart-cart.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
  70. package/build/es/src/ecom-v1-cart-cart.http.js +0 -803
  71. package/build/es/src/ecom-v1-cart-cart.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  73. package/build/es/src/ecom-v1-cart-cart.meta.js +0 -218
  74. package/build/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-cart-cart.public.d.ts +0 -129
  76. package/build/es/src/ecom-v1-cart-cart.public.js +0 -187
  77. package/build/es/src/ecom-v1-cart-cart.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-cart-cart.types.js +0 -252
  79. package/build/es/src/ecom-v1-cart-cart.types.js.map +0 -1
  80. package/build/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
  81. package/build/es/src/ecom-v1-cart-cart.universal.js +0 -1154
  82. package/build/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/ecom-v1-cart-cart.context.d.ts +0 -31
  93. package/build/internal/cjs/src/ecom-v1-cart-cart.context.js +0 -59
  94. package/build/internal/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
  95. package/build/internal/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
  96. package/build/internal/cjs/src/ecom-v1-cart-cart.http.js +0 -818
  97. package/build/internal/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
  98. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  99. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
  100. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -138
  102. package/build/internal/cjs/src/ecom-v1-cart-cart.public.js +0 -227
  103. package/build/internal/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
  104. package/build/internal/cjs/src/ecom-v1-cart-cart.types.js +0 -255
  105. package/build/internal/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
  106. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
  107. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
  108. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/ecom-v1-cart-cart.context.d.ts +0 -31
  119. package/build/internal/es/src/ecom-v1-cart-cart.context.js +0 -31
  120. package/build/internal/es/src/ecom-v1-cart-cart.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
  122. package/build/internal/es/src/ecom-v1-cart-cart.http.js +0 -803
  123. package/build/internal/es/src/ecom-v1-cart-cart.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  125. package/build/internal/es/src/ecom-v1-cart-cart.meta.js +0 -218
  126. package/build/internal/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-cart-cart.public.d.ts +0 -138
  128. package/build/internal/es/src/ecom-v1-cart-cart.public.js +0 -187
  129. package/build/internal/es/src/ecom-v1-cart-cart.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-cart-cart.types.js +0 -252
  131. package/build/internal/es/src/ecom-v1-cart-cart.types.js.map +0 -1
  132. package/build/internal/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
  133. package/build/internal/es/src/ecom-v1-cart-cart.universal.js +0 -1154
  134. package/build/internal/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
@@ -0,0 +1,1875 @@
1
+ // src/ecom-v1-cart-cart.public.ts
2
+ import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { transformRESTAddressToSDKAddress as transformRESTAddressToSDKAddress2 } from "@wix/sdk-runtime/transformations/address";
4
+ import { transformRESTFloatToSDKFloat as transformRESTFloatToSDKFloat2 } from "@wix/sdk-runtime/transformations/float";
5
+ import { transformRESTImageToSDKImage as transformRESTImageToSDKImage2 } from "@wix/sdk-runtime/transformations/image";
6
+ import { transformRESTPageURLV2ToSDKPageURLV2 as transformRESTPageURLV2ToSDKPageURLV22 } from "@wix/sdk-runtime/transformations/page-url-v2";
7
+ import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
8
+ import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
9
+ import { EventDefinition } from "@wix/sdk-types";
10
+
11
+ // src/ecom-v1-cart-cart.universal.ts
12
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
13
+ import {
14
+ renameKeysFromSDKRequestToRESTRequest,
15
+ renameKeysFromRESTResponseToSDKResponse
16
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
17
+
18
+ // src/ecom-v1-cart-cart.http.ts
19
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
20
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
21
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
22
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
23
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
24
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
25
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
26
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
27
+ function resolveComWixEcomCartApiV1CartServiceUrl(opts) {
28
+ const domainToMappings = {
29
+ "api._api_base_domain_": [
30
+ {
31
+ srcPath: "/cart",
32
+ destPath: ""
33
+ }
34
+ ],
35
+ "www.wixapis.com": [
36
+ {
37
+ srcPath: "/ecom/v1/carts",
38
+ destPath: "/v1/carts"
39
+ }
40
+ ],
41
+ "www.wixgateway.com": [
42
+ {
43
+ srcPath: "/ecom/v1/carts",
44
+ destPath: "/v1/carts"
45
+ }
46
+ ],
47
+ _: [
48
+ {
49
+ srcPath: "/_api/ecom-cart",
50
+ destPath: ""
51
+ },
52
+ {
53
+ srcPath: "/_api/cart",
54
+ destPath: ""
55
+ },
56
+ {
57
+ srcPath: "/ecom/v1/carts",
58
+ destPath: "/v1/carts"
59
+ }
60
+ ],
61
+ "manage._base_domain_": [
62
+ {
63
+ srcPath: "/ecom/v1/carts",
64
+ destPath: "/v1/carts"
65
+ }
66
+ ],
67
+ "editor._base_domain_": [
68
+ {
69
+ srcPath: "/_api/ecom-cart",
70
+ destPath: ""
71
+ }
72
+ ],
73
+ "blocks._base_domain_": [
74
+ {
75
+ srcPath: "/_api/ecom-cart",
76
+ destPath: ""
77
+ }
78
+ ],
79
+ "create.editorx": [
80
+ {
81
+ srcPath: "/_api/ecom-cart",
82
+ destPath: ""
83
+ }
84
+ ],
85
+ "*.dev.wix-code.com": [
86
+ {
87
+ srcPath: "/_api/ecom-cart",
88
+ destPath: ""
89
+ }
90
+ ],
91
+ "www._base_domain_": [
92
+ {
93
+ srcPath: "/_api/ecom-cart",
94
+ destPath: ""
95
+ }
96
+ ],
97
+ "bo._base_domain_": [
98
+ {
99
+ srcPath: "/ecom/v1/carts",
100
+ destPath: "/v1/carts"
101
+ }
102
+ ],
103
+ "wixbo.ai": [
104
+ {
105
+ srcPath: "/ecom/v1/carts",
106
+ destPath: "/v1/carts"
107
+ }
108
+ ],
109
+ "wix-bo.com": [
110
+ {
111
+ srcPath: "/ecom/v1/carts",
112
+ destPath: "/v1/carts"
113
+ }
114
+ ],
115
+ "editor.wixapps.net": [
116
+ {
117
+ srcPath: "/_api/ecom-cart",
118
+ destPath: ""
119
+ }
120
+ ]
121
+ };
122
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
123
+ }
124
+ var PACKAGE_NAME = "@wix/auto_sdk_ecom_cart";
125
+ function createCart(payload) {
126
+ function __createCart({ host }) {
127
+ const serializedData = transformPaths(payload, [
128
+ {
129
+ transformFn: transformSDKTimestampToRESTTimestamp,
130
+ paths: [
131
+ { path: "cartInfo.createdDate" },
132
+ { path: "cartInfo.updatedDate" },
133
+ { path: "cartInfo.lineItems.image.urlExpirationDate" },
134
+ {
135
+ path: "cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
136
+ },
137
+ { path: "cartInfo.lineItems.serviceProperties.scheduledDate" },
138
+ { path: "lineItems.image.urlExpirationDate" },
139
+ {
140
+ path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
141
+ },
142
+ { path: "lineItems.serviceProperties.scheduledDate" },
143
+ {
144
+ path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
145
+ },
146
+ { path: "customLineItems.serviceProperties.scheduledDate" }
147
+ ]
148
+ },
149
+ {
150
+ transformFn: transformSDKFloatToRESTFloat,
151
+ paths: [
152
+ { path: "cartInfo.lineItems.image.focalPoint.x" },
153
+ { path: "cartInfo.lineItems.image.focalPoint.y" },
154
+ { path: "lineItems.image.focalPoint.x" },
155
+ { path: "lineItems.image.focalPoint.y" },
156
+ { path: "cartInfo.lineItems.physicalProperties.weight" },
157
+ {
158
+ path: "cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight"
159
+ },
160
+ { path: "cartInfo.contactInfo.address.geocode.latitude" },
161
+ { path: "cartInfo.contactInfo.address.geocode.longitude" },
162
+ { path: "lineItems.physicalProperties.weight" },
163
+ { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
164
+ { path: "customLineItems.physicalProperties.weight" }
165
+ ]
166
+ }
167
+ ]);
168
+ const metadata = {
169
+ entityFqdn: "wix.ecom.v1.cart",
170
+ method: "POST",
171
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.CreateCart",
172
+ packageName: PACKAGE_NAME,
173
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
174
+ protoPath: "/v1/carts",
175
+ data: serializedData,
176
+ host
177
+ }),
178
+ data: serializedData,
179
+ transformResponse: (payload2) => transformPaths(payload2, [
180
+ {
181
+ transformFn: transformRESTTimestampToSDKTimestamp,
182
+ paths: [
183
+ { path: "cart.createdDate" },
184
+ { path: "cart.updatedDate" },
185
+ { path: "cart.lineItems.image.urlExpirationDate" },
186
+ {
187
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
188
+ },
189
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
190
+ ]
191
+ },
192
+ {
193
+ transformFn: transformRESTFloatToSDKFloat,
194
+ paths: [
195
+ { path: "cart.lineItems.image.focalPoint.x" },
196
+ { path: "cart.lineItems.image.focalPoint.y" },
197
+ { path: "cart.lineItems.physicalProperties.weight" },
198
+ {
199
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
200
+ },
201
+ { path: "cart.contactInfo.address.geocode.latitude" },
202
+ { path: "cart.contactInfo.address.geocode.longitude" }
203
+ ]
204
+ }
205
+ ])
206
+ };
207
+ return metadata;
208
+ }
209
+ return __createCart;
210
+ }
211
+ function updateCart(payload) {
212
+ function __updateCart({ host }) {
213
+ const serializedData = transformPaths(payload, [
214
+ {
215
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
216
+ paths: [{ path: "cartFieldmask" }]
217
+ },
218
+ {
219
+ transformFn: transformSDKTimestampToRESTTimestamp,
220
+ paths: [
221
+ { path: "cartInfo.createdDate" },
222
+ { path: "cartInfo.updatedDate" },
223
+ { path: "cartInfo.lineItems.image.urlExpirationDate" },
224
+ {
225
+ path: "cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
226
+ },
227
+ { path: "cartInfo.lineItems.serviceProperties.scheduledDate" },
228
+ { path: "lineItems.image.urlExpirationDate" },
229
+ {
230
+ path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
231
+ },
232
+ { path: "lineItems.serviceProperties.scheduledDate" },
233
+ {
234
+ path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
235
+ },
236
+ { path: "customLineItems.serviceProperties.scheduledDate" }
237
+ ]
238
+ },
239
+ {
240
+ transformFn: transformSDKFloatToRESTFloat,
241
+ paths: [
242
+ { path: "cartInfo.lineItems.image.focalPoint.x" },
243
+ { path: "cartInfo.lineItems.image.focalPoint.y" },
244
+ { path: "lineItems.image.focalPoint.x" },
245
+ { path: "lineItems.image.focalPoint.y" },
246
+ { path: "cartInfo.lineItems.physicalProperties.weight" },
247
+ {
248
+ path: "cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight"
249
+ },
250
+ { path: "cartInfo.contactInfo.address.geocode.latitude" },
251
+ { path: "cartInfo.contactInfo.address.geocode.longitude" },
252
+ { path: "lineItems.physicalProperties.weight" },
253
+ { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
254
+ { path: "customLineItems.physicalProperties.weight" }
255
+ ]
256
+ }
257
+ ]);
258
+ const metadata = {
259
+ entityFqdn: "wix.ecom.v1.cart",
260
+ method: "PATCH",
261
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.UpdateCart",
262
+ packageName: PACKAGE_NAME,
263
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
264
+ protoPath: "/v1/carts/{cartInfo.id}",
265
+ data: serializedData,
266
+ host
267
+ }),
268
+ data: serializedData,
269
+ transformResponse: (payload2) => transformPaths(payload2, [
270
+ {
271
+ transformFn: transformRESTTimestampToSDKTimestamp,
272
+ paths: [
273
+ { path: "cart.createdDate" },
274
+ { path: "cart.updatedDate" },
275
+ { path: "cart.lineItems.image.urlExpirationDate" },
276
+ {
277
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
278
+ },
279
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
280
+ ]
281
+ },
282
+ {
283
+ transformFn: transformRESTFloatToSDKFloat,
284
+ paths: [
285
+ { path: "cart.lineItems.image.focalPoint.x" },
286
+ { path: "cart.lineItems.image.focalPoint.y" },
287
+ { path: "cart.lineItems.physicalProperties.weight" },
288
+ {
289
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
290
+ },
291
+ { path: "cart.contactInfo.address.geocode.latitude" },
292
+ { path: "cart.contactInfo.address.geocode.longitude" }
293
+ ]
294
+ }
295
+ ])
296
+ };
297
+ return metadata;
298
+ }
299
+ return __updateCart;
300
+ }
301
+ function getCart(payload) {
302
+ function __getCart({ host }) {
303
+ const metadata = {
304
+ entityFqdn: "wix.ecom.v1.cart",
305
+ method: "GET",
306
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.GetCart",
307
+ packageName: PACKAGE_NAME,
308
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
309
+ protoPath: "/v1/carts/{id}",
310
+ data: payload,
311
+ host
312
+ }),
313
+ params: toURLSearchParams(payload),
314
+ transformResponse: (payload2) => transformPaths(payload2, [
315
+ {
316
+ transformFn: transformRESTTimestampToSDKTimestamp,
317
+ paths: [
318
+ { path: "cart.createdDate" },
319
+ { path: "cart.updatedDate" },
320
+ { path: "cart.lineItems.image.urlExpirationDate" },
321
+ {
322
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
323
+ },
324
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
325
+ ]
326
+ },
327
+ {
328
+ transformFn: transformRESTFloatToSDKFloat,
329
+ paths: [
330
+ { path: "cart.lineItems.image.focalPoint.x" },
331
+ { path: "cart.lineItems.image.focalPoint.y" },
332
+ { path: "cart.lineItems.physicalProperties.weight" },
333
+ {
334
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
335
+ },
336
+ { path: "cart.contactInfo.address.geocode.latitude" },
337
+ { path: "cart.contactInfo.address.geocode.longitude" }
338
+ ]
339
+ }
340
+ ])
341
+ };
342
+ return metadata;
343
+ }
344
+ return __getCart;
345
+ }
346
+ function getCartByCheckoutId(payload) {
347
+ function __getCartByCheckoutId({ host }) {
348
+ const metadata = {
349
+ entityFqdn: "wix.ecom.v1.cart",
350
+ method: "GET",
351
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.GetCartByCheckoutId",
352
+ packageName: PACKAGE_NAME,
353
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
354
+ protoPath: "/v1/carts/by-checkout-id/{id}",
355
+ data: payload,
356
+ host
357
+ }),
358
+ params: toURLSearchParams(payload),
359
+ transformResponse: (payload2) => transformPaths(payload2, [
360
+ {
361
+ transformFn: transformRESTTimestampToSDKTimestamp,
362
+ paths: [
363
+ { path: "cart.createdDate" },
364
+ { path: "cart.updatedDate" },
365
+ { path: "cart.lineItems.image.urlExpirationDate" },
366
+ {
367
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
368
+ },
369
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
370
+ ]
371
+ },
372
+ {
373
+ transformFn: transformRESTFloatToSDKFloat,
374
+ paths: [
375
+ { path: "cart.lineItems.image.focalPoint.x" },
376
+ { path: "cart.lineItems.image.focalPoint.y" },
377
+ { path: "cart.lineItems.physicalProperties.weight" },
378
+ {
379
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
380
+ },
381
+ { path: "cart.contactInfo.address.geocode.latitude" },
382
+ { path: "cart.contactInfo.address.geocode.longitude" }
383
+ ]
384
+ }
385
+ ])
386
+ };
387
+ return metadata;
388
+ }
389
+ return __getCartByCheckoutId;
390
+ }
391
+ function addToCart(payload) {
392
+ function __addToCart({ host }) {
393
+ const serializedData = transformPaths(payload, [
394
+ {
395
+ transformFn: transformSDKTimestampToRESTTimestamp,
396
+ paths: [
397
+ { path: "lineItems.image.urlExpirationDate" },
398
+ {
399
+ path: "lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
400
+ },
401
+ { path: "lineItems.serviceProperties.scheduledDate" },
402
+ {
403
+ path: "customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
404
+ },
405
+ { path: "customLineItems.serviceProperties.scheduledDate" }
406
+ ]
407
+ },
408
+ {
409
+ transformFn: transformSDKFloatToRESTFloat,
410
+ paths: [
411
+ { path: "lineItems.image.focalPoint.x" },
412
+ { path: "lineItems.image.focalPoint.y" },
413
+ { path: "lineItems.physicalProperties.weight" },
414
+ { path: "lineItems.catalogOverrideFields.physicalProperties.weight" },
415
+ { path: "customLineItems.physicalProperties.weight" }
416
+ ]
417
+ }
418
+ ]);
419
+ const metadata = {
420
+ entityFqdn: "wix.ecom.v1.cart",
421
+ method: "POST",
422
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.AddToCart",
423
+ packageName: PACKAGE_NAME,
424
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
425
+ protoPath: "/v1/carts/{id}/add-to-cart",
426
+ data: serializedData,
427
+ host
428
+ }),
429
+ data: serializedData,
430
+ transformResponse: (payload2) => transformPaths(payload2, [
431
+ {
432
+ transformFn: transformRESTTimestampToSDKTimestamp,
433
+ paths: [
434
+ { path: "cart.createdDate" },
435
+ { path: "cart.updatedDate" },
436
+ { path: "cart.lineItems.image.urlExpirationDate" },
437
+ {
438
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
439
+ },
440
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
441
+ ]
442
+ },
443
+ {
444
+ transformFn: transformRESTFloatToSDKFloat,
445
+ paths: [
446
+ { path: "cart.lineItems.image.focalPoint.x" },
447
+ { path: "cart.lineItems.image.focalPoint.y" },
448
+ { path: "cart.lineItems.physicalProperties.weight" },
449
+ {
450
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
451
+ },
452
+ { path: "cart.contactInfo.address.geocode.latitude" },
453
+ { path: "cart.contactInfo.address.geocode.longitude" }
454
+ ]
455
+ }
456
+ ])
457
+ };
458
+ return metadata;
459
+ }
460
+ return __addToCart;
461
+ }
462
+ function removeLineItems(payload) {
463
+ function __removeLineItems({ host }) {
464
+ const metadata = {
465
+ entityFqdn: "wix.ecom.v1.cart",
466
+ method: "POST",
467
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.RemoveLineItems",
468
+ packageName: PACKAGE_NAME,
469
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
470
+ protoPath: "/v1/carts/{id}/remove-line-items",
471
+ data: payload,
472
+ host
473
+ }),
474
+ data: payload,
475
+ transformResponse: (payload2) => transformPaths(payload2, [
476
+ {
477
+ transformFn: transformRESTTimestampToSDKTimestamp,
478
+ paths: [
479
+ { path: "cart.createdDate" },
480
+ { path: "cart.updatedDate" },
481
+ { path: "cart.lineItems.image.urlExpirationDate" },
482
+ {
483
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
484
+ },
485
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
486
+ ]
487
+ },
488
+ {
489
+ transformFn: transformRESTFloatToSDKFloat,
490
+ paths: [
491
+ { path: "cart.lineItems.image.focalPoint.x" },
492
+ { path: "cart.lineItems.image.focalPoint.y" },
493
+ { path: "cart.lineItems.physicalProperties.weight" },
494
+ {
495
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
496
+ },
497
+ { path: "cart.contactInfo.address.geocode.latitude" },
498
+ { path: "cart.contactInfo.address.geocode.longitude" }
499
+ ]
500
+ }
501
+ ])
502
+ };
503
+ return metadata;
504
+ }
505
+ return __removeLineItems;
506
+ }
507
+ function createCheckout(payload) {
508
+ function __createCheckout({ host }) {
509
+ const serializedData = transformPaths(payload, [
510
+ {
511
+ transformFn: transformSDKFloatToRESTFloat,
512
+ paths: [
513
+ { path: "shippingAddress.geocode.latitude" },
514
+ { path: "shippingAddress.geocode.longitude" },
515
+ { path: "billingAddress.geocode.latitude" },
516
+ { path: "billingAddress.geocode.longitude" }
517
+ ]
518
+ }
519
+ ]);
520
+ const metadata = {
521
+ entityFqdn: "wix.ecom.v1.cart",
522
+ method: "POST",
523
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.CreateCheckout",
524
+ packageName: PACKAGE_NAME,
525
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
526
+ protoPath: "/v1/carts/{id}/create-checkout",
527
+ data: serializedData,
528
+ host
529
+ }),
530
+ data: serializedData
531
+ };
532
+ return metadata;
533
+ }
534
+ return __createCheckout;
535
+ }
536
+ function removeCoupon(payload) {
537
+ function __removeCoupon({ host }) {
538
+ const metadata = {
539
+ entityFqdn: "wix.ecom.v1.cart",
540
+ method: "POST",
541
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.RemoveCoupon",
542
+ packageName: PACKAGE_NAME,
543
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
544
+ protoPath: "/v1/carts/{id}/remove-coupon",
545
+ data: payload,
546
+ host
547
+ }),
548
+ data: payload,
549
+ transformResponse: (payload2) => transformPaths(payload2, [
550
+ {
551
+ transformFn: transformRESTTimestampToSDKTimestamp,
552
+ paths: [
553
+ { path: "cart.createdDate" },
554
+ { path: "cart.updatedDate" },
555
+ { path: "cart.lineItems.image.urlExpirationDate" },
556
+ {
557
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
558
+ },
559
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
560
+ ]
561
+ },
562
+ {
563
+ transformFn: transformRESTFloatToSDKFloat,
564
+ paths: [
565
+ { path: "cart.lineItems.image.focalPoint.x" },
566
+ { path: "cart.lineItems.image.focalPoint.y" },
567
+ { path: "cart.lineItems.physicalProperties.weight" },
568
+ {
569
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
570
+ },
571
+ { path: "cart.contactInfo.address.geocode.latitude" },
572
+ { path: "cart.contactInfo.address.geocode.longitude" }
573
+ ]
574
+ }
575
+ ])
576
+ };
577
+ return metadata;
578
+ }
579
+ return __removeCoupon;
580
+ }
581
+ function updateLineItemsQuantity(payload) {
582
+ function __updateLineItemsQuantity({ host }) {
583
+ const metadata = {
584
+ entityFqdn: "wix.ecom.v1.cart",
585
+ method: "POST",
586
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.UpdateLineItemsQuantity",
587
+ packageName: PACKAGE_NAME,
588
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
589
+ protoPath: "/v1/carts/{id}/update-line-items-quantity",
590
+ data: payload,
591
+ host
592
+ }),
593
+ data: payload,
594
+ transformResponse: (payload2) => transformPaths(payload2, [
595
+ {
596
+ transformFn: transformRESTTimestampToSDKTimestamp,
597
+ paths: [
598
+ { path: "cart.createdDate" },
599
+ { path: "cart.updatedDate" },
600
+ { path: "cart.lineItems.image.urlExpirationDate" },
601
+ {
602
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
603
+ },
604
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
605
+ ]
606
+ },
607
+ {
608
+ transformFn: transformRESTFloatToSDKFloat,
609
+ paths: [
610
+ { path: "cart.lineItems.image.focalPoint.x" },
611
+ { path: "cart.lineItems.image.focalPoint.y" },
612
+ { path: "cart.lineItems.physicalProperties.weight" },
613
+ {
614
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
615
+ },
616
+ { path: "cart.contactInfo.address.geocode.latitude" },
617
+ { path: "cart.contactInfo.address.geocode.longitude" }
618
+ ]
619
+ }
620
+ ])
621
+ };
622
+ return metadata;
623
+ }
624
+ return __updateLineItemsQuantity;
625
+ }
626
+ function estimateTotals(payload) {
627
+ function __estimateTotals({ host }) {
628
+ const serializedData = transformPaths(payload, [
629
+ {
630
+ transformFn: transformSDKFloatToRESTFloat,
631
+ paths: [
632
+ { path: "shippingAddress.geocode.latitude" },
633
+ { path: "shippingAddress.geocode.longitude" },
634
+ { path: "billingAddress.geocode.latitude" },
635
+ { path: "billingAddress.geocode.longitude" }
636
+ ]
637
+ }
638
+ ]);
639
+ const metadata = {
640
+ entityFqdn: "wix.ecom.v1.cart",
641
+ method: "POST",
642
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.EstimateTotals",
643
+ packageName: PACKAGE_NAME,
644
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
645
+ protoPath: "/v1/carts/{id}/estimate-totals",
646
+ data: serializedData,
647
+ host
648
+ }),
649
+ data: serializedData,
650
+ transformResponse: (payload2) => transformPaths(payload2, [
651
+ {
652
+ transformFn: transformRESTTimestampToSDKTimestamp,
653
+ paths: [
654
+ { path: "cart.createdDate" },
655
+ { path: "cart.updatedDate" },
656
+ { path: "cart.lineItems.image.urlExpirationDate" },
657
+ {
658
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
659
+ },
660
+ { path: "cart.lineItems.serviceProperties.scheduledDate" },
661
+ {
662
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
663
+ },
664
+ {
665
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
666
+ },
667
+ {
668
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
669
+ },
670
+ {
671
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
672
+ },
673
+ { path: "membershipOptions.eligibleMemberships.expirationDate" },
674
+ {
675
+ path: "membershipOptions.invalidMemberships.membership.expirationDate"
676
+ }
677
+ ]
678
+ },
679
+ {
680
+ transformFn: transformRESTFloatToSDKFloat,
681
+ paths: [
682
+ { path: "cart.lineItems.image.focalPoint.x" },
683
+ { path: "cart.lineItems.image.focalPoint.y" },
684
+ { path: "cart.lineItems.physicalProperties.weight" },
685
+ {
686
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
687
+ },
688
+ { path: "cart.contactInfo.address.geocode.latitude" },
689
+ { path: "cart.contactInfo.address.geocode.longitude" },
690
+ {
691
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude"
692
+ },
693
+ {
694
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude"
695
+ },
696
+ {
697
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude"
698
+ },
699
+ {
700
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude"
701
+ },
702
+ { path: "appliedDiscounts.merchantDiscount.percentage" }
703
+ ]
704
+ }
705
+ ])
706
+ };
707
+ return metadata;
708
+ }
709
+ return __estimateTotals;
710
+ }
711
+ function deleteCart(payload) {
712
+ function __deleteCart({ host }) {
713
+ const metadata = {
714
+ entityFqdn: "wix.ecom.v1.cart",
715
+ method: "DELETE",
716
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.DeleteCart",
717
+ packageName: PACKAGE_NAME,
718
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
719
+ protoPath: "/v1/carts/{id}",
720
+ data: payload,
721
+ host
722
+ }),
723
+ params: toURLSearchParams(payload)
724
+ };
725
+ return metadata;
726
+ }
727
+ return __deleteCart;
728
+ }
729
+ function removeBusinessLocation(payload) {
730
+ function __removeBusinessLocation({ host }) {
731
+ const metadata = {
732
+ entityFqdn: "wix.ecom.v1.cart",
733
+ method: "POST",
734
+ methodFqn: "com.wix.ecom.cart.api.v1.CartService.RemoveBusinessLocation",
735
+ packageName: PACKAGE_NAME,
736
+ url: resolveComWixEcomCartApiV1CartServiceUrl({
737
+ protoPath: "/v1/carts/{id}/remove-business-location",
738
+ data: payload,
739
+ host
740
+ }),
741
+ data: payload,
742
+ transformResponse: (payload2) => transformPaths(payload2, [
743
+ {
744
+ transformFn: transformRESTTimestampToSDKTimestamp,
745
+ paths: [
746
+ { path: "cart.createdDate" },
747
+ { path: "cart.updatedDate" },
748
+ { path: "cart.lineItems.image.urlExpirationDate" },
749
+ {
750
+ path: "cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
751
+ },
752
+ { path: "cart.lineItems.serviceProperties.scheduledDate" }
753
+ ]
754
+ },
755
+ {
756
+ transformFn: transformRESTFloatToSDKFloat,
757
+ paths: [
758
+ { path: "cart.lineItems.image.focalPoint.x" },
759
+ { path: "cart.lineItems.image.focalPoint.y" },
760
+ { path: "cart.lineItems.physicalProperties.weight" },
761
+ {
762
+ path: "cart.lineItems.catalogOverrideFields.physicalProperties.weight"
763
+ },
764
+ { path: "cart.contactInfo.address.geocode.latitude" },
765
+ { path: "cart.contactInfo.address.geocode.longitude" }
766
+ ]
767
+ }
768
+ ])
769
+ };
770
+ return metadata;
771
+ }
772
+ return __removeBusinessLocation;
773
+ }
774
+
775
+ // src/ecom-v1-cart-cart.universal.ts
776
+ import { transformSDKAddressToRESTAddress } from "@wix/sdk-runtime/transformations/address";
777
+ import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
778
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
779
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
780
+ import { transformSDKPageURLV2ToRESTPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
781
+ import { transformRESTPageURLV2ToSDKPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
782
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
783
+ var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
784
+ DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
785
+ DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
786
+ DescriptionLineType2["COLOR"] = "COLOR";
787
+ return DescriptionLineType2;
788
+ })(DescriptionLineType || {});
789
+ var ItemAvailabilityStatus = /* @__PURE__ */ ((ItemAvailabilityStatus2) => {
790
+ ItemAvailabilityStatus2["AVAILABLE"] = "AVAILABLE";
791
+ ItemAvailabilityStatus2["NOT_FOUND"] = "NOT_FOUND";
792
+ ItemAvailabilityStatus2["NOT_AVAILABLE"] = "NOT_AVAILABLE";
793
+ ItemAvailabilityStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
794
+ return ItemAvailabilityStatus2;
795
+ })(ItemAvailabilityStatus || {});
796
+ var ItemTypeItemType = /* @__PURE__ */ ((ItemTypeItemType2) => {
797
+ ItemTypeItemType2["UNRECOGNISED"] = "UNRECOGNISED";
798
+ ItemTypeItemType2["PHYSICAL"] = "PHYSICAL";
799
+ ItemTypeItemType2["DIGITAL"] = "DIGITAL";
800
+ ItemTypeItemType2["GIFT_CARD"] = "GIFT_CARD";
801
+ ItemTypeItemType2["SERVICE"] = "SERVICE";
802
+ return ItemTypeItemType2;
803
+ })(ItemTypeItemType || {});
804
+ var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
805
+ SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
806
+ SubscriptionFrequency2["DAY"] = "DAY";
807
+ SubscriptionFrequency2["WEEK"] = "WEEK";
808
+ SubscriptionFrequency2["MONTH"] = "MONTH";
809
+ SubscriptionFrequency2["YEAR"] = "YEAR";
810
+ return SubscriptionFrequency2;
811
+ })(SubscriptionFrequency || {});
812
+ var FileType = /* @__PURE__ */ ((FileType2) => {
813
+ FileType2["UNSPECIFIED"] = "UNSPECIFIED";
814
+ FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
815
+ FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
816
+ FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
817
+ FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
818
+ FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
819
+ return FileType2;
820
+ })(FileType || {});
821
+ var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
822
+ PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
823
+ PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
824
+ PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
825
+ PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
826
+ PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
827
+ return PaymentOptionType2;
828
+ })(PaymentOptionType || {});
829
+ var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
830
+ TaxableAddressType2["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
831
+ TaxableAddressType2["BUSINESS"] = "BUSINESS";
832
+ TaxableAddressType2["BILLING"] = "BILLING";
833
+ TaxableAddressType2["SHIPPING"] = "SHIPPING";
834
+ return TaxableAddressType2;
835
+ })(TaxableAddressType || {});
836
+ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
837
+ WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
838
+ WeightUnit2["KG"] = "KG";
839
+ WeightUnit2["LB"] = "LB";
840
+ return WeightUnit2;
841
+ })(WeightUnit || {});
842
+ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
843
+ DiscountType2["GLOBAL"] = "GLOBAL";
844
+ DiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
845
+ DiscountType2["SHIPPING"] = "SHIPPING";
846
+ return DiscountType2;
847
+ })(DiscountType || {});
848
+ var VatType = /* @__PURE__ */ ((VatType2) => {
849
+ VatType2["UNSPECIFIED"] = "UNSPECIFIED";
850
+ VatType2["CPF"] = "CPF";
851
+ VatType2["CNPJ"] = "CNPJ";
852
+ return VatType2;
853
+ })(VatType || {});
854
+ var JurisdictionType = /* @__PURE__ */ ((JurisdictionType2) => {
855
+ JurisdictionType2["UNDEFINED"] = "UNDEFINED";
856
+ JurisdictionType2["COUNTRY"] = "COUNTRY";
857
+ JurisdictionType2["STATE"] = "STATE";
858
+ JurisdictionType2["COUNTY"] = "COUNTY";
859
+ JurisdictionType2["CITY"] = "CITY";
860
+ JurisdictionType2["SPECIAL"] = "SPECIAL";
861
+ return JurisdictionType2;
862
+ })(JurisdictionType || {});
863
+ var RateType = /* @__PURE__ */ ((RateType2) => {
864
+ RateType2["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
865
+ RateType2["MANUAL_RATE"] = "MANUAL_RATE";
866
+ RateType2["AUTO_RATE"] = "AUTO_RATE";
867
+ RateType2["FALLBACK_RATE"] = "FALLBACK_RATE";
868
+ return RateType2;
869
+ })(RateType || {});
870
+ var ManualCalculationReason = /* @__PURE__ */ ((ManualCalculationReason2) => {
871
+ ManualCalculationReason2["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
872
+ ManualCalculationReason2["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
873
+ return ManualCalculationReason2;
874
+ })(ManualCalculationReason || {});
875
+ var FallbackReason = /* @__PURE__ */ ((FallbackReason2) => {
876
+ FallbackReason2["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
877
+ FallbackReason2["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
878
+ return FallbackReason2;
879
+ })(FallbackReason || {});
880
+ var PickupMethod = /* @__PURE__ */ ((PickupMethod2) => {
881
+ PickupMethod2["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
882
+ PickupMethod2["STORE_PICKUP"] = "STORE_PICKUP";
883
+ PickupMethod2["PICKUP_POINT"] = "PICKUP_POINT";
884
+ return PickupMethod2;
885
+ })(PickupMethod || {});
886
+ var ChargeType = /* @__PURE__ */ ((ChargeType2) => {
887
+ ChargeType2["HANDLING_FEE"] = "HANDLING_FEE";
888
+ ChargeType2["INSURANCE"] = "INSURANCE";
889
+ return ChargeType2;
890
+ })(ChargeType || {});
891
+ var AppliedDiscountDiscountType = /* @__PURE__ */ ((AppliedDiscountDiscountType2) => {
892
+ AppliedDiscountDiscountType2["GLOBAL"] = "GLOBAL";
893
+ AppliedDiscountDiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
894
+ AppliedDiscountDiscountType2["SHIPPING"] = "SHIPPING";
895
+ return AppliedDiscountDiscountType2;
896
+ })(AppliedDiscountDiscountType || {});
897
+ var RuleType = /* @__PURE__ */ ((RuleType2) => {
898
+ RuleType2["VALIDATION"] = "VALIDATION";
899
+ RuleType2["OTHER"] = "OTHER";
900
+ RuleType2["MAX"] = "MAX";
901
+ RuleType2["MIN"] = "MIN";
902
+ RuleType2["MAX_LENGTH"] = "MAX_LENGTH";
903
+ RuleType2["MIN_LENGTH"] = "MIN_LENGTH";
904
+ RuleType2["MAX_SIZE"] = "MAX_SIZE";
905
+ RuleType2["MIN_SIZE"] = "MIN_SIZE";
906
+ RuleType2["FORMAT"] = "FORMAT";
907
+ RuleType2["DECIMAL_LTE"] = "DECIMAL_LTE";
908
+ RuleType2["DECIMAL_GTE"] = "DECIMAL_GTE";
909
+ RuleType2["DECIMAL_LT"] = "DECIMAL_LT";
910
+ RuleType2["DECIMAL_GT"] = "DECIMAL_GT";
911
+ RuleType2["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
912
+ RuleType2["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
913
+ RuleType2["REQUIRED_FIELD"] = "REQUIRED_FIELD";
914
+ RuleType2["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
915
+ RuleType2["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
916
+ RuleType2["EXACT_LENGTH"] = "EXACT_LENGTH";
917
+ RuleType2["EXACT_SIZE"] = "EXACT_SIZE";
918
+ RuleType2["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
919
+ return RuleType2;
920
+ })(RuleType || {});
921
+ var AdditionalFeeSource = /* @__PURE__ */ ((AdditionalFeeSource2) => {
922
+ AdditionalFeeSource2["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
923
+ AdditionalFeeSource2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
924
+ AdditionalFeeSource2["ITEM"] = "ITEM";
925
+ AdditionalFeeSource2["MANUAL"] = "MANUAL";
926
+ return AdditionalFeeSource2;
927
+ })(AdditionalFeeSource || {});
928
+ var Severity = /* @__PURE__ */ ((Severity2) => {
929
+ Severity2["WARNING"] = "WARNING";
930
+ Severity2["ERROR"] = "ERROR";
931
+ return Severity2;
932
+ })(Severity || {});
933
+ var NameInOther = /* @__PURE__ */ ((NameInOther2) => {
934
+ NameInOther2["OTHER_DEFAULT"] = "OTHER_DEFAULT";
935
+ return NameInOther2;
936
+ })(NameInOther || {});
937
+ var NameInLineItem = /* @__PURE__ */ ((NameInLineItem2) => {
938
+ NameInLineItem2["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
939
+ return NameInLineItem2;
940
+ })(NameInLineItem || {});
941
+ var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
942
+ SuggestedFix2["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
943
+ SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
944
+ return SuggestedFix2;
945
+ })(SuggestedFix || {});
946
+ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
947
+ ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
948
+ ChannelType2["WEB"] = "WEB";
949
+ ChannelType2["POS"] = "POS";
950
+ ChannelType2["EBAY"] = "EBAY";
951
+ ChannelType2["AMAZON"] = "AMAZON";
952
+ ChannelType2["OTHER_PLATFORM"] = "OTHER_PLATFORM";
953
+ ChannelType2["WIX_APP_STORE"] = "WIX_APP_STORE";
954
+ ChannelType2["WIX_INVOICES"] = "WIX_INVOICES";
955
+ ChannelType2["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
956
+ ChannelType2["WISH"] = "WISH";
957
+ ChannelType2["CLASS_PASS"] = "CLASS_PASS";
958
+ ChannelType2["GLOBAL_E"] = "GLOBAL_E";
959
+ ChannelType2["FACEBOOK"] = "FACEBOOK";
960
+ ChannelType2["ETSY"] = "ETSY";
961
+ ChannelType2["TIKTOK"] = "TIKTOK";
962
+ ChannelType2["FAIRE_COM"] = "FAIRE_COM";
963
+ return ChannelType2;
964
+ })(ChannelType || {});
965
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
966
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
967
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
968
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
969
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
970
+ WebhookIdentityType2["APP"] = "APP";
971
+ return WebhookIdentityType2;
972
+ })(WebhookIdentityType || {});
973
+ async function createCart2(options) {
974
+ const { httpClient, sideEffects } = arguments[1];
975
+ const payload = transformPaths2(
976
+ renameKeysFromSDKRequestToRESTRequest({
977
+ cartInfo: options?.cartInfo,
978
+ couponCode: options?.couponCode,
979
+ merchantDiscounts: options?.merchantDiscounts,
980
+ lineItems: options?.lineItems,
981
+ customLineItems: options?.customLineItems
982
+ }),
983
+ [
984
+ {
985
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
986
+ paths: [
987
+ { path: "cartInfo.lineItems.url" },
988
+ { path: "lineItems.url" },
989
+ { path: "customLineItems.url" }
990
+ ]
991
+ },
992
+ {
993
+ transformFn: transformSDKImageToRESTImage,
994
+ paths: [
995
+ { path: "cartInfo.lineItems.image" },
996
+ { path: "cartInfo.lineItems.catalogOverrideFields.image" },
997
+ { path: "lineItems.image" },
998
+ { path: "lineItems.catalogOverrideFields.image" },
999
+ { path: "customLineItems.media" }
1000
+ ]
1001
+ },
1002
+ {
1003
+ transformFn: transformSDKAddressToRESTAddress,
1004
+ paths: [{ path: "cartInfo.contactInfo.address" }]
1005
+ }
1006
+ ]
1007
+ );
1008
+ const reqOpts = createCart(payload);
1009
+ sideEffects?.onSiteCall?.();
1010
+ try {
1011
+ const result = await httpClient.request(reqOpts);
1012
+ sideEffects?.onSuccess?.(result);
1013
+ return renameKeysFromRESTResponseToSDKResponse(
1014
+ transformPaths2(result.data, [
1015
+ {
1016
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1017
+ paths: [{ path: "cart.lineItems.url" }]
1018
+ },
1019
+ {
1020
+ transformFn: transformRESTImageToSDKImage,
1021
+ paths: [
1022
+ { path: "cart.lineItems.image" },
1023
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1024
+ ]
1025
+ },
1026
+ {
1027
+ transformFn: transformRESTAddressToSDKAddress,
1028
+ paths: [{ path: "cart.contactInfo.address" }]
1029
+ }
1030
+ ])
1031
+ )?.cart;
1032
+ } catch (err) {
1033
+ const transformedError = sdkTransformError(
1034
+ err,
1035
+ {
1036
+ spreadPathsToArguments: {},
1037
+ explicitPathsToArguments: {
1038
+ cartInfo: "$[0].cartInfo",
1039
+ couponCode: "$[0].couponCode",
1040
+ merchantDiscounts: "$[0].merchantDiscounts",
1041
+ lineItems: "$[0].lineItems",
1042
+ customLineItems: "$[0].customLineItems"
1043
+ },
1044
+ singleArgumentUnchanged: false
1045
+ },
1046
+ ["options"]
1047
+ );
1048
+ sideEffects?.onError?.(err);
1049
+ throw transformedError;
1050
+ }
1051
+ }
1052
+ async function updateCart2(_id, options) {
1053
+ const { httpClient, sideEffects } = arguments[2];
1054
+ const payload = transformPaths2(
1055
+ renameKeysFromSDKRequestToRESTRequest({
1056
+ cartInfo: { ...options?.cartInfo, id: _id },
1057
+ couponCode: options?.couponCode,
1058
+ merchantDiscounts: options?.merchantDiscounts,
1059
+ lineItems: options?.lineItems,
1060
+ customLineItems: options?.customLineItems
1061
+ }),
1062
+ [
1063
+ {
1064
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1065
+ paths: [
1066
+ { path: "cartInfo.lineItems.url" },
1067
+ { path: "lineItems.url" },
1068
+ { path: "customLineItems.url" }
1069
+ ]
1070
+ },
1071
+ {
1072
+ transformFn: transformSDKImageToRESTImage,
1073
+ paths: [
1074
+ { path: "cartInfo.lineItems.image" },
1075
+ { path: "cartInfo.lineItems.catalogOverrideFields.image" },
1076
+ { path: "lineItems.image" },
1077
+ { path: "lineItems.catalogOverrideFields.image" },
1078
+ { path: "customLineItems.media" }
1079
+ ]
1080
+ },
1081
+ {
1082
+ transformFn: transformSDKAddressToRESTAddress,
1083
+ paths: [{ path: "cartInfo.contactInfo.address" }]
1084
+ }
1085
+ ]
1086
+ );
1087
+ const reqOpts = updateCart(payload);
1088
+ sideEffects?.onSiteCall?.();
1089
+ try {
1090
+ const result = await httpClient.request(reqOpts);
1091
+ sideEffects?.onSuccess?.(result);
1092
+ return renameKeysFromRESTResponseToSDKResponse(
1093
+ transformPaths2(result.data, [
1094
+ {
1095
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1096
+ paths: [{ path: "cart.lineItems.url" }]
1097
+ },
1098
+ {
1099
+ transformFn: transformRESTImageToSDKImage,
1100
+ paths: [
1101
+ { path: "cart.lineItems.image" },
1102
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1103
+ ]
1104
+ },
1105
+ {
1106
+ transformFn: transformRESTAddressToSDKAddress,
1107
+ paths: [{ path: "cart.contactInfo.address" }]
1108
+ }
1109
+ ])
1110
+ )?.cart;
1111
+ } catch (err) {
1112
+ const transformedError = sdkTransformError(
1113
+ err,
1114
+ {
1115
+ spreadPathsToArguments: { cartInfo: "$[1].cartInfo" },
1116
+ explicitPathsToArguments: {
1117
+ "cartInfo.id": "$[0]",
1118
+ couponCode: "$[1].couponCode",
1119
+ merchantDiscounts: "$[1].merchantDiscounts",
1120
+ lineItems: "$[1].lineItems",
1121
+ customLineItems: "$[1].customLineItems"
1122
+ },
1123
+ singleArgumentUnchanged: false
1124
+ },
1125
+ ["_id", "options"]
1126
+ );
1127
+ sideEffects?.onError?.(err);
1128
+ throw transformedError;
1129
+ }
1130
+ }
1131
+ async function getCart2(_id) {
1132
+ const { httpClient, sideEffects } = arguments[1];
1133
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1134
+ const reqOpts = getCart(payload);
1135
+ sideEffects?.onSiteCall?.();
1136
+ try {
1137
+ const result = await httpClient.request(reqOpts);
1138
+ sideEffects?.onSuccess?.(result);
1139
+ return renameKeysFromRESTResponseToSDKResponse(
1140
+ transformPaths2(result.data, [
1141
+ {
1142
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1143
+ paths: [{ path: "cart.lineItems.url" }]
1144
+ },
1145
+ {
1146
+ transformFn: transformRESTImageToSDKImage,
1147
+ paths: [
1148
+ { path: "cart.lineItems.image" },
1149
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1150
+ ]
1151
+ },
1152
+ {
1153
+ transformFn: transformRESTAddressToSDKAddress,
1154
+ paths: [{ path: "cart.contactInfo.address" }]
1155
+ }
1156
+ ])
1157
+ )?.cart;
1158
+ } catch (err) {
1159
+ const transformedError = sdkTransformError(
1160
+ err,
1161
+ {
1162
+ spreadPathsToArguments: {},
1163
+ explicitPathsToArguments: { id: "$[0]" },
1164
+ singleArgumentUnchanged: false
1165
+ },
1166
+ ["_id"]
1167
+ );
1168
+ sideEffects?.onError?.(err);
1169
+ throw transformedError;
1170
+ }
1171
+ }
1172
+ async function getCartByCheckoutId2(_id) {
1173
+ const { httpClient, sideEffects } = arguments[1];
1174
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1175
+ const reqOpts = getCartByCheckoutId(payload);
1176
+ sideEffects?.onSiteCall?.();
1177
+ try {
1178
+ const result = await httpClient.request(reqOpts);
1179
+ sideEffects?.onSuccess?.(result);
1180
+ return renameKeysFromRESTResponseToSDKResponse(
1181
+ transformPaths2(result.data, [
1182
+ {
1183
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1184
+ paths: [{ path: "cart.lineItems.url" }]
1185
+ },
1186
+ {
1187
+ transformFn: transformRESTImageToSDKImage,
1188
+ paths: [
1189
+ { path: "cart.lineItems.image" },
1190
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1191
+ ]
1192
+ },
1193
+ {
1194
+ transformFn: transformRESTAddressToSDKAddress,
1195
+ paths: [{ path: "cart.contactInfo.address" }]
1196
+ }
1197
+ ])
1198
+ );
1199
+ } catch (err) {
1200
+ const transformedError = sdkTransformError(
1201
+ err,
1202
+ {
1203
+ spreadPathsToArguments: {},
1204
+ explicitPathsToArguments: { id: "$[0]" },
1205
+ singleArgumentUnchanged: false
1206
+ },
1207
+ ["_id"]
1208
+ );
1209
+ sideEffects?.onError?.(err);
1210
+ throw transformedError;
1211
+ }
1212
+ }
1213
+ async function addToCart2(_id, options) {
1214
+ const { httpClient, sideEffects } = arguments[2];
1215
+ const payload = transformPaths2(
1216
+ renameKeysFromSDKRequestToRESTRequest({
1217
+ id: _id,
1218
+ lineItems: options?.lineItems,
1219
+ customLineItems: options?.customLineItems,
1220
+ businessLocationId: options?.businessLocationId
1221
+ }),
1222
+ [
1223
+ {
1224
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1225
+ paths: [{ path: "lineItems.url" }, { path: "customLineItems.url" }]
1226
+ },
1227
+ {
1228
+ transformFn: transformSDKImageToRESTImage,
1229
+ paths: [
1230
+ { path: "lineItems.image" },
1231
+ { path: "lineItems.catalogOverrideFields.image" },
1232
+ { path: "customLineItems.media" }
1233
+ ]
1234
+ }
1235
+ ]
1236
+ );
1237
+ const reqOpts = addToCart(payload);
1238
+ sideEffects?.onSiteCall?.();
1239
+ try {
1240
+ const result = await httpClient.request(reqOpts);
1241
+ sideEffects?.onSuccess?.(result);
1242
+ return renameKeysFromRESTResponseToSDKResponse(
1243
+ transformPaths2(result.data, [
1244
+ {
1245
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1246
+ paths: [{ path: "cart.lineItems.url" }]
1247
+ },
1248
+ {
1249
+ transformFn: transformRESTImageToSDKImage,
1250
+ paths: [
1251
+ { path: "cart.lineItems.image" },
1252
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1253
+ ]
1254
+ },
1255
+ {
1256
+ transformFn: transformRESTAddressToSDKAddress,
1257
+ paths: [{ path: "cart.contactInfo.address" }]
1258
+ }
1259
+ ])
1260
+ );
1261
+ } catch (err) {
1262
+ const transformedError = sdkTransformError(
1263
+ err,
1264
+ {
1265
+ spreadPathsToArguments: {},
1266
+ explicitPathsToArguments: {
1267
+ id: "$[0]",
1268
+ lineItems: "$[1].lineItems",
1269
+ customLineItems: "$[1].customLineItems",
1270
+ businessLocationId: "$[1].businessLocationId"
1271
+ },
1272
+ singleArgumentUnchanged: false
1273
+ },
1274
+ ["_id", "options"]
1275
+ );
1276
+ sideEffects?.onError?.(err);
1277
+ throw transformedError;
1278
+ }
1279
+ }
1280
+ async function removeLineItems2(_id, lineItemIds) {
1281
+ const { httpClient, sideEffects } = arguments[2];
1282
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1283
+ id: _id,
1284
+ lineItemIds
1285
+ });
1286
+ const reqOpts = removeLineItems(payload);
1287
+ sideEffects?.onSiteCall?.();
1288
+ try {
1289
+ const result = await httpClient.request(reqOpts);
1290
+ sideEffects?.onSuccess?.(result);
1291
+ return renameKeysFromRESTResponseToSDKResponse(
1292
+ transformPaths2(result.data, [
1293
+ {
1294
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1295
+ paths: [{ path: "cart.lineItems.url" }]
1296
+ },
1297
+ {
1298
+ transformFn: transformRESTImageToSDKImage,
1299
+ paths: [
1300
+ { path: "cart.lineItems.image" },
1301
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1302
+ ]
1303
+ },
1304
+ {
1305
+ transformFn: transformRESTAddressToSDKAddress,
1306
+ paths: [{ path: "cart.contactInfo.address" }]
1307
+ }
1308
+ ])
1309
+ );
1310
+ } catch (err) {
1311
+ const transformedError = sdkTransformError(
1312
+ err,
1313
+ {
1314
+ spreadPathsToArguments: {},
1315
+ explicitPathsToArguments: { id: "$[0]", lineItemIds: "$[1]" },
1316
+ singleArgumentUnchanged: false
1317
+ },
1318
+ ["_id", "lineItemIds"]
1319
+ );
1320
+ sideEffects?.onError?.(err);
1321
+ throw transformedError;
1322
+ }
1323
+ }
1324
+ async function createCheckout2(_id, options) {
1325
+ const { httpClient, sideEffects } = arguments[2];
1326
+ const payload = transformPaths2(
1327
+ renameKeysFromSDKRequestToRESTRequest({
1328
+ id: _id,
1329
+ channelType: options?.channelType,
1330
+ shippingAddress: options?.shippingAddress,
1331
+ billingAddress: options?.billingAddress,
1332
+ selectedShippingOption: options?.selectedShippingOption,
1333
+ email: options?.email
1334
+ }),
1335
+ [
1336
+ {
1337
+ transformFn: transformSDKAddressToRESTAddress,
1338
+ paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
1339
+ }
1340
+ ]
1341
+ );
1342
+ const reqOpts = createCheckout(payload);
1343
+ sideEffects?.onSiteCall?.();
1344
+ try {
1345
+ const result = await httpClient.request(reqOpts);
1346
+ sideEffects?.onSuccess?.(result);
1347
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1348
+ } catch (err) {
1349
+ const transformedError = sdkTransformError(
1350
+ err,
1351
+ {
1352
+ spreadPathsToArguments: {},
1353
+ explicitPathsToArguments: {
1354
+ id: "$[0]",
1355
+ channelType: "$[1].channelType",
1356
+ shippingAddress: "$[1].shippingAddress",
1357
+ billingAddress: "$[1].billingAddress",
1358
+ selectedShippingOption: "$[1].selectedShippingOption",
1359
+ email: "$[1].email"
1360
+ },
1361
+ singleArgumentUnchanged: false
1362
+ },
1363
+ ["_id", "options"]
1364
+ );
1365
+ sideEffects?.onError?.(err);
1366
+ throw transformedError;
1367
+ }
1368
+ }
1369
+ async function removeCoupon2(_id) {
1370
+ const { httpClient, sideEffects } = arguments[1];
1371
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1372
+ const reqOpts = removeCoupon(payload);
1373
+ sideEffects?.onSiteCall?.();
1374
+ try {
1375
+ const result = await httpClient.request(reqOpts);
1376
+ sideEffects?.onSuccess?.(result);
1377
+ return renameKeysFromRESTResponseToSDKResponse(
1378
+ transformPaths2(result.data, [
1379
+ {
1380
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1381
+ paths: [{ path: "cart.lineItems.url" }]
1382
+ },
1383
+ {
1384
+ transformFn: transformRESTImageToSDKImage,
1385
+ paths: [
1386
+ { path: "cart.lineItems.image" },
1387
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1388
+ ]
1389
+ },
1390
+ {
1391
+ transformFn: transformRESTAddressToSDKAddress,
1392
+ paths: [{ path: "cart.contactInfo.address" }]
1393
+ }
1394
+ ])
1395
+ );
1396
+ } catch (err) {
1397
+ const transformedError = sdkTransformError(
1398
+ err,
1399
+ {
1400
+ spreadPathsToArguments: {},
1401
+ explicitPathsToArguments: { id: "$[0]" },
1402
+ singleArgumentUnchanged: false
1403
+ },
1404
+ ["_id"]
1405
+ );
1406
+ sideEffects?.onError?.(err);
1407
+ throw transformedError;
1408
+ }
1409
+ }
1410
+ async function updateLineItemsQuantity2(_id, lineItems) {
1411
+ const { httpClient, sideEffects } = arguments[2];
1412
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1413
+ id: _id,
1414
+ lineItems
1415
+ });
1416
+ const reqOpts = updateLineItemsQuantity(payload);
1417
+ sideEffects?.onSiteCall?.();
1418
+ try {
1419
+ const result = await httpClient.request(reqOpts);
1420
+ sideEffects?.onSuccess?.(result);
1421
+ return renameKeysFromRESTResponseToSDKResponse(
1422
+ transformPaths2(result.data, [
1423
+ {
1424
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1425
+ paths: [{ path: "cart.lineItems.url" }]
1426
+ },
1427
+ {
1428
+ transformFn: transformRESTImageToSDKImage,
1429
+ paths: [
1430
+ { path: "cart.lineItems.image" },
1431
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1432
+ ]
1433
+ },
1434
+ {
1435
+ transformFn: transformRESTAddressToSDKAddress,
1436
+ paths: [{ path: "cart.contactInfo.address" }]
1437
+ }
1438
+ ])
1439
+ );
1440
+ } catch (err) {
1441
+ const transformedError = sdkTransformError(
1442
+ err,
1443
+ {
1444
+ spreadPathsToArguments: {},
1445
+ explicitPathsToArguments: { id: "$[0]", lineItems: "$[1]" },
1446
+ singleArgumentUnchanged: false
1447
+ },
1448
+ ["_id", "lineItems"]
1449
+ );
1450
+ sideEffects?.onError?.(err);
1451
+ throw transformedError;
1452
+ }
1453
+ }
1454
+ async function estimateTotals2(_id, options) {
1455
+ const { httpClient, sideEffects } = arguments[2];
1456
+ const payload = transformPaths2(
1457
+ renameKeysFromSDKRequestToRESTRequest({
1458
+ id: _id,
1459
+ selectedShippingOption: options?.selectedShippingOption,
1460
+ shippingAddress: options?.shippingAddress,
1461
+ billingAddress: options?.billingAddress,
1462
+ selectedMemberships: options?.selectedMemberships,
1463
+ calculateTax: options?.calculateTax,
1464
+ calculateShipping: options?.calculateShipping
1465
+ }),
1466
+ [
1467
+ {
1468
+ transformFn: transformSDKAddressToRESTAddress,
1469
+ paths: [{ path: "shippingAddress" }, { path: "billingAddress" }]
1470
+ }
1471
+ ]
1472
+ );
1473
+ const reqOpts = estimateTotals(payload);
1474
+ sideEffects?.onSiteCall?.();
1475
+ try {
1476
+ const result = await httpClient.request(reqOpts);
1477
+ sideEffects?.onSuccess?.(result);
1478
+ return renameKeysFromRESTResponseToSDKResponse(
1479
+ transformPaths2(result.data, [
1480
+ {
1481
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1482
+ paths: [{ path: "cart.lineItems.url" }]
1483
+ },
1484
+ {
1485
+ transformFn: transformRESTImageToSDKImage,
1486
+ paths: [
1487
+ { path: "cart.lineItems.image" },
1488
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1489
+ ]
1490
+ },
1491
+ {
1492
+ transformFn: transformRESTAddressToSDKAddress,
1493
+ paths: [
1494
+ { path: "cart.contactInfo.address" },
1495
+ {
1496
+ path: "shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
1497
+ },
1498
+ {
1499
+ path: "shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
1500
+ }
1501
+ ]
1502
+ }
1503
+ ])
1504
+ );
1505
+ } catch (err) {
1506
+ const transformedError = sdkTransformError(
1507
+ err,
1508
+ {
1509
+ spreadPathsToArguments: {},
1510
+ explicitPathsToArguments: {
1511
+ id: "$[0]",
1512
+ selectedShippingOption: "$[1].selectedShippingOption",
1513
+ shippingAddress: "$[1].shippingAddress",
1514
+ billingAddress: "$[1].billingAddress",
1515
+ selectedMemberships: "$[1].selectedMemberships",
1516
+ calculateTax: "$[1].calculateTax",
1517
+ calculateShipping: "$[1].calculateShipping"
1518
+ },
1519
+ singleArgumentUnchanged: false
1520
+ },
1521
+ ["_id", "options"]
1522
+ );
1523
+ sideEffects?.onError?.(err);
1524
+ throw transformedError;
1525
+ }
1526
+ }
1527
+ async function deleteCart2(_id) {
1528
+ const { httpClient, sideEffects } = arguments[1];
1529
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1530
+ const reqOpts = deleteCart(payload);
1531
+ sideEffects?.onSiteCall?.();
1532
+ try {
1533
+ const result = await httpClient.request(reqOpts);
1534
+ sideEffects?.onSuccess?.(result);
1535
+ } catch (err) {
1536
+ const transformedError = sdkTransformError(
1537
+ err,
1538
+ {
1539
+ spreadPathsToArguments: {},
1540
+ explicitPathsToArguments: { id: "$[0]" },
1541
+ singleArgumentUnchanged: false
1542
+ },
1543
+ ["_id"]
1544
+ );
1545
+ sideEffects?.onError?.(err);
1546
+ throw transformedError;
1547
+ }
1548
+ }
1549
+ async function removeBusinessLocation2(_id) {
1550
+ const { httpClient, sideEffects } = arguments[1];
1551
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1552
+ const reqOpts = removeBusinessLocation(payload);
1553
+ sideEffects?.onSiteCall?.();
1554
+ try {
1555
+ const result = await httpClient.request(reqOpts);
1556
+ sideEffects?.onSuccess?.(result);
1557
+ return renameKeysFromRESTResponseToSDKResponse(
1558
+ transformPaths2(result.data, [
1559
+ {
1560
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1561
+ paths: [{ path: "cart.lineItems.url" }]
1562
+ },
1563
+ {
1564
+ transformFn: transformRESTImageToSDKImage,
1565
+ paths: [
1566
+ { path: "cart.lineItems.image" },
1567
+ { path: "cart.lineItems.catalogOverrideFields.image" }
1568
+ ]
1569
+ },
1570
+ {
1571
+ transformFn: transformRESTAddressToSDKAddress,
1572
+ paths: [{ path: "cart.contactInfo.address" }]
1573
+ }
1574
+ ])
1575
+ );
1576
+ } catch (err) {
1577
+ const transformedError = sdkTransformError(
1578
+ err,
1579
+ {
1580
+ spreadPathsToArguments: {},
1581
+ explicitPathsToArguments: { id: "$[0]" },
1582
+ singleArgumentUnchanged: false
1583
+ },
1584
+ ["_id"]
1585
+ );
1586
+ sideEffects?.onError?.(err);
1587
+ throw transformedError;
1588
+ }
1589
+ }
1590
+
1591
+ // src/ecom-v1-cart-cart.public.ts
1592
+ function createCart3(httpClient) {
1593
+ return (options) => createCart2(
1594
+ options,
1595
+ // @ts-ignore
1596
+ { httpClient }
1597
+ );
1598
+ }
1599
+ function updateCart3(httpClient) {
1600
+ return (_id, options) => updateCart2(
1601
+ _id,
1602
+ options,
1603
+ // @ts-ignore
1604
+ { httpClient }
1605
+ );
1606
+ }
1607
+ function getCart3(httpClient) {
1608
+ return (_id) => getCart2(
1609
+ _id,
1610
+ // @ts-ignore
1611
+ { httpClient }
1612
+ );
1613
+ }
1614
+ function getCartByCheckoutId3(httpClient) {
1615
+ return (_id) => getCartByCheckoutId2(
1616
+ _id,
1617
+ // @ts-ignore
1618
+ { httpClient }
1619
+ );
1620
+ }
1621
+ function addToCart3(httpClient) {
1622
+ return (_id, options) => addToCart2(
1623
+ _id,
1624
+ options,
1625
+ // @ts-ignore
1626
+ { httpClient }
1627
+ );
1628
+ }
1629
+ function removeLineItems3(httpClient) {
1630
+ return (_id, lineItemIds) => removeLineItems2(
1631
+ _id,
1632
+ lineItemIds,
1633
+ // @ts-ignore
1634
+ { httpClient }
1635
+ );
1636
+ }
1637
+ function createCheckout3(httpClient) {
1638
+ return (_id, options) => createCheckout2(
1639
+ _id,
1640
+ options,
1641
+ // @ts-ignore
1642
+ { httpClient }
1643
+ );
1644
+ }
1645
+ function removeCoupon3(httpClient) {
1646
+ return (_id) => removeCoupon2(
1647
+ _id,
1648
+ // @ts-ignore
1649
+ { httpClient }
1650
+ );
1651
+ }
1652
+ function updateLineItemsQuantity3(httpClient) {
1653
+ return (_id, lineItems) => updateLineItemsQuantity2(
1654
+ _id,
1655
+ lineItems,
1656
+ // @ts-ignore
1657
+ { httpClient }
1658
+ );
1659
+ }
1660
+ function estimateTotals3(httpClient) {
1661
+ return (_id, options) => estimateTotals2(
1662
+ _id,
1663
+ options,
1664
+ // @ts-ignore
1665
+ { httpClient }
1666
+ );
1667
+ }
1668
+ function deleteCart3(httpClient) {
1669
+ return (_id) => deleteCart2(
1670
+ _id,
1671
+ // @ts-ignore
1672
+ { httpClient }
1673
+ );
1674
+ }
1675
+ function removeBusinessLocation3(httpClient) {
1676
+ return (_id) => removeBusinessLocation2(
1677
+ _id,
1678
+ // @ts-ignore
1679
+ { httpClient }
1680
+ );
1681
+ }
1682
+ var onCartDeleted = EventDefinition(
1683
+ "wix.ecom.v1.cart_deleted",
1684
+ true,
1685
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1686
+ transformPaths3(event, [
1687
+ {
1688
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1689
+ paths: [
1690
+ { path: "undefined.createdDate" },
1691
+ { path: "undefined.updatedDate" },
1692
+ {
1693
+ path: "undefined.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1694
+ },
1695
+ { path: "undefined.lineItems.serviceProperties.scheduledDate" },
1696
+ { path: "metadata.eventTime" }
1697
+ ]
1698
+ },
1699
+ {
1700
+ transformFn: transformRESTPageURLV2ToSDKPageURLV22,
1701
+ paths: [{ path: "undefined.lineItems.url" }]
1702
+ },
1703
+ {
1704
+ transformFn: transformRESTImageToSDKImage2,
1705
+ paths: [
1706
+ { path: "undefined.lineItems.image" },
1707
+ { path: "undefined.lineItems.catalogOverrideFields.image" }
1708
+ ]
1709
+ },
1710
+ {
1711
+ transformFn: transformRESTFloatToSDKFloat2,
1712
+ paths: [
1713
+ { path: "undefined.lineItems.physicalProperties.weight" },
1714
+ {
1715
+ path: "undefined.lineItems.catalogOverrideFields.physicalProperties.weight"
1716
+ }
1717
+ ]
1718
+ },
1719
+ {
1720
+ transformFn: transformRESTAddressToSDKAddress2,
1721
+ paths: [{ path: "undefined.contactInfo.address" }]
1722
+ }
1723
+ ])
1724
+ )
1725
+ )();
1726
+ var onCartUpdated = EventDefinition(
1727
+ "wix.ecom.v1.cart_updated",
1728
+ true,
1729
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1730
+ transformPaths3(event, [
1731
+ {
1732
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1733
+ paths: [
1734
+ { path: "entity.createdDate" },
1735
+ { path: "entity.updatedDate" },
1736
+ {
1737
+ path: "entity.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1738
+ },
1739
+ { path: "entity.lineItems.serviceProperties.scheduledDate" },
1740
+ { path: "metadata.eventTime" }
1741
+ ]
1742
+ },
1743
+ {
1744
+ transformFn: transformRESTPageURLV2ToSDKPageURLV22,
1745
+ paths: [{ path: "entity.lineItems.url" }]
1746
+ },
1747
+ {
1748
+ transformFn: transformRESTImageToSDKImage2,
1749
+ paths: [
1750
+ { path: "entity.lineItems.image" },
1751
+ { path: "entity.lineItems.catalogOverrideFields.image" }
1752
+ ]
1753
+ },
1754
+ {
1755
+ transformFn: transformRESTFloatToSDKFloat2,
1756
+ paths: [
1757
+ { path: "entity.lineItems.physicalProperties.weight" },
1758
+ {
1759
+ path: "entity.lineItems.catalogOverrideFields.physicalProperties.weight"
1760
+ }
1761
+ ]
1762
+ },
1763
+ {
1764
+ transformFn: transformRESTAddressToSDKAddress2,
1765
+ paths: [{ path: "entity.contactInfo.address" }]
1766
+ }
1767
+ ])
1768
+ )
1769
+ )();
1770
+ var onCartCreated = EventDefinition(
1771
+ "wix.ecom.v1.cart_created",
1772
+ true,
1773
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1774
+ transformPaths3(event, [
1775
+ {
1776
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1777
+ paths: [
1778
+ { path: "entity.createdDate" },
1779
+ { path: "entity.updatedDate" },
1780
+ {
1781
+ path: "entity.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1782
+ },
1783
+ { path: "entity.lineItems.serviceProperties.scheduledDate" },
1784
+ { path: "metadata.eventTime" }
1785
+ ]
1786
+ },
1787
+ {
1788
+ transformFn: transformRESTPageURLV2ToSDKPageURLV22,
1789
+ paths: [{ path: "entity.lineItems.url" }]
1790
+ },
1791
+ {
1792
+ transformFn: transformRESTImageToSDKImage2,
1793
+ paths: [
1794
+ { path: "entity.lineItems.image" },
1795
+ { path: "entity.lineItems.catalogOverrideFields.image" }
1796
+ ]
1797
+ },
1798
+ {
1799
+ transformFn: transformRESTFloatToSDKFloat2,
1800
+ paths: [
1801
+ { path: "entity.lineItems.physicalProperties.weight" },
1802
+ {
1803
+ path: "entity.lineItems.catalogOverrideFields.physicalProperties.weight"
1804
+ }
1805
+ ]
1806
+ },
1807
+ {
1808
+ transformFn: transformRESTAddressToSDKAddress2,
1809
+ paths: [{ path: "entity.contactInfo.address" }]
1810
+ }
1811
+ ])
1812
+ )
1813
+ )();
1814
+
1815
+ // src/ecom-v1-cart-cart.context.ts
1816
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1817
+ import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1818
+ var createCart4 = /* @__PURE__ */ createRESTModule(createCart3);
1819
+ var updateCart4 = /* @__PURE__ */ createRESTModule(updateCart3);
1820
+ var getCart4 = /* @__PURE__ */ createRESTModule(getCart3);
1821
+ var getCartByCheckoutId4 = /* @__PURE__ */ createRESTModule(getCartByCheckoutId3);
1822
+ var addToCart4 = /* @__PURE__ */ createRESTModule(addToCart3);
1823
+ var removeLineItems4 = /* @__PURE__ */ createRESTModule(removeLineItems3);
1824
+ var createCheckout4 = /* @__PURE__ */ createRESTModule(createCheckout3);
1825
+ var removeCoupon4 = /* @__PURE__ */ createRESTModule(removeCoupon3);
1826
+ var updateLineItemsQuantity4 = /* @__PURE__ */ createRESTModule(updateLineItemsQuantity3);
1827
+ var estimateTotals4 = /* @__PURE__ */ createRESTModule(estimateTotals3);
1828
+ var deleteCart4 = /* @__PURE__ */ createRESTModule(deleteCart3);
1829
+ var removeBusinessLocation4 = /* @__PURE__ */ createRESTModule(removeBusinessLocation3);
1830
+ var onCartDeleted2 = createEventModule(onCartDeleted);
1831
+ var onCartUpdated2 = createEventModule(onCartUpdated);
1832
+ var onCartCreated2 = createEventModule(onCartCreated);
1833
+ export {
1834
+ AdditionalFeeSource,
1835
+ AppliedDiscountDiscountType,
1836
+ ChannelType,
1837
+ ChargeType,
1838
+ DescriptionLineType,
1839
+ DiscountType,
1840
+ FallbackReason,
1841
+ FileType,
1842
+ ItemAvailabilityStatus,
1843
+ ItemTypeItemType,
1844
+ JurisdictionType,
1845
+ ManualCalculationReason,
1846
+ NameInLineItem,
1847
+ NameInOther,
1848
+ PaymentOptionType,
1849
+ PickupMethod,
1850
+ RateType,
1851
+ RuleType,
1852
+ Severity,
1853
+ SubscriptionFrequency,
1854
+ SuggestedFix,
1855
+ TaxableAddressType,
1856
+ VatType,
1857
+ WebhookIdentityType,
1858
+ WeightUnit,
1859
+ addToCart4 as addToCart,
1860
+ createCart4 as createCart,
1861
+ createCheckout4 as createCheckout,
1862
+ deleteCart4 as deleteCart,
1863
+ estimateTotals4 as estimateTotals,
1864
+ getCart4 as getCart,
1865
+ getCartByCheckoutId4 as getCartByCheckoutId,
1866
+ onCartCreated2 as onCartCreated,
1867
+ onCartDeleted2 as onCartDeleted,
1868
+ onCartUpdated2 as onCartUpdated,
1869
+ removeBusinessLocation4 as removeBusinessLocation,
1870
+ removeCoupon4 as removeCoupon,
1871
+ removeLineItems4 as removeLineItems,
1872
+ updateCart4 as updateCart,
1873
+ updateLineItemsQuantity4 as updateLineItemsQuantity
1874
+ };
1875
+ //# sourceMappingURL=index.mjs.map