@ecomiq/core 0.1.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -2
  3. package/dist/_virtual/_rolldown/runtime-C6LprzCP.cjs +22 -0
  4. package/dist/api.cjs +117 -102
  5. package/dist/api.d.cts +33 -37
  6. package/dist/api.d.ts +33 -37
  7. package/dist/api.js +116 -100
  8. package/dist/client.cjs +499 -1676
  9. package/dist/client.d.cts +156 -15
  10. package/dist/client.d.ts +156 -15
  11. package/dist/client.js +500 -1675
  12. package/dist/index.cjs +344 -2092
  13. package/dist/index.d.cts +54 -1127
  14. package/dist/index.d.ts +54 -1127
  15. package/dist/index.js +53 -1895
  16. package/dist/libs/bounded-read-cache-Abmb5VnJ.js +41 -0
  17. package/dist/libs/bounded-read-cache-D4644LJo.cjs +41 -0
  18. package/dist/libs/catalog-link-key-B7l5KZsF.js +9 -0
  19. package/dist/libs/catalog-link-key-CZTHJBGD.cjs +9 -0
  20. package/dist/libs/catalog-link-key.d.cts +2 -0
  21. package/dist/libs/catalog-link-key.d.ts +2 -0
  22. package/dist/libs/graphql-_6Y8lR_Q.js +49 -0
  23. package/dist/libs/graphql-selection-Cj51WkJn.cjs +21 -0
  24. package/dist/libs/graphql-selection-H1RMh6VD.js +21 -0
  25. package/dist/libs/graphql-selection.d.cts +3 -0
  26. package/dist/libs/graphql-selection.d.ts +3 -0
  27. package/dist/libs/graphql-wJH7HaQU.cjs +50 -0
  28. package/dist/libs/graphql.d.cts +24 -0
  29. package/dist/libs/graphql.d.ts +24 -0
  30. package/dist/models/amounts-cKBCecl7.js +5 -0
  31. package/dist/models/amounts-lmg89eJQ.cjs +4 -0
  32. package/dist/models/articles-C-4JvT2Z.js +27 -0
  33. package/dist/models/articles-xHCXLKDK.cjs +30 -0
  34. package/dist/models/articles.d.cts +46 -0
  35. package/dist/models/articles.d.ts +46 -0
  36. package/dist/models/catalog-links-BzJeyBy4.js +80 -0
  37. package/dist/models/catalog-links-c4LADGf_.cjs +88 -0
  38. package/dist/models/catalog-links.d.cts +39 -0
  39. package/dist/models/catalog-links.d.ts +39 -0
  40. package/dist/models/categories-CKkJY8_P.js +42 -0
  41. package/dist/models/categories-DZ5i5kwi.cjs +45 -0
  42. package/dist/models/categories.d.cts +54 -0
  43. package/dist/models/categories.d.ts +54 -0
  44. package/dist/models/collections.cjs +13 -22
  45. package/dist/models/collections.d.cts +23 -56
  46. package/dist/models/collections.d.ts +23 -56
  47. package/dist/models/collections.js +12 -20
  48. package/dist/models/complaint-book-D5INpuI2.cjs +64 -0
  49. package/dist/models/complaint-book-QpQZe7Xl.js +58 -0
  50. package/dist/models/complaint-book.d.cts +71 -0
  51. package/dist/models/complaint-book.d.ts +71 -0
  52. package/dist/models/customer-address.cjs +39 -38
  53. package/dist/models/customer-address.d.cts +59 -158
  54. package/dist/models/customer-address.d.ts +59 -158
  55. package/dist/models/customer-address.js +38 -36
  56. package/dist/models/customer-order.cjs +183 -142
  57. package/dist/models/customer-order.d.cts +474 -857
  58. package/dist/models/customer-order.d.ts +474 -857
  59. package/dist/models/customer-order.js +180 -141
  60. package/dist/models/customer-profile.cjs +121 -118
  61. package/dist/models/customer-profile.d.cts +89 -174
  62. package/dist/models/customer-profile.d.ts +89 -174
  63. package/dist/models/customer-profile.js +121 -116
  64. package/dist/models/customer-registration-C13knqyv.js +28 -0
  65. package/dist/models/customer-registration-EZ0yZgGr.cjs +31 -0
  66. package/dist/models/customer-registration.d.cts +66 -0
  67. package/dist/models/customer-registration.d.ts +66 -0
  68. package/dist/models/customer-session-BiX0TXhO.js +41 -0
  69. package/dist/models/customer-session-JeQiC8Yx.cjs +45 -0
  70. package/dist/models/customer-session.d.cts +61 -0
  71. package/dist/models/customer-session.d.ts +61 -0
  72. package/dist/models/geo.cjs +52 -49
  73. package/dist/models/geo.d.cts +141 -270
  74. package/dist/models/geo.d.ts +141 -270
  75. package/dist/models/geo.js +51 -47
  76. package/dist/models/ids.cjs +8 -11
  77. package/dist/models/ids.d.cts +7 -10
  78. package/dist/models/ids.d.ts +7 -10
  79. package/dist/models/ids.js +7 -9
  80. package/dist/models/order-draft-C-2WRbjl.cjs +41 -0
  81. package/dist/models/order-draft-CSIWRIV0.js +39 -0
  82. package/dist/models/order-draft.d.cts +69 -0
  83. package/dist/models/order-draft.d.ts +69 -0
  84. package/dist/models/order-review--xGlZKtS.cjs +18 -0
  85. package/dist/models/order-review-egGeCaqB.js +17 -0
  86. package/dist/models/order-review.d.cts +22 -0
  87. package/dist/models/order-review.d.ts +22 -0
  88. package/dist/models/order-status-CS_OeSPY.cjs +66 -0
  89. package/dist/models/order-status-CgaLkU0M.js +60 -0
  90. package/dist/models/order-status.d.cts +307 -0
  91. package/dist/models/order-status.d.ts +307 -0
  92. package/dist/models/payment-methods--VUUZpMz.js +17 -0
  93. package/dist/models/payment-methods-CmK08zBM.cjs +19 -0
  94. package/dist/models/payment-methods.d.cts +28 -0
  95. package/dist/models/payment-methods.d.ts +28 -0
  96. package/dist/models/personalization-BPFmkdJ0.js +69 -0
  97. package/dist/models/personalization-CQosKg8O.cjs +77 -0
  98. package/dist/models/personalization.d.cts +83 -0
  99. package/dist/models/personalization.d.ts +83 -0
  100. package/dist/models/products.cjs +218 -194
  101. package/dist/models/products.d.cts +646 -1353
  102. package/dist/models/products.d.ts +646 -1353
  103. package/dist/models/products.js +214 -187
  104. package/dist/models/search.cjs +13 -23
  105. package/dist/models/search.d.cts +21 -51
  106. package/dist/models/search.d.ts +21 -51
  107. package/dist/models/search.js +12 -21
  108. package/dist/models/sellers.cjs +44 -0
  109. package/dist/models/sellers.d.cts +82 -0
  110. package/dist/models/sellers.d.ts +82 -0
  111. package/dist/models/sellers.js +38 -0
  112. package/dist/models/settings.cjs +205 -236
  113. package/dist/models/settings.d.cts +853 -6940
  114. package/dist/models/settings.d.ts +853 -6940
  115. package/dist/models/settings.js +213 -239
  116. package/dist/models/storefront-cart.cjs +152 -118
  117. package/dist/models/storefront-cart.d.cts +277 -706
  118. package/dist/models/storefront-cart.d.ts +277 -706
  119. package/dist/models/storefront-cart.js +148 -117
  120. package/dist/models/storefront-checkout.cjs +212 -297
  121. package/dist/models/storefront-checkout.d.cts +672 -2449
  122. package/dist/models/storefront-checkout.d.ts +672 -2449
  123. package/dist/models/storefront-checkout.js +208 -297
  124. package/dist/models/storefront-reviews.cjs +58 -43
  125. package/dist/models/storefront-reviews.d.cts +71 -139
  126. package/dist/models/storefront-reviews.d.ts +71 -139
  127. package/dist/models/storefront-reviews.js +55 -42
  128. package/dist/models/tracking-CiIAhQW0.js +33 -0
  129. package/dist/models/tracking-wNyzQ6Bp.cjs +36 -0
  130. package/dist/models/tracking.d.cts +26 -0
  131. package/dist/models/tracking.d.ts +26 -0
  132. package/dist/models/urls-B0ZODOwH.cjs +35 -0
  133. package/dist/models/urls-Dt_dTt4Q.js +33 -0
  134. package/dist/models/urls.d.cts +233 -0
  135. package/dist/models/urls.d.ts +233 -0
  136. package/dist/redirects.cjs +113 -0
  137. package/dist/redirects.d.cts +11 -0
  138. package/dist/redirects.d.ts +11 -0
  139. package/dist/redirects.js +108 -0
  140. package/dist/services/article.service-DBsOvflH.js +10 -0
  141. package/dist/services/article.service-zmTkbbPV.cjs +11 -0
  142. package/dist/services/article.service.d.cts +4 -0
  143. package/dist/services/article.service.d.ts +4 -0
  144. package/dist/services/cart.service-B0D8s6jI.cjs +37 -0
  145. package/dist/services/cart.service-yMCz9oQP.js +33 -0
  146. package/dist/services/cart.service.d.cts +572 -0
  147. package/dist/services/cart.service.d.ts +572 -0
  148. package/dist/services/catalog-link.service-BQ2d-EPX.js +8 -0
  149. package/dist/services/catalog-link.service-DiB-OVjn.cjs +8 -0
  150. package/dist/services/category.service-8tieYX2r.js +6 -0
  151. package/dist/services/category.service-BsSJZV2B.cjs +6 -0
  152. package/dist/services/checkout.service-CC-3tm2y.js +60 -0
  153. package/dist/services/checkout.service-CG8KrDNY.cjs +69 -0
  154. package/dist/services/checkout.service.d.cts +475 -0
  155. package/dist/services/checkout.service.d.ts +475 -0
  156. package/dist/services/collection.service-C4QETpuI.js +11 -0
  157. package/dist/services/collection.service-DHGN3rhs.cjs +12 -0
  158. package/dist/services/complaint-book.service-C7TxltQe.cjs +13 -0
  159. package/dist/services/complaint-book.service-DXiVyKdD.js +12 -0
  160. package/dist/services/complaint-book.service.d.cts +4 -0
  161. package/dist/services/complaint-book.service.d.ts +4 -0
  162. package/dist/services/customer-address.service-Ca4qla_R.cjs +51 -0
  163. package/dist/services/customer-address.service-xEThx7cQ.js +47 -0
  164. package/dist/services/customer-address.service.d.cts +19 -0
  165. package/dist/services/customer-address.service.d.ts +19 -0
  166. package/dist/services/customer-order.service-DLGgT0xa.cjs +54 -0
  167. package/dist/services/customer-order.service-qHoRBuyX.js +51 -0
  168. package/dist/services/customer-order.service.d.cts +34 -0
  169. package/dist/services/customer-order.service.d.ts +34 -0
  170. package/dist/services/customer-registration.service-C3BNyCHP.cjs +10 -0
  171. package/dist/services/customer-registration.service-CxcWD2hf.js +9 -0
  172. package/dist/services/customer-registration.service.d.cts +5 -0
  173. package/dist/services/customer-registration.service.d.ts +5 -0
  174. package/dist/services/customer-session.service-4YgfbWRB.js +16 -0
  175. package/dist/services/customer-session.service-Bd8pLC2v.cjs +19 -0
  176. package/dist/services/customer.service-BM0NrOxP.cjs +26 -0
  177. package/dist/services/customer.service-BoU6l2-R.js +25 -0
  178. package/dist/services/customer.service.d.cts +10 -0
  179. package/dist/services/customer.service.d.ts +10 -0
  180. package/dist/services/geo.service-C32R7N8W.js +39 -0
  181. package/dist/services/geo.service-JeTT3Wun.cjs +42 -0
  182. package/dist/services/geo.service.d.cts +10 -0
  183. package/dist/services/geo.service.d.ts +10 -0
  184. package/dist/services/layout.service-BkvLzl1g.cjs +50 -0
  185. package/dist/services/layout.service-DmbeMOkK.js +50 -0
  186. package/dist/services/layout.service.d.cts +9 -0
  187. package/dist/services/layout.service.d.ts +9 -0
  188. package/dist/services/order-draft.service-B0VcmWhn.js +13 -0
  189. package/dist/services/order-draft.service-Dlu6eEkV.cjs +14 -0
  190. package/dist/services/order-draft.service.d.cts +4 -0
  191. package/dist/services/order-draft.service.d.ts +4 -0
  192. package/dist/services/order-review.service-BEr-FB6_.cjs +11 -0
  193. package/dist/services/order-review.service-PdBPUsxE.js +11 -0
  194. package/dist/services/order-review.service.d.cts +7 -0
  195. package/dist/services/order-review.service.d.ts +7 -0
  196. package/dist/services/order-status.service-Cn7dsaJo.cjs +26 -0
  197. package/dist/services/order-status.service-MC9hVpP-.js +23 -0
  198. package/dist/services/order-status.service.d.cts +16 -0
  199. package/dist/services/order-status.service.d.ts +16 -0
  200. package/dist/services/page.service-CWhWCjMQ.js +7 -0
  201. package/dist/services/page.service-DmCSeMiR.cjs +7 -0
  202. package/dist/services/page.service.d.cts +4 -0
  203. package/dist/services/page.service.d.ts +4 -0
  204. package/dist/services/payment-method.service-CEt_nB4R.cjs +7 -0
  205. package/dist/services/payment-method.service-CjKbAsOh.js +7 -0
  206. package/dist/services/payment-method.service.d.cts +4 -0
  207. package/dist/services/payment-method.service.d.ts +4 -0
  208. package/dist/services/product.service-B05Qmbuh.js +35 -0
  209. package/dist/services/product.service-B7OFZWB1.cjs +37 -0
  210. package/dist/services/product.service.d.cts +256 -0
  211. package/dist/services/product.service.d.ts +256 -0
  212. package/dist/services/review.service-CO2icjpu.cjs +46 -0
  213. package/dist/services/review.service-De1YkhFp.js +43 -0
  214. package/dist/services/review.service.d.cts +28 -0
  215. package/dist/services/review.service.d.ts +28 -0
  216. package/dist/services/search.service-Bx1zbTHJ.cjs +10 -0
  217. package/dist/services/search.service-DSBMhaSY.js +10 -0
  218. package/dist/services/search.service.d.cts +9 -0
  219. package/dist/services/search.service.d.ts +9 -0
  220. package/dist/services/seller.service-D11WHhbC.cjs +10 -0
  221. package/dist/services/seller.service-DUptDTv4.js +9 -0
  222. package/dist/services/seller.service.d.cts +42 -0
  223. package/dist/services/seller.service.d.ts +42 -0
  224. package/dist/services/tracking.service-CPK1B69N.js +11 -0
  225. package/dist/services/tracking.service-DqOoi8qr.cjs +11 -0
  226. package/dist/services/tracking.service.d.cts +7 -0
  227. package/dist/services/tracking.service.d.ts +7 -0
  228. package/dist/services/url.service-B-nC14Ue.cjs +19 -0
  229. package/dist/services/url.service-CLW0Tc7S.js +18 -0
  230. package/dist/storefront-cache-revision.cjs +23 -0
  231. package/dist/storefront-cache-revision.d.cts +16 -0
  232. package/dist/storefront-cache-revision.d.ts +16 -0
  233. package/dist/storefront-cache-revision.js +17 -0
  234. package/dist/storefront-routes.cjs +14 -0
  235. package/dist/storefront-routes.d.cts +11 -0
  236. package/dist/storefront-routes.d.ts +11 -0
  237. package/dist/storefront-routes.js +12 -0
  238. package/dist/utils-CDEC5xcY.cjs +139 -0
  239. package/dist/utils-DK7qa54o.js +136 -0
  240. package/dist/utils.d.cts +3 -0
  241. package/dist/utils.d.ts +3 -0
  242. package/dist/video-links-CbRO0m8V.js +47 -0
  243. package/dist/video-links-ClryQjPH.cjs +47 -0
  244. package/dist/video-links.d.cts +7 -0
  245. package/dist/video-links.d.ts +7 -0
  246. package/package.json +28 -11
  247. package/dist/api.cjs.map +0 -1
  248. package/dist/api.js.map +0 -1
  249. package/dist/client-Ba1r_uiO.d.ts +0 -195
  250. package/dist/client-Cqcnv2tC.d.cts +0 -195
  251. package/dist/client.cjs.map +0 -1
  252. package/dist/client.js.map +0 -1
  253. package/dist/index.cjs.map +0 -1
  254. package/dist/index.js.map +0 -1
  255. package/dist/models/collections.cjs.map +0 -1
  256. package/dist/models/collections.js.map +0 -1
  257. package/dist/models/customer-address.cjs.map +0 -1
  258. package/dist/models/customer-address.js.map +0 -1
  259. package/dist/models/customer-order.cjs.map +0 -1
  260. package/dist/models/customer-order.js.map +0 -1
  261. package/dist/models/customer-profile.cjs.map +0 -1
  262. package/dist/models/customer-profile.js.map +0 -1
  263. package/dist/models/geo.cjs.map +0 -1
  264. package/dist/models/geo.js.map +0 -1
  265. package/dist/models/ids.cjs.map +0 -1
  266. package/dist/models/ids.js.map +0 -1
  267. package/dist/models/products.cjs.map +0 -1
  268. package/dist/models/products.js.map +0 -1
  269. package/dist/models/search.cjs.map +0 -1
  270. package/dist/models/search.js.map +0 -1
  271. package/dist/models/settings.cjs.map +0 -1
  272. package/dist/models/settings.js.map +0 -1
  273. package/dist/models/storefront-cart.cjs.map +0 -1
  274. package/dist/models/storefront-cart.js.map +0 -1
  275. package/dist/models/storefront-checkout.cjs.map +0 -1
  276. package/dist/models/storefront-checkout.js.map +0 -1
  277. package/dist/models/storefront-reviews.cjs.map +0 -1
  278. package/dist/models/storefront-reviews.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,2092 +1,344 @@
