@ecomiq/core 0.1.9 → 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 -1676
  9. package/dist/client.d.cts +156 -15
  10. package/dist/client.d.ts +156 -15
  11. package/dist/client.js +500 -1675
  12. package/dist/index.cjs +333 -2092
  13. package/dist/index.d.cts +53 -1127
  14. package/dist/index.d.ts +53 -1127
  15. package/dist/index.js +52 -1895
  16. package/dist/libs/bounded-read-cache-Abmb5VnJ.js +41 -0
  17. package/dist/libs/bounded-read-cache-D4644LJo.cjs +41 -0
  18. package/dist/libs/catalog-link-key-B7l5KZsF.js +9 -0
  19. package/dist/libs/catalog-link-key-CZTHJBGD.cjs +9 -0
  20. package/dist/libs/catalog-link-key.d.cts +2 -0
  21. package/dist/libs/catalog-link-key.d.ts +2 -0
  22. package/dist/libs/graphql-_6Y8lR_Q.js +49 -0
  23. package/dist/libs/graphql-selection-Cj51WkJn.cjs +21 -0
  24. package/dist/libs/graphql-selection-H1RMh6VD.js +21 -0
  25. package/dist/libs/graphql-selection.d.cts +3 -0
  26. package/dist/libs/graphql-selection.d.ts +3 -0
  27. package/dist/libs/graphql-wJH7HaQU.cjs +50 -0
  28. package/dist/libs/graphql.d.cts +24 -0
  29. package/dist/libs/graphql.d.ts +24 -0
  30. package/dist/models/amounts-cKBCecl7.js +5 -0
  31. package/dist/models/amounts-lmg89eJQ.cjs +4 -0
  32. package/dist/models/articles-C-4JvT2Z.js +27 -0
  33. package/dist/models/articles-xHCXLKDK.cjs +30 -0
  34. package/dist/models/articles.d.cts +46 -0
  35. package/dist/models/articles.d.ts +46 -0
  36. package/dist/models/catalog-links-BzJeyBy4.js +80 -0
  37. package/dist/models/catalog-links-c4LADGf_.cjs +88 -0
  38. package/dist/models/catalog-links.d.cts +39 -0
  39. package/dist/models/catalog-links.d.ts +39 -0
  40. package/dist/models/categories-CKkJY8_P.js +42 -0
  41. package/dist/models/categories-DZ5i5kwi.cjs +45 -0
  42. package/dist/models/categories.d.cts +54 -0
  43. package/dist/models/categories.d.ts +54 -0
  44. package/dist/models/collections.cjs +13 -22
  45. package/dist/models/collections.d.cts +23 -56
  46. package/dist/models/collections.d.ts +23 -56
  47. package/dist/models/collections.js +12 -20
  48. package/dist/models/complaint-book-D5INpuI2.cjs +64 -0
  49. package/dist/models/complaint-book-QpQZe7Xl.js +58 -0
  50. package/dist/models/complaint-book.d.cts +71 -0
  51. package/dist/models/complaint-book.d.ts +71 -0
  52. package/dist/models/customer-address.cjs +39 -38
  53. package/dist/models/customer-address.d.cts +59 -158
  54. package/dist/models/customer-address.d.ts +59 -158
  55. package/dist/models/customer-address.js +38 -36
  56. package/dist/models/customer-order.cjs +181 -142
  57. package/dist/models/customer-order.d.cts +430 -858
  58. package/dist/models/customer-order.d.ts +430 -858
  59. package/dist/models/customer-order.js +178 -141
  60. package/dist/models/customer-profile.cjs +121 -118
  61. package/dist/models/customer-profile.d.cts +89 -174
  62. package/dist/models/customer-profile.d.ts +89 -174
  63. package/dist/models/customer-profile.js +121 -116
  64. package/dist/models/customer-registration-C13knqyv.js +28 -0
  65. package/dist/models/customer-registration-EZ0yZgGr.cjs +31 -0
  66. package/dist/models/customer-registration.d.cts +66 -0
  67. package/dist/models/customer-registration.d.ts +66 -0
  68. package/dist/models/customer-session-BiX0TXhO.js +41 -0
  69. package/dist/models/customer-session-JeQiC8Yx.cjs +45 -0
  70. package/dist/models/customer-session.d.cts +61 -0
  71. package/dist/models/customer-session.d.ts +61 -0
  72. package/dist/models/geo.cjs +52 -49
  73. package/dist/models/geo.d.cts +141 -270
  74. package/dist/models/geo.d.ts +141 -270
  75. package/dist/models/geo.js +51 -47
  76. package/dist/models/ids.cjs +8 -11
  77. package/dist/models/ids.d.cts +7 -10
  78. package/dist/models/ids.d.ts +7 -10
  79. package/dist/models/ids.js +7 -9
  80. package/dist/models/order-draft-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 +215 -194
  97. package/dist/models/products.d.cts +612 -1354
  98. package/dist/models/products.d.ts +612 -1354
  99. package/dist/models/products.js +211 -187
  100. package/dist/models/search.cjs +13 -23
  101. package/dist/models/search.d.cts +21 -51
  102. package/dist/models/search.d.ts +21 -51
  103. package/dist/models/search.js +12 -21
  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 -236
  109. package/dist/models/settings.d.cts +853 -6940
  110. package/dist/models/settings.d.ts +853 -6940
  111. package/dist/models/settings.js +213 -239
  112. package/dist/models/storefront-cart.cjs +144 -118
  113. package/dist/models/storefront-cart.d.cts +246 -706
  114. package/dist/models/storefront-cart.d.ts +246 -706
  115. package/dist/models/storefront-cart.js +141 -117
  116. package/dist/models/storefront-checkout.cjs +212 -297
  117. package/dist/models/storefront-checkout.d.cts +654 -2449
  118. package/dist/models/storefront-checkout.d.ts +654 -2449
  119. package/dist/models/storefront-checkout.js +208 -297
  120. package/dist/models/storefront-reviews.cjs +58 -43
  121. package/dist/models/storefront-reviews.d.cts +71 -139
  122. package/dist/models/storefront-reviews.d.ts +71 -139
  123. package/dist/models/storefront-reviews.js +55 -42
  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-Ba1r_uiO.d.ts +0 -195
  246. package/dist/client-Cqcnv2tC.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,124 +1,129 @@
