@ecomiq/core 0.1.8 → 1.0.0

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