1
- 'use strict';
2
-
3
- var zod = require('zod');
4
- var sanitize = require('sanitize-html');
5
-
6
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
-
8
- var sanitize__default = /*#__PURE__*/_interopDefault(sanitize);
9
-
10
- // src/libs/api.ts
11
- var DEFAULT_API_BASE_URL = "https://storefront.ecomiq.pe";
12
- var DEFAULT_API_VERSION = "v1";
13
- var ApiError = class extends Error {
14
- constructor(message, status, url, body) {
15
- super(message);
16
- this.status = status;
17
- this.url = url;
18
- this.body = body;
19
- this.name = "ApiError";
20
- }
21
- status;
22
- url;
23
- body;
24
- };
25
- function resolveApiBaseUrl(baseUrl = DEFAULT_API_BASE_URL, version = DEFAULT_API_VERSION) {
26
- const root = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
27
- const segment = version.replace(/^\/+|\/+$/g, "");
28
- if (!segment) return root;
29
- return new URL(`${segment}/`, root).toString();
30
- }
31
- function createApi(options = {}) {
32
- const {
33
- baseUrl = DEFAULT_API_BASE_URL,
34
- version = DEFAULT_API_VERSION,
35
- headers: baseHeaders = {},
36
- timeoutMs = 1e4
37
- } = options;
38
- const effectiveBaseUrl = resolveApiBaseUrl(baseUrl, version);
39
- async function request(method, path, schema, opts = {}) {
40
- const url = new URL(path.replace(/^\//, ""), effectiveBaseUrl);
41
- for (const [key, value] of Object.entries(opts.query ?? {})) {
42
- if (value !== void 0) url.searchParams.set(key, String(value));
43
- }
44
- const controller = new AbortController();
45
- const timeout = setTimeout(() => controller.abort(), timeoutMs);
46
- if (opts.signal) opts.signal.addEventListener("abort", () => controller.abort(), { once: true });
47
- const isFormData = typeof FormData !== "undefined" && opts.body instanceof FormData;
48
- let response;
49
- try {
50
- response = await fetch(url.toString(), {
51
- method,
52
- headers: {
53
- accept: "application/json",
54
- ...opts.body !== void 0 && !isFormData ? { "content-type": "application/json" } : {},
55
- ...baseHeaders,
56
- ...opts.headers
57
- },
58
- body: opts.body === void 0 ? void 0 : isFormData ? opts.body : JSON.stringify(opts.body),
59
- signal: controller.signal
60
- });
61
- } catch (err) {
62
- throw new ApiError(
63
- err instanceof DOMException && err.name === "AbortError" ? `Timeout tras ${timeoutMs}ms: ${url}` : `No se pudo conectar con ${url}`,
64
- 0,
65
- url.toString()
66
- );
67
- } finally {
68
- clearTimeout(timeout);
69
- }
70
- if (!response.ok) {
71
- const bodyText2 = await response.text().catch(() => void 0);
72
- let body = bodyText2;
73
- if (bodyText2) {
74
- try {
75
- body = JSON.parse(bodyText2);
76
- } catch {
77
- }
78
- }
79
- throw new ApiError(`${method} ${url} \u2192 ${response.status}`, response.status, url.toString(), body);
80
- }
81
- const bodyText = await response.text();
82
- let json = null;
83
- if (bodyText.trim()) {
84
- try {
85
- json = JSON.parse(bodyText);
86
- } catch {
87
- throw new ApiError(
88
- `Respuesta no JSON de ${url}`,
89
- response.status,
90
- url.toString(),
91
- bodyText
92
- );
93
- }
94
- }
95
- const parsed = schema.safeParse(json);
96
- if (!parsed.success) {
97
- throw new ApiError(
98
- `Respuesta inesperada de ${url}: ${parsed.error.issues[0]?.path.join(".")} ${parsed.error.issues[0]?.message}`,
99
- response.status,
100
- url.toString(),
101
- json
102
- );
103
- }
104
- return parsed.data;
105
- }
106
- return {
107
- request,
108
- get: (path, schema, opts) => request("GET", path, schema, opts),
109
- post: (path, body, schema, opts) => request("POST", path, schema, { ...opts, body }),
110
- postForm: (path, body, schema, opts) => request("POST", path, schema, { ...opts, body })
111
- };
112
- }
113
- var EntityIdSchema = zod.z.string().min(1, "Expected resource id");
114
- var CartTokenSchema = zod.z.string().min(1).max(32).regex(/^[A-Za-z0-9_-]+$/, "Expected cart token");
115
- var NullableEntityIdSchema = EntityIdSchema.nullable();
116
- var OptionalEntityIdSchema = EntityIdSchema.optional();
117
-
118
- // src/models/collections.ts
119
- var CollectionSchema = zod.z.object({
120
- id: EntityIdSchema,
121
- slug: zod.z.string(),
122
- name: zod.z.string(),
123
- description: zod.z.string().nullable().optional(),
124
- imageUrl: zod.z.string().nullable().optional(),
125
- type: zod.z.string(),
126
- productCount: zod.z.number().optional()
127
- });
128
- var CollectionsSchema = zod.z.array(CollectionSchema);
129
- var ProductSummarySchema = zod.z.object({
130
- id: EntityIdSchema,
131
- name: zod.z.string(),
132
- slug: zod.z.string(),
133
- productType: zod.z.string(),
134
- imageUrl: zod.z.string(),
135
- price: zod.z.number().nonnegative(),
136
- compareAtPrice: zod.z.number().nonnegative().nullable(),
137
- variantCount: zod.z.number().int().nonnegative(),
138
- isAvailable: zod.z.boolean(),
139
- totalInventory: zod.z.number().int().nonnegative(),
140
- bundleItemsCount: zod.z.number().int().nonnegative(),
141
- brand: zod.z.string(),
142
- category: zod.z.string(),
143
- status: zod.z.string(),
144
- collections: zod.z.array(zod.z.string()),
145
- tags: zod.z.array(zod.z.string())
146
- });
147
- var ProductSummariesSchema = zod.z.array(ProductSummarySchema);
148
- var ProductSchema = ProductSummarySchema;
149
- var FacetItemSchema = zod.z.object({
150
- value: zod.z.string(),
151
- count: zod.z.number().int().nonnegative(),
152
- label: zod.z.string().nullable(),
153
- selected: zod.z.boolean()
154
- });
155
- var FacetSchema = FacetItemSchema;
156
- var SearchFilterSchema = zod.z.object({
157
- id: zod.z.string(),
158
- label: zod.z.string(),
159
- type: zod.z.enum(["list", "price_range"]),
160
- values: zod.z.array(FacetItemSchema),
161
- min: zod.z.number().nonnegative().nullable(),
162
- max: zod.z.number().nonnegative().nullable(),
163
- selectedMin: zod.z.number().nonnegative().nullable(),
164
- selectedMax: zod.z.number().nonnegative().nullable()
165
- });
166
- var ProductsResponseSchema = zod.z.object({
167
- pageIndex: zod.z.number().int().positive(),
168
- pageSize: zod.z.number().int().positive().max(100),
169
- totalCount: zod.z.number().int().nonnegative(),
170
- totalPages: zod.z.number().int().nonnegative(),
171
- products: zod.z.array(ProductSummarySchema),
172
- filters: zod.z.array(SearchFilterSchema)
173
- });
174
- var ProductSortSchema = zod.z.enum([
175
- "price_asc",
176
- "price_desc",
177
- "name_asc",
178
- "name_desc",
179
- "newest"
180
- ]);
181
- var ProductsParamsSchema = zod.z.object({
182
- page: zod.z.number().int().positive().default(1),
183
- pageSize: zod.z.number().int().positive().max(100).default(24),
184
- sort: ProductSortSchema.optional(),
185
- sellerId: OptionalEntityIdSchema,
186
- search: zod.z.string().optional(),
187
- collection: zod.z.string().optional(),
188
- collections: zod.z.array(zod.z.string()).optional(),
189
- collectionId: EntityIdSchema.optional(),
190
- category: zod.z.string().optional(),
191
- categories: zod.z.array(zod.z.string()).optional(),
192
- brand: zod.z.string().optional(),
193
- brands: zod.z.array(zod.z.string()).optional(),
194
- productType: zod.z.string().optional(),
195
- productTypes: zod.z.array(zod.z.string()).optional(),
196
- tag: zod.z.string().optional(),
197
- tags: zod.z.array(zod.z.string()).optional(),
198
- filters: zod.z.array(zod.z.string()).optional(),
199
- locationId: OptionalEntityIdSchema,
200
- inStock: zod.z.boolean().optional(),
201
- minPrice: zod.z.number().nonnegative().optional(),
202
- maxPrice: zod.z.number().nonnegative().optional()
203
- });
204
- var ProductDetailParamsSchema = zod.z.object({
205
- sellerId: OptionalEntityIdSchema
206
- });
207
- var RelatedProductsParamsSchema = zod.z.object({
208
- productId: EntityIdSchema,
209
- limit: zod.z.number().int().positive().max(12).default(8),
210
- sellerId: OptionalEntityIdSchema
211
- });
212
- var SpecItemSchema = zod.z.object({
213
- key: zod.z.string(),
214
- name: zod.z.string(),
215
- value: zod.z.string()
216
- });
217
- var VariantOptionSchema = SpecItemSchema;
218
- var ProductImageSchema = zod.z.object({
219
- url: zod.z.string(),
220
- name: zod.z.string(),
221
- order: zod.z.number().int().nonnegative()
222
- });
223
- var VariantItemSchema = zod.z.object({
224
- id: EntityIdSchema.nullable(),
225
- sku: zod.z.string(),
226
- status: zod.z.string(),
227
- price: zod.z.number().nonnegative(),
228
- compareAtPrice: zod.z.number().nonnegative().nullable(),
229
- quantity: zod.z.number().int().nonnegative(),
230
- options: zod.z.array(SpecItemSchema),
231
- images: zod.z.array(ProductImageSchema)
232
- });
233
- var VariantSchema = VariantItemSchema;
234
- var ProductPriceTierSchema = zod.z.object({
235
- variantId: EntityIdSchema,
236
- minQuantity: zod.z.number().int().positive(),
237
- maxQuantity: zod.z.number().int().positive().nullable(),
238
- unitPrice: zod.z.number().nonnegative()
239
- });
240
- var PriceTierSchema = ProductPriceTierSchema;
241
- var BundleItemSchema = zod.z.object({
242
- productId: EntityIdSchema,
243
- variantId: EntityIdSchema,
244
- productName: zod.z.string(),
245
- variantName: zod.z.string().nullable(),
246
- sku: zod.z.string().nullable(),
247
- brand: zod.z.string().nullable(),
248
- imageUrl: zod.z.string().nullable(),
249
- quantity: zod.z.number().int().positive(),
250
- available: zod.z.number().int().nonnegative(),
251
- allowBackorders: zod.z.boolean(),
252
- requiresShipping: zod.z.boolean()
253
- });
254
- var SizeGuideMeasurementSchema = zod.z.object({
255
- key: zod.z.string(),
256
- name: zod.z.string(),
257
- min: zod.z.number().nullable(),
258
- max: zod.z.number().nullable(),
259
- value: zod.z.number().nullable(),
260
- description: zod.z.string().nullable()
261
- });
262
- var SizeGuideRowSchema = zod.z.object({
263
- label: zod.z.string(),
264
- sizeKey: zod.z.string(),
265
- order: zod.z.number().int().nonnegative(),
266
- measurements: zod.z.array(SizeGuideMeasurementSchema)
267
- });
268
- var SizeGuideSchema = zod.z.object({
269
- id: EntityIdSchema,
270
- name: zod.z.string(),
271
- slug: zod.z.string(),
272
- description: zod.z.string().nullable(),
273
- imageUrl: zod.z.string().nullable(),
274
- gender: zod.z.string(),
275
- measurementType: zod.z.string(),
276
- unit: zod.z.string(),
277
- notes: zod.z.string().nullable(),
278
- rows: zod.z.array(SizeGuideRowSchema)
279
- });
280
- var ProductDetailSchema = zod.z.object({
281
- id: EntityIdSchema,
282
- name: zod.z.string(),
283
- slug: zod.z.string(),
284
- description: zod.z.string(),
285
- productType: zod.z.string(),
286
- status: zod.z.string(),
287
- imageUrl: zod.z.string(),
288
- price: zod.z.number().nonnegative(),
289
- compareAtPrice: zod.z.number().nonnegative().nullable(),
290
- isAvailable: zod.z.boolean(),
291
- totalInventory: zod.z.number().int().nonnegative(),
292
- brand: zod.z.string(),
293
- category: zod.z.string(),
294
- categoryId: EntityIdSchema.nullable(),
295
- tags: zod.z.array(zod.z.string()),
296
- specifications: zod.z.array(SpecItemSchema),
297
- variants: zod.z.array(VariantItemSchema),
298
- images: zod.z.array(ProductImageSchema),
299
- bundleItems: zod.z.array(BundleItemSchema),
300
- sizeGuide: SizeGuideSchema.nullable(),
301
- priceTiers: zod.z.array(ProductPriceTierSchema),
302
- createdAt: zod.z.string().datetime({ offset: true }).nullable(),
303
- updatedAt: zod.z.string().datetime({ offset: true }).nullable()
304
- });
305
- var JsonElementSchema = zod.z.lazy(
306
- () => zod.z.union([
307
- zod.z.null(),
308
- zod.z.boolean(),
309
- zod.z.number().finite(),
310
- zod.z.string(),
311
- zod.z.array(JsonElementSchema),
312
- zod.z.record(zod.z.string(), JsonElementSchema)
313
- ])
314
- );
315
- var DateTimeOffsetSchema = zod.z.string().datetime({ offset: true });
316
- var NullableDateTimeOffsetSchema = DateTimeOffsetSchema.nullable();
317
- var StoreTypeSchema = zod.z.enum([
318
- "b2C",
319
- "marketplace",
320
- "retail",
321
- "b2B",
322
- "social",
323
- "hub",
324
- "restaurant"
325
- ]);
326
- var StoreVisibilitySchema = zod.z.enum(["public", "private"]);
327
- var StoreThemeSettingsSchema = zod.z.object({
328
- name: zod.z.string().nullable(),
329
- mode: zod.z.string().nullable(),
330
- colors: zod.z.record(zod.z.string(), zod.z.string()),
331
- fonts: zod.z.record(zod.z.string(), zod.z.string()),
332
- assets: zod.z.record(zod.z.string(), zod.z.string())
333
- }).strict();
334
- var StoreFeatureFlagsSchema = zod.z.object({
335
- flags: zod.z.record(zod.z.string(), zod.z.boolean())
336
- }).strict();
337
- var StoreCheckoutGeneralSettingsSchema = zod.z.object({
338
- allowGuestCheckout: zod.z.boolean(),
339
- identityScope: zod.z.enum(["store", "tenant", "global"]),
340
- signInMethods: zod.z.array(zod.z.enum(["password", "emailOtp", "google"])),
341
- useSequentialOrderNumbers: zod.z.boolean(),
342
- automaticallySelectFirstAddress: zod.z.boolean(),
343
- alwaysRequestCustomerAddress: zod.z.boolean(),
344
- requestCustomerDateOfBirth: zod.z.boolean(),
345
- automaticallySelectBestPromotion: zod.z.boolean()
346
- }).strict();
347
- var StoreCheckoutShippingSettingsSchema = zod.z.object({
348
- showDeliveryTime: zod.z.boolean(),
349
- showDeliveryTimeInDays: zod.z.boolean(),
350
- useBusinessDaysForDeliveryTime: zod.z.boolean(),
351
- showEstimatedDeliveryDateInThankYouAndEmails: zod.z.boolean(),
352
- showOriginalShippingPriceWhenFree: zod.z.boolean()
353
- }).strict();
354
- var StoreCheckoutCartPageSettingsSchema = zod.z.object({
355
- showShippingCostCalculation: zod.z.boolean(),
356
- allowProductLinks: zod.z.boolean(),
357
- redirectToCartPage: zod.z.boolean()
358
- }).strict();
359
- var StoreCheckoutOrderBumpSettingsSchema = zod.z.object({
360
- mergeOrderBumpOrders: zod.z.boolean(),
361
- allowOnlyOneAdditionalOffer: zod.z.boolean(),
362
- maxVisibleOffers: zod.z.number().int()
363
- }).strict();
364
- var StoreCheckoutOrdersAndPaymentsSettingsSchema = zod.z.object({
365
- allowPurchasesFrom: zod.z.enum(["any", "individual", "company"]),
366
- creditCardDailyOrderLimitPerIp: zod.z.number().int().nullable(),
367
- maximumItemsPerOrder: zod.z.number().int().nullable(),
368
- deliveryNoteText: zod.z.string().nullable(),
369
- boletoPaymentNoteText: zod.z.string().nullable()
370
- }).strict();
371
- var StoreCheckoutSettingsSchema = zod.z.object({
372
- general: StoreCheckoutGeneralSettingsSchema,
373
- shipping: StoreCheckoutShippingSettingsSchema,
374
- cartPage: StoreCheckoutCartPageSettingsSchema,
375
- orderBumps: StoreCheckoutOrderBumpSettingsSchema,
376
- ordersAndPayments: StoreCheckoutOrdersAndPaymentsSettingsSchema
377
- }).strict();
378
- var StorefrontStoreShape = {
379
- id: EntityIdSchema,
380
- tenantId: EntityIdSchema,
381
- sellerId: NullableEntityIdSchema,
382
- type: StoreTypeSchema,
383
- isActive: zod.z.boolean(),
384
- name: zod.z.string(),
385
- description: zod.z.string(),
386
- logo: zod.z.string().nullable(),
387
- icon: zod.z.string().nullable(),
388
- slug: zod.z.string().nullable(),
389
- domain: zod.z.string().nullable(),
390
- domains: zod.z.array(zod.z.string()),
391
- timeZone: zod.z.string(),
392
- currency: zod.z.string(),
393
- language: zod.z.string(),
394
- visibility: StoreVisibilitySchema,
395
- themeConfig: StoreThemeSettingsSchema,
396
- featuresEnabled: StoreFeatureFlagsSchema,
397
- checkoutSettings: StoreCheckoutSettingsSchema
398
- };
399
- var StoreModelSchema = zod.z.object(StorefrontStoreShape).strict();
400
- var CmsBrandingSettingsDtoSchema = zod.z.object({
401
- logoUrl: zod.z.string().nullable(),
402
- logoDarkUrl: zod.z.string().nullable(),
403
- faviconUrl: zod.z.string().nullable(),
404
- socialImageUrl: zod.z.string().nullable()
405
- }).strict();
406
- var CmsSeoSettingsDtoSchema = zod.z.object({
407
- siteName: zod.z.string().nullable(),
408
- metaTitle: zod.z.string().nullable(),
409
- metaDescription: zod.z.string().nullable(),
410
- titleTemplate: zod.z.string().nullable(),
411
- robotsIndex: zod.z.boolean()
412
- }).strict();
413
- var CmsSocialLinksDtoSchema = zod.z.object({
414
- instagram: zod.z.string().nullable(),
415
- facebook: zod.z.string().nullable(),
416
- tiktok: zod.z.string().nullable(),
417
- youtube: zod.z.string().nullable(),
418
- x: zod.z.string().nullable()
419
- }).strict();
420
- var CmsContactSettingsDtoSchema = zod.z.object({
421
- supportEmail: zod.z.string().nullable(),
422
- phone: zod.z.string().nullable(),
423
- whatsapp: zod.z.string().nullable(),
424
- address: zod.z.string().nullable(),
425
- socialLinks: CmsSocialLinksDtoSchema
426
- }).strict();
427
- var CmsTrackingSettingsDtoSchema = zod.z.object({
428
- googleAnalyticsMeasurementId: zod.z.string().nullable(),
429
- metaPixelId: zod.z.string().nullable(),
430
- googleTagManagerContainerId: zod.z.string().nullable()
431
- }).strict();
432
- var CmsCustomScriptsDtoSchema = zod.z.object({
433
- enabled: zod.z.boolean(),
434
- head: zod.z.string().nullable(),
435
- bodyEnd: zod.z.string().nullable()
436
- }).strict();
437
- var CmsSiteSettingsDtoSchema = zod.z.object({
438
- themeKey: zod.z.string(),
439
- branding: CmsBrandingSettingsDtoSchema,
440
- seo: CmsSeoSettingsDtoSchema,
441
- contact: CmsContactSettingsDtoSchema,
442
- tracking: CmsTrackingSettingsDtoSchema,
443
- customScripts: CmsCustomScriptsDtoSchema,
444
- updatedOn: NullableDateTimeOffsetSchema
445
- }).strict();
446
- var CmsMenuItemSchema = zod.z.lazy(
447
- () => zod.z.object({
448
- label: zod.z.string(),
449
- url: zod.z.string(),
450
- order: zod.z.number().int(),
451
- target: zod.z.string().nullable(),
452
- visible: zod.z.boolean().nullable(),
453
- children: zod.z.array(CmsMenuItemSchema).nullable()
454
- }).strict()
455
- );
456
- var CmsMenuDtoSchema = zod.z.object({
457
- key: zod.z.string(),
458
- name: zod.z.string(),
459
- items: zod.z.array(CmsMenuItemSchema)
460
- }).strict();
461
- var CmsBlockDtoSchema = zod.z.object({
462
- id: EntityIdSchema,
463
- type: zod.z.string(),
464
- order: zod.z.number().int(),
465
- settings: JsonElementSchema
466
- }).strict();
467
- var CmsSectionDtoSchema = zod.z.object({
468
- id: EntityIdSchema,
469
- type: zod.z.string(),
470
- order: zod.z.number().int(),
471
- settings: JsonElementSchema,
472
- blocks: zod.z.array(CmsBlockDtoSchema)
473
- }).strict();
474
- var CmsContentChannelSchema = zod.z.enum(["storefront", "pos"]);
475
- var CmsPageStatusSchema = zod.z.enum(["draft", "published", "archived"]);
476
- var CmsPageDetailsDtoSchema = zod.z.object({
477
- id: EntityIdSchema,
478
- name: zod.z.string(),
479
- slug: zod.z.string(),
480
- channel: CmsContentChannelSchema,
481
- layout: zod.z.string(),
482
- version: zod.z.number().int().nullable(),
483
- settings: JsonElementSchema,
484
- sections: zod.z.array(CmsSectionDtoSchema),
485
- status: CmsPageStatusSchema,
486
- hasPublishedVersion: zod.z.boolean(),
487
- publishedOn: NullableDateTimeOffsetSchema,
488
- publishedBy: NullableEntityIdSchema,
489
- createdOn: DateTimeOffsetSchema,
490
- updatedOn: NullableDateTimeOffsetSchema,
491
- createdBy: NullableEntityIdSchema,
492
- updatedBy: NullableEntityIdSchema,
493
- lastModifiedBy: zod.z.string().nullable()
494
- }).strict();
495
- var CmsSnapshotDtoSchema = zod.z.object({
496
- settings: CmsSiteSettingsDtoSchema,
497
- pages: zod.z.array(CmsPageDetailsDtoSchema),
498
- menus: zod.z.array(CmsMenuDtoSchema)
499
- }).strict();
500
- var StoreSettingsSnapshotV1Schema = zod.z.object({
501
- schemaVersion: zod.z.literal(1),
502
- generatedAt: DateTimeOffsetSchema,
503
- store: zod.z.object(StorefrontStoreShape),
504
- cms: CmsSnapshotDtoSchema
505
- }).strict();
506
- var StoreSettingsSnapshotV2Schema = zod.z.object({
507
- schemaVersion: zod.z.literal(2),
508
- generatedAt: DateTimeOffsetSchema,
509
- store: StoreModelSchema,
510
- cms: CmsSnapshotDtoSchema
511
- }).strict();
512
- var StoreSettingsSnapshotDtoSchema = zod.z.discriminatedUnion(
513
- "schemaVersion",
514
- [StoreSettingsSnapshotV1Schema, StoreSettingsSnapshotV2Schema]
515
- );
516
- var StorefrontCheckoutSettingsSchema = StoreCheckoutSettingsSchema;
517
- var StorefrontFeaturesEnabledSchema = StoreFeatureFlagsSchema;
518
- var StorefrontCmsBrandingSchema = CmsBrandingSettingsDtoSchema;
519
- var StorefrontThemeConfigSchema = StoreThemeSettingsSchema;
520
- var StorefrontStoreTypeSchema = StoreTypeSchema;
521
- var StorefrontStoreSchema = StoreModelSchema;
522
- var StorefrontCmsSeoSchema = CmsSeoSettingsDtoSchema;
523
- var StorefrontCmsSocialLinksSchema = CmsSocialLinksDtoSchema;
524
- var StorefrontCmsContactSchema = CmsContactSettingsDtoSchema;
525
- var StorefrontCmsTrackingSchema = CmsTrackingSettingsDtoSchema;
526
- var StorefrontCmsCustomScriptsSchema = CmsCustomScriptsDtoSchema;
527
- var StorefrontCmsSettingsSchema = CmsSiteSettingsDtoSchema;
528
- var StorefrontMenuItemSchema = CmsMenuItemSchema;
529
- var StorefrontMenuSchema = CmsMenuDtoSchema;
530
- var StorefrontCmsPageSchema = CmsPageDetailsDtoSchema;
531
- var StorefrontSettingsSchema = StoreSettingsSnapshotDtoSchema;
532
- function getMenuItems(settings, key) {
533
- const menu = settings?.cms.menus.find((candidate) => candidate.key === key);
534
- return (menu?.items ?? []).filter((item) => item.visible !== false).slice().sort((a, b) => a.order - b.order);
535
- }
536
-
537
- // src/services/product.service.ts
538
- async function getProducts(api, params = {}) {
539
- const input = ProductsParamsSchema.parse(params);
540
- const query = new URLSearchParams();
541
- query.set("page", String(input.page));
542
- query.set("pageSize", String(input.pageSize));
543
- if (input.sort) query.set("sort", input.sort);
544
- if (input.sellerId) query.set("sellerId", input.sellerId);
545
- if (input.search) query.set("search", input.search);
546
- if (input.collection) query.set("collection", input.collection);
547
- for (const collection of input.collections ?? []) {
548
- query.append("collections", collection);
549
- }
550
- if (input.collectionId) query.set("collectionId", input.collectionId);
551
- if (input.category) query.set("category", input.category);
552
- for (const category of input.categories ?? []) {
553
- query.append("categories", category);
554
- }
555
- if (input.brand) query.set("brand", input.brand);
556
- for (const brand of input.brands ?? []) {
557
- query.append("brands", brand);
558
- }
559
- if (input.productType) query.set("productType", input.productType);
560
- for (const productType of input.productTypes ?? []) {
561
- query.append("productTypes", productType);
562
- }
563
- if (input.tag) query.set("tag", input.tag);
564
- for (const tag of input.tags ?? []) {
565
- query.append("tags", tag);
566
- }
567
- for (const filter of input.filters ?? []) {
568
- query.append("filters", filter);
569
- }
570
- if (input.locationId) query.set("locationId", input.locationId);
571
- if (input.inStock !== void 0) query.set("inStock", String(input.inStock));
572
- if (input.minPrice !== void 0) query.set("minPrice", String(input.minPrice));
573
- if (input.maxPrice !== void 0) query.set("maxPrice", String(input.maxPrice));
574
- return api.get(`products?${query.toString()}`, ProductsResponseSchema);
575
- }
576
- async function getProductBySlug(api, slug, params = {}) {
577
- const input = ProductDetailParamsSchema.parse(params);
578
- const query = new URLSearchParams();
579
- if (input.sellerId) query.set("sellerId", input.sellerId);
580
- const path = `products/${encodeURIComponent(slug)}`;
581
- const search = query.toString();
582
- if (search) {
583
- return api.get(`${path}?${search}`, ProductDetailSchema);
584
- }
585
- return api.get(path, ProductDetailSchema);
586
- }
587
- async function getRelatedProducts(api, params) {
588
- const input = RelatedProductsParamsSchema.parse(params);
589
- return api.get(
590
- `products/${encodeURIComponent(input.productId)}/related`,
591
- ProductSummariesSchema,
592
- {
593
- query: {
594
- limit: input.limit,
595
- sellerId: input.sellerId
596
- }
597
- }
598
- );
599
- }
600
- var ProductAutocompleteParamsSchema = zod.z.object({
601
- search: zod.z.string().min(2).max(80),
602
- limit: zod.z.number().int().positive().max(20).default(8),
603
- sellerId: OptionalEntityIdSchema
604
- });
605
- var ProductSuggestionSchema = zod.z.object({
606
- id: EntityIdSchema,
607
- name: zod.z.string(),
608
- slug: zod.z.string(),
609
- imageUrl: zod.z.string()
610
- });
611
- var ProductSuggestionsSchema = zod.z.array(ProductSuggestionSchema);
612
-
613
- // src/services/search.service.ts
614
- async function autocompleteProducts(api, params) {
615
- const input = ProductAutocompleteParamsSchema.parse(params);
616
- return api.get("search/autocomplete", ProductSuggestionsSchema, {
617
- query: {
618
- search: input.search,
619
- limit: input.limit,
620
- sellerId: input.sellerId
621
- }
622
- });
623
- }
624
- var StorefrontReviewSchema = zod.z.object({
625
- id: EntityIdSchema,
626
- productId: EntityIdSchema,
627
- isVerifiedPurchase: zod.z.boolean(),
628
- rating: zod.z.number().int().min(1).max(5),
629
- title: zod.z.string().nullable(),
630
- content: zod.z.string(),
631
- reviewerName: zod.z.string().nullable(),
632
- createdOn: zod.z.string().datetime({ offset: true })
633
- });
634
- var StorefrontReviewsSchema = zod.z.object({
635
- data: zod.z.array(StorefrontReviewSchema),
636
- hasNextPage: zod.z.boolean(),
637
- nextCursor: zod.z.string().nullable(),
638
- totalCount: zod.z.number().int().nonnegative().nullable()
639
- });
640
- var ListProductReviewsParamsSchema = zod.z.object({
641
- productId: EntityIdSchema,
642
- limit: zod.z.number().int().min(1).max(200).optional(),
643
- cursor: zod.z.string().optional(),
644
- search: zod.z.string().optional(),
645
- sortBy: zod.z.enum(["rating", "createdOn"]).optional(),
646
- sortDirection: zod.z.enum(["asc", "desc"]).optional(),
647
- rating: zod.z.number().int().min(1).max(5).optional()
648
- });
649
- var CreateProductReviewParamsSchema = zod.z.object({
650
- productId: EntityIdSchema,
651
- rating: zod.z.number().int().min(1).max(5),
652
- content: zod.z.string().min(1).max(4e3),
653
- title: zod.z.string().max(200).optional(),
654
- reviewerName: zod.z.string().min(1).max(200),
655
- reviewerEmail: zod.z.string().email().max(320),
656
- orderId: EntityIdSchema.optional()
657
- });
658
-
659
- // src/services/review.service.ts
660
- async function listProductReviews(api, params) {
661
- const input = ListProductReviewsParamsSchema.parse(params);
662
- return api.get(
663
- `products/${encodeURIComponent(input.productId)}/reviews`,
664
- StorefrontReviewsSchema,
665
- {
666
- query: {
667
- limit: input.limit,
668
- cursor: input.cursor,
669
- search: input.search,
670
- sortBy: input.sortBy,
671
- sortDirection: input.sortDirection,
672
- rating: input.rating
673
- }
674
- }
675
- );
676
- }
677
- async function createProductReview(api, params) {
678
- const input = CreateProductReviewParamsSchema.parse(params);
679
- return api.post(
680
- `products/${encodeURIComponent(input.productId)}/reviews`,
681
- {
682
- rating: input.rating,
683
- content: input.content,
684
- title: input.title,
685
- reviewerName: input.reviewerName,
686
- reviewerEmail: input.reviewerEmail,
687
- orderId: input.orderId
688
- },
689
- StorefrontReviewSchema
690
- );
691
- }
692
- var StorefrontAddressSchema = zod.z.object({
693
- name: zod.z.string().nullable(),
694
- address1: zod.z.string(),
695
- city: zod.z.string(),
696
- countryCode: zod.z.string(),
697
- company: zod.z.string().nullable(),
698
- address2: zod.z.string().nullable(),
699
- province: zod.z.string().nullable(),
700
- postalCode: zod.z.string().nullable(),
701
- district: zod.z.string().nullable(),
702
- phone: zod.z.string().nullable(),
703
- latitude: zod.z.number().nullable(),
704
- longitude: zod.z.number().nullable()
705
- });
706
- var StorefrontCartBundleItemSchema = zod.z.object({
707
- productId: EntityIdSchema,
708
- variantId: EntityIdSchema,
709
- productName: zod.z.string(),
710
- variantName: zod.z.string().nullable(),
711
- sku: zod.z.string().nullable(),
712
- brand: zod.z.string().nullable(),
713
- imageUrl: zod.z.string().nullable(),
714
- quantity: zod.z.number().int().positive()
715
- });
716
- var StorefrontCartItemSchema = zod.z.object({
717
- id: EntityIdSchema,
718
- productId: NullableEntityIdSchema,
719
- title: zod.z.string(),
720
- variantLabel: zod.z.string().nullable(),
721
- productHandle: zod.z.string().nullable(),
722
- thumbnail: zod.z.string().nullable(),
723
- quantity: zod.z.number().int().positive(),
724
- variantId: NullableEntityIdSchema,
725
- variantSku: zod.z.string().nullable(),
726
- unitPrice: zod.z.number(),
727
- compareAtUnitPrice: zod.z.number().nullable(),
728
- bundleItems: zod.z.array(StorefrontCartBundleItemSchema)
729
- });
730
- var StorefrontCartShippingMethodSchema = zod.z.object({
731
- id: EntityIdSchema,
732
- shippingMethodId: NullableEntityIdSchema,
733
- rateId: NullableEntityIdSchema,
734
- name: zod.z.string(),
735
- description: zod.z.string().nullable(),
736
- total: zod.z.number(),
737
- locationId: NullableEntityIdSchema,
738
- estimatedDays: zod.z.number().int().nullable(),
739
- pickupPointId: NullableEntityIdSchema,
740
- scheduledDate: zod.z.string().nullable(),
741
- scheduledTime: zod.z.string().nullable(),
742
- serviceCode: zod.z.string().nullable(),
743
- sellerId: NullableEntityIdSchema,
744
- shippingProfileId: NullableEntityIdSchema
745
- });
746
- var StorefrontCartTotalsSchema = zod.z.object({
747
- subtotal: zod.z.number(),
748
- discountTotal: zod.z.number(),
749
- shippingOriginalTotal: zod.z.number(),
750
- shippingTotal: zod.z.number(),
751
- taxTotal: zod.z.number(),
752
- warrantyTotal: zod.z.number(),
753
- total: zod.z.number()
754
- });
755
- var StorefrontCartStatusSchema = zod.z.enum([
756
- "inProgress",
757
- "pending",
758
- "completed",
759
- "abandoned",
760
- "cancelled",
761
- "expired",
762
- "failed"
763
- ]);
764
- var StorefrontCartSchema = zod.z.object({
765
- id: EntityIdSchema,
766
- token: CartTokenSchema,
767
- cartNumber: zod.z.string(),
768
- email: zod.z.string().nullable(),
769
- phone: zod.z.string().nullable(),
770
- firstName: zod.z.string().nullable(),
771
- lastName: zod.z.string().nullable(),
772
- currencyCode: zod.z.string(),
773
- status: StorefrontCartStatusSchema,
774
- completedAt: zod.z.string().datetime({ offset: true }).nullable(),
775
- shippingAddress: StorefrontAddressSchema.nullable(),
776
- billingAddress: StorefrontAddressSchema.nullable(),
777
- promotionCodes: zod.z.array(zod.z.string()),
778
- items: zod.z.array(StorefrontCartItemSchema),
779
- shippingMethods: zod.z.array(StorefrontCartShippingMethodSchema),
780
- totals: StorefrontCartTotalsSchema
781
- });
782
- var CreateCartParamsSchema = zod.z.object({
783
- currencyCode: zod.z.string().length(3),
784
- salesChannelId: zod.z.string().optional(),
785
- email: zod.z.string().email().optional()
786
- });
787
- var GetCartParamsSchema = zod.z.object({
788
- cartToken: CartTokenSchema
789
- });
790
- var CartItemModifierSchema = zod.z.object({
791
- modifierGroupId: EntityIdSchema,
792
- optionIds: zod.z.array(EntityIdSchema).min(1)
793
- });
794
- var AddCartItemParamsSchema = zod.z.object({
795
- cartToken: CartTokenSchema,
796
- variantId: EntityIdSchema,
797
- quantity: zod.z.number().int().positive(),
798
- modifiers: zod.z.array(CartItemModifierSchema).optional()
799
- });
800
- var UpdateCartItemQuantityParamsSchema = zod.z.object({
801
- cartToken: CartTokenSchema,
802
- cartItemId: EntityIdSchema,
803
- quantity: zod.z.number().int().nonnegative()
804
- });
805
- var RemoveCartItemParamsSchema = zod.z.object({
806
- cartToken: CartTokenSchema,
807
- cartItemId: EntityIdSchema
808
- });
809
-
810
- // src/services/cart.service.ts
811
- async function createCart(api, params) {
812
- const input = CreateCartParamsSchema.parse(params);
813
- return api.post(
814
- "carts",
815
- {
816
- currencyCode: input.currencyCode,
817
- salesChannelId: input.salesChannelId,
818
- email: input.email
819
- },
820
- StorefrontCartSchema
821
- );
822
- }
823
- async function getCart(api, params) {
824
- const input = GetCartParamsSchema.parse(params);
825
- return api.get(
826
- `carts/${encodeURIComponent(input.cartToken)}`,
827
- StorefrontCartSchema
828
- );
829
- }
830
- async function addCartItem(api, params) {
831
- const input = AddCartItemParamsSchema.parse(params);
832
- return api.post(
833
- `carts/${encodeURIComponent(input.cartToken)}/items`,
834
- {
835
- variantId: input.variantId,
836
- quantity: input.quantity,
837
- modifiers: input.modifiers
838
- },
839
- StorefrontCartSchema
840
- );
841
- }
842
- async function updateCartItemQuantity(api, params) {
843
- const input = UpdateCartItemQuantityParamsSchema.parse(params);
844
- return api.request(
845
- "PATCH",
846
- `carts/${encodeURIComponent(input.cartToken)}/items/${encodeURIComponent(input.cartItemId)}`,
847
- StorefrontCartSchema,
848
- { body: { quantity: input.quantity } }
849
- );
850
- }
851
- async function removeCartItem(api, params) {
852
- const input = RemoveCartItemParamsSchema.parse(params);
853
- return api.request(
854
- "DELETE",
855
- `carts/${encodeURIComponent(input.cartToken)}/items/${encodeURIComponent(input.cartItemId)}`,
856
- StorefrontCartSchema
857
- );
858
- }
859
-
860
- // src/services/collection.service.ts
861
- async function getCollections(api) {
862
- return api.get("collections", CollectionsSchema);
863
- }
864
- async function getCollectionBySlug(api, collectionSlug) {
865
- return api.get(`collections/${encodeURIComponent(collectionSlug)}`, CollectionSchema);
866
- }
867
-
868
- // src/services/page.service.ts
869
- async function getPageBySlug(api, pageSlug) {
870
- return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
871
- }
872
- var CheckoutMetadataValueSchema = zod.z.lazy(
873
- () => zod.z.union([
874
- zod.z.string(),
875
- zod.z.number(),
876
- zod.z.boolean(),
877
- zod.z.null(),
878
- zod.z.array(CheckoutMetadataValueSchema),
879
- zod.z.record(zod.z.string(), CheckoutMetadataValueSchema)
880
- ])
881
- );
882
- var CartBuyerParamsSchema = zod.z.object({
883
- cartToken: CartTokenSchema,
884
- email: zod.z.string().email(),
885
- firstName: zod.z.string().min(1),
886
- lastName: zod.z.string().min(1),
887
- phone: zod.z.string().min(1)
888
- });
889
- var CartAddressWriteSchema = zod.z.object({
890
- name: zod.z.string().min(1),
891
- address1: zod.z.string().min(1),
892
- city: zod.z.string().min(1),
893
- countryCode: zod.z.string().length(2),
894
- company: zod.z.string().nullable().optional(),
895
- address2: zod.z.string().nullable().optional(),
896
- province: zod.z.string().nullable().optional(),
897
- postalCode: zod.z.string().nullable().optional(),
898
- district: zod.z.string().nullable().optional(),
899
- phone: zod.z.string().nullable().optional(),
900
- latitude: zod.z.number().nullable().optional(),
901
- longitude: zod.z.number().nullable().optional(),
902
- geo: zod.z.object({
903
- departmentCode: zod.z.string().nullable().optional(),
904
- provinceCode: zod.z.string().nullable().optional(),
905
- districtCode: zod.z.string().nullable().optional()
906
- }).nullable().optional()
907
- });
908
- var CartAddressesParamsSchema = zod.z.object({
909
- cartToken: CartTokenSchema,
910
- shippingAddress: CartAddressWriteSchema,
911
- billingAddress: CartAddressWriteSchema
912
- });
913
- var CartPaymentMethodSchema = zod.z.object({
914
- code: zod.z.string(),
915
- name: zod.z.string(),
916
- description: zod.z.string().nullable().optional(),
917
- kind: zod.z.string(),
918
- providerMethodCode: zod.z.string().nullable().optional(),
919
- isActive: zod.z.boolean(),
920
- isDefault: zod.z.boolean(),
921
- isManual: zod.z.boolean(),
922
- sortOrder: zod.z.number(),
923
- phoneNumber: zod.z.string().nullable().optional(),
924
- accountHolder: zod.z.string().nullable().optional(),
925
- qrImageUrl: zod.z.string().nullable().optional()
926
- });
927
- var StorefrontOrderBumpSchema = zod.z.object({
928
- id: EntityIdSchema,
929
- productId: EntityIdSchema,
930
- variantId: EntityIdSchema,
931
- productName: zod.z.string(),
932
- variantName: zod.z.string().nullable().optional(),
933
- imageUrl: zod.z.string().nullable().optional(),
934
- currencyCode: zod.z.string(),
935
- regularPrice: zod.z.number(),
936
- offerPrice: zod.z.number(),
937
- badgeLabel: zod.z.string().nullable().optional(),
938
- callToAction: zod.z.string(),
939
- description: zod.z.string().nullable().optional()
940
- });
941
- var CartCheckoutReadParamsSchema = zod.z.object({
942
- cartToken: CartTokenSchema
943
- });
944
- var CartCheckoutReadResponseSchema = zod.z.object({
945
- cart: StorefrontCartSchema,
946
- paymentMethods: zod.z.object({
947
- methods: zod.z.array(CartPaymentMethodSchema)
948
- }),
949
- orderBumps: zod.z.array(StorefrontOrderBumpSchema).optional().default([])
950
- });
951
- var CartCheckoutPaymentActionSchema = zod.z.object({
952
- publicConfiguration: zod.z.object({
953
- publishableKey: zod.z.string().nullable().optional(),
954
- checkoutMode: zod.z.string().nullable().optional(),
955
- phoneNumber: zod.z.string().nullable().optional(),
956
- accountHolder: zod.z.string().nullable().optional(),
957
- qrImageUrl: zod.z.string().nullable().optional()
958
- }).strip().nullable().optional(),
959
- url: zod.z.string().nullable().optional(),
960
- html: zod.z.string().nullable().optional(),
961
- clientSecret: zod.z.string().nullable().optional(),
962
- qrCode: zod.z.string().nullable().optional(),
963
- expiresAt: zod.z.string().nullable().optional()
964
- }).strip();
965
- var CartCheckoutPaymentSchema = zod.z.object({
966
- transactionId: zod.z.string(),
967
- paymentMethodCode: zod.z.string(),
968
- providerId: zod.z.string().nullable().optional(),
969
- status: zod.z.string(),
970
- amount: zod.z.number(),
971
- reference: zod.z.string(),
972
- actionType: zod.z.string(),
973
- receiptUrl: zod.z.string().nullable().optional(),
974
- action: CartCheckoutPaymentActionSchema.nullable().optional()
975
- }).strip();
976
- var CartCheckoutResponseSchema = zod.z.object({
977
- publicKey: zod.z.string().optional(),
978
- publishableKey: zod.z.string().optional(),
979
- stripePublicKey: zod.z.string().optional(),
980
- clientSecret: zod.z.string().optional(),
981
- intentClientSecret: zod.z.string().optional(),
982
- orderId: EntityIdSchema.optional(),
983
- orderGroup: zod.z.string().optional(),
984
- orderIds: zod.z.array(EntityIdSchema).optional(),
985
- payment: CartCheckoutPaymentSchema.optional(),
986
- cart: StorefrontCartSchema.optional()
987
- }).strip();
988
- var CartCheckoutParamsSchema = zod.z.object({
989
- cartToken: CartTokenSchema,
990
- paymentMethodCode: zod.z.string().min(1),
991
- externalRef: zod.z.string().min(1),
992
- receiptUrl: zod.z.string().min(1).optional()
993
- });
994
- var ShippingRateSchema = zod.z.object({
995
- shippingMethodId: zod.z.string(),
996
- name: zod.z.string(),
997
- displayName: zod.z.string().optional(),
998
- type: zod.z.string().optional(),
999
- price: zod.z.number(),
1000
- currency: zod.z.string().optional(),
1001
- sortOrder: zod.z.number().optional(),
1002
- rateId: zod.z.string(),
1003
- description: zod.z.string().nullable().optional(),
1004
- deliveryLocationId: zod.z.string().nullable().optional(),
1005
- deliveryLocationName: zod.z.string().nullable().optional(),
1006
- estimatedDeliveryDays: zod.z.number().nullable().optional(),
1007
- serviceCode: zod.z.string().nullable().optional(),
1008
- metadata: zod.z.record(zod.z.string(), CheckoutMetadataValueSchema).optional()
1009
- }).strip();
1010
- var ShippingOptionGroupSchema = zod.z.object({
1011
- sellerId: zod.z.string(),
1012
- shippingProfileId: zod.z.string().nullable().optional(),
1013
- orderAmount: zod.z.number().optional(),
1014
- totalWeight: zod.z.number().optional(),
1015
- itemIds: zod.z.array(zod.z.string()).optional(),
1016
- rates: zod.z.array(ShippingRateSchema)
1017
- }).strip();
1018
- var ShippingOptionsResponseSchema = zod.z.object({
1019
- groups: zod.z.array(ShippingOptionGroupSchema)
1020
- });
1021
- var GetShippingOptionsParamsSchema = zod.z.object({
1022
- cartToken: CartTokenSchema,
1023
- postalCode: zod.z.string().min(1)
1024
- });
1025
- var PutShippingMethodParamsSchema = zod.z.object({
1026
- cartToken: CartTokenSchema,
1027
- rateId: zod.z.string().min(1),
1028
- shippingMethodId: zod.z.string().min(1),
1029
- serviceCode: zod.z.string().nullable().optional(),
1030
- sellerId: zod.z.string().nullable().optional(),
1031
- shippingProfileId: zod.z.string().nullable().optional(),
1032
- locationId: zod.z.string().nullable().optional(),
1033
- pickupPointId: zod.z.string().nullable().optional(),
1034
- scheduledDate: zod.z.string().nullable().optional(),
1035
- scheduledTime: zod.z.string().nullable().optional()
1036
- });
1037
- var CartPaymentReceiptResponseSchema = zod.z.object({
1038
- id: zod.z.string(),
1039
- url: zod.z.string()
1040
- });
1041
- var CartPromotionCodeParamsSchema = zod.z.object({
1042
- cartToken: CartTokenSchema,
1043
- code: zod.z.string().min(1)
1044
- });
1045
-
1046
- // src/services/checkout.service.ts
1047
- async function getCartCheckout(api, params) {
1048
- const input = CartCheckoutReadParamsSchema.parse(params);
1049
- return api.get(
1050
- `carts/${encodeURIComponent(input.cartToken)}/checkout`,
1051
- CartCheckoutReadResponseSchema
1052
- );
1053
- }
1054
- async function getShippingOptions(api, params) {
1055
- const input = GetShippingOptionsParamsSchema.parse(params);
1056
- return api.get(
1057
- `carts/${encodeURIComponent(input.cartToken)}/shipping-options`,
1058
- ShippingOptionsResponseSchema,
1059
- { query: { postalCode: input.postalCode } }
1060
- );
1061
- }
1062
- async function putCartShippingMethod(api, params) {
1063
- const input = PutShippingMethodParamsSchema.parse(params);
1064
- const { cartToken, ...body } = input;
1065
- return api.request(
1066
- "PUT",
1067
- `carts/${encodeURIComponent(cartToken)}/shipping-method`,
1068
- StorefrontCartSchema,
1069
- { body }
1070
- );
1071
- }
1072
- async function patchCartBuyer(api, params) {
1073
- const input = CartBuyerParamsSchema.parse(params);
1074
- const { cartToken, ...body } = input;
1075
- return api.request(
1076
- "PATCH",
1077
- `carts/${encodeURIComponent(cartToken)}/buyer`,
1078
- StorefrontCartSchema,
1079
- { body }
1080
- );
1081
- }
1082
- async function patchCartAddresses(api, params) {
1083
- const input = CartAddressesParamsSchema.parse(params);
1084
- const { cartToken, shippingAddress, billingAddress } = input;
1085
- return api.request(
1086
- "PATCH",
1087
- `carts/${encodeURIComponent(cartToken)}/addresses`,
1088
- StorefrontCartSchema,
1089
- { body: { shippingAddress, billingAddress } }
1090
- );
1091
- }
1092
- async function checkoutCart(api, params) {
1093
- const input = CartCheckoutParamsSchema.parse(params);
1094
- const { cartToken, ...body } = input;
1095
- return api.post(
1096
- `carts/${encodeURIComponent(cartToken)}/checkout`,
1097
- body,
1098
- CartCheckoutResponseSchema
1099
- );
1100
- }
1101
- async function uploadPaymentReceipt(api, params) {
1102
- const cartToken = CartCheckoutReadParamsSchema.shape.cartToken.parse(params.cartToken);
1103
- if (!(params.file instanceof Blob)) {
1104
- throw new TypeError("uploadPaymentReceipt requiere un archivo (Blob/File)");
1105
- }
1106
- const form = new FormData();
1107
- const name = params.fileName ?? (params.file instanceof File ? params.file.name : "receipt");
1108
- form.append("file", params.file, name);
1109
- return api.postForm(
1110
- `carts/${encodeURIComponent(cartToken)}/payment-receipt`,
1111
- form,
1112
- CartPaymentReceiptResponseSchema
1113
- );
1114
- }
1115
- async function addCartPromotionCode(api, params) {
1116
- const input = CartPromotionCodeParamsSchema.parse(params);
1117
- return api.post(
1118
- `carts/${encodeURIComponent(input.cartToken)}/promotion-codes`,
1119
- { code: input.code },
1120
- StorefrontCartSchema
1121
- );
1122
- }
1123
- async function removeCartPromotionCode(api, params) {
1124
- const input = CartPromotionCodeParamsSchema.parse(params);
1125
- return api.request(
1126
- "DELETE",
1127
- `carts/${encodeURIComponent(input.cartToken)}/promotion-codes/${encodeURIComponent(input.code)}`,
1128
- StorefrontCartSchema
1129
- );
1130
- }
1131
- var CountrySchema = zod.z.object({
1132
- code: zod.z.string().length(2),
1133
- name: zod.z.string().min(1)
1134
- }).strict();
1135
- var CountriesSchema = zod.z.array(CountrySchema);
1136
- var GeoDivisionTypeSchema = zod.z.enum(["level1", "level2", "level3"]);
1137
- var GeoDivisionSchema = zod.z.object({
1138
- id: EntityIdSchema,
1139
- countryCode: zod.z.string().length(2),
1140
- type: GeoDivisionTypeSchema,
1141
- code: zod.z.string().min(1),
1142
- name: zod.z.string().min(1),
1143
- parentId: NullableEntityIdSchema,
1144
- source: zod.z.string().min(1)
1145
- }).strict();
1146
- var DepartmentSchema = GeoDivisionSchema;
1147
- var DepartmentsSchema = zod.z.array(DepartmentSchema);
1148
- var GetDepartmentsParamsSchema = zod.z.object({
1149
- countryCode: zod.z.string().length(2),
1150
- source: zod.z.string().min(1).default("inei"),
1151
- search: zod.z.string().default(""),
1152
- limit: zod.z.number().int().positive().max(500).default(200)
1153
- });
1154
- var ProvinceSchema = GeoDivisionSchema;
1155
- var ProvincesSchema = zod.z.array(ProvinceSchema);
1156
- var GetProvincesParamsSchema = zod.z.object({
1157
- countryCode: zod.z.string().length(2),
1158
- departmentCode: zod.z.string().min(1),
1159
- source: zod.z.string().min(1).default("inei"),
1160
- search: zod.z.string().default(""),
1161
- limit: zod.z.number().int().positive().max(500).default(200)
1162
- });
1163
- var DistrictSchema = GeoDivisionSchema;
1164
- var DistrictsSchema = zod.z.array(DistrictSchema);
1165
- var GetDistrictsParamsSchema = zod.z.object({
1166
- countryCode: zod.z.string().length(2),
1167
- provinceCode: zod.z.string().min(1),
1168
- source: zod.z.string().min(1).default("inei"),
1169
- search: zod.z.string().default(""),
1170
- limit: zod.z.number().int().positive().max(500).default(200)
1171
- });
1172
-
1173
- // src/services/geo.service.ts
1174
- async function getCountries(api) {
1175
- return api.get("geo/countries", CountriesSchema);
1176
- }
1177
- async function getDepartments(api, params) {
1178
- const input = GetDepartmentsParamsSchema.parse(params);
1179
- return api.get("geo/departments", DepartmentsSchema, {
1180
- query: {
1181
- countryCode: input.countryCode,
1182
- source: input.source,
1183
- search: input.search,
1184
- limit: input.limit
1185
- }
1186
- });
1187
- }
1188
- async function getProvinces(api, params) {
1189
- const input = GetProvincesParamsSchema.parse(params);
1190
- return api.get("geo/provinces", ProvincesSchema, {
1191
- query: {
1192
- countryCode: input.countryCode,
1193
- departmentCode: input.departmentCode,
1194
- source: input.source,
1195
- search: input.search,
1196
- limit: input.limit
1197
- }
1198
- });
1199
- }
1200
- async function getDistricts(api, params) {
1201
- const input = GetDistrictsParamsSchema.parse(params);
1202
- return api.get("geo/districts", DistrictsSchema, {
1203
- query: {
1204
- countryCode: input.countryCode,
1205
- provinceCode: input.provinceCode,
1206
- source: input.source,
1207
- search: input.search,
1208
- limit: input.limit
1209
- }
1210
- });
1211
- }
1212
- var CustomerAddressUpsertInputSchema = zod.z.object({
1213
- addressKey: zod.z.string().trim().min(1),
1214
- countryIsoCode: zod.z.string().trim().length(2),
1215
- addressLine: zod.z.string().trim().min(1),
1216
- addressNumber: zod.z.string().trim().min(1),
1217
- department: zod.z.string().trim().min(1),
1218
- province: zod.z.string().trim().min(1),
1219
- district: zod.z.string().trim().min(1),
1220
- phone: zod.z.string().trim(),
1221
- cellPhone: zod.z.string().trim(),
1222
- postalCode: zod.z.string().trim().min(1),
1223
- reference: zod.z.string().trim(),
1224
- latitude: zod.z.number().nullable(),
1225
- longitude: zod.z.number().nullable(),
1226
- isDefault: zod.z.boolean()
1227
- });
1228
- var CustomerAddressSchema = CustomerAddressUpsertInputSchema.extend({
1229
- id: EntityIdSchema.optional()
1230
- });
1231
- var CustomerAddressesSchema = zod.z.array(CustomerAddressSchema);
1232
- function toCustomerSavedAddresses(addresses) {
1233
- const saved = [];
1234
- for (const address of addresses) {
1235
- if (!address.id?.trim()) continue;
1236
- const { id, ...rest } = address;
1237
- saved.push({ id: id.trim(), ...rest });
1238
- }
1239
- return saved;
1240
- }
1241
-
1242
- // src/services/customer-address.service.ts
1243
- var ADDRESSES_PATH = "customer/addresses";
1244
- var CustomerAddressMutationResponseSchema = zod.z.union([
1245
- CustomerAddressSchema,
1246
- zod.z.object({
1247
- id: EntityIdSchema
1248
- }),
1249
- zod.z.null()
1250
- ]);
1251
- async function getCustomerAddresses(api, options = {}) {
1252
- return api.get(ADDRESSES_PATH, CustomerAddressesSchema, {
1253
- headers: options.headers,
1254
- signal: options.signal
1255
- });
1256
- }
1257
- async function createCustomerAddress(api, data, options = {}) {
1258
- const payload = CustomerAddressUpsertInputSchema.parse(data);
1259
- return api.post(ADDRESSES_PATH, payload, CustomerAddressMutationResponseSchema, {
1260
- headers: options.headers,
1261
- signal: options.signal
1262
- });
1263
- }
1264
- async function updateCustomerAddress(api, addressId, data, options = {}) {
1265
- const id = addressId.trim();
1266
- if (!id) throw new Error("addressId requerido");
1267
- const payload = CustomerAddressUpsertInputSchema.parse(data);
1268
- return api.request(
1269
- "PUT",
1270
- `${ADDRESSES_PATH}/${encodeURIComponent(id)}`,
1271
- CustomerAddressMutationResponseSchema,
1272
- {
1273
- body: payload,
1274
- headers: options.headers,
1275
- signal: options.signal
1276
- }
1277
- );
1278
- }
1279
- async function deleteCustomerAddress(api, addressId, options = {}) {
1280
- const id = addressId.trim();
1281
- if (!id) throw new Error("addressId requerido");
1282
- await api.request(
1283
- "DELETE",
1284
- `${ADDRESSES_PATH}/${encodeURIComponent(id)}`,
1285
- zod.z.null(),
1286
- {
1287
- headers: options.headers,
1288
- signal: options.signal
1289
- }
1290
- );
1291
- }
1292
- var DEFAULT_COUNTRY_CODE = "PE";
1293
- var CustomerRegisterRequestSchema = zod.z.object({
1294
- email: zod.z.string().email(),
1295
- firstName: zod.z.string().trim().min(1),
1296
- lastName: zod.z.string().trim().min(1),
1297
- countryIsoCode: zod.z.string().trim().length(2),
1298
- password: zod.z.string().min(1),
1299
- phone: zod.z.string().trim().min(1).optional()
1300
- });
1301
- var CustomerProfilePatchSchema = zod.z.object({
1302
- firstName: zod.z.string().trim().min(1),
1303
- lastName: zod.z.string().trim().min(1),
1304
- phone: zod.z.string().trim(),
1305
- identificationNumber: zod.z.string().nullable(),
1306
- identificationType: zod.z.string().nullable(),
1307
- entityName: zod.z.string().nullable(),
1308
- entityIdentificationNumber: zod.z.string().nullable(),
1309
- gender: zod.z.string().nullable(),
1310
- role: zod.z.string().nullable(),
1311
- companyName: zod.z.string().nullable(),
1312
- dateOfBirth: zod.z.string().nullable(),
1313
- consent: zod.z.boolean(),
1314
- countryIsoCode: zod.z.string().trim().length(2)
1315
- });
1316
- var CustomerProfileSchema = zod.z.object({
1317
- firstName: zod.z.string(),
1318
- lastName: zod.z.string(),
1319
- phone: zod.z.string(),
1320
- email: zod.z.string().email(),
1321
- identificationNumber: zod.z.string().nullable(),
1322
- identificationType: zod.z.string().nullable(),
1323
- countryIsoCode: zod.z.string(),
1324
- consent: zod.z.boolean(),
1325
- entityName: zod.z.string().nullable(),
1326
- entityIdentificationNumber: zod.z.string().nullable(),
1327
- gender: zod.z.string().nullable(),
1328
- role: zod.z.string().nullable(),
1329
- companyName: zod.z.string().nullable(),
1330
- dateOfBirth: zod.z.string().nullable()
1331
- });
1332
- var nullableString = zod.z.string().nullable().optional().transform((v) => v ?? null);
1333
- var CustomerMeSchema = zod.z.object({
1334
- id: EntityIdSchema,
1335
- storeId: EntityIdSchema.optional(),
1336
- email: zod.z.string().email(),
1337
- firstName: zod.z.string(),
1338
- lastName: zod.z.string(),
1339
- phone: zod.z.union([zod.z.string(), zod.z.null()]).optional().transform((v) => v ?? ""),
1340
- identificationNumber: nullableString,
1341
- identificationType: nullableString,
1342
- entityName: nullableString,
1343
- entityIdentificationNumber: nullableString,
1344
- gender: nullableString,
1345
- role: nullableString,
1346
- companyName: nullableString,
1347
- dateOfBirth: nullableString,
1348
- countryIsoCode: zod.z.string().optional().transform((v) => v?.trim().length === 2 ? v.trim() : DEFAULT_COUNTRY_CODE),
1349
- consent: zod.z.boolean().optional().transform((v) => v ?? false)
1350
- }).passthrough();
1351
- function customerMeToProfile(me) {
1352
- return CustomerProfileSchema.parse({
1353
- firstName: me.firstName,
1354
- lastName: me.lastName,
1355
- phone: me.phone,
1356
- email: me.email,
1357
- identificationNumber: me.identificationNumber,
1358
- identificationType: me.identificationType,
1359
- countryIsoCode: me.countryIsoCode,
1360
- consent: me.consent,
1361
- entityName: me.entityName,
1362
- entityIdentificationNumber: me.entityIdentificationNumber,
1363
- gender: me.gender,
1364
- role: me.role,
1365
- companyName: me.companyName,
1366
- dateOfBirth: me.dateOfBirth
1367
- });
1368
- }
1369
- function customerMeToProfilePatch(me) {
1370
- return CustomerProfilePatchSchema.parse({
1371
- firstName: me.firstName,
1372
- lastName: me.lastName,
1373
- phone: me.phone,
1374
- identificationNumber: me.identificationNumber,
1375
- identificationType: me.identificationType,
1376
- entityName: me.entityName,
1377
- entityIdentificationNumber: me.entityIdentificationNumber,
1378
- gender: me.gender,
1379
- role: me.role,
1380
- companyName: me.companyName,
1381
- dateOfBirth: me.dateOfBirth,
1382
- consent: me.consent,
1383
- countryIsoCode: me.countryIsoCode || DEFAULT_COUNTRY_CODE
1384
- });
1385
- }
1386
- function customerProfileToPatch(profile) {
1387
- return CustomerProfilePatchSchema.parse({
1388
- firstName: profile.firstName,
1389
- lastName: profile.lastName,
1390
- phone: profile.phone,
1391
- identificationNumber: profile.identificationNumber,
1392
- identificationType: profile.identificationType,
1393
- entityName: profile.entityName,
1394
- entityIdentificationNumber: profile.entityIdentificationNumber,
1395
- gender: profile.gender,
1396
- role: profile.role,
1397
- companyName: profile.companyName,
1398
- dateOfBirth: profile.dateOfBirth,
1399
- consent: profile.consent,
1400
- countryIsoCode: profile.countryIsoCode || DEFAULT_COUNTRY_CODE
1401
- });
1402
- }
1403
-
1404
- // src/services/customer.service.ts
1405
- var CUSTOMER_PATH = "customer";
1406
- var CUSTOMER_REGISTER_PATH = "customer/register";
1407
- async function registerCustomer(api, data, options = {}) {
1408
- const payload = CustomerRegisterRequestSchema.parse(data);
1409
- return api.post(CUSTOMER_REGISTER_PATH, payload, zod.z.unknown(), {
1410
- headers: options.headers,
1411
- signal: options.signal
1412
- });
1413
- }
1414
- async function getCustomerMe(api, options = {}) {
1415
- return api.get(CUSTOMER_PATH, CustomerMeSchema, {
1416
- headers: options.headers,
1417
- signal: options.signal
1418
- });
1419
- }
1420
- async function patchCustomer(api, data, options = {}) {
1421
- const payload = CustomerProfilePatchSchema.parse(data);
1422
- await api.request("PATCH", CUSTOMER_PATH, zod.z.null(), {
1423
- body: payload,
1424
- headers: options.headers,
1425
- signal: options.signal
1426
- });
1427
- }
1428
- var CustomerOrderShippingAddressSchema = zod.z.object({
1429
- name: zod.z.string().nullable().optional(),
1430
- company: zod.z.string().nullable().optional(),
1431
- address1: zod.z.string(),
1432
- address2: zod.z.string().nullable().optional(),
1433
- city: zod.z.string().nullable().optional(),
1434
- countryCode: zod.z.string().min(2).max(2),
1435
- province: zod.z.string().nullable().optional(),
1436
- postalCode: zod.z.string().nullable().optional(),
1437
- district: zod.z.string().nullable().optional(),
1438
- phone: zod.z.string().nullable().optional(),
1439
- latitude: zod.z.number().nullable().optional(),
1440
- longitude: zod.z.number().nullable().optional(),
1441
- metadata: zod.z.record(zod.z.unknown()).nullable().optional()
1442
- }).passthrough();
1443
- var CustomerOrderLineItemSchema = zod.z.object({
1444
- id: EntityIdSchema,
1445
- orderId: EntityIdSchema,
1446
- productId: EntityIdSchema.nullable(),
1447
- variantId: EntityIdSchema.nullable(),
1448
- title: zod.z.string(),
1449
- subtitle: zod.z.string().nullable().optional(),
1450
- thumbnail: zod.z.string().nullable().optional(),
1451
- variantTitle: zod.z.string().nullable().optional(),
1452
- productHandle: zod.z.string().nullable().optional(),
1453
- quantity: zod.z.number(),
1454
- unitPrice: zod.z.number(),
1455
- total: zod.z.number(),
1456
- status: zod.z.string()
1457
- });
1458
- var CustomerOrderListItemSchema = zod.z.object({
1459
- orderId: EntityIdSchema,
1460
- orderNumber: zod.z.string(),
1461
- orderGroup: zod.z.string(),
1462
- orderIds: zod.z.array(EntityIdSchema),
1463
- status: zod.z.string(),
1464
- total: zod.z.number(),
1465
- totalPaid: zod.z.number(),
1466
- currencyCode: zod.z.string(),
1467
- orderDate: zod.z.string(),
1468
- createdOn: zod.z.string(),
1469
- updatedOn: zod.z.string().nullable().optional(),
1470
- paymentAt: zod.z.string().nullable().optional(),
1471
- shippingAddress: CustomerOrderShippingAddressSchema.nullable().optional(),
1472
- shippingAddressSummary: zod.z.string().nullable().optional(),
1473
- items: zod.z.array(CustomerOrderLineItemSchema)
1474
- });
1475
- var CustomerOrderListSchema = zod.z.array(CustomerOrderListItemSchema);
1476
- var CustomerOrderPaymentSchema = zod.z.object({
1477
- id: EntityIdSchema,
1478
- paymentMethod: zod.z.string(),
1479
- paymentCode: zod.z.string(),
1480
- amount: zod.z.number(),
1481
- paymentStatus: zod.z.string(),
1482
- receiptUrl: zod.z.string().nullable().optional(),
1483
- createdOn: zod.z.string()
1484
- });
1485
- var CustomerOrderStatusTimelineSchema = zod.z.object({
1486
- key: zod.z.string(),
1487
- label: zod.z.string(),
1488
- occurredAt: zod.z.string(),
1489
- description: zod.z.string().nullable().optional(),
1490
- status: zod.z.string(),
1491
- source: zod.z.string()
1492
- });
1493
- var CustomerOrderDetailSchema = zod.z.object({
1494
- id: EntityIdSchema,
1495
- orderNumber: zod.z.string(),
1496
- orderGroup: zod.z.string(),
1497
- status: zod.z.string(),
1498
- total: zod.z.number(),
1499
- totalPaid: zod.z.number(),
1500
- currencyCode: zod.z.string(),
1501
- orderDate: zod.z.string(),
1502
- createdOn: zod.z.string(),
1503
- updatedOn: zod.z.string().nullable().optional(),
1504
- paymentAt: zod.z.string().nullable().optional(),
1505
- subTotal: zod.z.number(),
1506
- discount: zod.z.number(),
1507
- shipping: zod.z.number(),
1508
- tax: zod.z.number(),
1509
- email: zod.z.string(),
1510
- phone: zod.z.string(),
1511
- firstName: zod.z.string(),
1512
- lastName: zod.z.string(),
1513
- shippingAddress: CustomerOrderShippingAddressSchema.nullable().optional(),
1514
- shippingAddressSummary: zod.z.string().nullable().optional(),
1515
- billingAddress: CustomerOrderShippingAddressSchema.nullable().optional(),
1516
- items: zod.z.array(CustomerOrderLineItemSchema),
1517
- payments: zod.z.array(CustomerOrderPaymentSchema),
1518
- statusTimeline: zod.z.array(CustomerOrderStatusTimelineSchema)
1519
- });
1520
- var ORDER_STATUS_LABELS = {
1521
- New: "Pedido realizado",
1522
- Confirmed: "Confirmado",
1523
- Processing: "En preparaci\xF3n",
1524
- InTransit: "En camino",
1525
- Delivered: "Entregado",
1526
- Cancelled: "Cancelado",
1527
- Canceled: "Cancelado",
1528
- Refunded: "Reembolsado",
1529
- Pending: "Pendiente",
1530
- PendingToConfirm: "Pendiente de confirmaci\xF3n",
1531
- Paid: "Pagado",
1532
- Captured: "Pago confirmado"
1533
- };
1534
- function formatCustomerOrderStatus(status) {
1535
- const trimmed = status.trim();
1536
- if (!trimmed) return "Desconocido";
1537
- return ORDER_STATUS_LABELS[trimmed] ?? trimmed.replace(/([A-Z])/g, " $1").trim();
1538
- }
1539
- function customerOrderStatusTone(status) {
1540
- const s = status.toLowerCase();
1541
- if (s.includes("cancel") || s.includes("refund")) return "danger";
1542
- if (s.includes("deliver")) return "success";
1543
- if (s.includes("transit") || s.includes("ship")) return "info";
1544
- if (s.includes("confirm") || s.includes("paid") || s.includes("capture"))
1545
- return "success";
1546
- if (s.includes("pending") || s.includes("new") || s.includes("process"))
1547
- return "warning";
1548
- return "default";
1549
- }
1550
- function formatOrderDate(iso, locale = "es-PE") {
1551
- const d = new Date(iso);
1552
- if (Number.isNaN(d.getTime())) return iso;
1553
- return new Intl.DateTimeFormat(locale, {
1554
- day: "numeric",
1555
- month: "long",
1556
- year: "numeric"
1557
- }).format(d);
1558
- }
1559
- function formatOrderDateTime(iso, locale = "es-PE") {
1560
- const d = new Date(iso);
1561
- if (Number.isNaN(d.getTime())) return iso;
1562
- return new Intl.DateTimeFormat(locale, {
1563
- day: "numeric",
1564
- month: "short",
1565
- year: "numeric",
1566
- hour: "2-digit",
1567
- minute: "2-digit"
1568
- }).format(d);
1569
- }
1570
-
1571
- // src/services/customer-order.service.ts
1572
- var ORDERS_PATH = "customer/orders";
1573
- async function getCustomerOrders(api, options = {}) {
1574
- return api.get(ORDERS_PATH, CustomerOrderListSchema, {
1575
- headers: options.headers,
1576
- signal: options.signal
1577
- });
1578
- }
1579
- async function getCustomerOrder(api, orderId, options = {}) {
1580
- const id = orderId.trim();
1581
- if (!id) throw new Error("orderId requerido");
1582
- return api.get(
1583
- `${ORDERS_PATH}/${encodeURIComponent(id)}`,
1584
- CustomerOrderDetailSchema,
1585
- {
1586
- headers: options.headers,
1587
- signal: options.signal
1588
- }
1589
- );
1590
- }
1591
-
1592
- // src/client.ts
1593
- var DEFAULT_SETTINGS_CACHE_TTL_MS = 3e4;
1594
- function createClient(options) {
1595
- const {
1596
- domain,
1597
- settingsCacheTtlMs = DEFAULT_SETTINGS_CACHE_TTL_MS,
1598
- ...apiOptions
1599
- } = options;
1600
- if (!domain?.trim()) {
1601
- throw new Error("createClient requiere `domain` (config.domain de ecomiq.config.js)");
1602
- }
1603
- if (!Number.isFinite(settingsCacheTtlMs) || settingsCacheTtlMs < 0) {
1604
- throw new Error("settingsCacheTtlMs debe ser un n\xFAmero mayor o igual a 0");
1605
- }
1606
- const api = createApi(apiOptions);
1607
- const apiClient = async () => {
1608
- const storeId = await getStoreId();
1609
- return createApi({
1610
- ...apiOptions,
1611
- headers: {
1612
- ...apiOptions.headers,
1613
- "x-Store-Id": storeId
1614
- }
1615
- });
1616
- };
1617
- let cache = null;
1618
- let inflight = null;
1619
- function clearCache() {
1620
- cache = null;
1621
- inflight = null;
1622
- }
1623
- async function getSettings() {
1624
- const now = Date.now();
1625
- if (cache && cache.expiresAt > now) return cache.data;
1626
- if (inflight) return inflight;
1627
- const previous = cache?.data;
1628
- inflight = api.get("settings", StorefrontSettingsSchema, {
1629
- headers: { "x-Store-Domain": domain }
1630
- }).then((data) => {
1631
- cache = { data, expiresAt: Date.now() + settingsCacheTtlMs };
1632
- return data;
1633
- }).catch((error) => {
1634
- if (previous) return previous;
1635
- throw error;
1636
- }).finally(() => {
1637
- inflight = null;
1638
- });
1639
- return inflight;
1640
- }
1641
- async function getStoreId() {
1642
- const settings = await getSettings();
1643
- return settings.store.id;
1644
- }
1645
- async function getCollections2() {
1646
- const client = await apiClient();
1647
- return getCollections(client);
1648
- }
1649
- async function getCollectionBySlug2(collectionSlug) {
1650
- const client = await apiClient();
1651
- return getCollectionBySlug(client, collectionSlug);
1652
- }
1653
- async function getPageBySlug2(pageSlug) {
1654
- const client = await apiClient();
1655
- return getPageBySlug(client, pageSlug);
1656
- }
1657
- async function getProducts2(params = {}) {
1658
- const client = await apiClient();
1659
- return getProducts(client, params);
1660
- }
1661
- async function getProductBySlug2(productSlug, params = {}) {
1662
- const client = await apiClient();
1663
- return getProductBySlug(client, productSlug, params);
1664
- }
1665
- async function getRelatedProducts2(params) {
1666
- const client = await apiClient();
1667
- return getRelatedProducts(client, params);
1668
- }
1669
- async function autocompleteProducts2(params) {
1670
- const client = await apiClient();
1671
- return autocompleteProducts(client, params);
1672
- }
1673
- async function listProductReviews2(params) {
1674
- const client = await apiClient();
1675
- return listProductReviews(client, params);
1676
- }
1677
- async function createProductReview2(params) {
1678
- const client = await apiClient();
1679
- return createProductReview(client, params);
1680
- }
1681
- async function createCart2(params) {
1682
- const client = await apiClient();
1683
- return createCart(client, params);
1684
- }
1685
- async function getCart2(params) {
1686
- const client = await apiClient();
1687
- return getCart(client, params);
1688
- }
1689
- async function addCartItem2(params) {
1690
- const client = await apiClient();
1691
- return addCartItem(client, params);
1692
- }
1693
- async function updateCartItemQuantity2(params) {
1694
- const client = await apiClient();
1695
- return updateCartItemQuantity(client, params);
1696
- }
1697
- async function removeCartItem2(params) {
1698
- const client = await apiClient();
1699
- return removeCartItem(client, params);
1700
- }
1701
- async function getCartCheckout2(params) {
1702
- const client = await apiClient();
1703
- return getCartCheckout(client, params);
1704
- }
1705
- async function getShippingOptions2(params) {
1706
- const client = await apiClient();
1707
- return getShippingOptions(client, params);
1708
- }
1709
- async function putCartShippingMethod2(params) {
1710
- const client = await apiClient();
1711
- return putCartShippingMethod(client, params);
1712
- }
1713
- async function patchCartBuyer2(params) {
1714
- const client = await apiClient();
1715
- return patchCartBuyer(client, params);
1716
- }
1717
- async function patchCartAddresses2(params) {
1718
- const client = await apiClient();
1719
- return patchCartAddresses(client, params);
1720
- }
1721
- async function checkoutCart2(params) {
1722
- const client = await apiClient();
1723
- return checkoutCart(client, params);
1724
- }
1725
- async function uploadPaymentReceipt2(params) {
1726
- const client = await apiClient();
1727
- return uploadPaymentReceipt(client, params);
1728
- }
1729
- async function addCartPromotionCode2(params) {
1730
- const client = await apiClient();
1731
- return addCartPromotionCode(client, params);
1732
- }
1733
- async function removeCartPromotionCode2(params) {
1734
- const client = await apiClient();
1735
- return removeCartPromotionCode(client, params);
1736
- }
1737
- async function getCountries2() {
1738
- return getCountries(api);
1739
- }
1740
- async function getDepartments2(params) {
1741
- return getDepartments(api, params);
1742
- }
1743
- async function getProvinces2(params) {
1744
- return getProvinces(api, params);
1745
- }
1746
- async function getDistricts2(params) {
1747
- return getDistricts(api, params);
1748
- }
1749
- async function getCustomerAddresses2(options2 = {}) {
1750
- const client = await apiClient();
1751
- return getCustomerAddresses(client, options2);
1752
- }
1753
- async function createCustomerAddress2(data, options2 = {}) {
1754
- const client = await apiClient();
1755
- return createCustomerAddress(client, data, options2);
1756
- }
1757
- async function updateCustomerAddress2(addressId, data, options2 = {}) {
1758
- const client = await apiClient();
1759
- return updateCustomerAddress(client, addressId, data, options2);
1760
- }
1761
- async function deleteCustomerAddress2(addressId, options2 = {}) {
1762
- const client = await apiClient();
1763
- return deleteCustomerAddress(client, addressId, options2);
1764
- }
1765
- async function getCustomerMe2(options2 = {}) {
1766
- const client = await apiClient();
1767
- return getCustomerMe(client, options2);
1768
- }
1769
- async function patchCustomer2(data, options2 = {}) {
1770
- const client = await apiClient();
1771
- return patchCustomer(client, data, options2);
1772
- }
1773
- async function getCustomerOrders2(options2 = {}) {
1774
- const client = await apiClient();
1775
- return getCustomerOrders(client, options2);
1776
- }
1777
- async function getCustomerOrder2(orderId, options2 = {}) {
1778
- const client = await apiClient();
1779
- return getCustomerOrder(client, orderId, options2);
1780
- }
1781
- return {
1782
- ...api,
1783
- getSettings,
1784
- getStoreId,
1785
- getCollections: getCollections2,
1786
- getCollectionBySlug: getCollectionBySlug2,
1787
- getPageBySlug: getPageBySlug2,
1788
- clearCache,
1789
- getProducts: getProducts2,
1790
- getProductBySlug: getProductBySlug2,
1791
- getRelatedProducts: getRelatedProducts2,
1792
- autocompleteProducts: autocompleteProducts2,
1793
- listProductReviews: listProductReviews2,
1794
- createProductReview: createProductReview2,
1795
- createCart: createCart2,
1796
- getCart: getCart2,
1797
- addCartItem: addCartItem2,
1798
- updateCartItemQuantity: updateCartItemQuantity2,
1799
- removeCartItem: removeCartItem2,
1800
- getCartCheckout: getCartCheckout2,
1801
- getShippingOptions: getShippingOptions2,
1802
- putCartShippingMethod: putCartShippingMethod2,
1803
- patchCartBuyer: patchCartBuyer2,
1804
- patchCartAddresses: patchCartAddresses2,
1805
- checkoutCart: checkoutCart2,
1806
- uploadPaymentReceipt: uploadPaymentReceipt2,
1807
- addCartPromotionCode: addCartPromotionCode2,
1808
- removeCartPromotionCode: removeCartPromotionCode2,
1809
- getCountries: getCountries2,
1810
- getDepartments: getDepartments2,
1811
- getProvinces: getProvinces2,
1812
- getDistricts: getDistricts2,
1813
- getCustomerAddresses: getCustomerAddresses2,
1814
- createCustomerAddress: createCustomerAddress2,
1815
- updateCustomerAddress: updateCustomerAddress2,
1816
- deleteCustomerAddress: deleteCustomerAddress2,
1817
- getCustomerMe: getCustomerMe2,
1818
- patchCustomer: patchCustomer2,
1819
- getCustomerOrders: getCustomerOrders2,
1820
- getCustomerOrder: getCustomerOrder2
1821
- };
1822
- }
1823
- var createStorefrontClient = createClient;
1824
- var STOREFRONT_HTML_ALLOWLIST = {
1825
- allowedTags: [
1826
- "a",
1827
- "b",
1828
- "blockquote",
1829
- "br",
1830
- "code",
1831
- "col",
1832
- "colgroup",
1833
- "div",
1834
- "em",
1835
- "figcaption",
1836
- "figure",
1837
- "h1",
1838
- "h2",
1839
- "h3",
1840
- "h4",
1841
- "h5",
1842
- "h6",
1843
- "hr",
1844
- "i",
1845
- "img",
1846
- "li",
1847
- "ol",
1848
- "p",
1849
- "pre",
1850
- "s",
1851
- "small",
1852
- "span",
1853
- "strong",
1854
- "sub",
1855
- "sup",
1856
- "table",
1857
- "tbody",
1858
- "td",
1859
- "tfoot",
1860
- "th",
1861
- "thead",
1862
- "tr",
1863
- "u",
1864
- "ul"
1865
- ],
1866
- allowedAttributes: {
1867
- a: ["href", "rel", "target", "title"],
1868
- col: ["span"],
1869
- img: ["alt", "height", "loading", "src", "title", "width"],
1870
- td: ["colspan", "rowspan"],
1871
- th: ["colspan", "rowspan", "scope"]
1872
- },
1873
- allowedSchemes: ["http", "https", "mailto", "tel"],
1874
- allowedSchemesAppliedToAttributes: ["href", "src"],
1875
- allowProtocolRelative: false,
1876
- disallowedTagsMode: "discard",
1877
- enforceHtmlBoundary: true,
1878
- parseStyleAttributes: false,
1879
- transformTags: {
1880
- a: (tagName, attributes) => {
1881
- if (attributes.target !== "_blank") return { tagName, attribs: attributes };
1882
- return {
1883
- tagName,
1884
- attribs: {
1885
- ...attributes,
1886
- rel: "noopener noreferrer"
1887
- }
1888
- };
1889
- }
1890
- }
1891
- };
1892
- function sanitizeHtml(html) {
1893
- return sanitize__default.default(html, STOREFRONT_HTML_ALLOWLIST);
1894
- }
1895
- function stripHtml(html) {
1896
- return html.replace(/<br\s*\/?>/gi, " ").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
1897
- }
1898
-
1899
- exports.AddCartItemParamsSchema = AddCartItemParamsSchema;
1900
- exports.ApiError = ApiError;
1901
- exports.BundleItemSchema = BundleItemSchema;
1902
- exports.CartAddressWriteSchema = CartAddressWriteSchema;
1903
- exports.CartAddressesParamsSchema = CartAddressesParamsSchema;
1904
- exports.CartBuyerParamsSchema = CartBuyerParamsSchema;
1905
- exports.CartCheckoutParamsSchema = CartCheckoutParamsSchema;
1906
- exports.CartCheckoutPaymentActionSchema = CartCheckoutPaymentActionSchema;
1907
- exports.CartCheckoutPaymentSchema = CartCheckoutPaymentSchema;
1908
- exports.CartCheckoutReadParamsSchema = CartCheckoutReadParamsSchema;
1909
- exports.CartCheckoutReadResponseSchema = CartCheckoutReadResponseSchema;
1910
- exports.CartCheckoutResponseSchema = CartCheckoutResponseSchema;
1911
- exports.CartItemModifierSchema = CartItemModifierSchema;
1912
- exports.CartPaymentMethodSchema = CartPaymentMethodSchema;
1913
- exports.CartPaymentReceiptResponseSchema = CartPaymentReceiptResponseSchema;
1914
- exports.CartPromotionCodeParamsSchema = CartPromotionCodeParamsSchema;
1915
- exports.CartTokenSchema = CartTokenSchema;
1916
- exports.CheckoutMetadataValueSchema = CheckoutMetadataValueSchema;
1917
- exports.CmsBlockDtoSchema = CmsBlockDtoSchema;
1918
- exports.CmsBrandingSettingsDtoSchema = CmsBrandingSettingsDtoSchema;
1919
- exports.CmsContactSettingsDtoSchema = CmsContactSettingsDtoSchema;
1920
- exports.CmsContentChannelSchema = CmsContentChannelSchema;
1921
- exports.CmsCustomScriptsDtoSchema = CmsCustomScriptsDtoSchema;
1922
- exports.CmsMenuDtoSchema = CmsMenuDtoSchema;
1923
- exports.CmsMenuItemSchema = CmsMenuItemSchema;
1924
- exports.CmsPageDetailsDtoSchema = CmsPageDetailsDtoSchema;
1925
- exports.CmsPageStatusSchema = CmsPageStatusSchema;
1926
- exports.CmsSectionDtoSchema = CmsSectionDtoSchema;
1927
- exports.CmsSeoSettingsDtoSchema = CmsSeoSettingsDtoSchema;
1928
- exports.CmsSiteSettingsDtoSchema = CmsSiteSettingsDtoSchema;
1929
- exports.CmsSnapshotDtoSchema = CmsSnapshotDtoSchema;
1930
- exports.CmsSocialLinksDtoSchema = CmsSocialLinksDtoSchema;
1931
- exports.CmsTrackingSettingsDtoSchema = CmsTrackingSettingsDtoSchema;
1932
- exports.CollectionSchema = CollectionSchema;
1933
- exports.CollectionsSchema = CollectionsSchema;
1934
- exports.CountriesSchema = CountriesSchema;
1935
- exports.CountrySchema = CountrySchema;
1936
- exports.CreateCartParamsSchema = CreateCartParamsSchema;
1937
- exports.CreateProductReviewParamsSchema = CreateProductReviewParamsSchema;
1938
- exports.CustomerAddressMutationResponseSchema = CustomerAddressMutationResponseSchema;
1939
- exports.CustomerAddressSchema = CustomerAddressSchema;
1940
- exports.CustomerAddressUpsertInputSchema = CustomerAddressUpsertInputSchema;
1941
- exports.CustomerAddressesSchema = CustomerAddressesSchema;
1942
- exports.CustomerMeSchema = CustomerMeSchema;
1943
- exports.CustomerOrderDetailSchema = CustomerOrderDetailSchema;
1944
- exports.CustomerOrderLineItemSchema = CustomerOrderLineItemSchema;
1945
- exports.CustomerOrderListItemSchema = CustomerOrderListItemSchema;
1946
- exports.CustomerOrderListSchema = CustomerOrderListSchema;
1947
- exports.CustomerOrderPaymentSchema = CustomerOrderPaymentSchema;
1948
- exports.CustomerOrderShippingAddressSchema = CustomerOrderShippingAddressSchema;
1949
- exports.CustomerOrderStatusTimelineSchema = CustomerOrderStatusTimelineSchema;
1950
- exports.CustomerProfilePatchSchema = CustomerProfilePatchSchema;
1951
- exports.CustomerProfileSchema = CustomerProfileSchema;
1952
- exports.CustomerRegisterRequestSchema = CustomerRegisterRequestSchema;
1953
- exports.DEFAULT_API_BASE_URL = DEFAULT_API_BASE_URL;
1954
- exports.DEFAULT_API_VERSION = DEFAULT_API_VERSION;
1955
- exports.DepartmentSchema = DepartmentSchema;
1956
- exports.DepartmentsSchema = DepartmentsSchema;
1957
- exports.DistrictSchema = DistrictSchema;
1958
- exports.DistrictsSchema = DistrictsSchema;
1959
- exports.EntityIdSchema = EntityIdSchema;
1960
- exports.FacetItemSchema = FacetItemSchema;
1961
- exports.FacetSchema = FacetSchema;
1962
- exports.GeoDivisionSchema = GeoDivisionSchema;
1963
- exports.GeoDivisionTypeSchema = GeoDivisionTypeSchema;
1964
- exports.GetCartParamsSchema = GetCartParamsSchema;
1965
- exports.GetDepartmentsParamsSchema = GetDepartmentsParamsSchema;
1966
- exports.GetDistrictsParamsSchema = GetDistrictsParamsSchema;
1967
- exports.GetProvincesParamsSchema = GetProvincesParamsSchema;
1968
- exports.GetShippingOptionsParamsSchema = GetShippingOptionsParamsSchema;
1969
- exports.JsonElementSchema = JsonElementSchema;
1970
- exports.ListProductReviewsParamsSchema = ListProductReviewsParamsSchema;
1971
- exports.NullableEntityIdSchema = NullableEntityIdSchema;
1972
- exports.OptionalEntityIdSchema = OptionalEntityIdSchema;
1973
- exports.PriceTierSchema = PriceTierSchema;
1974
- exports.ProductAutocompleteParamsSchema = ProductAutocompleteParamsSchema;
1975
- exports.ProductDetailParamsSchema = ProductDetailParamsSchema;
1976
- exports.ProductDetailSchema = ProductDetailSchema;
1977
- exports.ProductImageSchema = ProductImageSchema;
1978
- exports.ProductPriceTierSchema = ProductPriceTierSchema;
1979
- exports.ProductSchema = ProductSchema;
1980
- exports.ProductSortSchema = ProductSortSchema;
1981
- exports.ProductSuggestionSchema = ProductSuggestionSchema;
1982
- exports.ProductSuggestionsSchema = ProductSuggestionsSchema;
1983
- exports.ProductSummariesSchema = ProductSummariesSchema;
1984
- exports.ProductSummarySchema = ProductSummarySchema;
1985
- exports.ProductsParamsSchema = ProductsParamsSchema;
1986
- exports.ProductsResponseSchema = ProductsResponseSchema;
1987
- exports.ProvinceSchema = ProvinceSchema;
1988
- exports.ProvincesSchema = ProvincesSchema;
1989
- exports.PutShippingMethodParamsSchema = PutShippingMethodParamsSchema;
1990
- exports.RelatedProductsParamsSchema = RelatedProductsParamsSchema;
1991
- exports.RemoveCartItemParamsSchema = RemoveCartItemParamsSchema;
1992
- exports.SearchFilterSchema = SearchFilterSchema;
1993
- exports.ShippingOptionGroupSchema = ShippingOptionGroupSchema;
1994
- exports.ShippingOptionsResponseSchema = ShippingOptionsResponseSchema;
1995
- exports.ShippingRateSchema = ShippingRateSchema;
1996
- exports.SizeGuideMeasurementSchema = SizeGuideMeasurementSchema;
1997
- exports.SizeGuideRowSchema = SizeGuideRowSchema;
1998
- exports.SizeGuideSchema = SizeGuideSchema;
1999
- exports.SpecItemSchema = SpecItemSchema;
2000
- exports.StoreCheckoutCartPageSettingsSchema = StoreCheckoutCartPageSettingsSchema;
2001
- exports.StoreCheckoutGeneralSettingsSchema = StoreCheckoutGeneralSettingsSchema;
2002
- exports.StoreCheckoutOrderBumpSettingsSchema = StoreCheckoutOrderBumpSettingsSchema;
2003
- exports.StoreCheckoutOrdersAndPaymentsSettingsSchema = StoreCheckoutOrdersAndPaymentsSettingsSchema;
2004
- exports.StoreCheckoutSettingsSchema = StoreCheckoutSettingsSchema;
2005
- exports.StoreCheckoutShippingSettingsSchema = StoreCheckoutShippingSettingsSchema;
2006
- exports.StoreFeatureFlagsSchema = StoreFeatureFlagsSchema;
2007
- exports.StoreModelSchema = StoreModelSchema;
2008
- exports.StoreSettingsSnapshotDtoSchema = StoreSettingsSnapshotDtoSchema;
2009
- exports.StoreThemeSettingsSchema = StoreThemeSettingsSchema;
2010
- exports.StoreTypeSchema = StoreTypeSchema;
2011
- exports.StoreVisibilitySchema = StoreVisibilitySchema;
2012
- exports.StorefrontAddressSchema = StorefrontAddressSchema;
2013
- exports.StorefrontCartBundleItemSchema = StorefrontCartBundleItemSchema;
2014
- exports.StorefrontCartItemSchema = StorefrontCartItemSchema;
2015
- exports.StorefrontCartSchema = StorefrontCartSchema;
2016
- exports.StorefrontCartShippingMethodSchema = StorefrontCartShippingMethodSchema;
2017
- exports.StorefrontCartStatusSchema = StorefrontCartStatusSchema;
2018
- exports.StorefrontCartTotalsSchema = StorefrontCartTotalsSchema;
2019
- exports.StorefrontCheckoutSettingsSchema = StorefrontCheckoutSettingsSchema;
2020
- exports.StorefrontCmsBrandingSchema = StorefrontCmsBrandingSchema;
2021
- exports.StorefrontCmsContactSchema = StorefrontCmsContactSchema;
2022
- exports.StorefrontCmsCustomScriptsSchema = StorefrontCmsCustomScriptsSchema;
2023
- exports.StorefrontCmsPageSchema = StorefrontCmsPageSchema;
2024
- exports.StorefrontCmsSeoSchema = StorefrontCmsSeoSchema;
2025
- exports.StorefrontCmsSettingsSchema = StorefrontCmsSettingsSchema;
2026
- exports.StorefrontCmsSocialLinksSchema = StorefrontCmsSocialLinksSchema;
2027
- exports.StorefrontCmsTrackingSchema = StorefrontCmsTrackingSchema;
2028
- exports.StorefrontFeaturesEnabledSchema = StorefrontFeaturesEnabledSchema;
2029
- exports.StorefrontMenuItemSchema = StorefrontMenuItemSchema;
2030
- exports.StorefrontMenuSchema = StorefrontMenuSchema;
2031
- exports.StorefrontOrderBumpSchema = StorefrontOrderBumpSchema;
2032
- exports.StorefrontReviewSchema = StorefrontReviewSchema;
2033
- exports.StorefrontReviewsSchema = StorefrontReviewsSchema;
2034
- exports.StorefrontSettingsSchema = StorefrontSettingsSchema;
2035
- exports.StorefrontStoreSchema = StorefrontStoreSchema;
2036
- exports.StorefrontStoreTypeSchema = StorefrontStoreTypeSchema;
2037
- exports.StorefrontThemeConfigSchema = StorefrontThemeConfigSchema;
2038
- exports.UpdateCartItemQuantityParamsSchema = UpdateCartItemQuantityParamsSchema;
2039
- exports.VariantItemSchema = VariantItemSchema;
2040
- exports.VariantOptionSchema = VariantOptionSchema;
2041
- exports.VariantSchema = VariantSchema;
2042
- exports.addCartItem = addCartItem;
2043
- exports.addCartPromotionCode = addCartPromotionCode;
2044
- exports.autocompleteProducts = autocompleteProducts;
2045
- exports.checkoutCart = checkoutCart;
2046
- exports.createApi = createApi;
2047
- exports.createCart = createCart;
2048
- exports.createClient = createClient;
2049
- exports.createCustomerAddress = createCustomerAddress;
2050
- exports.createProductReview = createProductReview;
2051
- exports.createStorefrontClient = createStorefrontClient;
2052
- exports.customerMeToProfile = customerMeToProfile;
2053
- exports.customerMeToProfilePatch = customerMeToProfilePatch;
2054
- exports.customerOrderStatusTone = customerOrderStatusTone;
2055
- exports.customerProfileToPatch = customerProfileToPatch;
2056
- exports.deleteCustomerAddress = deleteCustomerAddress;
2057
- exports.formatCustomerOrderStatus = formatCustomerOrderStatus;
2058
- exports.formatOrderDate = formatOrderDate;
2059
- exports.formatOrderDateTime = formatOrderDateTime;
2060
- exports.getCart = getCart;
2061
- exports.getCartCheckout = getCartCheckout;
2062
- exports.getCountries = getCountries;
2063
- exports.getCustomerAddresses = getCustomerAddresses;
2064
- exports.getCustomerMe = getCustomerMe;
2065
- exports.getCustomerOrder = getCustomerOrder;
2066
- exports.getCustomerOrders = getCustomerOrders;
2067
- exports.getDepartments = getDepartments;
2068
- exports.getDistricts = getDistricts;
2069
- exports.getMenuItems = getMenuItems;
2070
- exports.getPageBySlug = getPageBySlug;
2071
- exports.getProductBySlug = getProductBySlug;
2072
- exports.getProducts = getProducts;
2073
- exports.getProvinces = getProvinces;
2074
- exports.getRelatedProducts = getRelatedProducts;
2075
- exports.getShippingOptions = getShippingOptions;
2076
- exports.listProductReviews = listProductReviews;
2077
- exports.patchCartAddresses = patchCartAddresses;
2078
- exports.patchCartBuyer = patchCartBuyer;
2079
- exports.patchCustomer = patchCustomer;
2080
- exports.putCartShippingMethod = putCartShippingMethod;
2081
- exports.registerCustomer = registerCustomer;
2082
- exports.removeCartItem = removeCartItem;
2083
- exports.removeCartPromotionCode = removeCartPromotionCode;
2084
- exports.resolveApiBaseUrl = resolveApiBaseUrl;
2085
- exports.sanitizeHtml = sanitizeHtml;
2086
- exports.stripHtml = stripHtml;
2087
- exports.toCustomerSavedAddresses = toCustomerSavedAddresses;
2088
- exports.updateCartItemQuantity = updateCartItemQuantity;
2089
- exports.updateCustomerAddress = updateCustomerAddress;
2090
- exports.uploadPaymentReceipt = uploadPaymentReceipt;
2091
- //# sourceMappingURL=index.cjs.map
2092
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_api = require("./api.cjs");
3
+ const require_graphql = require("./libs/graphql-wJH7HaQU.cjs");
4
+ const require_graphql_selection = require("./libs/graphql-selection-Cj51WkJn.cjs");
5
+ const require_client = require("./client.cjs");
6
+ const require_models_ids = require("./models/ids.cjs");
7
+ const require_catalog_link_key = require("./libs/catalog-link-key-CZTHJBGD.cjs");
8
+ const require_models_settings = require("./models/settings.cjs");
9
+ const require_models_collections = require("./models/collections.cjs");
10
+ const require_categories = require("./models/categories-DZ5i5kwi.cjs");
11
+ const require_urls = require("./models/urls-B0ZODOwH.cjs");
12
+ const require_catalog_links = require("./models/catalog-links-c4LADGf_.cjs");
13
+ const require_payment_methods = require("./models/payment-methods-CmK08zBM.cjs");
14
+ const require_articles = require("./models/articles-xHCXLKDK.cjs");
15
+ const require_models_products = require("./models/products.cjs");
16
+ const require_personalization = require("./models/personalization-CQosKg8O.cjs");
17
+ const require_models_search = require("./models/search.cjs");
18
+ const require_models_storefront_cart = require("./models/storefront-cart.cjs");
19
+ const require_models_storefront_checkout = require("./models/storefront-checkout.cjs");
20
+ const require_models_storefront_reviews = require("./models/storefront-reviews.cjs");
21
+ const require_models_geo = require("./models/geo.cjs");
22
+ const require_models_sellers = require("./models/sellers.cjs");
23
+ const require_models_customer_address = require("./models/customer-address.cjs");
24
+ const require_models_customer_profile = require("./models/customer-profile.cjs");
25
+ const require_customer_session = require("./models/customer-session-JeQiC8Yx.cjs");
26
+ const require_customer_registration = require("./models/customer-registration-EZ0yZgGr.cjs");
27
+ const require_customer_registration_service = require("./services/customer-registration.service-C3BNyCHP.cjs");
28
+ const require_models_customer_order = require("./models/customer-order.cjs");
29
+ const require_product_service = require("./services/product.service-B7OFZWB1.cjs");
30
+ const require_search_service = require("./services/search.service-Bx1zbTHJ.cjs");
31
+ const require_review_service = require("./services/review.service-CO2icjpu.cjs");
32
+ const require_cart_service = require("./services/cart.service-B0D8s6jI.cjs");
33
+ const require_payment_method_service = require("./services/payment-method.service-CEt_nB4R.cjs");
34
+ const require_checkout_service = require("./services/checkout.service-CG8KrDNY.cjs");
35
+ const require_geo_service = require("./services/geo.service-JeTT3Wun.cjs");
36
+ const require_seller_service = require("./services/seller.service-D11WHhbC.cjs");
37
+ const require_customer_address_service = require("./services/customer-address.service-Ca4qla_R.cjs");
38
+ const require_customer_service = require("./services/customer.service-BM0NrOxP.cjs");
39
+ const require_customer_order_service = require("./services/customer-order.service-DLGgT0xa.cjs");
40
+ const require_tracking = require("./models/tracking-wNyzQ6Bp.cjs");
41
+ const require_tracking_service = require("./services/tracking.service-DqOoi8qr.cjs");
42
+ const require_order_review = require("./models/order-review--xGlZKtS.cjs");
43
+ const require_order_review_service = require("./services/order-review.service-BEr-FB6_.cjs");
44
+ const require_order_status = require("./models/order-status-CS_OeSPY.cjs");
45
+ const require_order_status_service = require("./services/order-status.service-Cn7dsaJo.cjs");
46
+ const require_order_draft = require("./models/order-draft-C-2WRbjl.cjs");
47
+ const require_order_draft_service = require("./services/order-draft.service-Dlu6eEkV.cjs");
48
+ const require_complaint_book = require("./models/complaint-book-D5INpuI2.cjs");
49
+ const require_complaint_book_service = require("./services/complaint-book.service-C7TxltQe.cjs");
50
+ const require_page_service = require("./services/page.service-DmCSeMiR.cjs");
51
+ const require_article_service = require("./services/article.service-zmTkbbPV.cjs");
52
+ const require_utils = require("./utils-CDEC5xcY.cjs");
53
+ const require_video_links = require("./video-links-ClryQjPH.cjs");
54
+ exports.AddCartItemParamsSchema = require_models_storefront_cart.AddCartItemParamsSchema;
55
+ exports.ApiError = require_api.ApiError;
56
+ exports.ArticleSchema = require_articles.ArticleSchema;
57
+ exports.ArticleSummarySchema = require_articles.ArticleSummarySchema;
58
+ exports.ArticlesSchema = require_articles.ArticlesSchema;
59
+ exports.AuthenticateOrderPaymentInputSchema = require_order_status.AuthenticateOrderPaymentInputSchema;
60
+ exports.BundleItemSchema = require_models_products.BundleItemSchema;
61
+ exports.CATALOG_LINK_ID = require_catalog_links.CATALOG_LINK_ID;
62
+ exports.CATALOG_LINK_MAX_LENGTH = require_catalog_links.CATALOG_LINK_MAX_LENGTH;
63
+ exports.COMPLAINT_BOOK_ATTACHMENT_TYPES = require_complaint_book.COMPLAINT_BOOK_ATTACHMENT_TYPES;
64
+ exports.COMPLAINT_BOOK_MAX_ATTACHMENTS = require_complaint_book.COMPLAINT_BOOK_MAX_ATTACHMENTS;
65
+ exports.COMPLAINT_BOOK_MAX_ATTACHMENT_BYTES = require_complaint_book.COMPLAINT_BOOK_MAX_ATTACHMENT_BYTES;
66
+ exports.CartAddressWriteSchema = require_models_storefront_checkout.CartAddressWriteSchema;
67
+ exports.CartAddressesParamsSchema = require_models_storefront_checkout.CartAddressesParamsSchema;
68
+ exports.CartBuyerParamsSchema = require_models_storefront_checkout.CartBuyerParamsSchema;
69
+ exports.CartCheckoutParamsSchema = require_models_storefront_checkout.CartCheckoutParamsSchema;
70
+ exports.CartCheckoutPaymentActionSchema = require_models_storefront_checkout.CartCheckoutPaymentActionSchema;
71
+ exports.CartCheckoutPaymentMethodSchema = require_models_storefront_checkout.CartCheckoutPaymentMethodSchema;
72
+ exports.CartCheckoutPaymentSchema = require_models_storefront_checkout.CartCheckoutPaymentSchema;
73
+ exports.CartCheckoutReadParamsSchema = require_models_storefront_checkout.CartCheckoutReadParamsSchema;
74
+ exports.CartCheckoutReadResponseSchema = require_models_storefront_checkout.CartCheckoutReadResponseSchema;
75
+ exports.CartCheckoutResponseSchema = require_models_storefront_checkout.CartCheckoutResponseSchema;
76
+ exports.CartItemModifierOptionSchema = require_models_storefront_cart.CartItemModifierOptionSchema;
77
+ exports.CartItemModifierSchema = require_models_storefront_cart.CartItemModifierSchema;
78
+ exports.CartPaymentMethodSchema = require_models_storefront_checkout.CartPaymentMethodSchema;
79
+ exports.CartPaymentReceiptResponseSchema = require_models_storefront_checkout.CartPaymentReceiptResponseSchema;
80
+ exports.CartPromotionCodeParamsSchema = require_models_storefront_checkout.CartPromotionCodeParamsSchema;
81
+ exports.CartShippingMethodTypeSchema = require_models_storefront_cart.CartShippingMethodTypeSchema;
82
+ exports.CartTokenSchema = require_models_ids.CartTokenSchema;
83
+ exports.CatalogLinkReferenceSchema = require_catalog_links.CatalogLinkReferenceSchema;
84
+ exports.CatalogLinkSchema = require_catalog_links.CatalogLinkSchema;
85
+ exports.CatalogLinksResponseSchema = require_catalog_links.CatalogLinksResponseSchema;
86
+ exports.CategoryAncestorSchema = require_categories.CategoryAncestorSchema;
87
+ exports.CategoryChildSchema = require_categories.CategoryChildSchema;
88
+ exports.CategoryDetailSchema = require_categories.CategoryDetailSchema;
89
+ exports.CategoryItemSchema = require_categories.CategoryItemSchema;
90
+ exports.CheckoutMetadataValueSchema = require_models_storefront_checkout.CheckoutMetadataValueSchema;
91
+ exports.CheckoutModeSchema = require_models_storefront_checkout.CheckoutModeSchema;
92
+ exports.CheckoutPaymentChargeSchema = require_models_storefront_checkout.CheckoutPaymentChargeSchema;
93
+ exports.CmsBlockDtoSchema = require_models_settings.CmsBlockDtoSchema;
94
+ exports.CmsBrandingSettingsDtoSchema = require_models_settings.CmsBrandingSettingsDtoSchema;
95
+ exports.CmsContactSettingsDtoSchema = require_models_settings.CmsContactSettingsDtoSchema;
96
+ exports.CmsContentChannelSchema = require_models_settings.CmsContentChannelSchema;
97
+ exports.CmsCustomScriptsDtoSchema = require_models_settings.CmsCustomScriptsDtoSchema;
98
+ exports.CmsMenuDtoSchema = require_models_settings.CmsMenuDtoSchema;
99
+ exports.CmsMenuItemSchema = require_models_settings.CmsMenuItemSchema;
100
+ exports.CmsPageDetailsDtoSchema = require_models_settings.CmsPageDetailsDtoSchema;
101
+ exports.CmsPageStatusSchema = require_models_settings.CmsPageStatusSchema;
102
+ exports.CmsSectionDtoSchema = require_models_settings.CmsSectionDtoSchema;
103
+ exports.CmsSeoSettingsDtoSchema = require_models_settings.CmsSeoSettingsDtoSchema;
104
+ exports.CmsSiteSettingsDtoSchema = require_models_settings.CmsSiteSettingsDtoSchema;
105
+ exports.CmsSnapshotDtoSchema = require_models_settings.CmsSnapshotDtoSchema;
106
+ exports.CmsSocialLinksDtoSchema = require_models_settings.CmsSocialLinksDtoSchema;
107
+ exports.CmsTrackingSettingsDtoSchema = require_models_settings.CmsTrackingSettingsDtoSchema;
108
+ exports.CollectionSchema = require_models_collections.CollectionSchema;
109
+ exports.CollectionsSchema = require_models_collections.CollectionsSchema;
110
+ exports.ComplaintBookDocumentTypeSchema = require_complaint_book.ComplaintBookDocumentTypeSchema;
111
+ exports.ComplaintBookEntryInputSchema = require_complaint_book.ComplaintBookEntryInputSchema;
112
+ exports.ComplaintBookEntrySchema = require_complaint_book.ComplaintBookEntrySchema;
113
+ exports.ComplaintBookSchema = require_complaint_book.ComplaintBookSchema;
114
+ exports.CountriesSchema = require_models_geo.CountriesSchema;
115
+ exports.CountrySchema = require_models_geo.CountrySchema;
116
+ exports.CreateCartParamsSchema = require_models_storefront_cart.CreateCartParamsSchema;
117
+ exports.CreateCustomerProductReviewParamsSchema = require_models_storefront_reviews.CreateCustomerProductReviewParamsSchema;
118
+ exports.CreateProductReviewParamsSchema = require_models_storefront_reviews.CreateProductReviewParamsSchema;
119
+ exports.CustomerAddressCreatedSchema = require_customer_address_service.CustomerAddressCreatedSchema;
120
+ exports.CustomerAddressSchema = require_models_customer_address.CustomerAddressSchema;
121
+ exports.CustomerAddressUpsertInputSchema = require_models_customer_address.CustomerAddressUpsertInputSchema;
122
+ exports.CustomerAddressesSchema = require_models_customer_address.CustomerAddressesSchema;
123
+ exports.CustomerAuthConfigurationSchema = require_customer_session.CustomerAuthConfigurationSchema;
124
+ exports.CustomerMeSchema = require_models_customer_profile.CustomerMeSchema;
125
+ exports.CustomerOrderDetailSchema = require_models_customer_order.CustomerOrderDetailSchema;
126
+ exports.CustomerOrderLineItemSchema = require_models_customer_order.CustomerOrderLineItemSchema;
127
+ exports.CustomerOrderListItemSchema = require_models_customer_order.CustomerOrderListItemSchema;
128
+ exports.CustomerOrderListSchema = require_models_customer_order.CustomerOrderListSchema;
129
+ exports.CustomerOrderPageSchema = require_models_customer_order.CustomerOrderPageSchema;
130
+ exports.CustomerOrderPaymentSchema = require_models_customer_order.CustomerOrderPaymentSchema;
131
+ exports.CustomerOrderShipmentSchema = require_models_customer_order.CustomerOrderShipmentSchema;
132
+ exports.CustomerOrderShippingAddressSchema = require_models_customer_order.CustomerOrderShippingAddressSchema;
133
+ exports.CustomerOrderStatusTimelineSchema = require_models_customer_order.CustomerOrderStatusTimelineSchema;
134
+ exports.CustomerProfilePatchSchema = require_models_customer_profile.CustomerProfilePatchSchema;
135
+ exports.CustomerProfileSchema = require_models_customer_profile.CustomerProfileSchema;
136
+ exports.CustomerRegistrationFieldModeSchema = require_customer_registration.CustomerRegistrationFieldModeSchema;
137
+ exports.CustomerRegistrationFieldsSchema = require_customer_registration.CustomerRegistrationFieldsSchema;
138
+ exports.CustomerRegistrationInputSchema = require_customer_registration.CustomerRegistrationInputSchema;
139
+ exports.CustomerRegistrationSchema = require_customer_registration.CustomerRegistrationSchema;
140
+ exports.CustomerSessionCreateSchema = require_customer_session.CustomerSessionCreateSchema;
141
+ exports.CustomerSessionCreatedSchema = require_customer_session.CustomerSessionCreatedSchema;
142
+ exports.CustomerSessionProfileSchema = require_customer_session.CustomerSessionProfileSchema;
143
+ exports.CustomerSessionSchema = require_customer_session.CustomerSessionSchema;
144
+ exports.DEFAULT_API_BASE_URL = require_api.DEFAULT_API_BASE_URL;
145
+ exports.DEFAULT_API_VERSION = require_api.DEFAULT_API_VERSION;
146
+ exports.DepartmentSchema = require_models_geo.DepartmentSchema;
147
+ exports.DepartmentsSchema = require_models_geo.DepartmentsSchema;
148
+ exports.DistrictSchema = require_models_geo.DistrictSchema;
149
+ exports.DistrictsSchema = require_models_geo.DistrictsSchema;
150
+ exports.EntityIdSchema = require_models_ids.EntityIdSchema;
151
+ exports.FacetItemSchema = require_models_products.FacetItemSchema;
152
+ exports.GeoDivisionSchema = require_models_geo.GeoDivisionSchema;
153
+ exports.GeoDivisionTypeSchema = require_models_geo.GeoDivisionTypeSchema;
154
+ exports.GetCartParamsSchema = require_models_storefront_cart.GetCartParamsSchema;
155
+ exports.GetDepartmentsParamsSchema = require_models_geo.GetDepartmentsParamsSchema;
156
+ exports.GetDistrictsParamsSchema = require_models_geo.GetDistrictsParamsSchema;
157
+ exports.GetProvincesParamsSchema = require_models_geo.GetProvincesParamsSchema;
158
+ exports.GetShippingOptionsParamsSchema = require_models_storefront_checkout.GetShippingOptionsParamsSchema;
159
+ exports.GraphQLResponseError = require_graphql.GraphQLResponseError;
160
+ exports.ItemModifierSchema = require_personalization.ItemModifierSchema;
161
+ exports.JsonElementSchema = require_models_settings.JsonElementSchema;
162
+ exports.ListArticlesParamsSchema = require_articles.ListArticlesParamsSchema;
163
+ exports.ListProductReviewsParamsSchema = require_models_storefront_reviews.ListProductReviewsParamsSchema;
164
+ exports.ListStoreReviewsParamsSchema = require_models_storefront_reviews.ListStoreReviewsParamsSchema;
165
+ exports.ModifierDisplaySchema = require_personalization.ModifierDisplaySchema;
166
+ exports.ModifierGroupItemSchema = require_personalization.ModifierGroupItemSchema;
167
+ exports.ModifierOptionItemSchema = require_personalization.ModifierOptionItemSchema;
168
+ exports.ModifierSelectionTypeSchema = require_personalization.ModifierSelectionTypeSchema;
169
+ exports.NullableEntityIdSchema = require_models_ids.NullableEntityIdSchema;
170
+ exports.OptionalEntityIdSchema = require_models_ids.OptionalEntityIdSchema;
171
+ exports.OrderDraftCheckoutSchema = require_order_draft.OrderDraftCheckoutSchema;
172
+ exports.OrderDraftItemSchema = require_order_draft.OrderDraftItemSchema;
173
+ exports.OrderDraftSchema = require_order_draft.OrderDraftSchema;
174
+ exports.OrderPaymentInReviewSchema = require_order_status.OrderPaymentInReviewSchema;
175
+ exports.OrderPaymentMethodSchema = require_order_status.OrderPaymentMethodSchema;
176
+ exports.OrderPaymentStartSchema = require_order_status.OrderPaymentStartSchema;
177
+ exports.OrderReviewContextItemSchema = require_order_review.OrderReviewContextItemSchema;
178
+ exports.OrderReviewContextSchema = require_order_review.OrderReviewContextSchema;
179
+ exports.OrderStatusViewSchema = require_order_status.OrderStatusViewSchema;
180
+ exports.OrderStepSchema = require_models_customer_order.OrderStepSchema;
181
+ exports.PaymentAuthentication3DSSchema = require_order_status.PaymentAuthentication3DSSchema;
182
+ exports.PaymentBankAccountSchema = require_models_storefront_checkout.PaymentBankAccountSchema;
183
+ exports.PaymentPublicConfigurationSchema = require_order_status.PaymentPublicConfigurationSchema;
184
+ exports.ProductAutocompleteParamsSchema = require_models_search.ProductAutocompleteParamsSchema;
185
+ exports.ProductDetailSchema = require_models_products.ProductDetailSchema;
186
+ exports.ProductImageSchema = require_models_products.ProductImageSchema;
187
+ exports.ProductMediaTypeSchema = require_models_products.ProductMediaTypeSchema;
188
+ exports.ProductOptionGroupSchema = require_models_products.ProductOptionGroupSchema;
189
+ exports.ProductPriceTierSchema = require_models_products.ProductPriceTierSchema;
190
+ exports.ProductSellerSchema = require_models_products.ProductSellerSchema;
191
+ exports.ProductSortSchema = require_models_products.ProductSortSchema;
192
+ exports.ProductSuggestionSchema = require_models_search.ProductSuggestionSchema;
193
+ exports.ProductSuggestionsSchema = require_models_search.ProductSuggestionsSchema;
194
+ exports.ProductSummariesSchema = require_models_products.ProductSummariesSchema;
195
+ exports.ProductSummarySchema = require_models_products.ProductSummarySchema;
196
+ exports.ProductsParamsSchema = require_models_products.ProductsParamsSchema;
197
+ exports.ProductsResponseSchema = require_models_products.ProductsResponseSchema;
198
+ exports.ProvinceSchema = require_models_geo.ProvinceSchema;
199
+ exports.ProvincesSchema = require_models_geo.ProvincesSchema;
200
+ exports.PublicOrderTrackingSchema = require_tracking.PublicOrderTrackingSchema;
201
+ exports.PutCartPaymentMethodParamsSchema = require_models_storefront_checkout.PutCartPaymentMethodParamsSchema;
202
+ exports.PutShippingMethodParamsSchema = require_models_storefront_checkout.PutShippingMethodParamsSchema;
203
+ exports.RelatedProductsParamsSchema = require_models_products.RelatedProductsParamsSchema;
204
+ exports.RemoveCartItemParamsSchema = require_models_storefront_cart.RemoveCartItemParamsSchema;
205
+ exports.STOREFRONT_SETTINGS_SCHEMA_VERSION = require_models_settings.STOREFRONT_SETTINGS_SCHEMA_VERSION;
206
+ exports.SearchFilterSchema = require_models_products.SearchFilterSchema;
207
+ exports.SellerLinkStyleSchema = require_models_sellers.SellerLinkStyleSchema;
208
+ exports.SellerLinksSchema = require_models_sellers.SellerLinksSchema;
209
+ exports.SellerProfileSchema = require_models_sellers.SellerProfileSchema;
210
+ exports.SellerRatingSchema = require_models_sellers.SellerRatingSchema;
211
+ exports.SellerSummarySchema = require_models_sellers.SellerSummarySchema;
212
+ exports.SellersSchema = require_models_sellers.SellersSchema;
213
+ exports.ShipmentTrackingEventSchema = require_tracking.ShipmentTrackingEventSchema;
214
+ exports.ShippingMethodTargetSelectionSchema = require_models_storefront_cart.ShippingMethodTargetSelectionSchema;
215
+ exports.ShippingOptionGroupSchema = require_models_storefront_checkout.ShippingOptionGroupSchema;
216
+ exports.ShippingOptionsResponseSchema = require_models_storefront_checkout.ShippingOptionsResponseSchema;
217
+ exports.ShippingRateSchema = require_models_storefront_checkout.ShippingRateSchema;
218
+ exports.SitemapItemSchema = require_urls.SitemapItemSchema;
219
+ exports.SitemapPageSchema = require_urls.SitemapPageSchema;
220
+ exports.SizeGuideMeasurementSchema = require_models_products.SizeGuideMeasurementSchema;
221
+ exports.SizeGuideRowSchema = require_models_products.SizeGuideRowSchema;
222
+ exports.SizeGuideSchema = require_models_products.SizeGuideSchema;
223
+ exports.SpecItemSchema = require_models_products.SpecItemSchema;
224
+ exports.SpecificationTypeSchema = require_models_products.SpecificationTypeSchema;
225
+ exports.StoreBusinessSettingsSchema = require_models_settings.StoreBusinessSettingsSchema;
226
+ exports.StoreCheckoutGeneralSettingsSchema = require_models_settings.StoreCheckoutGeneralSettingsSchema;
227
+ exports.StoreCheckoutOrderBumpSettingsSchema = require_models_settings.StoreCheckoutOrderBumpSettingsSchema;
228
+ exports.StoreCheckoutOrdersAndPaymentsSettingsSchema = require_models_settings.StoreCheckoutOrdersAndPaymentsSettingsSchema;
229
+ exports.StoreCheckoutSettingsSchema = require_models_settings.StoreCheckoutSettingsSchema;
230
+ exports.StoreModelSchema = require_models_settings.StoreModelSchema;
231
+ exports.StoreSettingsSnapshotDtoSchema = require_models_settings.StoreSettingsSnapshotDtoSchema;
232
+ exports.StoreTypeSchema = require_models_settings.StoreTypeSchema;
233
+ exports.StoreVisibilitySchema = require_models_settings.StoreVisibilitySchema;
234
+ exports.StorefrontAddressSchema = require_models_storefront_cart.StorefrontAddressSchema;
235
+ exports.StorefrontCartBundleItemSchema = require_models_storefront_cart.StorefrontCartBundleItemSchema;
236
+ exports.StorefrontCartItemSchema = require_models_storefront_cart.StorefrontCartItemSchema;
237
+ exports.StorefrontCartSchema = require_models_storefront_cart.StorefrontCartSchema;
238
+ exports.StorefrontCartShippingMethodSchema = require_models_storefront_cart.StorefrontCartShippingMethodSchema;
239
+ exports.StorefrontCartStatusSchema = require_models_storefront_cart.StorefrontCartStatusSchema;
240
+ exports.StorefrontCartTotalsSchema = require_models_storefront_cart.StorefrontCartTotalsSchema;
241
+ exports.StorefrontCheckoutSettingsSchema = require_models_settings.StorefrontCheckoutSettingsSchema;
242
+ exports.StorefrontCmsBrandingSchema = require_models_settings.StorefrontCmsBrandingSchema;
243
+ exports.StorefrontCmsContactSchema = require_models_settings.StorefrontCmsContactSchema;
244
+ exports.StorefrontCmsCustomScriptsSchema = require_models_settings.StorefrontCmsCustomScriptsSchema;
245
+ exports.StorefrontCmsPageSchema = require_models_settings.StorefrontCmsPageSchema;
246
+ exports.StorefrontCmsSeoSchema = require_models_settings.StorefrontCmsSeoSchema;
247
+ exports.StorefrontCmsSettingsSchema = require_models_settings.StorefrontCmsSettingsSchema;
248
+ exports.StorefrontCmsSocialLinksSchema = require_models_settings.StorefrontCmsSocialLinksSchema;
249
+ exports.StorefrontCmsTrackingSchema = require_models_settings.StorefrontCmsTrackingSchema;
250
+ exports.StorefrontInvoiceTypeSchema = require_models_storefront_cart.StorefrontInvoiceTypeSchema;
251
+ exports.StorefrontMenuItemSchema = require_models_settings.StorefrontMenuItemSchema;
252
+ exports.StorefrontMenuSchema = require_models_settings.StorefrontMenuSchema;
253
+ exports.StorefrontOrderBumpSchema = require_models_storefront_checkout.StorefrontOrderBumpSchema;
254
+ exports.StorefrontPaymentCodeSchema = require_payment_methods.StorefrontPaymentCodeSchema;
255
+ exports.StorefrontPaymentMethodSchema = require_payment_methods.StorefrontPaymentMethodSchema;
256
+ exports.StorefrontPaymentMethodsSchema = require_payment_methods.StorefrontPaymentMethodsSchema;
257
+ exports.StorefrontReviewSchema = require_models_storefront_reviews.StorefrontReviewSchema;
258
+ exports.StorefrontReviewsSchema = require_models_storefront_reviews.StorefrontReviewsSchema;
259
+ exports.StorefrontSettingsSchema = require_models_settings.StorefrontSettingsSchema;
260
+ exports.StorefrontStoreReviewSchema = require_models_storefront_reviews.StorefrontStoreReviewSchema;
261
+ exports.StorefrontStoreSchema = require_models_settings.StorefrontStoreSchema;
262
+ exports.StorefrontStoreTypeSchema = require_models_settings.StorefrontStoreTypeSchema;
263
+ exports.TRACKING_STATUS_LABELS = require_tracking.TRACKING_STATUS_LABELS;
264
+ exports.UpdateCartItemQuantityParamsSchema = require_models_storefront_cart.UpdateCartItemQuantityParamsSchema;
265
+ exports.UrlResolutionSchema = require_urls.UrlResolutionSchema;
266
+ exports.VariantItemSchema = require_models_products.VariantItemSchema;
267
+ exports.addCartItem = require_cart_service.addCartItem;
268
+ exports.addCartPromotionCode = require_checkout_service.addCartPromotionCode;
269
+ exports.authenticateOrderPayment = require_order_status_service.authenticateOrderPayment;
270
+ exports.autocompleteProducts = require_search_service.autocompleteProducts;
271
+ exports.catalogLinkCandidates = require_catalog_links.catalogLinkCandidates;
272
+ exports.catalogLinkKey = require_catalog_link_key.catalogLinkKey;
273
+ exports.checkoutCart = require_checkout_service.checkoutCart;
274
+ exports.checkoutOrderDraft = require_order_draft_service.checkoutOrderDraft;
275
+ exports.completeCustomerRegistration = require_customer_registration_service.completeCustomerRegistration;
276
+ exports.createApi = require_api.createApi;
277
+ exports.createCart = require_cart_service.createCart;
278
+ exports.createClient = require_client.createClient;
279
+ exports.createComplaintBookEntry = require_complaint_book_service.createComplaintBookEntry;
280
+ exports.createCustomerAddress = require_customer_address_service.createCustomerAddress;
281
+ exports.createProductReview = require_review_service.createProductReview;
282
+ exports.customerMeToProfile = require_models_customer_profile.customerMeToProfile;
283
+ exports.customerMeToProfilePatch = require_models_customer_profile.customerMeToProfilePatch;
284
+ exports.customerOrderStatusTone = require_models_customer_order.customerOrderStatusTone;
285
+ exports.customerProfileToPatch = require_models_customer_profile.customerProfileToPatch;
286
+ exports.deleteCustomerAddress = require_customer_address_service.deleteCustomerAddress;
287
+ exports.embeddedVideo = require_video_links.embeddedVideo;
288
+ exports.formatCustomerOrderStatus = require_models_customer_order.formatCustomerOrderStatus;
289
+ exports.formatOrderDate = require_models_customer_order.formatOrderDate;
290
+ exports.formatOrderDateTime = require_models_customer_order.formatOrderDateTime;
291
+ exports.formatTrackingStatus = require_tracking.formatTrackingStatus;
292
+ exports.getArticleBySlug = require_article_service.getArticleBySlug;
293
+ exports.getCart = require_cart_service.getCart;
294
+ exports.getCartCheckout = require_checkout_service.getCartCheckout;
295
+ exports.getComplaintBook = require_complaint_book_service.getComplaintBook;
296
+ exports.getCountries = require_geo_service.getCountries;
297
+ exports.getCustomerAddresses = require_customer_address_service.getCustomerAddresses;
298
+ exports.getCustomerMe = require_customer_service.getCustomerMe;
299
+ exports.getCustomerOrder = require_customer_order_service.getCustomerOrder;
300
+ exports.getCustomerOrders = require_customer_order_service.getCustomerOrders;
301
+ exports.getCustomerRegistration = require_customer_registration_service.getCustomerRegistration;
302
+ exports.getDepartments = require_geo_service.getDepartments;
303
+ exports.getDistricts = require_geo_service.getDistricts;
304
+ exports.getMenuItems = require_models_settings.getMenuItems;
305
+ exports.getOrderDraft = require_order_draft_service.getOrderDraft;
306
+ exports.getOrderReviewContext = require_order_review_service.getOrderReviewContext;
307
+ exports.getOrderStatus = require_order_status_service.getOrderStatus;
308
+ exports.getOrderTracking = require_tracking_service.getOrderTracking;
309
+ exports.getPageBySlug = require_page_service.getPageBySlug;
310
+ exports.getPaymentMethods = require_payment_method_service.getPaymentMethods;
311
+ exports.getProductBySlug = require_product_service.getProductBySlug;
312
+ exports.getProducts = require_product_service.getProducts;
313
+ exports.getProvinces = require_geo_service.getProvinces;
314
+ exports.getRelatedProducts = require_product_service.getRelatedProducts;
315
+ exports.getSellerBySlug = require_seller_service.getSellerBySlug;
316
+ exports.getSellers = require_seller_service.getSellers;
317
+ exports.getShippingOptions = require_checkout_service.getShippingOptions;
318
+ exports.graphQLSelection = require_graphql_selection.graphQLSelection;
319
+ exports.isCatalogLinkCandidate = require_catalog_links.isCatalogLinkCandidate;
320
+ exports.lineTotal = require_personalization.lineTotal;
321
+ exports.lineUnitPrice = require_personalization.lineUnitPrice;
322
+ exports.listArticles = require_article_service.listArticles;
323
+ exports.listProductReviews = require_review_service.listProductReviews;
324
+ exports.modifierLabel = require_personalization.modifierLabel;
325
+ exports.modifiersUnitPrice = require_personalization.modifiersUnitPrice;
326
+ exports.patchCartAddresses = require_checkout_service.patchCartAddresses;
327
+ exports.patchCartBuyer = require_checkout_service.patchCartBuyer;
328
+ exports.patchCustomer = require_customer_service.patchCustomer;
329
+ exports.putCartPaymentMethod = require_checkout_service.putCartPaymentMethod;
330
+ exports.putCartShippingMethod = require_checkout_service.putCartShippingMethod;
331
+ exports.readCatalogLink = require_catalog_links.readCatalogLink;
332
+ exports.removeCartItem = require_cart_service.removeCartItem;
333
+ exports.removeCartPromotionCode = require_checkout_service.removeCartPromotionCode;
334
+ exports.requestCustomerOrderCancellation = require_customer_order_service.requestCustomerOrderCancellation;
335
+ exports.requestCustomerOrderReturn = require_customer_order_service.requestCustomerOrderReturn;
336
+ exports.resolveApiBaseUrl = require_api.resolveApiBaseUrl;
337
+ exports.sanitizeHtml = require_utils.sanitizeHtml;
338
+ exports.startOrderPayment = require_order_status_service.startOrderPayment;
339
+ exports.stripHtml = require_utils.stripHtml;
340
+ exports.toCustomerSavedAddresses = require_models_customer_address.toCustomerSavedAddresses;
341
+ exports.updateCartItemQuantity = require_cart_service.updateCartItemQuantity;
342
+ exports.updateCustomerAddress = require_customer_address_service.updateCustomerAddress;
343
+ exports.uploadOrderPaymentReceipt = require_order_status_service.uploadOrderPaymentReceipt;
344
+ exports.uploadPaymentReceipt = require_checkout_service.uploadPaymentReceipt;