1
- import { z } from 'zod';
2
-
1
+ import { EntityIdSchema } from "./ids.js";
2
+ import { CustomerAddressSchema } from "./customer-address.js";
3
+ import { z } from "zod";
3
4
  // src/models/customer-profile.ts
4
- var EntityIdSchema = z.string().min(1, "Expected resource id");
5
- z.string().min(1).max(32).regex(/^[A-Za-z0-9_-]+$/, "Expected cart token");
6
- EntityIdSchema.nullable();
7
- EntityIdSchema.optional();
8
-
9
- // src/models/customer-profile.ts
10
- var DEFAULT_COUNTRY_CODE = "PE";
11
- var CustomerRegisterRequestSchema = z.object({
12
- email: z.string().email(),
13
- firstName: z.string().trim().min(1),
14
- lastName: z.string().trim().min(1),
15
- countryIsoCode: z.string().trim().length(2),
16
- password: z.string().min(1),
17
- phone: z.string().trim().min(1).optional()
5
+ /** Cuerpo de `PATCH /v1/customer` (proxy `customer`). */
6
+ const CustomerProfilePatchSchema = z.object({
7
+ firstName: z.string().trim().max(100),
8
+ lastName: z.string().trim().max(100),
9
+ phone: z.string().trim(),
10
+ identificationNumber: z.string().nullable(),
11
+ identificationType: z.string().nullable(),
12
+ identificationCountryCode: z.string().length(2).nullish(),
13
+ entityName: z.string().nullable(),
14
+ entityIdentificationNumber: z.string().nullable(),
15
+ gender: z.string().nullable(),
16
+ role: z.string().nullable(),
17
+ companyName: z.string().nullable(),
18
+ dateOfBirth: z.string().nullable(),
19
+ consent: z.boolean(),
20
+ countryIsoCode: z.string().trim().length(2)
18
21
  });
19
- var CustomerProfilePatchSchema = z.object({
20
- firstName: z.string().trim().min(1),
21
- lastName: z.string().trim().min(1),
22
- phone: z.string().trim(),
23
- identificationNumber: z.string().nullable(),
24
- identificationType: z.string().nullable(),
25
- entityName: z.string().nullable(),
26
- entityIdentificationNumber: z.string().nullable(),
27
- gender: z.string().nullable(),
28
- role: z.string().nullable(),
29
- companyName: z.string().nullable(),
30
- dateOfBirth: z.string().nullable(),
31
- consent: z.boolean(),
32
- countryIsoCode: z.string().trim().length(2)
22
+ /** Perfil mostrado en cuenta (subset de GET customer). */
23
+ const CustomerProfileSchema = z.object({
24
+ firstName: z.string(),
25
+ lastName: z.string(),
26
+ phone: z.string(),
27
+ email: z.string(),
28
+ identificationNumber: z.string().nullable(),
29
+ identificationType: z.string().nullable(),
30
+ identificationCountryCode: z.string().length(2).nullish(),
31
+ countryIsoCode: z.string(),
32
+ consent: z.boolean(),
33
+ entityName: z.string().nullable(),
34
+ entityIdentificationNumber: z.string().nullable(),
35
+ gender: z.string().nullable(),
36
+ role: z.string().nullable(),
37
+ companyName: z.string().nullable(),
38
+ dateOfBirth: z.string().nullable()
33
39
  });
34
- var CustomerProfileSchema = z.object({
35
- firstName: z.string(),
36
- lastName: z.string(),
37
- phone: z.string(),
38
- email: z.string().email(),
39
- identificationNumber: z.string().nullable(),
40
- identificationType: z.string().nullable(),
41
- countryIsoCode: z.string(),
42
- consent: z.boolean(),
43
- entityName: z.string().nullable(),
44
- entityIdentificationNumber: z.string().nullable(),
45
- gender: z.string().nullable(),
46
- role: z.string().nullable(),
47
- companyName: z.string().nullable(),
48
- dateOfBirth: z.string().nullable()
40
+ /** Respuesta de `GET /v1/customer/me` (proxy `customer`). */
41
+ const CustomerMeSchema = z.object({
42
+ id: EntityIdSchema,
43
+ storeId: EntityIdSchema,
44
+ email: z.string().nullable(),
45
+ firstName: z.string().nullable(),
46
+ lastName: z.string().nullable(),
47
+ phone: z.string().nullable(),
48
+ identificationNumber: z.string().nullable(),
49
+ identificationType: z.string().nullable(),
50
+ identificationCountryCode: z.string().length(2).nullish(),
51
+ entityName: z.string().nullable(),
52
+ dateOfBirth: z.string().nullable(),
53
+ gender: z.string(),
54
+ countryIsoCode: z.string().nullable(),
55
+ role: z.string().nullable(),
56
+ companyName: z.string().nullable(),
57
+ consent: z.boolean(),
58
+ userId: z.string().uuid().nullable(),
59
+ customerType: z.string(),
60
+ status: z.string(),
61
+ isVerified: z.boolean(),
62
+ entityIdentificationNumber: z.string().nullable(),
63
+ defaultAddressId: EntityIdSchema.nullable(),
64
+ metadata: z.record(z.string(), z.unknown()).nullable(),
65
+ totalOrders: z.number().int().nonnegative(),
66
+ avgOrders: z.number(),
67
+ lastOrderId: EntityIdSchema.nullable(),
68
+ lastOrderDate: z.string().nullable(),
69
+ loyaltyPoints: z.number().int(),
70
+ addresses: z.array(CustomerAddressSchema),
71
+ createdOn: z.string(),
72
+ updatedOn: z.string().nullable()
49
73
  });
50
- var nullableString = z.string().nullable().optional().transform((v) => v ?? null);
51
- var CustomerMeSchema = z.object({
52
- id: EntityIdSchema,
53
- storeId: EntityIdSchema.optional(),
54
- email: z.string().email(),
55
- firstName: z.string(),
56
- lastName: z.string(),
57
- phone: z.union([z.string(), z.null()]).optional().transform((v) => v ?? ""),
58
- identificationNumber: nullableString,
59
- identificationType: nullableString,
60
- entityName: nullableString,
61
- entityIdentificationNumber: nullableString,
62
- gender: nullableString,
63
- role: nullableString,
64
- companyName: nullableString,
65
- dateOfBirth: nullableString,
66
- countryIsoCode: z.string().optional().transform((v) => v?.trim().length === 2 ? v.trim() : DEFAULT_COUNTRY_CODE),
67
- consent: z.boolean().optional().transform((v) => v ?? false)
68
- }).passthrough();
69
- function customerMeToProfile(me) {
70
- return CustomerProfileSchema.parse({
71
- firstName: me.firstName,
72
- lastName: me.lastName,
73
- phone: me.phone,
74
- email: me.email,
75
- identificationNumber: me.identificationNumber,
76
- identificationType: me.identificationType,
77
- countryIsoCode: me.countryIsoCode,
78
- consent: me.consent,
79
- entityName: me.entityName,
80
- entityIdentificationNumber: me.entityIdentificationNumber,
81
- gender: me.gender,
82
- role: me.role,
83
- companyName: me.companyName,
84
- dateOfBirth: me.dateOfBirth
85
- });
74
+ function customerMeToProfile(me, countryCode) {
75
+ return CustomerProfileSchema.parse({
76
+ firstName: me.firstName ?? "",
77
+ lastName: me.lastName ?? "",
78
+ phone: me.phone ?? "",
79
+ email: me.email ?? "",
80
+ identificationNumber: me.identificationNumber,
81
+ identificationType: me.identificationType,
82
+ identificationCountryCode: me.identificationCountryCode,
83
+ countryIsoCode: me.countryIsoCode ?? countryCode,
84
+ consent: me.consent,
85
+ entityName: me.entityName,
86
+ entityIdentificationNumber: me.entityIdentificationNumber,
87
+ gender: me.gender,
88
+ role: me.role,
89
+ companyName: me.companyName,
90
+ dateOfBirth: me.dateOfBirth
91
+ });
86
92
  }
87
- function customerMeToProfilePatch(me) {
88
- return CustomerProfilePatchSchema.parse({
89
- firstName: me.firstName,
90
- lastName: me.lastName,
91
- phone: me.phone,
92
- identificationNumber: me.identificationNumber,
93
- identificationType: me.identificationType,
94
- entityName: me.entityName,
95
- entityIdentificationNumber: me.entityIdentificationNumber,
96
- gender: me.gender,
97
- role: me.role,
98
- companyName: me.companyName,
99
- dateOfBirth: me.dateOfBirth,
100
- consent: me.consent,
101
- countryIsoCode: me.countryIsoCode || DEFAULT_COUNTRY_CODE
102
- });
93
+ function customerMeToProfilePatch(me, countryCode) {
94
+ return CustomerProfilePatchSchema.parse({
95
+ firstName: me.firstName ?? "",
96
+ lastName: me.lastName ?? "",
97
+ phone: me.phone ?? "",
98
+ identificationNumber: me.identificationNumber,
99
+ identificationType: me.identificationType,
100
+ identificationCountryCode: me.identificationCountryCode,
101
+ entityName: me.entityName,
102
+ entityIdentificationNumber: me.entityIdentificationNumber,
103
+ gender: me.gender,
104
+ role: me.role,
105
+ companyName: me.companyName,
106
+ dateOfBirth: me.dateOfBirth,
107
+ consent: me.consent,
108
+ countryIsoCode: me.countryIsoCode ?? countryCode
109
+ });
103
110
  }
104
111
  function customerProfileToPatch(profile) {
105
- return CustomerProfilePatchSchema.parse({
106
- firstName: profile.firstName,
107
- lastName: profile.lastName,
108
- phone: profile.phone,
109
- identificationNumber: profile.identificationNumber,
110
- identificationType: profile.identificationType,
111
- entityName: profile.entityName,
112
- entityIdentificationNumber: profile.entityIdentificationNumber,
113
- gender: profile.gender,
114
- role: profile.role,
115
- companyName: profile.companyName,
116
- dateOfBirth: profile.dateOfBirth,
117
- consent: profile.consent,
118
- countryIsoCode: profile.countryIsoCode || DEFAULT_COUNTRY_CODE
119
- });
112
+ return CustomerProfilePatchSchema.parse({
113
+ firstName: profile.firstName,
114
+ lastName: profile.lastName,
115
+ phone: profile.phone,
116
+ identificationNumber: profile.identificationNumber,
117
+ identificationType: profile.identificationType,
118
+ identificationCountryCode: profile.identificationCountryCode,
119
+ entityName: profile.entityName,
120
+ entityIdentificationNumber: profile.entityIdentificationNumber,
121
+ gender: profile.gender,
122
+ role: profile.role,
123
+ companyName: profile.companyName,
124
+ dateOfBirth: profile.dateOfBirth,
125
+ consent: profile.consent,
126
+ countryIsoCode: profile.countryIsoCode
127
+ });
120
128
  }
121
-
122
- export { CustomerMeSchema, CustomerProfilePatchSchema, CustomerProfileSchema, CustomerRegisterRequestSchema, customerMeToProfile, customerMeToProfilePatch, customerProfileToPatch };
123
- //# sourceMappingURL=customer-profile.js.map
124
- //# sourceMappingURL=customer-profile.js.map
129
+ export { CustomerMeSchema, CustomerProfilePatchSchema, CustomerProfileSchema, customerMeToProfile, customerMeToProfilePatch, customerProfileToPatch };
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ // src/models/customer-registration.ts
3
+ const CustomerRegistrationFieldModeSchema = z.enum([
4
+ "hidden",
5
+ "optional",
6
+ "required"
7
+ ]);
8
+ const CustomerRegistrationFieldsSchema = z.object({
9
+ firstName: CustomerRegistrationFieldModeSchema,
10
+ lastName: CustomerRegistrationFieldModeSchema,
11
+ phone: CustomerRegistrationFieldModeSchema,
12
+ dateOfBirth: CustomerRegistrationFieldModeSchema
13
+ });
14
+ const CustomerRegistrationSchema = z.object({
15
+ fields: CustomerRegistrationFieldsSchema,
16
+ firstName: z.string().nullable(),
17
+ lastName: z.string().nullable(),
18
+ phone: z.string().nullable(),
19
+ dateOfBirth: z.string().nullable(),
20
+ requiresCompletion: z.boolean()
21
+ });
22
+ const CustomerRegistrationInputSchema = z.object({
23
+ firstName: z.string().trim().max(100).nullable().optional(),
24
+ lastName: z.string().trim().max(100).nullable().optional(),
25
+ phone: z.string().trim().max(20).nullable().optional(),
26
+ dateOfBirth: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional()
27
+ });
28
+ export { CustomerRegistrationFieldModeSchema, CustomerRegistrationFieldsSchema, CustomerRegistrationInputSchema, CustomerRegistrationSchema };
@@ -0,0 +1,31 @@
1
+ let zod = require("zod");
2
+ // src/models/customer-registration.ts
3
+ const CustomerRegistrationFieldModeSchema = zod.z.enum([
4
+ "hidden",
5
+ "optional",
6
+ "required"
7
+ ]);
8
+ const CustomerRegistrationFieldsSchema = zod.z.object({
9
+ firstName: CustomerRegistrationFieldModeSchema,
10
+ lastName: CustomerRegistrationFieldModeSchema,
11
+ phone: CustomerRegistrationFieldModeSchema,
12
+ dateOfBirth: CustomerRegistrationFieldModeSchema
13
+ });
14
+ const CustomerRegistrationSchema = zod.z.object({
15
+ fields: CustomerRegistrationFieldsSchema,
16
+ firstName: zod.z.string().nullable(),
17
+ lastName: zod.z.string().nullable(),
18
+ phone: zod.z.string().nullable(),
19
+ dateOfBirth: zod.z.string().nullable(),
20
+ requiresCompletion: zod.z.boolean()
21
+ });
22
+ const CustomerRegistrationInputSchema = zod.z.object({
23
+ firstName: zod.z.string().trim().max(100).nullable().optional(),
24
+ lastName: zod.z.string().trim().max(100).nullable().optional(),
25
+ phone: zod.z.string().trim().max(20).nullable().optional(),
26
+ dateOfBirth: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional()
27
+ });
28
+ exports.CustomerRegistrationFieldModeSchema = CustomerRegistrationFieldModeSchema;
29
+ exports.CustomerRegistrationFieldsSchema = CustomerRegistrationFieldsSchema;
30
+ exports.CustomerRegistrationInputSchema = CustomerRegistrationInputSchema;
31
+ exports.CustomerRegistrationSchema = CustomerRegistrationSchema;
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ export declare const CustomerRegistrationFieldModeSchema: z.ZodEnum<{
3
+ hidden: "hidden";
4
+ optional: "optional";
5
+ required: "required";
6
+ }>;
7
+ export declare const CustomerRegistrationFieldsSchema: z.ZodObject<{
8
+ firstName: z.ZodEnum<{
9
+ hidden: "hidden";
10
+ optional: "optional";
11
+ required: "required";
12
+ }>;
13
+ lastName: z.ZodEnum<{
14
+ hidden: "hidden";
15
+ optional: "optional";
16
+ required: "required";
17
+ }>;
18
+ phone: z.ZodEnum<{
19
+ hidden: "hidden";
20
+ optional: "optional";
21
+ required: "required";
22
+ }>;
23
+ dateOfBirth: z.ZodEnum<{
24
+ hidden: "hidden";
25
+ optional: "optional";
26
+ required: "required";
27
+ }>;
28
+ }, z.core.$strip>;
29
+ export declare const CustomerRegistrationSchema: z.ZodObject<{
30
+ fields: z.ZodObject<{
31
+ firstName: z.ZodEnum<{
32
+ hidden: "hidden";
33
+ optional: "optional";
34
+ required: "required";
35
+ }>;
36
+ lastName: z.ZodEnum<{
37
+ hidden: "hidden";
38
+ optional: "optional";
39
+ required: "required";
40
+ }>;
41
+ phone: z.ZodEnum<{
42
+ hidden: "hidden";
43
+ optional: "optional";
44
+ required: "required";
45
+ }>;
46
+ dateOfBirth: z.ZodEnum<{
47
+ hidden: "hidden";
48
+ optional: "optional";
49
+ required: "required";
50
+ }>;
51
+ }, z.core.$strip>;
52
+ firstName: z.ZodNullable<z.ZodString>;
53
+ lastName: z.ZodNullable<z.ZodString>;
54
+ phone: z.ZodNullable<z.ZodString>;
55
+ dateOfBirth: z.ZodNullable<z.ZodString>;
56
+ requiresCompletion: z.ZodBoolean;
57
+ }, z.core.$strip>;
58
+ export declare const CustomerRegistrationInputSchema: z.ZodObject<{
59
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ dateOfBirth: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ }, z.core.$strip>;
64
+ export type CustomerRegistration = z.infer<typeof CustomerRegistrationSchema>;
65
+ export type CustomerRegistrationInput = z.infer<typeof CustomerRegistrationInputSchema>;
66
+ export type CustomerRegistrationFields = z.infer<typeof CustomerRegistrationFieldsSchema>;
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ export declare const CustomerRegistrationFieldModeSchema: z.ZodEnum<{
3
+ hidden: "hidden";
4
+ optional: "optional";
5
+ required: "required";
6
+ }>;
7
+ export declare const CustomerRegistrationFieldsSchema: z.ZodObject<{
8
+ firstName: z.ZodEnum<{
9
+ hidden: "hidden";
10
+ optional: "optional";
11
+ required: "required";
12
+ }>;
13
+ lastName: z.ZodEnum<{
14
+ hidden: "hidden";
15
+ optional: "optional";
16
+ required: "required";
17
+ }>;
18
+ phone: z.ZodEnum<{
19
+ hidden: "hidden";
20
+ optional: "optional";
21
+ required: "required";
22
+ }>;
23
+ dateOfBirth: z.ZodEnum<{
24
+ hidden: "hidden";
25
+ optional: "optional";
26
+ required: "required";
27
+ }>;
28
+ }, z.core.$strip>;
29
+ export declare const CustomerRegistrationSchema: z.ZodObject<{
30
+ fields: z.ZodObject<{
31
+ firstName: z.ZodEnum<{
32
+ hidden: "hidden";
33
+ optional: "optional";
34
+ required: "required";
35
+ }>;
36
+ lastName: z.ZodEnum<{
37
+ hidden: "hidden";
38
+ optional: "optional";
39
+ required: "required";
40
+ }>;
41
+ phone: z.ZodEnum<{
42
+ hidden: "hidden";
43
+ optional: "optional";
44
+ required: "required";
45
+ }>;
46
+ dateOfBirth: z.ZodEnum<{
47
+ hidden: "hidden";
48
+ optional: "optional";
49
+ required: "required";
50
+ }>;
51
+ }, z.core.$strip>;
52
+ firstName: z.ZodNullable<z.ZodString>;
53
+ lastName: z.ZodNullable<z.ZodString>;
54
+ phone: z.ZodNullable<z.ZodString>;
55
+ dateOfBirth: z.ZodNullable<z.ZodString>;
56
+ requiresCompletion: z.ZodBoolean;
57
+ }, z.core.$strip>;
58
+ export declare const CustomerRegistrationInputSchema: z.ZodObject<{
59
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ dateOfBirth: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ }, z.core.$strip>;
64
+ export type CustomerRegistration = z.infer<typeof CustomerRegistrationSchema>;
65
+ export type CustomerRegistrationInput = z.infer<typeof CustomerRegistrationInputSchema>;
66
+ export type CustomerRegistrationFields = z.infer<typeof CustomerRegistrationFieldsSchema>;
@@ -0,0 +1,41 @@
1
+ import { EntityIdSchema } from "./ids.js";
2
+ import { z } from "zod";
3
+ // src/models/customer-session.ts
4
+ const CustomerAuthConfigurationSchema = z.object({
5
+ authority: z.string().url(),
6
+ clientId: z.string().min(1),
7
+ authorizationEndpoint: z.string().url(),
8
+ tokenEndpoint: z.string().url(),
9
+ revocationEndpoint: z.string().url(),
10
+ scope: z.string().min(1),
11
+ redirectUri: z.string().url(),
12
+ loginMode: z.enum(["hosted", "storefront"]),
13
+ captcha: z.object({
14
+ provider: z.enum([
15
+ "off",
16
+ "turnstile",
17
+ "recaptcha"
18
+ ]),
19
+ siteKey: z.string().nullable(),
20
+ isConfigured: z.boolean()
21
+ })
22
+ });
23
+ const CustomerSessionProfileSchema = z.object({
24
+ id: EntityIdSchema,
25
+ firstName: z.string().nullable(),
26
+ lastName: z.string().nullable(),
27
+ email: z.string(),
28
+ status: z.string()
29
+ });
30
+ const CustomerSessionSchema = z.object({
31
+ expiresAt: z.string().datetime({ offset: true }),
32
+ customer: CustomerSessionProfileSchema
33
+ });
34
+ const CustomerSessionCreatedSchema = CustomerSessionSchema.extend({ sessionId: z.string().min(1) });
35
+ const CustomerSessionCreateSchema = z.object({
36
+ code: z.string().min(1),
37
+ codeVerifier: z.string().min(43).max(128),
38
+ redirectUri: z.string().url(),
39
+ nonce: z.string().min(1)
40
+ });
41
+ export { CustomerAuthConfigurationSchema, CustomerSessionCreateSchema, CustomerSessionCreatedSchema, CustomerSessionProfileSchema, CustomerSessionSchema };
@@ -0,0 +1,45 @@
1
+ const require_models_ids = require("./ids.cjs");
2
+ let zod = require("zod");
3
+ // src/models/customer-session.ts
4
+ const CustomerAuthConfigurationSchema = zod.z.object({
5
+ authority: zod.z.string().url(),
6
+ clientId: zod.z.string().min(1),
7
+ authorizationEndpoint: zod.z.string().url(),
8
+ tokenEndpoint: zod.z.string().url(),
9
+ revocationEndpoint: zod.z.string().url(),
10
+ scope: zod.z.string().min(1),
11
+ redirectUri: zod.z.string().url(),
12
+ loginMode: zod.z.enum(["hosted", "storefront"]),
13
+ captcha: zod.z.object({
14
+ provider: zod.z.enum([
15
+ "off",
16
+ "turnstile",
17
+ "recaptcha"
18
+ ]),
19
+ siteKey: zod.z.string().nullable(),
20
+ isConfigured: zod.z.boolean()
21
+ })
22
+ });
23
+ const CustomerSessionProfileSchema = zod.z.object({
24
+ id: require_models_ids.EntityIdSchema,
25
+ firstName: zod.z.string().nullable(),
26
+ lastName: zod.z.string().nullable(),
27
+ email: zod.z.string(),
28
+ status: zod.z.string()
29
+ });
30
+ const CustomerSessionSchema = zod.z.object({
31
+ expiresAt: zod.z.string().datetime({ offset: true }),
32
+ customer: CustomerSessionProfileSchema
33
+ });
34
+ const CustomerSessionCreatedSchema = CustomerSessionSchema.extend({ sessionId: zod.z.string().min(1) });
35
+ const CustomerSessionCreateSchema = zod.z.object({
36
+ code: zod.z.string().min(1),
37
+ codeVerifier: zod.z.string().min(43).max(128),
38
+ redirectUri: zod.z.string().url(),
39
+ nonce: zod.z.string().min(1)
40
+ });
41
+ exports.CustomerAuthConfigurationSchema = CustomerAuthConfigurationSchema;
42
+ exports.CustomerSessionCreateSchema = CustomerSessionCreateSchema;
43
+ exports.CustomerSessionCreatedSchema = CustomerSessionCreatedSchema;
44
+ exports.CustomerSessionProfileSchema = CustomerSessionProfileSchema;
45
+ exports.CustomerSessionSchema = CustomerSessionSchema;
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ export declare const CustomerAuthConfigurationSchema: z.ZodObject<{
3
+ authority: z.ZodString;
4
+ clientId: z.ZodString;
5
+ authorizationEndpoint: z.ZodString;
6
+ tokenEndpoint: z.ZodString;
7
+ revocationEndpoint: z.ZodString;
8
+ scope: z.ZodString;
9
+ redirectUri: z.ZodString;
10
+ loginMode: z.ZodEnum<{
11
+ hosted: "hosted";
12
+ storefront: "storefront";
13
+ }>;
14
+ captcha: z.ZodObject<{
15
+ provider: z.ZodEnum<{
16
+ off: "off";
17
+ recaptcha: "recaptcha";
18
+ turnstile: "turnstile";
19
+ }>;
20
+ siteKey: z.ZodNullable<z.ZodString>;
21
+ isConfigured: z.ZodBoolean;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ export declare const CustomerSessionProfileSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ firstName: z.ZodNullable<z.ZodString>;
27
+ lastName: z.ZodNullable<z.ZodString>;
28
+ email: z.ZodString;
29
+ status: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export declare const CustomerSessionSchema: z.ZodObject<{
32
+ expiresAt: z.ZodString;
33
+ customer: z.ZodObject<{
34
+ id: z.ZodString;
35
+ firstName: z.ZodNullable<z.ZodString>;
36
+ lastName: z.ZodNullable<z.ZodString>;
37
+ email: z.ZodString;
38
+ status: z.ZodString;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>;
41
+ export declare const CustomerSessionCreatedSchema: z.ZodObject<{
42
+ expiresAt: z.ZodString;
43
+ customer: z.ZodObject<{
44
+ id: z.ZodString;
45
+ firstName: z.ZodNullable<z.ZodString>;
46
+ lastName: z.ZodNullable<z.ZodString>;
47
+ email: z.ZodString;
48
+ status: z.ZodString;
49
+ }, z.core.$strip>;
50
+ sessionId: z.ZodString;
51
+ }, z.core.$strip>;
52
+ export declare const CustomerSessionCreateSchema: z.ZodObject<{
53
+ code: z.ZodString;
54
+ codeVerifier: z.ZodString;
55
+ redirectUri: z.ZodString;
56
+ nonce: z.ZodString;
57
+ }, z.core.$strip>;
58
+ export type CustomerAuthConfiguration = z.infer<typeof CustomerAuthConfigurationSchema>;
59
+ export type CustomerSession = z.infer<typeof CustomerSessionSchema>;
60
+ export type CustomerSessionCreated = z.infer<typeof CustomerSessionCreatedSchema>;
61
+ export type CustomerSessionCreate = z.infer<typeof CustomerSessionCreateSchema>;
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ export declare const CustomerAuthConfigurationSchema: z.ZodObject<{
3
+ authority: z.ZodString;
4
+ clientId: z.ZodString;
5
+ authorizationEndpoint: z.ZodString;
6
+ tokenEndpoint: z.ZodString;
7
+ revocationEndpoint: z.ZodString;
8
+ scope: z.ZodString;
9
+ redirectUri: z.ZodString;
10
+ loginMode: z.ZodEnum<{
11
+ hosted: "hosted";
12
+ storefront: "storefront";
13
+ }>;
14
+ captcha: z.ZodObject<{
15
+ provider: z.ZodEnum<{
16
+ off: "off";
17
+ recaptcha: "recaptcha";
18
+ turnstile: "turnstile";
19
+ }>;
20
+ siteKey: z.ZodNullable<z.ZodString>;
21
+ isConfigured: z.ZodBoolean;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ export declare const CustomerSessionProfileSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ firstName: z.ZodNullable<z.ZodString>;
27
+ lastName: z.ZodNullable<z.ZodString>;
28
+ email: z.ZodString;
29
+ status: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export declare const CustomerSessionSchema: z.ZodObject<{
32
+ expiresAt: z.ZodString;
33
+ customer: z.ZodObject<{
34
+ id: z.ZodString;
35
+ firstName: z.ZodNullable<z.ZodString>;
36
+ lastName: z.ZodNullable<z.ZodString>;
37
+ email: z.ZodString;
38
+ status: z.ZodString;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>;
41
+ export declare const CustomerSessionCreatedSchema: z.ZodObject<{
42
+ expiresAt: z.ZodString;
43
+ customer: z.ZodObject<{
44
+ id: z.ZodString;
45
+ firstName: z.ZodNullable<z.ZodString>;
46
+ lastName: z.ZodNullable<z.ZodString>;
47
+ email: z.ZodString;
48
+ status: z.ZodString;
49
+ }, z.core.$strip>;
50
+ sessionId: z.ZodString;
51
+ }, z.core.$strip>;
52
+ export declare const CustomerSessionCreateSchema: z.ZodObject<{
53
+ code: z.ZodString;
54
+ codeVerifier: z.ZodString;
55
+ redirectUri: z.ZodString;
56
+ nonce: z.ZodString;
57
+ }, z.core.$strip>;
58
+ export type CustomerAuthConfiguration = z.infer<typeof CustomerAuthConfigurationSchema>;
59
+ export type CustomerSession = z.infer<typeof CustomerSessionSchema>;
60
+ export type CustomerSessionCreated = z.infer<typeof CustomerSessionCreatedSchema>;
61
+ export type CustomerSessionCreate = z.infer<typeof CustomerSessionCreateSchema>;