@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
@@ -1,195 +0,0 @@
1
- import { Api, CreateApiOptions } from './api.js';
2
- import { Collections, Collection } from './models/collections.js';
3
- import { ProductsParamsInput, ProductsResponse, ProductDetailParams, ProductDetail, RelatedProductsParams, ProductSummary } from './models/products.js';
4
- import { ProductAutocompleteParams, ProductSuggestion } from './models/search.js';
5
- import { ListProductReviewsParams, StorefrontReviews, CreateProductReviewParams, StorefrontReview } from './models/storefront-reviews.js';
6
- import { CreateCartParams, StorefrontCart, GetCartParams, AddCartItemParams, UpdateCartItemQuantityParams, RemoveCartItemParams } from './models/storefront-cart.js';
7
- import { CartCheckoutReadParams, CartCheckoutReadResponse, GetShippingOptionsParams, ShippingOptionsResponse, PutShippingMethodParams, CartBuyerParams, CartAddressesParams, CartCheckoutParams, CartCheckoutResponse, UploadPaymentReceiptParams, CartPaymentReceiptResponse, CartPromotionCodeParams } from './models/storefront-checkout.js';
8
- import { Countries, GetDepartmentsParams, Departments, GetProvincesParams, Provinces, GetDistrictsParams, Districts } from './models/geo.js';
9
- import { CustomerAddressUpsertInput, CustomerAddresses } from './models/customer-address.js';
10
- import { z } from 'zod';
11
- import { CustomerMe, CustomerProfilePatch, CustomerRegisterRequest } from './models/customer-profile.js';
12
- import { CustomerOrderDetail, CustomerOrderList } from './models/customer-order.js';
13
- import { StorefrontSettings, CmsPageDetailsDto } from './models/settings.js';
14
-
15
- /** POST/PUT a menudo responde solo `{ id }` (no el body completo). */
16
- declare const CustomerAddressMutationResponseSchema: z.ZodUnion<[z.ZodObject<{
17
- addressKey: z.ZodString;
18
- countryIsoCode: z.ZodString;
19
- addressLine: z.ZodString;
20
- addressNumber: z.ZodString;
21
- department: z.ZodString;
22
- province: z.ZodString;
23
- district: z.ZodString;
24
- phone: z.ZodString;
25
- cellPhone: z.ZodString;
26
- postalCode: z.ZodString;
27
- reference: z.ZodString;
28
- latitude: z.ZodNullable<z.ZodNumber>;
29
- longitude: z.ZodNullable<z.ZodNumber>;
30
- isDefault: z.ZodBoolean;
31
- } & {
32
- id: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>>;
33
- }, "strip", z.ZodTypeAny, {
34
- province: string;
35
- postalCode: string;
36
- district: string;
37
- phone: string;
38
- latitude: number | null;
39
- longitude: number | null;
40
- isDefault: boolean;
41
- reference: string;
42
- addressKey: string;
43
- countryIsoCode: string;
44
- addressLine: string;
45
- addressNumber: string;
46
- department: string;
47
- cellPhone: string;
48
- id?: string | undefined;
49
- }, {
50
- province: string;
51
- postalCode: string;
52
- district: string;
53
- phone: string;
54
- latitude: number | null;
55
- longitude: number | null;
56
- isDefault: boolean;
57
- reference: string;
58
- addressKey: string;
59
- countryIsoCode: string;
60
- addressLine: string;
61
- addressNumber: string;
62
- department: string;
63
- cellPhone: string;
64
- id?: string | number | undefined;
65
- }>, z.ZodObject<{
66
- id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
67
- }, "strip", z.ZodTypeAny, {
68
- id: string;
69
- }, {
70
- id: string | number;
71
- }>, z.ZodNull]>;
72
- type CustomerAddressMutationResponse = z.infer<typeof CustomerAddressMutationResponseSchema>;
73
- type CustomerAddressRequestOptions = {
74
- headers?: Record<string, string>;
75
- signal?: AbortSignal;
76
- };
77
- /** GET /v1/customer/me/addresses → proxy `customer/addresses` */
78
- declare function getCustomerAddresses(api: Api, options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
79
- /** POST /v1/customer/me/addresses → proxy `customer/addresses` */
80
- declare function createCustomerAddress(api: Api, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
81
- /** PUT /v1/customer/me/addresses/{id} → proxy `customer/addresses/{id}` */
82
- declare function updateCustomerAddress(api: Api, addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
83
- /** DELETE /v1/customer/me/addresses/{id} → proxy `customer/addresses/{id}` */
84
- declare function deleteCustomerAddress(api: Api, addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
85
-
86
- type CustomerRequestOptions = {
87
- headers?: Record<string, string>;
88
- signal?: AbortSignal;
89
- };
90
- /** POST /v1/customer/register → proxy `customer/register` (público). */
91
- declare function registerCustomer(api: Api, data: CustomerRegisterRequest, options?: CustomerRequestOptions): Promise<unknown>;
92
- /** GET /v1/customer/me → proxy `customer` */
93
- declare function getCustomerMe(api: Api, options?: CustomerRequestOptions): Promise<CustomerMe>;
94
- /** PATCH /v1/customer → proxy `customer` (204). */
95
- declare function patchCustomer(api: Api, data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
96
-
97
- type CustomerOrderRequestOptions = {
98
- headers?: Record<string, string>;
99
- signal?: AbortSignal;
100
- };
101
- /** GET /v1/customer/orders → proxy `customer/orders` */
102
- declare function getCustomerOrders(api: Api, options?: CustomerOrderRequestOptions): Promise<CustomerOrderList>;
103
- /** GET /v1/customer/orders/{orderId} → proxy `customer/orders/{orderId}` */
104
- declare function getCustomerOrder(api: Api, orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
105
-
106
- interface CreateClientOptions extends CreateApiOptions {
107
- /**
108
- * Dominio/slug de la tienda (header x-Store-Domain).
109
- * Debe venir de ecomiq.config.js (`config.domain`).
110
- * Acepta `marketplace`, `marketplace.ecomiq.app` o `marketplace.pe`.
111
- */
112
- domain: string;
113
- settingsCacheTtlMs?: number;
114
- }
115
- interface StorefrontClient extends Api {
116
- getSettings(): Promise<StorefrontSettings>;
117
- /** store.id desde settings (asegura cache). */
118
- getStoreId(): Promise<string>;
119
- /** GET /v1/collections */
120
- getCollections(): Promise<Collections>;
121
- /** GET /v1/collections/by-slug/:slug */
122
- getCollectionBySlug(slug: string): Promise<Collection>;
123
- /** GET /v1/pages/{slug} */
124
- getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
125
- /** Invalida el cache de settings. */
126
- clearCache(): void;
127
- getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
128
- /** GET product by slug con x-Store-Id. */
129
- getProductBySlug(slug: string, params?: ProductDetailParams): Promise<ProductDetail>;
130
- getRelatedProducts(params: RelatedProductsParams): Promise<ProductSummary[]>;
131
- autocompleteProducts(params: ProductAutocompleteParams): Promise<ProductSuggestion[]>;
132
- listProductReviews(params: ListProductReviewsParams): Promise<StorefrontReviews>;
133
- createProductReview(params: CreateProductReviewParams): Promise<StorefrontReview>;
134
- createCart(params: CreateCartParams): Promise<StorefrontCart>;
135
- getCart(params: GetCartParams): Promise<StorefrontCart>;
136
- addCartItem(params: AddCartItemParams): Promise<StorefrontCart>;
137
- updateCartItemQuantity(params: UpdateCartItemQuantityParams): Promise<StorefrontCart>;
138
- removeCartItem(params: RemoveCartItemParams): Promise<StorefrontCart>;
139
- /** GET /v1/carts/{id}/checkout */
140
- getCartCheckout(params: CartCheckoutReadParams): Promise<CartCheckoutReadResponse>;
141
- /** GET /v1/carts/{id}/shipping-options */
142
- getShippingOptions(params: GetShippingOptionsParams): Promise<ShippingOptionsResponse>;
143
- /** PUT /v1/carts/{id}/shipping-method */
144
- putCartShippingMethod(params: PutShippingMethodParams): Promise<StorefrontCart>;
145
- /** PATCH /v1/carts/{id}/buyer */
146
- patchCartBuyer(params: CartBuyerParams): Promise<StorefrontCart>;
147
- /** PATCH /v1/carts/{id}/addresses */
148
- patchCartAddresses(params: CartAddressesParams): Promise<StorefrontCart>;
149
- /** POST /v1/carts/{id}/checkout */
150
- checkoutCart(params: CartCheckoutParams): Promise<CartCheckoutResponse>;
151
- /** POST /v1/carts/{id}/payment-receipt */
152
- uploadPaymentReceipt(params: UploadPaymentReceiptParams): Promise<CartPaymentReceiptResponse>;
153
- /** POST /v1/carts/{id}/promotion-codes */
154
- addCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
155
- /** DELETE /v1/carts/{id}/promotion-codes/{code} */
156
- removeCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
157
- /** GET /v1/geo/countries */
158
- getCountries(): Promise<Countries>;
159
- /** GET /v1/geo/departments */
160
- getDepartments(params: GetDepartmentsParams): Promise<Departments>;
161
- /** GET /v1/geo/provinces */
162
- getProvinces(params: GetProvincesParams): Promise<Provinces>;
163
- /** GET /v1/geo/districts */
164
- getDistricts(params: GetDistrictsParams): Promise<Districts>;
165
- /** GET customer addresses (requiere Authorization Bearer). */
166
- getCustomerAddresses(options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
167
- /** POST customer address. */
168
- createCustomerAddress(data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
169
- /** PUT customer address. */
170
- updateCustomerAddress(addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
171
- /** DELETE customer address. */
172
- deleteCustomerAddress(addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
173
- /** GET /v1/customer/me */
174
- getCustomerMe(options?: CustomerRequestOptions): Promise<CustomerMe>;
175
- /** PATCH /v1/customer */
176
- patchCustomer(data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
177
- /** GET /v1/customer/orders */
178
- getCustomerOrders(options?: CustomerOrderRequestOptions): Promise<CustomerOrderList>;
179
- /** GET /v1/customer/orders/{orderId} */
180
- getCustomerOrder(orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
181
- }
182
- /**
183
- * Crea el cliente storefront de bajo nivel (requiere domain).
184
- * En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el domain del config.
185
- *
186
- * ```ts
187
- * const api = createClient({ domain: 'marketplace' })
188
- * const collections = await api.getCollections()
189
- * ```
190
- */
191
- declare function createClient(options: CreateClientOptions): StorefrontClient;
192
- /** @deprecated Usa createClient. Alias de compatibilidad con el plan. */
193
- declare const createStorefrontClient: typeof createClient;
194
-
195
- export { type CreateClientOptions as C, type StorefrontClient as S, type CustomerAddressMutationResponse as a, CustomerAddressMutationResponseSchema as b, type CustomerAddressRequestOptions as c, type CustomerOrderRequestOptions as d, type CustomerRequestOptions as e, createClient as f, createCustomerAddress as g, createStorefrontClient as h, deleteCustomerAddress as i, getCustomerAddresses as j, getCustomerMe as k, getCustomerOrder as l, getCustomerOrders as m, patchCustomer as p, registerCustomer as r, updateCustomerAddress as u };
@@ -1,195 +0,0 @@
1
- import { Api, CreateApiOptions } from './api.cjs';
2
- import { Collections, Collection } from './models/collections.cjs';
3
- import { ProductsParamsInput, ProductsResponse, ProductDetailParams, ProductDetail, RelatedProductsParams, ProductSummary } from './models/products.cjs';
4
- import { ProductAutocompleteParams, ProductSuggestion } from './models/search.cjs';
5
- import { ListProductReviewsParams, StorefrontReviews, CreateProductReviewParams, StorefrontReview } from './models/storefront-reviews.cjs';
6
- import { CreateCartParams, StorefrontCart, GetCartParams, AddCartItemParams, UpdateCartItemQuantityParams, RemoveCartItemParams } from './models/storefront-cart.cjs';
7
- import { CartCheckoutReadParams, CartCheckoutReadResponse, GetShippingOptionsParams, ShippingOptionsResponse, PutShippingMethodParams, CartBuyerParams, CartAddressesParams, CartCheckoutParams, CartCheckoutResponse, UploadPaymentReceiptParams, CartPaymentReceiptResponse, CartPromotionCodeParams } from './models/storefront-checkout.cjs';
8
- import { Countries, GetDepartmentsParams, Departments, GetProvincesParams, Provinces, GetDistrictsParams, Districts } from './models/geo.cjs';
9
- import { CustomerAddressUpsertInput, CustomerAddresses } from './models/customer-address.cjs';
10
- import { z } from 'zod';
11
- import { CustomerMe, CustomerProfilePatch, CustomerRegisterRequest } from './models/customer-profile.cjs';
12
- import { CustomerOrderDetail, CustomerOrderList } from './models/customer-order.cjs';
13
- import { StorefrontSettings, CmsPageDetailsDto } from './models/settings.cjs';
14
-
15
- /** POST/PUT a menudo responde solo `{ id }` (no el body completo). */
16
- declare const CustomerAddressMutationResponseSchema: z.ZodUnion<[z.ZodObject<{
17
- addressKey: z.ZodString;
18
- countryIsoCode: z.ZodString;
19
- addressLine: z.ZodString;
20
- addressNumber: z.ZodString;
21
- department: z.ZodString;
22
- province: z.ZodString;
23
- district: z.ZodString;
24
- phone: z.ZodString;
25
- cellPhone: z.ZodString;
26
- postalCode: z.ZodString;
27
- reference: z.ZodString;
28
- latitude: z.ZodNullable<z.ZodNumber>;
29
- longitude: z.ZodNullable<z.ZodNumber>;
30
- isDefault: z.ZodBoolean;
31
- } & {
32
- id: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>>;
33
- }, "strip", z.ZodTypeAny, {
34
- province: string;
35
- postalCode: string;
36
- district: string;
37
- phone: string;
38
- latitude: number | null;
39
- longitude: number | null;
40
- isDefault: boolean;
41
- reference: string;
42
- addressKey: string;
43
- countryIsoCode: string;
44
- addressLine: string;
45
- addressNumber: string;
46
- department: string;
47
- cellPhone: string;
48
- id?: string | undefined;
49
- }, {
50
- province: string;
51
- postalCode: string;
52
- district: string;
53
- phone: string;
54
- latitude: number | null;
55
- longitude: number | null;
56
- isDefault: boolean;
57
- reference: string;
58
- addressKey: string;
59
- countryIsoCode: string;
60
- addressLine: string;
61
- addressNumber: string;
62
- department: string;
63
- cellPhone: string;
64
- id?: string | number | undefined;
65
- }>, z.ZodObject<{
66
- id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
67
- }, "strip", z.ZodTypeAny, {
68
- id: string;
69
- }, {
70
- id: string | number;
71
- }>, z.ZodNull]>;
72
- type CustomerAddressMutationResponse = z.infer<typeof CustomerAddressMutationResponseSchema>;
73
- type CustomerAddressRequestOptions = {
74
- headers?: Record<string, string>;
75
- signal?: AbortSignal;
76
- };
77
- /** GET /v1/customer/me/addresses → proxy `customer/addresses` */
78
- declare function getCustomerAddresses(api: Api, options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
79
- /** POST /v1/customer/me/addresses → proxy `customer/addresses` */
80
- declare function createCustomerAddress(api: Api, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
81
- /** PUT /v1/customer/me/addresses/{id} → proxy `customer/addresses/{id}` */
82
- declare function updateCustomerAddress(api: Api, addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
83
- /** DELETE /v1/customer/me/addresses/{id} → proxy `customer/addresses/{id}` */
84
- declare function deleteCustomerAddress(api: Api, addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
85
-
86
- type CustomerRequestOptions = {
87
- headers?: Record<string, string>;
88
- signal?: AbortSignal;
89
- };
90
- /** POST /v1/customer/register → proxy `customer/register` (público). */
91
- declare function registerCustomer(api: Api, data: CustomerRegisterRequest, options?: CustomerRequestOptions): Promise<unknown>;
92
- /** GET /v1/customer/me → proxy `customer` */
93
- declare function getCustomerMe(api: Api, options?: CustomerRequestOptions): Promise<CustomerMe>;
94
- /** PATCH /v1/customer → proxy `customer` (204). */
95
- declare function patchCustomer(api: Api, data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
96
-
97
- type CustomerOrderRequestOptions = {
98
- headers?: Record<string, string>;
99
- signal?: AbortSignal;
100
- };
101
- /** GET /v1/customer/orders → proxy `customer/orders` */
102
- declare function getCustomerOrders(api: Api, options?: CustomerOrderRequestOptions): Promise<CustomerOrderList>;
103
- /** GET /v1/customer/orders/{orderId} → proxy `customer/orders/{orderId}` */
104
- declare function getCustomerOrder(api: Api, orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
105
-
106
- interface CreateClientOptions extends CreateApiOptions {
107
- /**
108
- * Dominio/slug de la tienda (header x-Store-Domain).
109
- * Debe venir de ecomiq.config.js (`config.domain`).
110
- * Acepta `marketplace`, `marketplace.ecomiq.app` o `marketplace.pe`.
111
- */
112
- domain: string;
113
- settingsCacheTtlMs?: number;
114
- }
115
- interface StorefrontClient extends Api {
116
- getSettings(): Promise<StorefrontSettings>;
117
- /** store.id desde settings (asegura cache). */
118
- getStoreId(): Promise<string>;
119
- /** GET /v1/collections */
120
- getCollections(): Promise<Collections>;
121
- /** GET /v1/collections/by-slug/:slug */
122
- getCollectionBySlug(slug: string): Promise<Collection>;
123
- /** GET /v1/pages/{slug} */
124
- getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
125
- /** Invalida el cache de settings. */
126
- clearCache(): void;
127
- getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
128
- /** GET product by slug con x-Store-Id. */
129
- getProductBySlug(slug: string, params?: ProductDetailParams): Promise<ProductDetail>;
130
- getRelatedProducts(params: RelatedProductsParams): Promise<ProductSummary[]>;
131
- autocompleteProducts(params: ProductAutocompleteParams): Promise<ProductSuggestion[]>;
132
- listProductReviews(params: ListProductReviewsParams): Promise<StorefrontReviews>;
133
- createProductReview(params: CreateProductReviewParams): Promise<StorefrontReview>;
134
- createCart(params: CreateCartParams): Promise<StorefrontCart>;
135
- getCart(params: GetCartParams): Promise<StorefrontCart>;
136
- addCartItem(params: AddCartItemParams): Promise<StorefrontCart>;
137
- updateCartItemQuantity(params: UpdateCartItemQuantityParams): Promise<StorefrontCart>;
138
- removeCartItem(params: RemoveCartItemParams): Promise<StorefrontCart>;
139
- /** GET /v1/carts/{id}/checkout */
140
- getCartCheckout(params: CartCheckoutReadParams): Promise<CartCheckoutReadResponse>;
141
- /** GET /v1/carts/{id}/shipping-options */
142
- getShippingOptions(params: GetShippingOptionsParams): Promise<ShippingOptionsResponse>;
143
- /** PUT /v1/carts/{id}/shipping-method */
144
- putCartShippingMethod(params: PutShippingMethodParams): Promise<StorefrontCart>;
145
- /** PATCH /v1/carts/{id}/buyer */
146
- patchCartBuyer(params: CartBuyerParams): Promise<StorefrontCart>;
147
- /** PATCH /v1/carts/{id}/addresses */
148
- patchCartAddresses(params: CartAddressesParams): Promise<StorefrontCart>;
149
- /** POST /v1/carts/{id}/checkout */
150
- checkoutCart(params: CartCheckoutParams): Promise<CartCheckoutResponse>;
151
- /** POST /v1/carts/{id}/payment-receipt */
152
- uploadPaymentReceipt(params: UploadPaymentReceiptParams): Promise<CartPaymentReceiptResponse>;
153
- /** POST /v1/carts/{id}/promotion-codes */
154
- addCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
155
- /** DELETE /v1/carts/{id}/promotion-codes/{code} */
156
- removeCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
157
- /** GET /v1/geo/countries */
158
- getCountries(): Promise<Countries>;
159
- /** GET /v1/geo/departments */
160
- getDepartments(params: GetDepartmentsParams): Promise<Departments>;
161
- /** GET /v1/geo/provinces */
162
- getProvinces(params: GetProvincesParams): Promise<Provinces>;
163
- /** GET /v1/geo/districts */
164
- getDistricts(params: GetDistrictsParams): Promise<Districts>;
165
- /** GET customer addresses (requiere Authorization Bearer). */
166
- getCustomerAddresses(options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
167
- /** POST customer address. */
168
- createCustomerAddress(data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
169
- /** PUT customer address. */
170
- updateCustomerAddress(addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressMutationResponse>;
171
- /** DELETE customer address. */
172
- deleteCustomerAddress(addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
173
- /** GET /v1/customer/me */
174
- getCustomerMe(options?: CustomerRequestOptions): Promise<CustomerMe>;
175
- /** PATCH /v1/customer */
176
- patchCustomer(data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
177
- /** GET /v1/customer/orders */
178
- getCustomerOrders(options?: CustomerOrderRequestOptions): Promise<CustomerOrderList>;
179
- /** GET /v1/customer/orders/{orderId} */
180
- getCustomerOrder(orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
181
- }
182
- /**
183
- * Crea el cliente storefront de bajo nivel (requiere domain).
184
- * En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el domain del config.
185
- *
186
- * ```ts
187
- * const api = createClient({ domain: 'marketplace' })
188
- * const collections = await api.getCollections()
189
- * ```
190
- */
191
- declare function createClient(options: CreateClientOptions): StorefrontClient;
192
- /** @deprecated Usa createClient. Alias de compatibilidad con el plan. */
193
- declare const createStorefrontClient: typeof createClient;
194
-
195
- export { type CreateClientOptions as C, type StorefrontClient as S, type CustomerAddressMutationResponse as a, CustomerAddressMutationResponseSchema as b, type CustomerAddressRequestOptions as c, type CustomerOrderRequestOptions as d, type CustomerRequestOptions as e, createClient as f, createCustomerAddress as g, createStorefrontClient as h, deleteCustomerAddress as i, getCustomerAddresses as j, getCustomerMe as k, getCustomerOrder as l, getCustomerOrders as m, patchCustomer as p, registerCustomer as r, updateCustomerAddress as u };