@infrab4a/connect 0.17.1-beta.3 → 1.0.0-beta.1

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 (970) hide show
  1. package/README.md +24 -24
  2. package/bundles/infrab4a-connect.umd.js +2271 -2465
  3. package/bundles/infrab4a-connect.umd.js.map +1 -1
  4. package/esm2015/infrab4a-connect.js +5 -5
  5. package/esm2015/lib/domain/catalog/index.js +3 -0
  6. package/esm2015/lib/domain/catalog/models/category.js +7 -0
  7. package/esm2015/lib/domain/catalog/models/enums/index.js +2 -0
  8. package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -0
  9. package/esm2015/lib/domain/catalog/models/index.js +6 -0
  10. package/esm2015/lib/domain/catalog/models/product.js +11 -0
  11. package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -0
  12. package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -0
  13. package/esm2015/lib/domain/catalog/models/types/index.js +8 -0
  14. package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -0
  15. package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -0
  16. package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -0
  17. package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -0
  18. package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -0
  19. package/esm2015/lib/domain/catalog/models/variant.js +7 -0
  20. package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -0
  21. package/esm2015/lib/domain/catalog/repositories/index.js +5 -0
  22. package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -0
  23. package/esm2015/lib/domain/catalog/repositories/subscription-product.repository.js +2 -0
  24. package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -0
  25. package/esm2015/lib/domain/general/index.js +3 -0
  26. package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +2 -0
  27. package/esm2015/lib/domain/general/model/base.model.js +13 -0
  28. package/esm2015/lib/domain/general/model/identifier-fields.js +2 -0
  29. package/esm2015/lib/domain/general/model/index.js +5 -0
  30. package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +2 -0
  31. package/esm2015/lib/domain/general/model/types/index.js +4 -0
  32. package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +2 -0
  33. package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +2 -0
  34. package/esm2015/lib/domain/general/repository/create.repository.js +2 -0
  35. package/esm2015/lib/domain/general/repository/crud.repository.js +2 -0
  36. package/esm2015/lib/domain/general/repository/delete.repository.js +2 -0
  37. package/esm2015/lib/domain/general/repository/enums/index.js +3 -0
  38. package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +9 -0
  39. package/esm2015/lib/domain/general/repository/enums/where.enum.js +12 -0
  40. package/esm2015/lib/domain/general/repository/find.repository.js +2 -0
  41. package/esm2015/lib/domain/general/repository/get.repository.js +2 -0
  42. package/esm2015/lib/domain/general/repository/index.js +10 -0
  43. package/esm2015/lib/domain/general/repository/read.repository.js +2 -0
  44. package/esm2015/lib/domain/general/repository/types/index.js +6 -0
  45. package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +2 -0
  46. package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +2 -0
  47. package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +2 -0
  48. package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +2 -0
  49. package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +2 -0
  50. package/esm2015/lib/domain/general/repository/update.repository.js +2 -0
  51. package/esm2015/lib/domain/index.js +7 -0
  52. package/esm2015/lib/domain/location/index.js +2 -0
  53. package/esm2015/lib/domain/location/models/address.js +4 -0
  54. package/esm2015/lib/domain/location/models/index.js +3 -0
  55. package/esm2015/lib/domain/location/models/types/index.js +4 -0
  56. package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -0
  57. package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -0
  58. package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -0
  59. package/esm2015/lib/domain/shop-settings/enums/filter-type.enum.js +21 -0
  60. package/esm2015/lib/domain/shop-settings/enums/index.js +3 -0
  61. package/esm2015/lib/domain/shop-settings/enums/questions-filters.enum.js +21 -0
  62. package/esm2015/lib/domain/shop-settings/helpers/beauty-questions.helper.js +46 -0
  63. package/esm2015/lib/domain/shop-settings/helpers/index.js +2 -0
  64. package/esm2015/lib/domain/shop-settings/index.js +5 -0
  65. package/esm2015/lib/domain/shop-settings/models/home.js +7 -0
  66. package/esm2015/lib/domain/shop-settings/models/index.js +4 -0
  67. package/esm2015/lib/domain/shop-settings/models/shop-menu.js +7 -0
  68. package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +2 -0
  69. package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +2 -0
  70. package/esm2015/lib/domain/shop-settings/models/types/index.js +5 -0
  71. package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +2 -0
  72. package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +2 -0
  73. package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +2 -0
  74. package/esm2015/lib/domain/shop-settings/repositories/index.js +3 -0
  75. package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +2 -0
  76. package/esm2015/lib/domain/shopping/index.js +3 -0
  77. package/esm2015/lib/domain/shopping/models/buy-2-win.js +14 -0
  78. package/esm2015/lib/domain/shopping/models/checkout.js +38 -0
  79. package/esm2015/lib/domain/shopping/models/coupons/club-coupon.js +23 -0
  80. package/esm2015/lib/domain/shopping/models/coupons/coupon.js +31 -0
  81. package/esm2015/lib/domain/shopping/models/coupons/enums/discount-type.enum.js +7 -0
  82. package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -0
  83. package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +3 -0
  84. package/esm2015/lib/domain/shopping/models/coupons/index.js +5 -0
  85. package/esm2015/lib/domain/shopping/models/coupons/store-coupon.js +23 -0
  86. package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -0
  87. package/esm2015/lib/domain/shopping/models/enums/index.js +3 -0
  88. package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -0
  89. package/esm2015/lib/domain/shopping/models/index.js +12 -0
  90. package/esm2015/lib/domain/shopping/models/line-item.js +4 -0
  91. package/esm2015/lib/domain/shopping/models/order.js +11 -0
  92. package/esm2015/lib/domain/shopping/models/payment.js +169 -0
  93. package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -0
  94. package/esm2015/lib/domain/shopping/models/subscription/checkout.js +28 -0
  95. package/esm2015/lib/domain/shopping/models/subscription/index.js +3 -0
  96. package/esm2015/lib/domain/shopping/models/subscription/plan.js +7 -0
  97. package/esm2015/lib/domain/shopping/models/types/index.js +8 -0
  98. package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -0
  99. package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -0
  100. package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -0
  101. package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -0
  102. package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -0
  103. package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -0
  104. package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -0
  105. package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +2 -0
  106. package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -0
  107. package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -0
  108. package/esm2015/lib/domain/shopping/repositories/index.js +8 -0
  109. package/esm2015/lib/domain/shopping/repositories/legacy-order.repository.js +2 -0
  110. package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -0
  111. package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -0
  112. package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +2 -0
  113. package/esm2015/lib/domain/shopping/repositories/subscription/index.js +3 -0
  114. package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +2 -0
  115. package/esm2015/lib/domain/users/errors/index.js +4 -0
  116. package/esm2015/lib/domain/users/errors/unauthorized.error.js +7 -0
  117. package/esm2015/lib/domain/users/errors/user-already-registered.error.js +7 -0
  118. package/esm2015/lib/domain/users/errors/weak-password.error.js +7 -0
  119. package/esm2015/lib/domain/users/index.js +6 -0
  120. package/esm2015/lib/domain/users/models/beauty-profile.js +12 -0
  121. package/esm2015/lib/domain/users/models/enums/accessory-importances.enum.js +7 -0
  122. package/esm2015/lib/domain/users/models/enums/area.enum.js +13 -0
  123. package/esm2015/lib/domain/users/models/enums/beard-problems.enum.js +11 -0
  124. package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +9 -0
  125. package/esm2015/lib/domain/users/models/enums/beauty-product-importances.enum.js +8 -0
  126. package/esm2015/lib/domain/users/models/enums/body-problems.enum.js +13 -0
  127. package/esm2015/lib/domain/users/models/enums/body-shapes.enum.js +9 -0
  128. package/esm2015/lib/domain/users/models/enums/body-tattoos.enum.js +7 -0
  129. package/esm2015/lib/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -0
  130. package/esm2015/lib/domain/users/models/enums/face-skin-problems.enum.js +12 -0
  131. package/esm2015/lib/domain/users/models/enums/face-skin-tones.enum.js +10 -0
  132. package/esm2015/lib/domain/users/models/enums/family-incomes.enum.js +10 -0
  133. package/esm2015/lib/domain/users/models/enums/fragrance-importances.enum.js +7 -0
  134. package/esm2015/lib/domain/users/models/enums/hair-colors.enum.js +12 -0
  135. package/esm2015/lib/domain/users/models/enums/hair-problems.enum.js +12 -0
  136. package/esm2015/lib/domain/users/models/enums/hair-strands.enum.js +10 -0
  137. package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +9 -0
  138. package/esm2015/lib/domain/users/models/enums/index.js +21 -0
  139. package/esm2015/lib/domain/users/models/enums/office-position.enum.js +8 -0
  140. package/esm2015/lib/domain/users/models/enums/product-spents.enum.js +10 -0
  141. package/esm2015/lib/domain/users/models/enums/user-type.enum.js +10 -0
  142. package/esm2015/lib/domain/users/models/index.js +8 -0
  143. package/esm2015/lib/domain/users/models/lead.js +7 -0
  144. package/esm2015/lib/domain/users/models/subscription/edition.js +7 -0
  145. package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +5 -0
  146. package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +6 -0
  147. package/esm2015/lib/domain/users/models/subscription/enums/index.js +5 -0
  148. package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +7 -0
  149. package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +6 -0
  150. package/esm2015/lib/domain/users/models/subscription/index.js +5 -0
  151. package/esm2015/lib/domain/users/models/subscription/payment.js +14 -0
  152. package/esm2015/lib/domain/users/models/subscription/subscription.js +43 -0
  153. package/esm2015/lib/domain/users/models/user-address.js +7 -0
  154. package/esm2015/lib/domain/users/models/user-payment-method.js +7 -0
  155. package/esm2015/lib/domain/users/models/user.js +26 -0
  156. package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +2 -0
  157. package/esm2015/lib/domain/users/repositories/edition.repository.js +2 -0
  158. package/esm2015/lib/domain/users/repositories/index.js +9 -0
  159. package/esm2015/lib/domain/users/repositories/lead.repository.js +2 -0
  160. package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +2 -0
  161. package/esm2015/lib/domain/users/repositories/subscription.repository.js +2 -0
  162. package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -0
  163. package/esm2015/lib/domain/users/repositories/user-payment-method.repository.js +2 -0
  164. package/esm2015/lib/domain/users/repositories/user.repository.js +2 -0
  165. package/esm2015/lib/domain/users/services/authentication.service.js +2 -0
  166. package/esm2015/lib/domain/users/services/index.js +4 -0
  167. package/esm2015/lib/domain/users/services/register.service.js +2 -0
  168. package/esm2015/lib/domain/users/services/types/basic-user-data.type.js +2 -0
  169. package/esm2015/lib/domain/users/services/types/index.js +2 -0
  170. package/esm2015/lib/domain/users/use-cases/authentication.js +40 -0
  171. package/esm2015/lib/domain/users/use-cases/index.js +4 -0
  172. package/esm2015/lib/domain/users/use-cases/register.js +34 -0
  173. package/esm2015/lib/domain/users/use-cases/signout.js +12 -0
  174. package/esm2015/lib/errors/duplicated-results.error.js +7 -0
  175. package/esm2015/lib/errors/index.js +5 -0
  176. package/esm2015/lib/errors/invalid-argument.error.js +7 -0
  177. package/esm2015/lib/errors/not-found.error.js +7 -0
  178. package/esm2015/lib/errors/required-argument.error.js +8 -0
  179. package/esm2015/lib/index.js +5 -0
  180. package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +47 -0
  181. package/esm2015/lib/infra/firebase/auth/index.js +3 -0
  182. package/esm2015/lib/infra/firebase/auth/register-firebase-auth.service.js +26 -0
  183. package/esm2015/lib/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -0
  184. package/esm2015/lib/infra/firebase/firestore/index.js +4 -0
  185. package/esm2015/lib/infra/firebase/firestore/mixins/index.js +10 -0
  186. package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -0
  187. package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -0
  188. package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -0
  189. package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +76 -0
  190. package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -0
  191. package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -0
  192. package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -0
  193. package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -0
  194. package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -0
  195. package/esm2015/lib/infra/firebase/firestore/models/user-search.js +7 -0
  196. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +78 -0
  197. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +5 -0
  198. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -0
  199. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -0
  200. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -0
  201. package/esm2015/lib/infra/firebase/firestore/repositories/index.js +5 -0
  202. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +12 -0
  203. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +3 -0
  204. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -0
  205. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -0
  206. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -0
  207. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -0
  208. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +39 -0
  209. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +9 -0
  210. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -0
  211. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -0
  212. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -0
  213. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -0
  214. package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +10 -0
  215. package/esm2015/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -0
  216. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -0
  217. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -0
  218. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -0
  219. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -0
  220. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -0
  221. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -0
  222. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -0
  223. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -0
  224. package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -0
  225. package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +2 -0
  226. package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +2 -0
  227. package/esm2015/lib/infra/firebase/firestore/types/index.js +4 -0
  228. package/esm2015/lib/infra/firebase/index.js +3 -0
  229. package/esm2015/lib/infra/index.js +2 -0
  230. package/esm2015/lib/utils/index.js +5 -0
  231. package/esm2015/lib/utils/mixins/base.mixin.js +6 -0
  232. package/esm2015/lib/utils/mixins/index.js +3 -0
  233. package/esm2015/lib/utils/mixins/mixin-ctor.type.js +2 -0
  234. package/esm2015/lib/utils/types/index.js +2 -0
  235. package/esm2015/lib/utils/types/prop.type.js +2 -0
  236. package/esm2015/public-api.js +3 -0
  237. package/fesm2015/infrab4a-connect.js +1549 -1687
  238. package/fesm2015/infrab4a-connect.js.map +1 -1
  239. package/infrab4a-connect.d.ts +5 -5
  240. package/lib/domain/catalog/index.d.ts +2 -0
  241. package/lib/domain/catalog/models/category.d.ts +22 -0
  242. package/lib/domain/catalog/models/enums/index.d.ts +1 -0
  243. package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -0
  244. package/lib/domain/catalog/models/index.d.ts +5 -0
  245. package/lib/domain/catalog/models/product.d.ts +33 -0
  246. package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -0
  247. package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -0
  248. package/lib/domain/catalog/models/types/index.d.ts +7 -0
  249. package/lib/domain/catalog/models/types/product-review.type.d.ts +14 -0
  250. package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -0
  251. package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -0
  252. package/lib/domain/catalog/models/types/stock.type.d.ts +3 -0
  253. package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -0
  254. package/lib/domain/catalog/models/variant.d.ts +14 -0
  255. package/lib/domain/catalog/repositories/category.repository.d.ts +12 -0
  256. package/lib/domain/catalog/repositories/index.d.ts +4 -0
  257. package/lib/domain/catalog/repositories/product.repository.d.ts +5 -0
  258. package/lib/domain/catalog/repositories/subscription-product.repository.d.ts +4 -0
  259. package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -0
  260. package/lib/domain/general/index.d.ts +2 -0
  261. package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +3 -0
  262. package/lib/domain/general/model/base.model.d.ts +6 -0
  263. package/lib/domain/general/model/identifier-fields.d.ts +4 -0
  264. package/lib/domain/general/model/index.d.ts +4 -0
  265. package/lib/domain/general/model/types/base-model-builder.type.d.ts +5 -0
  266. package/lib/domain/general/model/types/index.d.ts +3 -0
  267. package/lib/domain/general/model/types/non-function-properties.type.d.ts +2 -0
  268. package/lib/domain/general/model/types/non-function-property-name.type.d.ts +3 -0
  269. package/lib/domain/general/repository/create.repository.d.ts +5 -0
  270. package/lib/domain/general/repository/crud.repository.d.ts +7 -0
  271. package/lib/domain/general/repository/delete.repository.d.ts +5 -0
  272. package/lib/domain/general/repository/enums/index.d.ts +2 -0
  273. package/lib/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -0
  274. package/lib/domain/general/repository/enums/where.enum.d.ts +10 -0
  275. package/lib/domain/general/repository/find.repository.d.ts +5 -0
  276. package/lib/domain/general/repository/get.repository.d.ts +5 -0
  277. package/lib/domain/general/repository/index.d.ts +9 -0
  278. package/lib/domain/general/repository/read.repository.d.ts +5 -0
  279. package/lib/domain/general/repository/types/index.d.ts +5 -0
  280. package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +14 -0
  281. package/lib/domain/general/repository/types/repository-find-result.type.d.ts +4 -0
  282. package/lib/domain/general/repository/types/repository-limit-options.type.d.ts +4 -0
  283. package/lib/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -0
  284. package/lib/domain/general/repository/types/repository-update-params.type.d.ts +11 -0
  285. package/lib/domain/general/repository/update.repository.d.ts +5 -0
  286. package/lib/domain/index.d.ts +6 -0
  287. package/lib/domain/location/index.d.ts +1 -0
  288. package/lib/domain/location/models/address.d.ts +21 -0
  289. package/lib/domain/location/models/index.d.ts +2 -0
  290. package/lib/domain/location/models/types/index.d.ts +3 -0
  291. package/lib/domain/location/models/types/location-bound.type.d.ts +6 -0
  292. package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -0
  293. package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -0
  294. package/lib/domain/shop-settings/enums/filter-type.enum.d.ts +19 -0
  295. package/lib/domain/shop-settings/enums/index.d.ts +2 -0
  296. package/lib/domain/shop-settings/enums/questions-filters.enum.d.ts +19 -0
  297. package/lib/domain/shop-settings/helpers/beauty-questions.helper.d.ts +9 -0
  298. package/lib/domain/shop-settings/helpers/index.d.ts +1 -0
  299. package/lib/domain/shop-settings/index.d.ts +4 -0
  300. package/lib/domain/shop-settings/models/home.d.ts +17 -0
  301. package/lib/domain/shop-settings/models/index.d.ts +3 -0
  302. package/lib/domain/shop-settings/models/shop-menu.d.ts +7 -0
  303. package/lib/domain/shop-settings/models/types/banner.type.d.ts +6 -0
  304. package/lib/domain/shop-settings/models/types/benefit.type.d.ts +5 -0
  305. package/lib/domain/shop-settings/models/types/index.d.ts +4 -0
  306. package/lib/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -0
  307. package/lib/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -0
  308. package/lib/domain/shop-settings/repositories/home.repository.d.ts +4 -0
  309. package/lib/domain/shop-settings/repositories/index.d.ts +2 -0
  310. package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -0
  311. package/lib/domain/shopping/index.d.ts +2 -0
  312. package/lib/domain/shopping/models/buy-2-win.d.ts +18 -0
  313. package/lib/domain/shopping/models/checkout.d.ts +28 -0
  314. package/lib/domain/shopping/models/coupons/club-coupon.d.ts +9 -0
  315. package/lib/domain/shopping/models/coupons/coupon.d.ts +28 -0
  316. package/lib/domain/shopping/models/coupons/enums/discount-type.enum.d.ts +5 -0
  317. package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -0
  318. package/lib/domain/shopping/models/coupons/enums/index.d.ts +2 -0
  319. package/lib/domain/shopping/models/coupons/index.d.ts +4 -0
  320. package/lib/domain/shopping/models/coupons/store-coupon.d.ts +8 -0
  321. package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -0
  322. package/lib/domain/shopping/models/enums/index.d.ts +2 -0
  323. package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -0
  324. package/lib/domain/shopping/models/index.d.ts +11 -0
  325. package/lib/domain/shopping/models/line-item.d.ts +8 -0
  326. package/lib/domain/shopping/models/order.d.ts +9 -0
  327. package/lib/domain/shopping/models/payment.d.ts +69 -0
  328. package/lib/domain/shopping/models/shipping-method.d.ts +18 -0
  329. package/lib/domain/shopping/models/subscription/checkout.d.ts +23 -0
  330. package/lib/domain/shopping/models/subscription/index.d.ts +2 -0
  331. package/lib/domain/shopping/models/subscription/plan.d.ts +12 -0
  332. package/lib/domain/shopping/models/types/index.d.ts +7 -0
  333. package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -0
  334. package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -0
  335. package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -0
  336. package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -0
  337. package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -0
  338. package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -0
  339. package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -0
  340. package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -0
  341. package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -0
  342. package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -0
  343. package/lib/domain/shopping/repositories/index.d.ts +7 -0
  344. package/lib/domain/shopping/repositories/legacy-order.repository.d.ts +3 -0
  345. package/lib/domain/shopping/repositories/order.repository.d.ts +4 -0
  346. package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -0
  347. package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -0
  348. package/lib/domain/shopping/repositories/subscription/index.d.ts +2 -0
  349. package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -0
  350. package/lib/domain/users/errors/index.d.ts +3 -0
  351. package/lib/domain/users/errors/unauthorized.error.d.ts +4 -0
  352. package/lib/domain/users/errors/user-already-registered.error.d.ts +4 -0
  353. package/lib/domain/users/errors/weak-password.error.d.ts +4 -0
  354. package/lib/domain/users/index.d.ts +5 -0
  355. package/lib/domain/users/models/beauty-profile.d.ts +12 -0
  356. package/lib/domain/users/models/enums/accessory-importances.enum.d.ts +5 -0
  357. package/lib/domain/users/models/enums/area.enum.d.ts +11 -0
  358. package/lib/domain/users/models/enums/beard-problems.enum.d.ts +9 -0
  359. package/lib/domain/users/models/enums/beard-sizes.enum.d.ts +7 -0
  360. package/lib/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -0
  361. package/lib/domain/users/models/enums/body-problems.enum.d.ts +11 -0
  362. package/lib/domain/users/models/enums/body-shapes.enum.d.ts +7 -0
  363. package/lib/domain/users/models/enums/body-tattoos.enum.d.ts +5 -0
  364. package/lib/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -0
  365. package/lib/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -0
  366. package/lib/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -0
  367. package/lib/domain/users/models/enums/family-incomes.enum.d.ts +8 -0
  368. package/lib/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -0
  369. package/lib/domain/users/models/enums/hair-colors.enum.d.ts +10 -0
  370. package/lib/domain/users/models/enums/hair-problems.enum.d.ts +10 -0
  371. package/lib/domain/users/models/enums/hair-strands.enum.d.ts +8 -0
  372. package/lib/domain/users/models/enums/hair-types.enum.d.ts +7 -0
  373. package/lib/domain/users/models/enums/index.d.ts +20 -0
  374. package/lib/domain/users/models/enums/office-position.enum.d.ts +6 -0
  375. package/lib/domain/users/models/enums/product-spents.enum.d.ts +8 -0
  376. package/lib/domain/users/models/enums/user-type.enum.d.ts +8 -0
  377. package/lib/domain/users/models/index.d.ts +7 -0
  378. package/lib/domain/users/models/lead.d.ts +9 -0
  379. package/lib/domain/users/models/subscription/edition.d.ts +15 -0
  380. package/lib/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -0
  381. package/lib/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -0
  382. package/lib/domain/users/models/subscription/enums/index.d.ts +4 -0
  383. package/lib/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -0
  384. package/lib/domain/users/models/subscription/enums/status.enum.d.ts +4 -0
  385. package/lib/domain/users/models/subscription/index.d.ts +4 -0
  386. package/lib/domain/users/models/subscription/payment.d.ts +14 -0
  387. package/lib/domain/users/models/subscription/subscription.d.ts +30 -0
  388. package/lib/domain/users/models/user-address.d.ts +7 -0
  389. package/lib/domain/users/models/user-payment-method.d.ts +13 -0
  390. package/lib/domain/users/models/user.d.ts +24 -0
  391. package/lib/domain/users/repositories/beauty-profile.repository.d.ts +4 -0
  392. package/lib/domain/users/repositories/edition.repository.d.ts +4 -0
  393. package/lib/domain/users/repositories/index.d.ts +8 -0
  394. package/lib/domain/users/repositories/lead.repository.d.ts +4 -0
  395. package/lib/domain/users/repositories/subscription-payment.repository.d.ts +4 -0
  396. package/lib/domain/users/repositories/subscription.repository.d.ts +4 -0
  397. package/lib/domain/users/repositories/user-address.repository.d.ts +4 -0
  398. package/lib/domain/users/repositories/user-payment-method.repository.d.ts +4 -0
  399. package/lib/domain/users/repositories/user.repository.d.ts +6 -0
  400. package/lib/domain/users/services/authentication.service.d.ts +11 -0
  401. package/lib/domain/users/services/index.d.ts +3 -0
  402. package/lib/domain/users/services/register.service.d.ts +7 -0
  403. package/lib/domain/users/services/types/basic-user-data.type.d.ts +4 -0
  404. package/lib/domain/users/services/types/index.d.ts +1 -0
  405. package/lib/domain/users/use-cases/authentication.d.ts +21 -0
  406. package/lib/domain/users/use-cases/index.d.ts +3 -0
  407. package/lib/domain/users/use-cases/register.d.ts +13 -0
  408. package/lib/domain/users/use-cases/signout.d.ts +6 -0
  409. package/lib/errors/duplicated-results.error.d.ts +4 -0
  410. package/lib/errors/index.d.ts +4 -0
  411. package/lib/errors/invalid-argument.error.d.ts +4 -0
  412. package/lib/errors/not-found.error.d.ts +4 -0
  413. package/lib/errors/required-argument.error.d.ts +5 -0
  414. package/lib/index.d.ts +4 -0
  415. package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +11 -0
  416. package/lib/infra/firebase/auth/index.d.ts +2 -0
  417. package/lib/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -0
  418. package/lib/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -0
  419. package/lib/infra/firebase/firestore/index.d.ts +3 -0
  420. package/lib/infra/firebase/firestore/mixins/index.d.ts +9 -0
  421. package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -0
  422. package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -0
  423. package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -0
  424. package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -0
  425. package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -0
  426. package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -0
  427. package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -0
  428. package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -0
  429. package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -0
  430. package/lib/infra/firebase/firestore/models/user-search.d.ts +9 -0
  431. package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +55 -0
  432. package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -0
  433. package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -0
  434. package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -0
  435. package/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -0
  436. package/lib/infra/firebase/firestore/repositories/index.d.ts +4 -0
  437. package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +49 -0
  438. package/lib/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -0
  439. package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -0
  440. package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -0
  441. package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -0
  442. package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -0
  443. package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -0
  444. package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -0
  445. package/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -0
  446. package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -0
  447. package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -0
  448. package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -0
  449. package/lib/infra/firebase/firestore/repositories/users/index.d.ts +9 -0
  450. package/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -0
  451. package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -0
  452. package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -0
  453. package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -0
  454. package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -0
  455. package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -0
  456. package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -0
  457. package/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -0
  458. package/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -0
  459. package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -0
  460. package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -0
  461. package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -0
  462. package/lib/infra/firebase/firestore/types/index.d.ts +3 -0
  463. package/lib/infra/firebase/index.d.ts +2 -0
  464. package/lib/infra/index.d.ts +1 -0
  465. package/lib/utils/index.d.ts +4 -0
  466. package/lib/utils/mixins/base.mixin.d.ts +3 -0
  467. package/lib/utils/mixins/index.d.ts +2 -0
  468. package/lib/utils/mixins/mixin-ctor.type.d.ts +1 -0
  469. package/lib/utils/types/index.d.ts +1 -0
  470. package/lib/utils/types/prop.type.d.ts +1 -0
  471. package/package.json +1 -3
  472. package/public-api.d.ts +2 -0
  473. package/domain/catalog/index.d.ts +0 -2
  474. package/domain/catalog/models/category.d.ts +0 -22
  475. package/domain/catalog/models/enums/index.d.ts +0 -1
  476. package/domain/catalog/models/enums/shops.enum.d.ts +0 -5
  477. package/domain/catalog/models/index.d.ts +0 -5
  478. package/domain/catalog/models/product.d.ts +0 -35
  479. package/domain/catalog/models/types/category-condition.type.d.ts +0 -4
  480. package/domain/catalog/models/types/category-filter.type.d.ts +0 -4
  481. package/domain/catalog/models/types/index.d.ts +0 -7
  482. package/domain/catalog/models/types/product-review.type.d.ts +0 -15
  483. package/domain/catalog/models/types/shops-description.type.d.ts +0 -7
  484. package/domain/catalog/models/types/shops-price.type.d.ts +0 -10
  485. package/domain/catalog/models/types/stock.type.d.ts +0 -3
  486. package/domain/catalog/models/types/variant-grade.type.d.ts +0 -4
  487. package/domain/catalog/models/variant.d.ts +0 -14
  488. package/domain/catalog/repositories/category.repository.d.ts +0 -15
  489. package/domain/catalog/repositories/index.d.ts +0 -4
  490. package/domain/catalog/repositories/product.repository.d.ts +0 -5
  491. package/domain/catalog/repositories/subscription-product.repository.d.ts +0 -4
  492. package/domain/catalog/repositories/variant.repository.d.ts +0 -4
  493. package/domain/general/index.d.ts +0 -2
  494. package/domain/general/model/base-model-with-identifier-fields.d.ts +0 -3
  495. package/domain/general/model/base.model.d.ts +0 -6
  496. package/domain/general/model/identifier-fields.d.ts +0 -4
  497. package/domain/general/model/index.d.ts +0 -4
  498. package/domain/general/model/types/base-model-builder.type.d.ts +0 -5
  499. package/domain/general/model/types/index.d.ts +0 -3
  500. package/domain/general/model/types/non-function-properties.type.d.ts +0 -2
  501. package/domain/general/model/types/non-function-property-name.type.d.ts +0 -3
  502. package/domain/general/repository/create.repository.d.ts +0 -5
  503. package/domain/general/repository/crud.repository.d.ts +0 -7
  504. package/domain/general/repository/delete.repository.d.ts +0 -5
  505. package/domain/general/repository/enums/index.d.ts +0 -2
  506. package/domain/general/repository/enums/update-option-actions.enum.d.ts +0 -7
  507. package/domain/general/repository/enums/where.enum.d.ts +0 -10
  508. package/domain/general/repository/find.repository.d.ts +0 -5
  509. package/domain/general/repository/get.repository.d.ts +0 -5
  510. package/domain/general/repository/index.d.ts +0 -9
  511. package/domain/general/repository/read.repository.d.ts +0 -5
  512. package/domain/general/repository/types/index.d.ts +0 -5
  513. package/domain/general/repository/types/repository-find-filters.type.d.ts +0 -14
  514. package/domain/general/repository/types/repository-find-result.type.d.ts +0 -4
  515. package/domain/general/repository/types/repository-limit-options.type.d.ts +0 -4
  516. package/domain/general/repository/types/repository-order-by-list.type.d.ts +0 -5
  517. package/domain/general/repository/types/repository-update-params.type.d.ts +0 -11
  518. package/domain/general/repository/update.repository.d.ts +0 -5
  519. package/domain/index.d.ts +0 -6
  520. package/domain/location/index.d.ts +0 -1
  521. package/domain/location/models/address.d.ts +0 -21
  522. package/domain/location/models/index.d.ts +0 -2
  523. package/domain/location/models/types/index.d.ts +0 -3
  524. package/domain/location/models/types/location-bound.type.d.ts +0 -6
  525. package/domain/location/models/types/location-geometry.type.d.ts +0 -7
  526. package/domain/location/models/types/location-lat-lng.type.d.ts +0 -4
  527. package/domain/shop-settings/enums/filter-type.enum.d.ts +0 -19
  528. package/domain/shop-settings/enums/index.d.ts +0 -2
  529. package/domain/shop-settings/enums/questions-filters.enum.d.ts +0 -19
  530. package/domain/shop-settings/helpers/beauty-questions.helper.d.ts +0 -9
  531. package/domain/shop-settings/helpers/index.d.ts +0 -1
  532. package/domain/shop-settings/index.d.ts +0 -4
  533. package/domain/shop-settings/models/home.d.ts +0 -17
  534. package/domain/shop-settings/models/index.d.ts +0 -4
  535. package/domain/shop-settings/models/shop-menu.d.ts +0 -7
  536. package/domain/shop-settings/models/shop-settings.d.ts +0 -9
  537. package/domain/shop-settings/models/types/banner.type.d.ts +0 -6
  538. package/domain/shop-settings/models/types/benefit.type.d.ts +0 -5
  539. package/domain/shop-settings/models/types/home-data.type.d.ts +0 -15
  540. package/domain/shop-settings/models/types/index.d.ts +0 -10
  541. package/domain/shop-settings/models/types/menu-nav.type.d.ts +0 -8
  542. package/domain/shop-settings/models/types/shop-banner.type.d.ts +0 -10
  543. package/domain/shop-settings/models/types/shop-brands.type.d.ts +0 -10
  544. package/domain/shop-settings/models/types/shop-carousel.type.d.ts +0 -5
  545. package/domain/shop-settings/models/types/shop-collection.type.d.ts +0 -8
  546. package/domain/shop-settings/models/types/shop-section.type.d.ts +0 -9
  547. package/domain/shop-settings/models/types/sub-menu.type.d.ts +0 -8
  548. package/domain/shop-settings/repositories/home.repository.d.ts +0 -4
  549. package/domain/shop-settings/repositories/index.d.ts +0 -3
  550. package/domain/shop-settings/repositories/shop-menu.repository.d.ts +0 -4
  551. package/domain/shop-settings/repositories/shop-settings.repository.d.ts +0 -4
  552. package/domain/shopping/index.d.ts +0 -2
  553. package/domain/shopping/models/buy-2-win.d.ts +0 -18
  554. package/domain/shopping/models/checkout.d.ts +0 -29
  555. package/domain/shopping/models/coupons/coupon.d.ts +0 -28
  556. package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +0 -4
  557. package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +0 -6
  558. package/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +0 -5
  559. package/domain/shopping/models/coupons/enums/index.d.ts +0 -3
  560. package/domain/shopping/models/coupons/financial-coupon.d.ts +0 -9
  561. package/domain/shopping/models/coupons/index.d.ts +0 -3
  562. package/domain/shopping/models/enums/checkout-types.enum.d.ts +0 -4
  563. package/domain/shopping/models/enums/index.d.ts +0 -2
  564. package/domain/shopping/models/enums/order-status.enum.d.ts +0 -10
  565. package/domain/shopping/models/index.d.ts +0 -11
  566. package/domain/shopping/models/line-item.d.ts +0 -8
  567. package/domain/shopping/models/order.d.ts +0 -9
  568. package/domain/shopping/models/payment.d.ts +0 -69
  569. package/domain/shopping/models/shipping-method.d.ts +0 -18
  570. package/domain/shopping/models/subscription/checkout.d.ts +0 -23
  571. package/domain/shopping/models/subscription/index.d.ts +0 -2
  572. package/domain/shopping/models/subscription/plan.d.ts +0 -12
  573. package/domain/shopping/models/types/index.d.ts +0 -7
  574. package/domain/shopping/models/types/payment-address.type.d.ts +0 -12
  575. package/domain/shopping/models/types/payment-billing.type.d.ts +0 -7
  576. package/domain/shopping/models/types/payment-card.type.d.ts +0 -14
  577. package/domain/shopping/models/types/payment-customer.type.d.ts +0 -18
  578. package/domain/shopping/models/types/payment-document.type.d.ts +0 -6
  579. package/domain/shopping/models/types/payment-item.type.d.ts +0 -11
  580. package/domain/shopping/models/types/payment-shipping.type.d.ts +0 -10
  581. package/domain/shopping/repositories/buy-2-win.repository.d.ts +0 -4
  582. package/domain/shopping/repositories/checkout.repository.d.ts +0 -4
  583. package/domain/shopping/repositories/coupon.repository.d.ts +0 -4
  584. package/domain/shopping/repositories/index.d.ts +0 -7
  585. package/domain/shopping/repositories/legacy-order.repository.d.ts +0 -3
  586. package/domain/shopping/repositories/order.repository.d.ts +0 -4
  587. package/domain/shopping/repositories/payment.repository.d.ts +0 -4
  588. package/domain/shopping/repositories/subscription/checkout.repository.d.ts +0 -4
  589. package/domain/shopping/repositories/subscription/index.d.ts +0 -2
  590. package/domain/shopping/repositories/subscription/plan.repository.d.ts +0 -4
  591. package/domain/users/errors/index.d.ts +0 -3
  592. package/domain/users/errors/unauthorized.error.d.ts +0 -4
  593. package/domain/users/errors/user-already-registered.error.d.ts +0 -4
  594. package/domain/users/errors/weak-password.error.d.ts +0 -4
  595. package/domain/users/index.d.ts +0 -5
  596. package/domain/users/models/beauty-profile.d.ts +0 -12
  597. package/domain/users/models/enums/accessory-importances.enum.d.ts +0 -5
  598. package/domain/users/models/enums/area.enum.d.ts +0 -11
  599. package/domain/users/models/enums/beard-problems.enum.d.ts +0 -9
  600. package/domain/users/models/enums/beard-sizes.enum.d.ts +0 -7
  601. package/domain/users/models/enums/beauty-product-importances.enum.d.ts +0 -6
  602. package/domain/users/models/enums/body-problems.enum.d.ts +0 -11
  603. package/domain/users/models/enums/body-shapes.enum.d.ts +0 -7
  604. package/domain/users/models/enums/body-tattoos.enum.d.ts +0 -5
  605. package/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +0 -7
  606. package/domain/users/models/enums/face-skin-problems.enum.d.ts +0 -10
  607. package/domain/users/models/enums/face-skin-tones.enum.d.ts +0 -8
  608. package/domain/users/models/enums/family-incomes.enum.d.ts +0 -8
  609. package/domain/users/models/enums/fragrance-importances.enum.d.ts +0 -5
  610. package/domain/users/models/enums/hair-colors.enum.d.ts +0 -10
  611. package/domain/users/models/enums/hair-problems.enum.d.ts +0 -10
  612. package/domain/users/models/enums/hair-strands.enum.d.ts +0 -8
  613. package/domain/users/models/enums/hair-types.enum.d.ts +0 -7
  614. package/domain/users/models/enums/index.d.ts +0 -20
  615. package/domain/users/models/enums/office-position.enum.d.ts +0 -6
  616. package/domain/users/models/enums/product-spents.enum.d.ts +0 -8
  617. package/domain/users/models/enums/user-type.enum.d.ts +0 -8
  618. package/domain/users/models/index.d.ts +0 -7
  619. package/domain/users/models/lead.d.ts +0 -9
  620. package/domain/users/models/subscription/edition.d.ts +0 -17
  621. package/domain/users/models/subscription/enums/billing-status.enum.d.ts +0 -3
  622. package/domain/users/models/subscription/enums/edition-status.enum.d.ts +0 -4
  623. package/domain/users/models/subscription/enums/index.d.ts +0 -4
  624. package/domain/users/models/subscription/enums/payment-type.enum.d.ts +0 -5
  625. package/domain/users/models/subscription/enums/status.enum.d.ts +0 -4
  626. package/domain/users/models/subscription/index.d.ts +0 -4
  627. package/domain/users/models/subscription/payment.d.ts +0 -14
  628. package/domain/users/models/subscription/subscription.d.ts +0 -30
  629. package/domain/users/models/user-address.d.ts +0 -7
  630. package/domain/users/models/user-payment-method.d.ts +0 -14
  631. package/domain/users/models/user.d.ts +0 -25
  632. package/domain/users/repositories/beauty-profile.repository.d.ts +0 -4
  633. package/domain/users/repositories/edition.repository.d.ts +0 -4
  634. package/domain/users/repositories/index.d.ts +0 -8
  635. package/domain/users/repositories/lead.repository.d.ts +0 -4
  636. package/domain/users/repositories/subscription-payment.repository.d.ts +0 -4
  637. package/domain/users/repositories/subscription.repository.d.ts +0 -4
  638. package/domain/users/repositories/user-address.repository.d.ts +0 -4
  639. package/domain/users/repositories/user-payment-method.repository.d.ts +0 -4
  640. package/domain/users/repositories/user.repository.d.ts +0 -6
  641. package/domain/users/services/authentication.service.d.ts +0 -12
  642. package/domain/users/services/index.d.ts +0 -3
  643. package/domain/users/services/register.service.d.ts +0 -7
  644. package/domain/users/services/types/basic-user-data.type.d.ts +0 -4
  645. package/domain/users/services/types/index.d.ts +0 -1
  646. package/domain/users/use-cases/authentication.d.ts +0 -21
  647. package/domain/users/use-cases/index.d.ts +0 -4
  648. package/domain/users/use-cases/recovery-password.d.ts +0 -6
  649. package/domain/users/use-cases/register.d.ts +0 -13
  650. package/domain/users/use-cases/signout.d.ts +0 -6
  651. package/errors/duplicated-results.error.d.ts +0 -4
  652. package/errors/index.d.ts +0 -4
  653. package/errors/invalid-argument.error.d.ts +0 -4
  654. package/errors/not-found.error.d.ts +0 -4
  655. package/errors/required-argument.error.d.ts +0 -5
  656. package/esm2015/domain/catalog/index.js +0 -3
  657. package/esm2015/domain/catalog/models/category.js +0 -7
  658. package/esm2015/domain/catalog/models/enums/index.js +0 -2
  659. package/esm2015/domain/catalog/models/enums/shops.enum.js +0 -7
  660. package/esm2015/domain/catalog/models/index.js +0 -6
  661. package/esm2015/domain/catalog/models/product.js +0 -11
  662. package/esm2015/domain/catalog/models/types/category-condition.type.js +0 -2
  663. package/esm2015/domain/catalog/models/types/category-filter.type.js +0 -2
  664. package/esm2015/domain/catalog/models/types/index.js +0 -8
  665. package/esm2015/domain/catalog/models/types/product-review.type.js +0 -2
  666. package/esm2015/domain/catalog/models/types/shops-description.type.js +0 -2
  667. package/esm2015/domain/catalog/models/types/shops-price.type.js +0 -2
  668. package/esm2015/domain/catalog/models/types/stock.type.js +0 -2
  669. package/esm2015/domain/catalog/models/types/variant-grade.type.js +0 -2
  670. package/esm2015/domain/catalog/models/variant.js +0 -7
  671. package/esm2015/domain/catalog/repositories/category.repository.js +0 -2
  672. package/esm2015/domain/catalog/repositories/index.js +0 -5
  673. package/esm2015/domain/catalog/repositories/product.repository.js +0 -2
  674. package/esm2015/domain/catalog/repositories/subscription-product.repository.js +0 -2
  675. package/esm2015/domain/catalog/repositories/variant.repository.js +0 -2
  676. package/esm2015/domain/general/index.js +0 -3
  677. package/esm2015/domain/general/model/base-model-with-identifier-fields.js +0 -2
  678. package/esm2015/domain/general/model/base.model.js +0 -13
  679. package/esm2015/domain/general/model/identifier-fields.js +0 -2
  680. package/esm2015/domain/general/model/index.js +0 -5
  681. package/esm2015/domain/general/model/types/base-model-builder.type.js +0 -2
  682. package/esm2015/domain/general/model/types/index.js +0 -4
  683. package/esm2015/domain/general/model/types/non-function-properties.type.js +0 -2
  684. package/esm2015/domain/general/model/types/non-function-property-name.type.js +0 -2
  685. package/esm2015/domain/general/repository/create.repository.js +0 -2
  686. package/esm2015/domain/general/repository/crud.repository.js +0 -2
  687. package/esm2015/domain/general/repository/delete.repository.js +0 -2
  688. package/esm2015/domain/general/repository/enums/index.js +0 -3
  689. package/esm2015/domain/general/repository/enums/update-option-actions.enum.js +0 -9
  690. package/esm2015/domain/general/repository/enums/where.enum.js +0 -12
  691. package/esm2015/domain/general/repository/find.repository.js +0 -2
  692. package/esm2015/domain/general/repository/get.repository.js +0 -2
  693. package/esm2015/domain/general/repository/index.js +0 -10
  694. package/esm2015/domain/general/repository/read.repository.js +0 -2
  695. package/esm2015/domain/general/repository/types/index.js +0 -6
  696. package/esm2015/domain/general/repository/types/repository-find-filters.type.js +0 -2
  697. package/esm2015/domain/general/repository/types/repository-find-result.type.js +0 -2
  698. package/esm2015/domain/general/repository/types/repository-limit-options.type.js +0 -2
  699. package/esm2015/domain/general/repository/types/repository-order-by-list.type.js +0 -2
  700. package/esm2015/domain/general/repository/types/repository-update-params.type.js +0 -2
  701. package/esm2015/domain/general/repository/update.repository.js +0 -2
  702. package/esm2015/domain/index.js +0 -7
  703. package/esm2015/domain/location/index.js +0 -2
  704. package/esm2015/domain/location/models/address.js +0 -4
  705. package/esm2015/domain/location/models/index.js +0 -3
  706. package/esm2015/domain/location/models/types/index.js +0 -4
  707. package/esm2015/domain/location/models/types/location-bound.type.js +0 -2
  708. package/esm2015/domain/location/models/types/location-geometry.type.js +0 -2
  709. package/esm2015/domain/location/models/types/location-lat-lng.type.js +0 -2
  710. package/esm2015/domain/shop-settings/enums/filter-type.enum.js +0 -21
  711. package/esm2015/domain/shop-settings/enums/index.js +0 -3
  712. package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +0 -21
  713. package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +0 -46
  714. package/esm2015/domain/shop-settings/helpers/index.js +0 -2
  715. package/esm2015/domain/shop-settings/index.js +0 -5
  716. package/esm2015/domain/shop-settings/models/home.js +0 -7
  717. package/esm2015/domain/shop-settings/models/index.js +0 -5
  718. package/esm2015/domain/shop-settings/models/shop-menu.js +0 -7
  719. package/esm2015/domain/shop-settings/models/shop-settings.js +0 -7
  720. package/esm2015/domain/shop-settings/models/types/banner.type.js +0 -2
  721. package/esm2015/domain/shop-settings/models/types/benefit.type.js +0 -2
  722. package/esm2015/domain/shop-settings/models/types/home-data.type.js +0 -2
  723. package/esm2015/domain/shop-settings/models/types/index.js +0 -11
  724. package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +0 -2
  725. package/esm2015/domain/shop-settings/models/types/shop-banner.type.js +0 -2
  726. package/esm2015/domain/shop-settings/models/types/shop-brands.type.js +0 -2
  727. package/esm2015/domain/shop-settings/models/types/shop-carousel.type.js +0 -2
  728. package/esm2015/domain/shop-settings/models/types/shop-collection.type.js +0 -2
  729. package/esm2015/domain/shop-settings/models/types/shop-section.type.js +0 -2
  730. package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +0 -2
  731. package/esm2015/domain/shop-settings/repositories/home.repository.js +0 -2
  732. package/esm2015/domain/shop-settings/repositories/index.js +0 -4
  733. package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +0 -2
  734. package/esm2015/domain/shop-settings/repositories/shop-settings.repository.js +0 -2
  735. package/esm2015/domain/shopping/index.js +0 -3
  736. package/esm2015/domain/shopping/models/buy-2-win.js +0 -14
  737. package/esm2015/domain/shopping/models/checkout.js +0 -38
  738. package/esm2015/domain/shopping/models/coupons/coupon.js +0 -23
  739. package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +0 -6
  740. package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +0 -8
  741. package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +0 -7
  742. package/esm2015/domain/shopping/models/coupons/enums/index.js +0 -4
  743. package/esm2015/domain/shopping/models/coupons/financial-coupon.js +0 -28
  744. package/esm2015/domain/shopping/models/coupons/index.js +0 -4
  745. package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +0 -6
  746. package/esm2015/domain/shopping/models/enums/index.js +0 -3
  747. package/esm2015/domain/shopping/models/enums/order-status.enum.js +0 -12
  748. package/esm2015/domain/shopping/models/index.js +0 -12
  749. package/esm2015/domain/shopping/models/line-item.js +0 -4
  750. package/esm2015/domain/shopping/models/order.js +0 -11
  751. package/esm2015/domain/shopping/models/payment.js +0 -169
  752. package/esm2015/domain/shopping/models/shipping-method.js +0 -7
  753. package/esm2015/domain/shopping/models/subscription/checkout.js +0 -28
  754. package/esm2015/domain/shopping/models/subscription/index.js +0 -3
  755. package/esm2015/domain/shopping/models/subscription/plan.js +0 -7
  756. package/esm2015/domain/shopping/models/types/index.js +0 -8
  757. package/esm2015/domain/shopping/models/types/payment-address.type.js +0 -2
  758. package/esm2015/domain/shopping/models/types/payment-billing.type.js +0 -2
  759. package/esm2015/domain/shopping/models/types/payment-card.type.js +0 -2
  760. package/esm2015/domain/shopping/models/types/payment-customer.type.js +0 -2
  761. package/esm2015/domain/shopping/models/types/payment-document.type.js +0 -2
  762. package/esm2015/domain/shopping/models/types/payment-item.type.js +0 -2
  763. package/esm2015/domain/shopping/models/types/payment-shipping.type.js +0 -2
  764. package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +0 -2
  765. package/esm2015/domain/shopping/repositories/checkout.repository.js +0 -2
  766. package/esm2015/domain/shopping/repositories/coupon.repository.js +0 -2
  767. package/esm2015/domain/shopping/repositories/index.js +0 -8
  768. package/esm2015/domain/shopping/repositories/legacy-order.repository.js +0 -2
  769. package/esm2015/domain/shopping/repositories/order.repository.js +0 -2
  770. package/esm2015/domain/shopping/repositories/payment.repository.js +0 -2
  771. package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +0 -2
  772. package/esm2015/domain/shopping/repositories/subscription/index.js +0 -3
  773. package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +0 -2
  774. package/esm2015/domain/users/errors/index.js +0 -4
  775. package/esm2015/domain/users/errors/unauthorized.error.js +0 -7
  776. package/esm2015/domain/users/errors/user-already-registered.error.js +0 -7
  777. package/esm2015/domain/users/errors/weak-password.error.js +0 -7
  778. package/esm2015/domain/users/index.js +0 -6
  779. package/esm2015/domain/users/models/beauty-profile.js +0 -12
  780. package/esm2015/domain/users/models/enums/accessory-importances.enum.js +0 -7
  781. package/esm2015/domain/users/models/enums/area.enum.js +0 -13
  782. package/esm2015/domain/users/models/enums/beard-problems.enum.js +0 -11
  783. package/esm2015/domain/users/models/enums/beard-sizes.enum.js +0 -9
  784. package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +0 -8
  785. package/esm2015/domain/users/models/enums/body-problems.enum.js +0 -13
  786. package/esm2015/domain/users/models/enums/body-shapes.enum.js +0 -9
  787. package/esm2015/domain/users/models/enums/body-tattoos.enum.js +0 -7
  788. package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +0 -9
  789. package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +0 -12
  790. package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +0 -10
  791. package/esm2015/domain/users/models/enums/family-incomes.enum.js +0 -10
  792. package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +0 -7
  793. package/esm2015/domain/users/models/enums/hair-colors.enum.js +0 -12
  794. package/esm2015/domain/users/models/enums/hair-problems.enum.js +0 -12
  795. package/esm2015/domain/users/models/enums/hair-strands.enum.js +0 -10
  796. package/esm2015/domain/users/models/enums/hair-types.enum.js +0 -9
  797. package/esm2015/domain/users/models/enums/index.js +0 -21
  798. package/esm2015/domain/users/models/enums/office-position.enum.js +0 -8
  799. package/esm2015/domain/users/models/enums/product-spents.enum.js +0 -10
  800. package/esm2015/domain/users/models/enums/user-type.enum.js +0 -10
  801. package/esm2015/domain/users/models/index.js +0 -8
  802. package/esm2015/domain/users/models/lead.js +0 -7
  803. package/esm2015/domain/users/models/subscription/edition.js +0 -7
  804. package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +0 -5
  805. package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +0 -6
  806. package/esm2015/domain/users/models/subscription/enums/index.js +0 -5
  807. package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +0 -7
  808. package/esm2015/domain/users/models/subscription/enums/status.enum.js +0 -6
  809. package/esm2015/domain/users/models/subscription/index.js +0 -5
  810. package/esm2015/domain/users/models/subscription/payment.js +0 -14
  811. package/esm2015/domain/users/models/subscription/subscription.js +0 -43
  812. package/esm2015/domain/users/models/user-address.js +0 -7
  813. package/esm2015/domain/users/models/user-payment-method.js +0 -7
  814. package/esm2015/domain/users/models/user.js +0 -26
  815. package/esm2015/domain/users/repositories/beauty-profile.repository.js +0 -2
  816. package/esm2015/domain/users/repositories/edition.repository.js +0 -2
  817. package/esm2015/domain/users/repositories/index.js +0 -9
  818. package/esm2015/domain/users/repositories/lead.repository.js +0 -2
  819. package/esm2015/domain/users/repositories/subscription-payment.repository.js +0 -2
  820. package/esm2015/domain/users/repositories/subscription.repository.js +0 -2
  821. package/esm2015/domain/users/repositories/user-address.repository.js +0 -2
  822. package/esm2015/domain/users/repositories/user-payment-method.repository.js +0 -2
  823. package/esm2015/domain/users/repositories/user.repository.js +0 -2
  824. package/esm2015/domain/users/services/authentication.service.js +0 -2
  825. package/esm2015/domain/users/services/index.js +0 -4
  826. package/esm2015/domain/users/services/register.service.js +0 -2
  827. package/esm2015/domain/users/services/types/basic-user-data.type.js +0 -2
  828. package/esm2015/domain/users/services/types/index.js +0 -2
  829. package/esm2015/domain/users/use-cases/authentication.js +0 -40
  830. package/esm2015/domain/users/use-cases/index.js +0 -5
  831. package/esm2015/domain/users/use-cases/recovery-password.js +0 -12
  832. package/esm2015/domain/users/use-cases/register.js +0 -34
  833. package/esm2015/domain/users/use-cases/signout.js +0 -12
  834. package/esm2015/errors/duplicated-results.error.js +0 -7
  835. package/esm2015/errors/index.js +0 -5
  836. package/esm2015/errors/invalid-argument.error.js +0 -7
  837. package/esm2015/errors/not-found.error.js +0 -7
  838. package/esm2015/errors/required-argument.error.js +0 -8
  839. package/esm2015/index.js +0 -6
  840. package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +0 -22
  841. package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +0 -2
  842. package/esm2015/infra/elasticsearch/adapters/index.js +0 -3
  843. package/esm2015/infra/elasticsearch/index.js +0 -4
  844. package/esm2015/infra/elasticsearch/indexes/index.js +0 -2
  845. package/esm2015/infra/elasticsearch/indexes/products-index.js +0 -59
  846. package/esm2015/infra/elasticsearch/types/elastic-search-result.js +0 -2
  847. package/esm2015/infra/elasticsearch/types/index.js +0 -2
  848. package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +0 -52
  849. package/esm2015/infra/firebase/auth/index.js +0 -3
  850. package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +0 -26
  851. package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +0 -2
  852. package/esm2015/infra/firebase/firestore/index.js +0 -4
  853. package/esm2015/infra/firebase/firestore/mixins/index.js +0 -10
  854. package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +0 -31
  855. package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +0 -10
  856. package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +0 -18
  857. package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +0 -87
  858. package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +0 -26
  859. package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +0 -24
  860. package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +0 -17
  861. package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +0 -11
  862. package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +0 -45
  863. package/esm2015/infra/firebase/firestore/models/user-search.js +0 -7
  864. package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +0 -72
  865. package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +0 -5
  866. package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +0 -23
  867. package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +0 -14
  868. package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +0 -12
  869. package/esm2015/infra/firebase/firestore/repositories/index.js +0 -5
  870. package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +0 -56
  871. package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +0 -4
  872. package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +0 -12
  873. package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.js +0 -12
  874. package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +0 -12
  875. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +0 -12
  876. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +0 -12
  877. package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +0 -29
  878. package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +0 -9
  879. package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +0 -9
  880. package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +0 -12
  881. package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +0 -12
  882. package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +0 -12
  883. package/esm2015/infra/firebase/firestore/repositories/users/index.js +0 -10
  884. package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +0 -12
  885. package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +0 -14
  886. package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +0 -12
  887. package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +0 -14
  888. package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +0 -14
  889. package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +0 -14
  890. package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +0 -70
  891. package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +0 -14
  892. package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +0 -12
  893. package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +0 -2
  894. package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +0 -2
  895. package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +0 -2
  896. package/esm2015/infra/firebase/firestore/types/index.js +0 -4
  897. package/esm2015/infra/firebase/index.js +0 -3
  898. package/esm2015/infra/index.js +0 -3
  899. package/esm2015/utils/index.js +0 -6
  900. package/esm2015/utils/mixins/base.mixin.js +0 -6
  901. package/esm2015/utils/mixins/index.js +0 -3
  902. package/esm2015/utils/mixins/mixin-ctor.type.js +0 -2
  903. package/esm2015/utils/types/index.js +0 -2
  904. package/esm2015/utils/types/prop.type.js +0 -2
  905. package/index.d.ts +0 -5
  906. package/infra/elasticsearch/adapters/axios.adapter.d.ts +0 -11
  907. package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +0 -4
  908. package/infra/elasticsearch/adapters/index.d.ts +0 -2
  909. package/infra/elasticsearch/index.d.ts +0 -3
  910. package/infra/elasticsearch/indexes/index.d.ts +0 -1
  911. package/infra/elasticsearch/indexes/products-index.d.ts +0 -11
  912. package/infra/elasticsearch/types/elastic-search-result.d.ts +0 -7
  913. package/infra/elasticsearch/types/index.d.ts +0 -1
  914. package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +0 -12
  915. package/infra/firebase/auth/index.d.ts +0 -2
  916. package/infra/firebase/auth/register-firebase-auth.service.d.ts +0 -8
  917. package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +0 -3
  918. package/infra/firebase/firestore/index.d.ts +0 -3
  919. package/infra/firebase/firestore/mixins/index.d.ts +0 -9
  920. package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +0 -17
  921. package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +0 -29
  922. package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +0 -15
  923. package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +0 -20
  924. package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +0 -15
  925. package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +0 -15
  926. package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +0 -10
  927. package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +0 -14
  928. package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +0 -16
  929. package/infra/firebase/firestore/models/user-search.d.ts +0 -9
  930. package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +0 -58
  931. package/infra/firebase/firestore/repositories/catalog/index.d.ts +0 -4
  932. package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +0 -50
  933. package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +0 -60
  934. package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +0 -49
  935. package/infra/firebase/firestore/repositories/index.d.ts +0 -4
  936. package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +0 -57
  937. package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +0 -3
  938. package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +0 -49
  939. package/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +0 -49
  940. package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +0 -49
  941. package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +0 -49
  942. package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +0 -49
  943. package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +0 -53
  944. package/infra/firebase/firestore/repositories/shopping/index.d.ts +0 -8
  945. package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +0 -7
  946. package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +0 -49
  947. package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +0 -49
  948. package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +0 -49
  949. package/infra/firebase/firestore/repositories/users/index.d.ts +0 -9
  950. package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +0 -49
  951. package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +0 -60
  952. package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +0 -49
  953. package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +0 -60
  954. package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +0 -60
  955. package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +0 -60
  956. package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +0 -60
  957. package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +0 -60
  958. package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +0 -50
  959. package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +0 -6
  960. package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +0 -8
  961. package/infra/firebase/firestore/types/firestore.repository.type.d.ts +0 -8
  962. package/infra/firebase/firestore/types/index.d.ts +0 -3
  963. package/infra/firebase/index.d.ts +0 -2
  964. package/infra/index.d.ts +0 -2
  965. package/utils/index.d.ts +0 -6
  966. package/utils/mixins/base.mixin.d.ts +0 -3
  967. package/utils/mixins/index.d.ts +0 -2
  968. package/utils/mixins/mixin-ctor.type.d.ts +0 -1
  969. package/utils/types/index.d.ts +0 -1
  970. package/utils/types/prop.type.d.ts +0 -1
@@ -1,2678 +1,2492 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('ts-md5'), require('axios'), require('firebase'), require('firebase/app')) :
3
- typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'ts-md5', 'axios', 'firebase', 'firebase/app'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global.tsMd5, global.axios, global.firebase, global.firebase$1));
5
- })(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, tsMd5, axios, firebase, firebase$1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('lodash'), require('firebase'), require('firebase/app')) :
3
+ typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'lodash', 'firebase', 'firebase/app'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global.lodash, global.firebase, global.firebase$1));
5
+ })(this, (function (exports, reflectMetadata, classTransformer, lodash, firebase, firebase$1) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
10
9
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
11
10
  var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
12
11
 
13
- var BaseModel = /** @class */ (function () {
14
- function BaseModel(args) {
15
- Object.assign(this, args);
16
- }
17
- BaseModel.toInstance = function (data) {
18
- return classTransformer.plainToClass(this, data);
19
- };
20
- BaseModel.prototype.toPlain = function () {
21
- return classTransformer.classToPlain(this, { exposeUnsetFields: false });
22
- };
23
- return BaseModel;
12
+ var BaseModel = /** @class */ (function () {
13
+ function BaseModel(args) {
14
+ Object.assign(this, args);
15
+ }
16
+ BaseModel.toInstance = function (data) {
17
+ return classTransformer.plainToClass(this, data);
18
+ };
19
+ BaseModel.prototype.toPlain = function () {
20
+ return classTransformer.classToPlain(this, { exposeUnsetFields: false });
21
+ };
22
+ return BaseModel;
24
23
  }());
25
24
 
26
- exports.Where = void 0;
27
- (function (Where) {
28
- Where["EQUALS"] = "==";
29
- Where["NOTEQUALS"] = "!=";
30
- Where["GT"] = ">";
31
- Where["GTE"] = ">=";
32
- Where["IN"] = "in";
33
- Where["LT"] = "<";
34
- Where["LTE"] = "<=";
35
- Where["LIKE"] = "like";
25
+ exports.Where = void 0;
26
+ (function (Where) {
27
+ Where["EQUALS"] = "==";
28
+ Where["NOTEQUALS"] = "!=";
29
+ Where["GT"] = ">";
30
+ Where["GTE"] = ">=";
31
+ Where["IN"] = "in";
32
+ Where["LT"] = "<";
33
+ Where["LTE"] = "<=";
34
+ Where["LIKE"] = "like";
36
35
  })(exports.Where || (exports.Where = {}));
37
36
 
38
- exports.UpdateOptionActions = void 0;
39
- (function (UpdateOptionActions) {
40
- UpdateOptionActions["UPDATE"] = "update";
41
- UpdateOptionActions["MERGE"] = "merge";
42
- UpdateOptionActions["REMOVE"] = "remove";
43
- UpdateOptionActions["REMOVE_FIELD"] = "removeField";
44
- UpdateOptionActions["NULL"] = "null";
37
+ exports.UpdateOptionActions = void 0;
38
+ (function (UpdateOptionActions) {
39
+ UpdateOptionActions["UPDATE"] = "update";
40
+ UpdateOptionActions["MERGE"] = "merge";
41
+ UpdateOptionActions["REMOVE"] = "remove";
42
+ UpdateOptionActions["REMOVE_FIELD"] = "removeField";
43
+ UpdateOptionActions["NULL"] = "null";
45
44
  })(exports.UpdateOptionActions || (exports.UpdateOptionActions = {}));
46
45
 
47
- exports.AccessoryImportances = void 0;
48
- (function (AccessoryImportances) {
49
- AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
50
- AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
51
- AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
46
+ exports.AccessoryImportances = void 0;
47
+ (function (AccessoryImportances) {
48
+ AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
49
+ AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
50
+ AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
52
51
  })(exports.AccessoryImportances || (exports.AccessoryImportances = {}));
53
52
 
54
- exports.Area = void 0;
55
- (function (Area) {
56
- Area["GP"] = "Geral";
57
- Area["CRM"] = "CRM";
58
- Area["MediaProd"] = "Media Production";
59
- Area["Tech"] = "Tecnologia";
60
- Area["Transactional"] = "Transacional";
61
- Area["Operations"] = "Opera\u00E7\u00F5es";
62
- Area["Sales"] = "Comercial";
63
- Area["Finantial"] = "Financeiro";
64
- Area["HR"] = "RH";
53
+ exports.Area = void 0;
54
+ (function (Area) {
55
+ Area["GP"] = "Geral";
56
+ Area["CRM"] = "CRM";
57
+ Area["MediaProd"] = "Media Production";
58
+ Area["Tech"] = "Tecnologia";
59
+ Area["Transactional"] = "Transacional";
60
+ Area["Operations"] = "Opera\u00E7\u00F5es";
61
+ Area["Sales"] = "Comercial";
62
+ Area["Finantial"] = "Financeiro";
63
+ Area["HR"] = "RH";
65
64
  })(exports.Area || (exports.Area = {}));
66
65
 
67
- exports.BeardProblems = void 0;
68
- (function (BeardProblems) {
69
- BeardProblems["NO_PROBLEMS"] = "Sem problemas";
70
- BeardProblems["DRY"] = "Barba Seca";
71
- BeardProblems["OILY"] = "Barba Oleaosa";
72
- BeardProblems["DANCRUFF"] = "Barba com Caspa";
73
- BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
74
- BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
75
- BeardProblems["SPARSE_BEARD"] = "Barba Rala";
66
+ exports.BeardProblems = void 0;
67
+ (function (BeardProblems) {
68
+ BeardProblems["NO_PROBLEMS"] = "Sem problemas";
69
+ BeardProblems["DRY"] = "Barba Seca";
70
+ BeardProblems["OILY"] = "Barba Oleaosa";
71
+ BeardProblems["DANCRUFF"] = "Barba com Caspa";
72
+ BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
73
+ BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
74
+ BeardProblems["SPARSE_BEARD"] = "Barba Rala";
76
75
  })(exports.BeardProblems || (exports.BeardProblems = {}));
77
76
 
78
- exports.BeardSizes = void 0;
79
- (function (BeardSizes) {
80
- BeardSizes["BIG"] = "Grande";
81
- BeardSizes["MEDIUM"] = "M\u00E9dia";
82
- BeardSizes["SHORT"] = "Curta";
83
- BeardSizes["MUSTACHE"] = "Bigode";
84
- BeardSizes["NOTHING"] = "Sem Barba";
77
+ exports.BeardSizes = void 0;
78
+ (function (BeardSizes) {
79
+ BeardSizes["BIG"] = "Grande";
80
+ BeardSizes["MEDIUM"] = "M\u00E9dia";
81
+ BeardSizes["SHORT"] = "Curta";
82
+ BeardSizes["MUSTACHE"] = "Bigode";
83
+ BeardSizes["NOTHING"] = "Sem Barba";
85
84
  })(exports.BeardSizes || (exports.BeardSizes = {}));
86
85
 
87
- exports.BeautyProductImportances = void 0;
88
- (function (BeautyProductImportances) {
89
- BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
90
- BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
91
- BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
92
- BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
86
+ exports.BeautyProductImportances = void 0;
87
+ (function (BeautyProductImportances) {
88
+ BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
89
+ BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
90
+ BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
91
+ BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
93
92
  })(exports.BeautyProductImportances || (exports.BeautyProductImportances = {}));
94
93
 
95
- exports.BodyProblems = void 0;
96
- (function (BodyProblems) {
97
- BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
98
- BodyProblems["FLACCIDITY"] = "Flacidez";
99
- BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
100
- BodyProblems["STRETCH_MARKS"] = "Estrias";
101
- BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
102
- BodyProblems["DRY_SKIN"] = "Pele Seca";
103
- BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
104
- BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
105
- BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
94
+ exports.BodyProblems = void 0;
95
+ (function (BodyProblems) {
96
+ BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
97
+ BodyProblems["FLACCIDITY"] = "Flacidez";
98
+ BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
99
+ BodyProblems["STRETCH_MARKS"] = "Estrias";
100
+ BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
101
+ BodyProblems["DRY_SKIN"] = "Pele Seca";
102
+ BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
103
+ BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
104
+ BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
106
105
  })(exports.BodyProblems || (exports.BodyProblems = {}));
107
106
 
108
- exports.BodyShapes = void 0;
109
- (function (BodyShapes) {
110
- BodyShapes["LEAN"] = "Magro";
111
- BodyShapes["REGULAR"] = "Regular";
112
- BodyShapes["OVERWEIGHT"] = "Acima do Peso";
113
- BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
114
- BodyShapes["MUSCULAR"] = "Musculoso";
107
+ exports.BodyShapes = void 0;
108
+ (function (BodyShapes) {
109
+ BodyShapes["LEAN"] = "Magro";
110
+ BodyShapes["REGULAR"] = "Regular";
111
+ BodyShapes["OVERWEIGHT"] = "Acima do Peso";
112
+ BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
113
+ BodyShapes["MUSCULAR"] = "Musculoso";
115
114
  })(exports.BodyShapes || (exports.BodyShapes = {}));
116
115
 
117
- exports.BodyTattoos = void 0;
118
- (function (BodyTattoos) {
119
- BodyTattoos["NONE"] = "Nenhuma";
120
- BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
121
- BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
116
+ exports.BodyTattoos = void 0;
117
+ (function (BodyTattoos) {
118
+ BodyTattoos["NONE"] = "Nenhuma";
119
+ BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
120
+ BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
122
121
  })(exports.BodyTattoos || (exports.BodyTattoos = {}));
123
122
 
124
- exports.FaceSkinOilinesses = void 0;
125
- (function (FaceSkinOilinesses) {
126
- FaceSkinOilinesses["DRY"] = "Seca";
127
- FaceSkinOilinesses["OILY"] = "Oleaosa";
128
- FaceSkinOilinesses["MIXED"] = "Mista";
129
- FaceSkinOilinesses["NORMAL"] = "Normal";
130
- FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
123
+ exports.FaceSkinOilinesses = void 0;
124
+ (function (FaceSkinOilinesses) {
125
+ FaceSkinOilinesses["DRY"] = "Seca";
126
+ FaceSkinOilinesses["OILY"] = "Oleaosa";
127
+ FaceSkinOilinesses["MIXED"] = "Mista";
128
+ FaceSkinOilinesses["NORMAL"] = "Normal";
129
+ FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
131
130
  })(exports.FaceSkinOilinesses || (exports.FaceSkinOilinesses = {}));
132
131
 
133
- exports.FaceSkinProblems = void 0;
134
- (function (FaceSkinProblems) {
135
- FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
136
- FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
137
- FaceSkinProblems["WRINKLES"] = "Rugas";
138
- FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
139
- FaceSkinProblems["STAINS"] = "Manchas";
140
- FaceSkinProblems["FRECKLES"] = "Sardas";
141
- FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
142
- FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
132
+ exports.FaceSkinProblems = void 0;
133
+ (function (FaceSkinProblems) {
134
+ FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
135
+ FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
136
+ FaceSkinProblems["WRINKLES"] = "Rugas";
137
+ FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
138
+ FaceSkinProblems["STAINS"] = "Manchas";
139
+ FaceSkinProblems["FRECKLES"] = "Sardas";
140
+ FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
141
+ FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
143
142
  })(exports.FaceSkinProblems || (exports.FaceSkinProblems = {}));
144
143
 
145
- exports.FaceSkinTones = void 0;
146
- (function (FaceSkinTones) {
147
- FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
148
- FaceSkinTones["CLEAR"] = "Clara";
149
- FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
150
- FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
151
- FaceSkinTones["DARK"] = "Escura";
152
- FaceSkinTones["VERY_DARK"] = "Muito Escura";
144
+ exports.FaceSkinTones = void 0;
145
+ (function (FaceSkinTones) {
146
+ FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
147
+ FaceSkinTones["CLEAR"] = "Clara";
148
+ FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
149
+ FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
150
+ FaceSkinTones["DARK"] = "Escura";
151
+ FaceSkinTones["VERY_DARK"] = "Muito Escura";
153
152
  })(exports.FaceSkinTones || (exports.FaceSkinTones = {}));
154
153
 
155
- exports.FamilyIncomes = void 0;
156
- (function (FamilyIncomes) {
157
- FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
158
- FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
159
- FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
160
- FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
161
- FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
162
- FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
154
+ exports.FamilyIncomes = void 0;
155
+ (function (FamilyIncomes) {
156
+ FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
157
+ FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
158
+ FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
159
+ FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
160
+ FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
161
+ FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
163
162
  })(exports.FamilyIncomes || (exports.FamilyIncomes = {}));
164
163
 
165
- exports.FragranceImportances = void 0;
166
- (function (FragranceImportances) {
167
- FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
168
- FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
169
- FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
164
+ exports.FragranceImportances = void 0;
165
+ (function (FragranceImportances) {
166
+ FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
167
+ FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
168
+ FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
170
169
  })(exports.FragranceImportances || (exports.FragranceImportances = {}));
171
170
 
172
- exports.HairColors = void 0;
173
- (function (HairColors) {
174
- HairColors["BLACK"] = "Preto";
175
- HairColors["DARK_BROWN"] = "Castanho Escuro";
176
- HairColors["LIGHT_BROWN"] = "Castanho Claro";
177
- HairColors["DARK_BLONDE"] = "Loiro Escuro";
178
- HairColors["LIGHT_BLONDE"] = "Loiro Claro";
179
- HairColors["WHITE_GRAY"] = "Branco/Grisalho";
180
- HairColors["REDHEAD"] = "Ruivo";
181
- HairColors["OTHER"] = "RuiOutroo";
171
+ exports.HairColors = void 0;
172
+ (function (HairColors) {
173
+ HairColors["BLACK"] = "Preto";
174
+ HairColors["DARK_BROWN"] = "Castanho Escuro";
175
+ HairColors["LIGHT_BROWN"] = "Castanho Claro";
176
+ HairColors["DARK_BLONDE"] = "Loiro Escuro";
177
+ HairColors["LIGHT_BLONDE"] = "Loiro Claro";
178
+ HairColors["WHITE_GRAY"] = "Branco/Grisalho";
179
+ HairColors["REDHEAD"] = "Ruivo";
180
+ HairColors["OTHER"] = "RuiOutroo";
182
181
  })(exports.HairColors || (exports.HairColors = {}));
183
182
 
184
- exports.HairProblems = void 0;
185
- (function (HairProblems) {
186
- HairProblems["NO_PROBLEMS"] = "Sem problemas";
187
- HairProblems["DANCRUFF"] = "Caspa";
188
- HairProblems["LOSS"] = "Queda";
189
- HairProblems["OILY"] = "Oleosidade";
190
- HairProblems["DRYNESS"] = "Ressecamento";
191
- HairProblems["CHEMICAL"] = "Quimica";
192
- HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
193
- HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
183
+ exports.HairProblems = void 0;
184
+ (function (HairProblems) {
185
+ HairProblems["NO_PROBLEMS"] = "Sem problemas";
186
+ HairProblems["DANCRUFF"] = "Caspa";
187
+ HairProblems["LOSS"] = "Queda";
188
+ HairProblems["OILY"] = "Oleosidade";
189
+ HairProblems["DRYNESS"] = "Ressecamento";
190
+ HairProblems["CHEMICAL"] = "Quimica";
191
+ HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
192
+ HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
194
193
  })(exports.HairProblems || (exports.HairProblems = {}));
195
194
 
196
- exports.HairStrands = void 0;
197
- (function (HairStrands) {
198
- HairStrands["NORMAL"] = "Fio Normal";
199
- HairStrands["DRY"] = "Fio Seco";
200
- HairStrands["OILY"] = "Fio Oleoso";
201
- HairStrands["MIXED"] = "Fio Misto";
202
- HairStrands["FINE"] = "Fio Fino";
203
- HairStrands["THICK"] = "Fio Grosso";
195
+ exports.HairStrands = void 0;
196
+ (function (HairStrands) {
197
+ HairStrands["NORMAL"] = "Fio Normal";
198
+ HairStrands["DRY"] = "Fio Seco";
199
+ HairStrands["OILY"] = "Fio Oleoso";
200
+ HairStrands["MIXED"] = "Fio Misto";
201
+ HairStrands["FINE"] = "Fio Fino";
202
+ HairStrands["THICK"] = "Fio Grosso";
204
203
  })(exports.HairStrands || (exports.HairStrands = {}));
205
204
 
206
- exports.HairTypes = void 0;
207
- (function (HairTypes) {
208
- HairTypes["Smooth"] = "Liso";
209
- HairTypes["WAVY"] = "Ondulado";
210
- HairTypes["CURLY"] = "Cacheado";
211
- HairTypes["FRIZZY"] = "Crespo";
212
- HairTypes["BALD"] = "Sou careca";
205
+ exports.HairTypes = void 0;
206
+ (function (HairTypes) {
207
+ HairTypes["Smooth"] = "Liso";
208
+ HairTypes["WAVY"] = "Ondulado";
209
+ HairTypes["CURLY"] = "Cacheado";
210
+ HairTypes["FRIZZY"] = "Crespo";
211
+ HairTypes["BALD"] = "Sou careca";
213
212
  })(exports.HairTypes || (exports.HairTypes = {}));
214
213
 
215
- exports.OfficePosition = void 0;
216
- (function (OfficePosition) {
217
- OfficePosition["Intern"] = "Estagi\u00E1rio";
218
- OfficePosition["Analyst"] = "Analista";
219
- OfficePosition["Manager"] = "Gerente";
220
- OfficePosition["Director"] = "Diretor";
214
+ exports.OfficePosition = void 0;
215
+ (function (OfficePosition) {
216
+ OfficePosition["Intern"] = "Estagi\u00E1rio";
217
+ OfficePosition["Analyst"] = "Analista";
218
+ OfficePosition["Manager"] = "Gerente";
219
+ OfficePosition["Director"] = "Diretor";
221
220
  })(exports.OfficePosition || (exports.OfficePosition = {}));
222
221
 
223
- exports.ProductSpents = void 0;
224
- (function (ProductSpents) {
225
- ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
226
- ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
227
- ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
228
- ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
229
- ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
230
- ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
222
+ exports.ProductSpents = void 0;
223
+ (function (ProductSpents) {
224
+ ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
225
+ ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
226
+ ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
227
+ ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
228
+ ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
229
+ ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
231
230
  })(exports.ProductSpents || (exports.ProductSpents = {}));
232
231
 
233
- exports.UserType = void 0;
234
- (function (UserType) {
235
- UserType["B2C"] = "Cliente Transacional";
236
- UserType["GlamGirl"] = "Glamgirl";
237
- UserType["MensBoy"] = "Mensboy";
238
- UserType["B2B"] = "Company";
239
- UserType["Collaborator"] = "Funcion\u00E1rio";
240
- UserType["Influencer"] = "Influencer";
232
+ exports.UserType = void 0;
233
+ (function (UserType) {
234
+ UserType["B2C"] = "Cliente Transacional";
235
+ UserType["GlamGirl"] = "Glamgirl";
236
+ UserType["MensBoy"] = "Mensboy";
237
+ UserType["B2B"] = "Company";
238
+ UserType["Collaborator"] = "Funcion\u00E1rio";
239
+ UserType["Influencer"] = "Influencer";
241
240
  })(exports.UserType || (exports.UserType = {}));
242
241
 
243
- exports.BillingStatus = void 0;
244
- (function (BillingStatus) {
245
- BillingStatus["PAYED"] = "PAGO";
242
+ exports.BillingStatus = void 0;
243
+ (function (BillingStatus) {
244
+ BillingStatus["PAYED"] = "PAGO";
246
245
  })(exports.BillingStatus || (exports.BillingStatus = {}));
247
246
 
248
- exports.EditionStatus = void 0;
249
- (function (EditionStatus) {
250
- EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
251
- EditionStatus["SHIPPED"] = "Enviado";
247
+ exports.EditionStatus = void 0;
248
+ (function (EditionStatus) {
249
+ EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
250
+ EditionStatus["SHIPPED"] = "Enviado";
252
251
  })(exports.EditionStatus || (exports.EditionStatus = {}));
253
252
 
254
- exports.PaymentType = void 0;
255
- (function (PaymentType) {
256
- PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
257
- PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
258
- PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
253
+ exports.PaymentType = void 0;
254
+ (function (PaymentType) {
255
+ PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
256
+ PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
257
+ PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
259
258
  })(exports.PaymentType || (exports.PaymentType = {}));
260
259
 
261
- exports.Status = void 0;
262
- (function (Status) {
263
- Status["ACTIVE"] = "active";
264
- Status["CANCELLED"] = "Cancelado";
260
+ exports.Status = void 0;
261
+ (function (Status) {
262
+ Status["ACTIVE"] = "active";
263
+ Status["CANCELLED"] = "Cancelado";
265
264
  })(exports.Status || (exports.Status = {}));
266
265
 
267
- /*! *****************************************************************************
268
- Copyright (c) Microsoft Corporation.
269
-
270
- Permission to use, copy, modify, and/or distribute this software for any
271
- purpose with or without fee is hereby granted.
272
-
273
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
274
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
275
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
276
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
277
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
278
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
279
- PERFORMANCE OF THIS SOFTWARE.
280
- ***************************************************************************** */
281
- /* global Reflect, Promise */
282
- var extendStatics = function (d, b) {
283
- extendStatics = Object.setPrototypeOf ||
284
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
285
- function (d, b) { for (var p in b)
286
- if (Object.prototype.hasOwnProperty.call(b, p))
287
- d[p] = b[p]; };
288
- return extendStatics(d, b);
289
- };
290
- function __extends(d, b) {
291
- if (typeof b !== "function" && b !== null)
292
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
293
- extendStatics(d, b);
294
- function __() { this.constructor = d; }
295
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
296
- }
297
- var __assign = function () {
298
- __assign = Object.assign || function __assign(t) {
299
- for (var s, i = 1, n = arguments.length; i < n; i++) {
300
- s = arguments[i];
301
- for (var p in s)
302
- if (Object.prototype.hasOwnProperty.call(s, p))
303
- t[p] = s[p];
304
- }
305
- return t;
306
- };
307
- return __assign.apply(this, arguments);
308
- };
309
- function __rest(s, e) {
310
- var t = {};
311
- for (var p in s)
312
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
313
- t[p] = s[p];
314
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
315
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
316
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
317
- t[p[i]] = s[p[i]];
318
- }
319
- return t;
320
- }
321
- function __decorate(decorators, target, key, desc) {
322
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
323
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
324
- r = Reflect.decorate(decorators, target, key, desc);
325
- else
326
- for (var i = decorators.length - 1; i >= 0; i--)
327
- if (d = decorators[i])
328
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
329
- return c > 3 && r && Object.defineProperty(target, key, r), r;
330
- }
331
- function __param(paramIndex, decorator) {
332
- return function (target, key) { decorator(target, key, paramIndex); };
333
- }
334
- function __metadata(metadataKey, metadataValue) {
335
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
336
- return Reflect.metadata(metadataKey, metadataValue);
337
- }
338
- function __awaiter(thisArg, _arguments, P, generator) {
339
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
340
- return new (P || (P = Promise))(function (resolve, reject) {
341
- function fulfilled(value) { try {
342
- step(generator.next(value));
343
- }
344
- catch (e) {
345
- reject(e);
346
- } }
347
- function rejected(value) { try {
348
- step(generator["throw"](value));
349
- }
350
- catch (e) {
351
- reject(e);
352
- } }
353
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
354
- step((generator = generator.apply(thisArg, _arguments || [])).next());
355
- });
356
- }
357
- function __generator(thisArg, body) {
358
- var _ = { label: 0, sent: function () { if (t[0] & 1)
359
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
360
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
361
- function verb(n) { return function (v) { return step([n, v]); }; }
362
- function step(op) {
363
- if (f)
364
- throw new TypeError("Generator is already executing.");
365
- while (_)
366
- try {
367
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
368
- return t;
369
- if (y = 0, t)
370
- op = [op[0] & 2, t.value];
371
- switch (op[0]) {
372
- case 0:
373
- case 1:
374
- t = op;
375
- break;
376
- case 4:
377
- _.label++;
378
- return { value: op[1], done: false };
379
- case 5:
380
- _.label++;
381
- y = op[1];
382
- op = [0];
383
- continue;
384
- case 7:
385
- op = _.ops.pop();
386
- _.trys.pop();
387
- continue;
388
- default:
389
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
390
- _ = 0;
391
- continue;
392
- }
393
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
394
- _.label = op[1];
395
- break;
396
- }
397
- if (op[0] === 6 && _.label < t[1]) {
398
- _.label = t[1];
399
- t = op;
400
- break;
401
- }
402
- if (t && _.label < t[2]) {
403
- _.label = t[2];
404
- _.ops.push(op);
405
- break;
406
- }
407
- if (t[2])
408
- _.ops.pop();
409
- _.trys.pop();
410
- continue;
411
- }
412
- op = body.call(thisArg, _);
413
- }
414
- catch (e) {
415
- op = [6, e];
416
- y = 0;
417
- }
418
- finally {
419
- f = t = 0;
420
- }
421
- if (op[0] & 5)
422
- throw op[1];
423
- return { value: op[0] ? op[1] : void 0, done: true };
424
- }
425
- }
426
- var __createBinding = Object.create ? (function (o, m, k, k2) {
427
- if (k2 === undefined)
428
- k2 = k;
429
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
430
- }) : (function (o, m, k, k2) {
431
- if (k2 === undefined)
432
- k2 = k;
433
- o[k2] = m[k];
434
- });
435
- function __exportStar(m, o) {
436
- for (var p in m)
437
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
438
- __createBinding(o, m, p);
439
- }
440
- function __values(o) {
441
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
442
- if (m)
443
- return m.call(o);
444
- if (o && typeof o.length === "number")
445
- return {
446
- next: function () {
447
- if (o && i >= o.length)
448
- o = void 0;
449
- return { value: o && o[i++], done: !o };
450
- }
451
- };
452
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
453
- }
454
- function __read(o, n) {
455
- var m = typeof Symbol === "function" && o[Symbol.iterator];
456
- if (!m)
457
- return o;
458
- var i = m.call(o), r, ar = [], e;
459
- try {
460
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
461
- ar.push(r.value);
462
- }
463
- catch (error) {
464
- e = { error: error };
465
- }
466
- finally {
467
- try {
468
- if (r && !r.done && (m = i["return"]))
469
- m.call(i);
470
- }
471
- finally {
472
- if (e)
473
- throw e.error;
474
- }
475
- }
476
- return ar;
477
- }
478
- /** @deprecated */
479
- function __spread() {
480
- for (var ar = [], i = 0; i < arguments.length; i++)
481
- ar = ar.concat(__read(arguments[i]));
482
- return ar;
483
- }
484
- /** @deprecated */
485
- function __spreadArrays() {
486
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
487
- s += arguments[i].length;
488
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
489
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
490
- r[k] = a[j];
491
- return r;
492
- }
493
- function __spreadArray(to, from, pack) {
494
- if (pack || arguments.length === 2)
495
- for (var i = 0, l = from.length, ar; i < l; i++) {
496
- if (ar || !(i in from)) {
497
- if (!ar)
498
- ar = Array.prototype.slice.call(from, 0, i);
499
- ar[i] = from[i];
500
- }
501
- }
502
- return to.concat(ar || Array.prototype.slice.call(from));
503
- }
504
- function __await(v) {
505
- return this instanceof __await ? (this.v = v, this) : new __await(v);
506
- }
507
- function __asyncGenerator(thisArg, _arguments, generator) {
508
- if (!Symbol.asyncIterator)
509
- throw new TypeError("Symbol.asyncIterator is not defined.");
510
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
511
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
512
- function verb(n) { if (g[n])
513
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
514
- function resume(n, v) { try {
515
- step(g[n](v));
516
- }
517
- catch (e) {
518
- settle(q[0][3], e);
519
- } }
520
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
521
- function fulfill(value) { resume("next", value); }
522
- function reject(value) { resume("throw", value); }
523
- function settle(f, v) { if (f(v), q.shift(), q.length)
524
- resume(q[0][0], q[0][1]); }
525
- }
526
- function __asyncDelegator(o) {
527
- var i, p;
528
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
529
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
530
- }
531
- function __asyncValues(o) {
532
- if (!Symbol.asyncIterator)
533
- throw new TypeError("Symbol.asyncIterator is not defined.");
534
- var m = o[Symbol.asyncIterator], i;
535
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
536
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
537
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
538
- }
539
- function __makeTemplateObject(cooked, raw) {
540
- if (Object.defineProperty) {
541
- Object.defineProperty(cooked, "raw", { value: raw });
542
- }
543
- else {
544
- cooked.raw = raw;
545
- }
546
- return cooked;
547
- }
548
- ;
549
- var __setModuleDefault = Object.create ? (function (o, v) {
550
- Object.defineProperty(o, "default", { enumerable: true, value: v });
551
- }) : function (o, v) {
552
- o["default"] = v;
553
- };
554
- function __importStar(mod) {
555
- if (mod && mod.__esModule)
556
- return mod;
557
- var result = {};
558
- if (mod != null)
559
- for (var k in mod)
560
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
561
- __createBinding(result, mod, k);
562
- __setModuleDefault(result, mod);
563
- return result;
564
- }
565
- function __importDefault(mod) {
566
- return (mod && mod.__esModule) ? mod : { default: mod };
567
- }
568
- function __classPrivateFieldGet(receiver, state, kind, f) {
569
- if (kind === "a" && !f)
570
- throw new TypeError("Private accessor was defined without a getter");
571
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
572
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
573
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
574
- }
575
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
576
- if (kind === "m")
577
- throw new TypeError("Private method is not writable");
578
- if (kind === "a" && !f)
579
- throw new TypeError("Private accessor was defined without a setter");
580
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
581
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
582
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
266
+ /*! *****************************************************************************
267
+ Copyright (c) Microsoft Corporation.
268
+
269
+ Permission to use, copy, modify, and/or distribute this software for any
270
+ purpose with or without fee is hereby granted.
271
+
272
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
273
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
274
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
275
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
276
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
277
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
278
+ PERFORMANCE OF THIS SOFTWARE.
279
+ ***************************************************************************** */
280
+ /* global Reflect, Promise */
281
+ var extendStatics = function (d, b) {
282
+ extendStatics = Object.setPrototypeOf ||
283
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
284
+ function (d, b) { for (var p in b)
285
+ if (Object.prototype.hasOwnProperty.call(b, p))
286
+ d[p] = b[p]; };
287
+ return extendStatics(d, b);
288
+ };
289
+ function __extends(d, b) {
290
+ if (typeof b !== "function" && b !== null)
291
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
292
+ extendStatics(d, b);
293
+ function __() { this.constructor = d; }
294
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
295
+ }
296
+ var __assign = function () {
297
+ __assign = Object.assign || function __assign(t) {
298
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
299
+ s = arguments[i];
300
+ for (var p in s)
301
+ if (Object.prototype.hasOwnProperty.call(s, p))
302
+ t[p] = s[p];
303
+ }
304
+ return t;
305
+ };
306
+ return __assign.apply(this, arguments);
307
+ };
308
+ function __rest(s, e) {
309
+ var t = {};
310
+ for (var p in s)
311
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
312
+ t[p] = s[p];
313
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
314
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
315
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
316
+ t[p[i]] = s[p[i]];
317
+ }
318
+ return t;
319
+ }
320
+ function __decorate(decorators, target, key, desc) {
321
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
322
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
323
+ r = Reflect.decorate(decorators, target, key, desc);
324
+ else
325
+ for (var i = decorators.length - 1; i >= 0; i--)
326
+ if (d = decorators[i])
327
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
328
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
329
+ }
330
+ function __param(paramIndex, decorator) {
331
+ return function (target, key) { decorator(target, key, paramIndex); };
332
+ }
333
+ function __metadata(metadataKey, metadataValue) {
334
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
335
+ return Reflect.metadata(metadataKey, metadataValue);
336
+ }
337
+ function __awaiter(thisArg, _arguments, P, generator) {
338
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
339
+ return new (P || (P = Promise))(function (resolve, reject) {
340
+ function fulfilled(value) { try {
341
+ step(generator.next(value));
342
+ }
343
+ catch (e) {
344
+ reject(e);
345
+ } }
346
+ function rejected(value) { try {
347
+ step(generator["throw"](value));
348
+ }
349
+ catch (e) {
350
+ reject(e);
351
+ } }
352
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
353
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
354
+ });
355
+ }
356
+ function __generator(thisArg, body) {
357
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
358
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
359
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
360
+ function verb(n) { return function (v) { return step([n, v]); }; }
361
+ function step(op) {
362
+ if (f)
363
+ throw new TypeError("Generator is already executing.");
364
+ while (_)
365
+ try {
366
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
367
+ return t;
368
+ if (y = 0, t)
369
+ op = [op[0] & 2, t.value];
370
+ switch (op[0]) {
371
+ case 0:
372
+ case 1:
373
+ t = op;
374
+ break;
375
+ case 4:
376
+ _.label++;
377
+ return { value: op[1], done: false };
378
+ case 5:
379
+ _.label++;
380
+ y = op[1];
381
+ op = [0];
382
+ continue;
383
+ case 7:
384
+ op = _.ops.pop();
385
+ _.trys.pop();
386
+ continue;
387
+ default:
388
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
389
+ _ = 0;
390
+ continue;
391
+ }
392
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
393
+ _.label = op[1];
394
+ break;
395
+ }
396
+ if (op[0] === 6 && _.label < t[1]) {
397
+ _.label = t[1];
398
+ t = op;
399
+ break;
400
+ }
401
+ if (t && _.label < t[2]) {
402
+ _.label = t[2];
403
+ _.ops.push(op);
404
+ break;
405
+ }
406
+ if (t[2])
407
+ _.ops.pop();
408
+ _.trys.pop();
409
+ continue;
410
+ }
411
+ op = body.call(thisArg, _);
412
+ }
413
+ catch (e) {
414
+ op = [6, e];
415
+ y = 0;
416
+ }
417
+ finally {
418
+ f = t = 0;
419
+ }
420
+ if (op[0] & 5)
421
+ throw op[1];
422
+ return { value: op[0] ? op[1] : void 0, done: true };
423
+ }
424
+ }
425
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
426
+ if (k2 === undefined)
427
+ k2 = k;
428
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
429
+ }) : (function (o, m, k, k2) {
430
+ if (k2 === undefined)
431
+ k2 = k;
432
+ o[k2] = m[k];
433
+ });
434
+ function __exportStar(m, o) {
435
+ for (var p in m)
436
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
437
+ __createBinding(o, m, p);
438
+ }
439
+ function __values(o) {
440
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
441
+ if (m)
442
+ return m.call(o);
443
+ if (o && typeof o.length === "number")
444
+ return {
445
+ next: function () {
446
+ if (o && i >= o.length)
447
+ o = void 0;
448
+ return { value: o && o[i++], done: !o };
449
+ }
450
+ };
451
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
452
+ }
453
+ function __read(o, n) {
454
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
455
+ if (!m)
456
+ return o;
457
+ var i = m.call(o), r, ar = [], e;
458
+ try {
459
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
460
+ ar.push(r.value);
461
+ }
462
+ catch (error) {
463
+ e = { error: error };
464
+ }
465
+ finally {
466
+ try {
467
+ if (r && !r.done && (m = i["return"]))
468
+ m.call(i);
469
+ }
470
+ finally {
471
+ if (e)
472
+ throw e.error;
473
+ }
474
+ }
475
+ return ar;
476
+ }
477
+ /** @deprecated */
478
+ function __spread() {
479
+ for (var ar = [], i = 0; i < arguments.length; i++)
480
+ ar = ar.concat(__read(arguments[i]));
481
+ return ar;
482
+ }
483
+ /** @deprecated */
484
+ function __spreadArrays() {
485
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
486
+ s += arguments[i].length;
487
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
488
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
489
+ r[k] = a[j];
490
+ return r;
491
+ }
492
+ function __spreadArray(to, from, pack) {
493
+ if (pack || arguments.length === 2)
494
+ for (var i = 0, l = from.length, ar; i < l; i++) {
495
+ if (ar || !(i in from)) {
496
+ if (!ar)
497
+ ar = Array.prototype.slice.call(from, 0, i);
498
+ ar[i] = from[i];
499
+ }
500
+ }
501
+ return to.concat(ar || Array.prototype.slice.call(from));
502
+ }
503
+ function __await(v) {
504
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
505
+ }
506
+ function __asyncGenerator(thisArg, _arguments, generator) {
507
+ if (!Symbol.asyncIterator)
508
+ throw new TypeError("Symbol.asyncIterator is not defined.");
509
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
510
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
511
+ function verb(n) { if (g[n])
512
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
513
+ function resume(n, v) { try {
514
+ step(g[n](v));
515
+ }
516
+ catch (e) {
517
+ settle(q[0][3], e);
518
+ } }
519
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
520
+ function fulfill(value) { resume("next", value); }
521
+ function reject(value) { resume("throw", value); }
522
+ function settle(f, v) { if (f(v), q.shift(), q.length)
523
+ resume(q[0][0], q[0][1]); }
524
+ }
525
+ function __asyncDelegator(o) {
526
+ var i, p;
527
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
528
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
529
+ }
530
+ function __asyncValues(o) {
531
+ if (!Symbol.asyncIterator)
532
+ throw new TypeError("Symbol.asyncIterator is not defined.");
533
+ var m = o[Symbol.asyncIterator], i;
534
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
535
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
536
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
537
+ }
538
+ function __makeTemplateObject(cooked, raw) {
539
+ if (Object.defineProperty) {
540
+ Object.defineProperty(cooked, "raw", { value: raw });
541
+ }
542
+ else {
543
+ cooked.raw = raw;
544
+ }
545
+ return cooked;
546
+ }
547
+ ;
548
+ var __setModuleDefault = Object.create ? (function (o, v) {
549
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
550
+ }) : function (o, v) {
551
+ o["default"] = v;
552
+ };
553
+ function __importStar(mod) {
554
+ if (mod && mod.__esModule)
555
+ return mod;
556
+ var result = {};
557
+ if (mod != null)
558
+ for (var k in mod)
559
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
560
+ __createBinding(result, mod, k);
561
+ __setModuleDefault(result, mod);
562
+ return result;
563
+ }
564
+ function __importDefault(mod) {
565
+ return (mod && mod.__esModule) ? mod : { default: mod };
566
+ }
567
+ function __classPrivateFieldGet(receiver, state, kind, f) {
568
+ if (kind === "a" && !f)
569
+ throw new TypeError("Private accessor was defined without a getter");
570
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
571
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
572
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
573
+ }
574
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
575
+ if (kind === "m")
576
+ throw new TypeError("Private method is not writable");
577
+ if (kind === "a" && !f)
578
+ throw new TypeError("Private accessor was defined without a setter");
579
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
580
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
581
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
583
582
  }
584
583
 
585
- var Edition = /** @class */ (function (_super) {
586
- __extends(Edition, _super);
587
- function Edition() {
588
- return _super !== null && _super.apply(this, arguments) || this;
589
- }
590
- Edition.prototype.identifierFields = function () {
591
- return ['id'];
592
- };
593
- return Edition;
584
+ var Edition = /** @class */ (function (_super) {
585
+ __extends(Edition, _super);
586
+ function Edition() {
587
+ return _super !== null && _super.apply(this, arguments) || this;
588
+ }
589
+ Edition.prototype.identifierFields = function () {
590
+ return ['id'];
591
+ };
592
+ return Edition;
594
593
  }(BaseModel));
595
594
 
596
- var Payment = /** @class */ (function (_super) {
597
- __extends(Payment, _super);
598
- function Payment() {
599
- return _super !== null && _super.apply(this, arguments) || this;
600
- }
601
- Payment.prototype.identifierFields = function () {
602
- return ['id'];
603
- };
604
- return Payment;
605
- }(BaseModel));
606
- __decorate([
607
- classTransformer.Expose({ name: 'refuse_reason' }),
608
- __metadata("design:type", String)
609
- ], Payment.prototype, "refuseReason", void 0);
610
- __decorate([
611
- classTransformer.Expose({ name: 'status_reason' }),
612
- __metadata("design:type", String)
613
- ], Payment.prototype, "statusReason", void 0);
614
- __decorate([
615
- classTransformer.Expose({ name: 'acquirer_response_code' }),
616
- __metadata("design:type", String)
617
- ], Payment.prototype, "acquirerResponseCode", void 0);
618
- __decorate([
619
- classTransformer.Expose({ name: 'acquirer_name' }),
620
- __metadata("design:type", String)
621
- ], Payment.prototype, "acquirerName", void 0);
622
- __decorate([
623
- classTransformer.Expose({ name: 'acquirer_id' }),
624
- __metadata("design:type", String)
625
- ], Payment.prototype, "acquirerId", void 0);
626
- __decorate([
627
- classTransformer.Expose({ name: 'authorization_code' }),
628
- __metadata("design:type", String)
629
- ], Payment.prototype, "authorizationCode", void 0);
630
- __decorate([
631
- classTransformer.Expose({ name: 'soft_descriptor' }),
632
- __metadata("design:type", String)
633
- ], Payment.prototype, "softDescriptor", void 0);
634
- __decorate([
635
- classTransformer.Expose({ name: 'date_created' }),
636
- __metadata("design:type", String)
637
- ], Payment.prototype, "dateCreated", void 0);
638
- __decorate([
639
- classTransformer.Expose({ name: 'date_updated' }),
640
- __metadata("design:type", String)
641
- ], Payment.prototype, "dateUpdated", void 0);
642
- __decorate([
643
- classTransformer.Expose({ name: 'authorized_amount' }),
644
- __metadata("design:type", Number)
645
- ], Payment.prototype, "authorizedAmount", void 0);
646
- __decorate([
647
- classTransformer.Expose({ name: 'paid_amount' }),
648
- __metadata("design:type", Number)
649
- ], Payment.prototype, "paidAmount", void 0);
650
- __decorate([
651
- classTransformer.Expose({ name: 'refunded_amount' }),
652
- __metadata("design:type", Number)
653
- ], Payment.prototype, "refundedAmount", void 0);
654
- __decorate([
655
- classTransformer.Expose({ name: 'card_holder_name' }),
656
- __metadata("design:type", String)
657
- ], Payment.prototype, "cardHolderName", void 0);
658
- __decorate([
659
- classTransformer.Expose({ name: 'card_last_digits' }),
660
- __metadata("design:type", String)
661
- ], Payment.prototype, "cardLastDigits", void 0);
662
- __decorate([
663
- classTransformer.Expose({ name: 'card_first_digits' }),
664
- __metadata("design:type", String)
665
- ], Payment.prototype, "cardFirstDigits", void 0);
666
- __decorate([
667
- classTransformer.Expose({ name: 'card_brand' }),
668
- __metadata("design:type", String)
669
- ], Payment.prototype, "cardBrand", void 0);
670
- __decorate([
671
- classTransformer.Expose({ name: 'card_pin_mode' }),
672
- __metadata("design:type", String)
673
- ], Payment.prototype, "cardPinMode", void 0);
674
- __decorate([
675
- classTransformer.Expose({ name: 'card_magstripe_fallback' }),
676
- __metadata("design:type", Boolean)
677
- ], Payment.prototype, "cardMagstripeFallback", void 0);
678
- __decorate([
679
- classTransformer.Expose({ name: 'cvm_pin' }),
680
- __metadata("design:type", Boolean)
681
- ], Payment.prototype, "cvmPin", void 0);
682
- __decorate([
683
- classTransformer.Expose({ name: 'postback_url' }),
684
- __metadata("design:type", String)
685
- ], Payment.prototype, "postbackUrl", void 0);
686
- __decorate([
687
- classTransformer.Expose({ name: 'payment_method' }),
688
- __metadata("design:type", String)
689
- ], Payment.prototype, "paymentMethod", void 0);
690
- __decorate([
691
- classTransformer.Expose({ name: 'capture_method' }),
692
- __metadata("design:type", String)
693
- ], Payment.prototype, "captureMethod", void 0);
694
- __decorate([
695
- classTransformer.Expose({ name: 'antifraud_score' }),
696
- __metadata("design:type", String)
697
- ], Payment.prototype, "antifraudScore", void 0);
698
- __decorate([
699
- classTransformer.Expose({ name: 'boleto_url' }),
700
- __metadata("design:type", String)
701
- ], Payment.prototype, "boletoUrl", void 0);
702
- __decorate([
703
- classTransformer.Expose({ name: 'boleto_barcode' }),
704
- __metadata("design:type", String)
705
- ], Payment.prototype, "boletoBarcode", void 0);
706
- __decorate([
707
- classTransformer.Expose({ name: 'boleto_expiration_date' }),
708
- __metadata("design:type", String)
709
- ], Payment.prototype, "boletoExpirationDate", void 0);
710
- __decorate([
711
- classTransformer.Expose({ name: 'subscription_id' }),
712
- __metadata("design:type", String)
713
- ], Payment.prototype, "subscriptionId", void 0);
714
- __decorate([
715
- classTransformer.Expose({ name: 'split_rules' }),
716
- __metadata("design:type", String)
717
- ], Payment.prototype, "splitRules", void 0);
718
- __decorate([
719
- classTransformer.Expose({ name: 'antifraud_metadata' }),
720
- __metadata("design:type", Object)
721
- ], Payment.prototype, "antifraudMetadata", void 0);
722
- __decorate([
723
- classTransformer.Expose({ name: 'reference_key' }),
724
- __metadata("design:type", String)
725
- ], Payment.prototype, "referenceKey", void 0);
726
- __decorate([
727
- classTransformer.Expose({ name: 'local_transaction_id' }),
728
- __metadata("design:type", String)
729
- ], Payment.prototype, "localTransactionId", void 0);
730
- __decorate([
731
- classTransformer.Expose({ name: 'local_time' }),
732
- __metadata("design:type", String)
733
- ], Payment.prototype, "localTime", void 0);
734
- __decorate([
735
- classTransformer.Expose({ name: 'fraud_covered' }),
736
- __metadata("design:type", Boolean)
737
- ], Payment.prototype, "fraudCovered", void 0);
738
- __decorate([
739
- classTransformer.Expose({ name: 'fraud_reimbursed' }),
740
- __metadata("design:type", String)
741
- ], Payment.prototype, "fraudReimbursed", void 0);
742
- __decorate([
743
- classTransformer.Expose({ name: 'order_id' }),
744
- __metadata("design:type", String)
745
- ], Payment.prototype, "orderId", void 0);
746
- __decorate([
747
- classTransformer.Expose({ name: 'risk_level' }),
748
- __metadata("design:type", String)
749
- ], Payment.prototype, "riskLevel", void 0);
750
- __decorate([
751
- classTransformer.Expose({ name: 'receipt_url' }),
752
- __metadata("design:type", String)
753
- ], Payment.prototype, "receiptUrl", void 0);
754
- __decorate([
755
- classTransformer.Expose({ name: 'private_label' }),
756
- __metadata("design:type", String)
757
- ], Payment.prototype, "privateLabel", void 0);
758
- __decorate([
759
- classTransformer.Expose({ name: 'pix_qr_code' }),
760
- __metadata("design:type", String)
761
- ], Payment.prototype, "pixQrCode", void 0);
762
- __decorate([
763
- classTransformer.Expose({ name: 'pix_expiration_date' }),
764
- __metadata("design:type", String)
595
+ var Payment = /** @class */ (function (_super) {
596
+ __extends(Payment, _super);
597
+ function Payment() {
598
+ return _super !== null && _super.apply(this, arguments) || this;
599
+ }
600
+ Payment.prototype.identifierFields = function () {
601
+ return ['id'];
602
+ };
603
+ return Payment;
604
+ }(BaseModel));
605
+ __decorate([
606
+ classTransformer.Expose({ name: 'refuse_reason' }),
607
+ __metadata("design:type", String)
608
+ ], Payment.prototype, "refuseReason", void 0);
609
+ __decorate([
610
+ classTransformer.Expose({ name: 'status_reason' }),
611
+ __metadata("design:type", String)
612
+ ], Payment.prototype, "statusReason", void 0);
613
+ __decorate([
614
+ classTransformer.Expose({ name: 'acquirer_response_code' }),
615
+ __metadata("design:type", String)
616
+ ], Payment.prototype, "acquirerResponseCode", void 0);
617
+ __decorate([
618
+ classTransformer.Expose({ name: 'acquirer_name' }),
619
+ __metadata("design:type", String)
620
+ ], Payment.prototype, "acquirerName", void 0);
621
+ __decorate([
622
+ classTransformer.Expose({ name: 'acquirer_id' }),
623
+ __metadata("design:type", String)
624
+ ], Payment.prototype, "acquirerId", void 0);
625
+ __decorate([
626
+ classTransformer.Expose({ name: 'authorization_code' }),
627
+ __metadata("design:type", String)
628
+ ], Payment.prototype, "authorizationCode", void 0);
629
+ __decorate([
630
+ classTransformer.Expose({ name: 'soft_descriptor' }),
631
+ __metadata("design:type", String)
632
+ ], Payment.prototype, "softDescriptor", void 0);
633
+ __decorate([
634
+ classTransformer.Expose({ name: 'date_created' }),
635
+ __metadata("design:type", String)
636
+ ], Payment.prototype, "dateCreated", void 0);
637
+ __decorate([
638
+ classTransformer.Expose({ name: 'date_updated' }),
639
+ __metadata("design:type", String)
640
+ ], Payment.prototype, "dateUpdated", void 0);
641
+ __decorate([
642
+ classTransformer.Expose({ name: 'authorized_amount' }),
643
+ __metadata("design:type", Number)
644
+ ], Payment.prototype, "authorizedAmount", void 0);
645
+ __decorate([
646
+ classTransformer.Expose({ name: 'paid_amount' }),
647
+ __metadata("design:type", Number)
648
+ ], Payment.prototype, "paidAmount", void 0);
649
+ __decorate([
650
+ classTransformer.Expose({ name: 'refunded_amount' }),
651
+ __metadata("design:type", Number)
652
+ ], Payment.prototype, "refundedAmount", void 0);
653
+ __decorate([
654
+ classTransformer.Expose({ name: 'card_holder_name' }),
655
+ __metadata("design:type", String)
656
+ ], Payment.prototype, "cardHolderName", void 0);
657
+ __decorate([
658
+ classTransformer.Expose({ name: 'card_last_digits' }),
659
+ __metadata("design:type", String)
660
+ ], Payment.prototype, "cardLastDigits", void 0);
661
+ __decorate([
662
+ classTransformer.Expose({ name: 'card_first_digits' }),
663
+ __metadata("design:type", String)
664
+ ], Payment.prototype, "cardFirstDigits", void 0);
665
+ __decorate([
666
+ classTransformer.Expose({ name: 'card_brand' }),
667
+ __metadata("design:type", String)
668
+ ], Payment.prototype, "cardBrand", void 0);
669
+ __decorate([
670
+ classTransformer.Expose({ name: 'card_pin_mode' }),
671
+ __metadata("design:type", String)
672
+ ], Payment.prototype, "cardPinMode", void 0);
673
+ __decorate([
674
+ classTransformer.Expose({ name: 'card_magstripe_fallback' }),
675
+ __metadata("design:type", Boolean)
676
+ ], Payment.prototype, "cardMagstripeFallback", void 0);
677
+ __decorate([
678
+ classTransformer.Expose({ name: 'cvm_pin' }),
679
+ __metadata("design:type", Boolean)
680
+ ], Payment.prototype, "cvmPin", void 0);
681
+ __decorate([
682
+ classTransformer.Expose({ name: 'postback_url' }),
683
+ __metadata("design:type", String)
684
+ ], Payment.prototype, "postbackUrl", void 0);
685
+ __decorate([
686
+ classTransformer.Expose({ name: 'payment_method' }),
687
+ __metadata("design:type", String)
688
+ ], Payment.prototype, "paymentMethod", void 0);
689
+ __decorate([
690
+ classTransformer.Expose({ name: 'capture_method' }),
691
+ __metadata("design:type", String)
692
+ ], Payment.prototype, "captureMethod", void 0);
693
+ __decorate([
694
+ classTransformer.Expose({ name: 'antifraud_score' }),
695
+ __metadata("design:type", String)
696
+ ], Payment.prototype, "antifraudScore", void 0);
697
+ __decorate([
698
+ classTransformer.Expose({ name: 'boleto_url' }),
699
+ __metadata("design:type", String)
700
+ ], Payment.prototype, "boletoUrl", void 0);
701
+ __decorate([
702
+ classTransformer.Expose({ name: 'boleto_barcode' }),
703
+ __metadata("design:type", String)
704
+ ], Payment.prototype, "boletoBarcode", void 0);
705
+ __decorate([
706
+ classTransformer.Expose({ name: 'boleto_expiration_date' }),
707
+ __metadata("design:type", String)
708
+ ], Payment.prototype, "boletoExpirationDate", void 0);
709
+ __decorate([
710
+ classTransformer.Expose({ name: 'subscription_id' }),
711
+ __metadata("design:type", String)
712
+ ], Payment.prototype, "subscriptionId", void 0);
713
+ __decorate([
714
+ classTransformer.Expose({ name: 'split_rules' }),
715
+ __metadata("design:type", String)
716
+ ], Payment.prototype, "splitRules", void 0);
717
+ __decorate([
718
+ classTransformer.Expose({ name: 'antifraud_metadata' }),
719
+ __metadata("design:type", Object)
720
+ ], Payment.prototype, "antifraudMetadata", void 0);
721
+ __decorate([
722
+ classTransformer.Expose({ name: 'reference_key' }),
723
+ __metadata("design:type", String)
724
+ ], Payment.prototype, "referenceKey", void 0);
725
+ __decorate([
726
+ classTransformer.Expose({ name: 'local_transaction_id' }),
727
+ __metadata("design:type", String)
728
+ ], Payment.prototype, "localTransactionId", void 0);
729
+ __decorate([
730
+ classTransformer.Expose({ name: 'local_time' }),
731
+ __metadata("design:type", String)
732
+ ], Payment.prototype, "localTime", void 0);
733
+ __decorate([
734
+ classTransformer.Expose({ name: 'fraud_covered' }),
735
+ __metadata("design:type", Boolean)
736
+ ], Payment.prototype, "fraudCovered", void 0);
737
+ __decorate([
738
+ classTransformer.Expose({ name: 'fraud_reimbursed' }),
739
+ __metadata("design:type", String)
740
+ ], Payment.prototype, "fraudReimbursed", void 0);
741
+ __decorate([
742
+ classTransformer.Expose({ name: 'order_id' }),
743
+ __metadata("design:type", String)
744
+ ], Payment.prototype, "orderId", void 0);
745
+ __decorate([
746
+ classTransformer.Expose({ name: 'risk_level' }),
747
+ __metadata("design:type", String)
748
+ ], Payment.prototype, "riskLevel", void 0);
749
+ __decorate([
750
+ classTransformer.Expose({ name: 'receipt_url' }),
751
+ __metadata("design:type", String)
752
+ ], Payment.prototype, "receiptUrl", void 0);
753
+ __decorate([
754
+ classTransformer.Expose({ name: 'private_label' }),
755
+ __metadata("design:type", String)
756
+ ], Payment.prototype, "privateLabel", void 0);
757
+ __decorate([
758
+ classTransformer.Expose({ name: 'pix_qr_code' }),
759
+ __metadata("design:type", String)
760
+ ], Payment.prototype, "pixQrCode", void 0);
761
+ __decorate([
762
+ classTransformer.Expose({ name: 'pix_expiration_date' }),
763
+ __metadata("design:type", String)
765
764
  ], Payment.prototype, "pixExpirationDate", void 0);
766
765
 
767
- var SubscriptionPayment = /** @class */ (function (_super) {
768
- __extends(SubscriptionPayment, _super);
769
- function SubscriptionPayment() {
770
- return _super !== null && _super.apply(this, arguments) || this;
771
- }
772
- SubscriptionPayment.prototype.identifierFields = function () {
773
- return ['id'];
774
- };
775
- return SubscriptionPayment;
776
- }(BaseModel));
777
- __decorate([
778
- classTransformer.Type(function () { return Payment; }),
779
- __metadata("design:type", Payment)
766
+ var SubscriptionPayment = /** @class */ (function (_super) {
767
+ __extends(SubscriptionPayment, _super);
768
+ function SubscriptionPayment() {
769
+ return _super !== null && _super.apply(this, arguments) || this;
770
+ }
771
+ SubscriptionPayment.prototype.identifierFields = function () {
772
+ return ['id'];
773
+ };
774
+ return SubscriptionPayment;
775
+ }(BaseModel));
776
+ __decorate([
777
+ classTransformer.Type(function () { return Payment; }),
778
+ __metadata("design:type", Payment)
780
779
  ], SubscriptionPayment.prototype, "payment", void 0);
781
780
 
782
- var Address = /** @class */ (function (_super) {
783
- __extends(Address, _super);
784
- function Address() {
785
- return _super !== null && _super.apply(this, arguments) || this;
786
- }
787
- return Address;
781
+ var Address = /** @class */ (function (_super) {
782
+ __extends(Address, _super);
783
+ function Address() {
784
+ return _super !== null && _super.apply(this, arguments) || this;
785
+ }
786
+ return Address;
788
787
  }(BaseModel));
789
788
 
790
- var Base = /** @class */ (function () {
791
- function Base() {
792
- var args = [];
793
- for (var _i = 0; _i < arguments.length; _i++) {
794
- args[_i] = arguments[_i];
795
- }
796
- Object.assign.apply(Object, __spreadArray([this], __read(args)));
797
- }
798
- return Base;
789
+ var Base = /** @class */ (function () {
790
+ function Base() {
791
+ var args = [];
792
+ for (var _i = 0; _i < arguments.length; _i++) {
793
+ args[_i] = arguments[_i];
794
+ }
795
+ Object.assign.apply(Object, __spreadArray([this], __read(args)));
796
+ }
797
+ return Base;
799
798
  }());
800
799
 
801
- var Coupon = /** @class */ (function (_super) {
802
- __extends(Coupon, _super);
803
- function Coupon() {
804
- return _super !== null && _super.apply(this, arguments) || this;
805
- }
806
- Object.defineProperty(Coupon.prototype, "isInfluencer", {
807
- get: function () {
808
- return !lodash.isNil(this.influencerEmail);
809
- },
810
- enumerable: false,
811
- configurable: true
812
- });
813
- Coupon.prototype.identifierFields = function () {
814
- return ['id'];
815
- };
816
- return Coupon;
817
- }(BaseModel));
818
- __decorate([
819
- classTransformer.Expose({ name: 'checkout_type' }),
820
- __metadata("design:type", Number)
821
- ], Coupon.prototype, "checkoutType", void 0);
822
- __decorate([
823
- classTransformer.Expose({ name: 'exclusivity_type' }),
824
- __metadata("design:type", Number)
800
+ exports.DiscountType = void 0;
801
+ (function (DiscountType) {
802
+ DiscountType[DiscountType["ABSOLUTE"] = 1] = "ABSOLUTE";
803
+ DiscountType[DiscountType["PERCENTAGE"] = 2] = "PERCENTAGE";
804
+ DiscountType[DiscountType["FREE_SHIPPING"] = 3] = "FREE_SHIPPING";
805
+ })(exports.DiscountType || (exports.DiscountType = {}));
806
+
807
+ exports.Exclusivities = void 0;
808
+ (function (Exclusivities) {
809
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
810
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
811
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
812
+ })(exports.Exclusivities || (exports.Exclusivities = {}));
813
+
814
+ var Coupon = /** @class */ (function (_super) {
815
+ __extends(Coupon, _super);
816
+ function Coupon() {
817
+ return _super !== null && _super.apply(this, arguments) || this;
818
+ }
819
+ Object.defineProperty(Coupon.prototype, "isInfluencer", {
820
+ get: function () {
821
+ return !lodash.isNil(this.influencerEmail);
822
+ },
823
+ enumerable: false,
824
+ configurable: true
825
+ });
826
+ Coupon.prototype.identifierFields = function () {
827
+ return ['id'];
828
+ };
829
+ Coupon.prototype.calculeDiscount = function (amount) {
830
+ switch (this.discountType) {
831
+ case exports.DiscountType.ABSOLUTE:
832
+ return this.discount < amount ? this.discount : amount;
833
+ case exports.DiscountType.PERCENTAGE:
834
+ return this.discount * 0.01 * amount;
835
+ }
836
+ };
837
+ return Coupon;
838
+ }(BaseModel));
839
+ __decorate([
840
+ classTransformer.Expose({ name: 'checkout_type' }),
841
+ __metadata("design:type", Number)
842
+ ], Coupon.prototype, "checkoutType", void 0);
843
+ __decorate([
844
+ classTransformer.Expose({ name: 'exclusivity_type' }),
845
+ __metadata("design:type", Number)
825
846
  ], Coupon.prototype, "exclusivityType", void 0);
826
847
 
827
- var SubscriptionPlan = /** @class */ (function (_super) {
828
- __extends(SubscriptionPlan, _super);
829
- function SubscriptionPlan() {
830
- return _super !== null && _super.apply(this, arguments) || this;
831
- }
832
- SubscriptionPlan.prototype.identifierFields = function () {
833
- return ['id'];
834
- };
835
- return SubscriptionPlan;
848
+ var SubscriptionPlan = /** @class */ (function (_super) {
849
+ __extends(SubscriptionPlan, _super);
850
+ function SubscriptionPlan() {
851
+ return _super !== null && _super.apply(this, arguments) || this;
852
+ }
853
+ SubscriptionPlan.prototype.identifierFields = function () {
854
+ return ['id'];
855
+ };
856
+ return SubscriptionPlan;
836
857
  }(BaseModel));
837
858
 
838
- var BeautyProfile = /** @class */ (function (_super) {
839
- __extends(BeautyProfile, _super);
840
- function BeautyProfile() {
841
- return _super !== null && _super.apply(this, arguments) || this;
842
- }
843
- BeautyProfile.prototype.toPlain = function () {
844
- var plain = _super.prototype.toPlain.call(this);
845
- delete plain.id;
846
- return plain;
847
- };
848
- BeautyProfile.prototype.identifierFields = function () {
849
- return ['id'];
850
- };
851
- return BeautyProfile;
859
+ var BeautyProfile = /** @class */ (function (_super) {
860
+ __extends(BeautyProfile, _super);
861
+ function BeautyProfile() {
862
+ return _super !== null && _super.apply(this, arguments) || this;
863
+ }
864
+ BeautyProfile.prototype.toPlain = function () {
865
+ var plain = _super.prototype.toPlain.call(this);
866
+ delete plain.id;
867
+ return plain;
868
+ };
869
+ BeautyProfile.prototype.identifierFields = function () {
870
+ return ['id'];
871
+ };
872
+ return BeautyProfile;
852
873
  }(BaseModel));
853
874
 
854
- var User = /** @class */ (function (_super) {
855
- __extends(User, _super);
856
- function User() {
857
- return _super !== null && _super.apply(this, arguments) || this;
858
- }
859
- User.toInstance = function (data) {
860
- var instance = _super.toInstance.call(this, data);
861
- if (!lodash.isNil(data.firstName))
862
- instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
863
- return instance;
864
- };
865
- User.prototype.identifierFields = function () {
866
- return ['id'];
867
- };
868
- User.prototype.toPlain = function () {
869
- var plain = _super.prototype.toPlain.call(this);
870
- delete plain.beautyProfile;
871
- return plain;
872
- };
873
- return User;
874
- }(BaseModel));
875
- __decorate([
876
- classTransformer.Type(function () { return BeautyProfile; }),
877
- __metadata("design:type", BeautyProfile)
875
+ var User = /** @class */ (function (_super) {
876
+ __extends(User, _super);
877
+ function User() {
878
+ return _super !== null && _super.apply(this, arguments) || this;
879
+ }
880
+ User.toInstance = function (data) {
881
+ var instance = _super.toInstance.call(this, data);
882
+ if (!lodash.isNil(data.firstName))
883
+ instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
884
+ return instance;
885
+ };
886
+ User.prototype.identifierFields = function () {
887
+ return ['id'];
888
+ };
889
+ User.prototype.toPlain = function () {
890
+ var plain = _super.prototype.toPlain.call(this);
891
+ delete plain.beautyProfile;
892
+ return plain;
893
+ };
894
+ return User;
895
+ }(BaseModel));
896
+ __decorate([
897
+ classTransformer.Type(function () { return BeautyProfile; }),
898
+ __metadata("design:type", BeautyProfile)
878
899
  ], User.prototype, "beautyProfile", void 0);
879
900
 
880
- var Subscription = /** @class */ (function (_super) {
881
- __extends(Subscription, _super);
882
- function Subscription() {
883
- return _super !== null && _super.apply(this, arguments) || this;
884
- }
885
- Subscription.prototype.identifierFields = function () {
886
- return ['id'];
887
- };
888
- return Subscription;
889
- }(BaseModel));
890
- __decorate([
891
- classTransformer.Type(function () { return User; }),
892
- __metadata("design:type", User)
893
- ], Subscription.prototype, "user", void 0);
894
- __decorate([
895
- classTransformer.Type(function () { return SubscriptionPlan; }),
896
- __metadata("design:type", SubscriptionPlan)
897
- ], Subscription.prototype, "subscriptionPlan", void 0);
898
- __decorate([
899
- classTransformer.Type(function () { return Address; }),
900
- __metadata("design:type", Address)
901
- ], Subscription.prototype, "shippingAddress", void 0);
902
- __decorate([
903
- classTransformer.Type(function () { return Address; }),
904
- __metadata("design:type", Address)
905
- ], Subscription.prototype, "billingAddress", void 0);
906
- __decorate([
907
- classTransformer.Type(function () { return Coupon; }),
908
- __metadata("design:type", Coupon)
909
- ], Subscription.prototype, "coupon", void 0);
910
- __decorate([
911
- classTransformer.Type(function () { return Edition; }),
912
- __metadata("design:type", Array)
913
- ], Subscription.prototype, "editions", void 0);
914
- __decorate([
915
- classTransformer.Type(function () { return SubscriptionPayment; }),
916
- __metadata("design:type", Array)
901
+ var Subscription = /** @class */ (function (_super) {
902
+ __extends(Subscription, _super);
903
+ function Subscription() {
904
+ return _super !== null && _super.apply(this, arguments) || this;
905
+ }
906
+ Subscription.prototype.identifierFields = function () {
907
+ return ['id'];
908
+ };
909
+ return Subscription;
910
+ }(BaseModel));
911
+ __decorate([
912
+ classTransformer.Type(function () { return User; }),
913
+ __metadata("design:type", User)
914
+ ], Subscription.prototype, "user", void 0);
915
+ __decorate([
916
+ classTransformer.Type(function () { return SubscriptionPlan; }),
917
+ __metadata("design:type", SubscriptionPlan)
918
+ ], Subscription.prototype, "subscriptionPlan", void 0);
919
+ __decorate([
920
+ classTransformer.Type(function () { return Address; }),
921
+ __metadata("design:type", Address)
922
+ ], Subscription.prototype, "shippingAddress", void 0);
923
+ __decorate([
924
+ classTransformer.Type(function () { return Address; }),
925
+ __metadata("design:type", Address)
926
+ ], Subscription.prototype, "billingAddress", void 0);
927
+ __decorate([
928
+ classTransformer.Type(function () { return Coupon; }),
929
+ __metadata("design:type", Coupon)
930
+ ], Subscription.prototype, "coupon", void 0);
931
+ __decorate([
932
+ classTransformer.Type(function () { return Edition; }),
933
+ __metadata("design:type", Array)
934
+ ], Subscription.prototype, "editions", void 0);
935
+ __decorate([
936
+ classTransformer.Type(function () { return SubscriptionPayment; }),
937
+ __metadata("design:type", Array)
917
938
  ], Subscription.prototype, "payment", void 0);
918
939
 
919
- var UserAddress = /** @class */ (function (_super) {
920
- __extends(UserAddress, _super);
921
- function UserAddress() {
922
- return _super !== null && _super.apply(this, arguments) || this;
923
- }
924
- UserAddress.prototype.identifierFields = function () {
925
- return ['id'];
926
- };
927
- return UserAddress;
940
+ var UserAddress = /** @class */ (function (_super) {
941
+ __extends(UserAddress, _super);
942
+ function UserAddress() {
943
+ return _super !== null && _super.apply(this, arguments) || this;
944
+ }
945
+ UserAddress.prototype.identifierFields = function () {
946
+ return ['id'];
947
+ };
948
+ return UserAddress;
928
949
  }(Address));
929
950
 
930
- var UserPaymentMethod = /** @class */ (function (_super) {
931
- __extends(UserPaymentMethod, _super);
932
- function UserPaymentMethod() {
933
- return _super !== null && _super.apply(this, arguments) || this;
934
- }
935
- UserPaymentMethod.prototype.identifierFields = function () {
936
- return ['id'];
937
- };
938
- return UserPaymentMethod;
951
+ var UserPaymentMethod = /** @class */ (function (_super) {
952
+ __extends(UserPaymentMethod, _super);
953
+ function UserPaymentMethod() {
954
+ return _super !== null && _super.apply(this, arguments) || this;
955
+ }
956
+ UserPaymentMethod.prototype.identifierFields = function () {
957
+ return ['id'];
958
+ };
959
+ return UserPaymentMethod;
939
960
  }(BaseModel));
940
961
 
941
- var Lead = /** @class */ (function (_super) {
942
- __extends(Lead, _super);
943
- function Lead() {
944
- return _super !== null && _super.apply(this, arguments) || this;
945
- }
946
- Lead.prototype.identifierFields = function () {
947
- return ['id'];
948
- };
949
- return Lead;
962
+ var Lead = /** @class */ (function (_super) {
963
+ __extends(Lead, _super);
964
+ function Lead() {
965
+ return _super !== null && _super.apply(this, arguments) || this;
966
+ }
967
+ Lead.prototype.identifierFields = function () {
968
+ return ['id'];
969
+ };
970
+ return Lead;
950
971
  }(BaseModel));
951
972
 
952
- var UnauthorizedError = /** @class */ (function (_super) {
953
- __extends(UnauthorizedError, _super);
954
- function UnauthorizedError(message) {
955
- var _this = _super.call(this, message) || this;
956
- _this.message = message;
957
- return _this;
958
- }
959
- return UnauthorizedError;
973
+ var UnauthorizedError = /** @class */ (function (_super) {
974
+ __extends(UnauthorizedError, _super);
975
+ function UnauthorizedError(message) {
976
+ var _this = _super.call(this, message) || this;
977
+ _this.message = message;
978
+ return _this;
979
+ }
980
+ return UnauthorizedError;
960
981
  }(Error));
961
982
 
962
- exports.SignInMethods = void 0;
963
- (function (SignInMethods) {
964
- SignInMethods["EMAIL_PASSWORD"] = "email_password";
965
- SignInMethods["GOOGLE"] = "google";
966
- })(exports.SignInMethods || (exports.SignInMethods = {}));
967
- var Authentication = /** @class */ (function () {
968
- function Authentication(authService, userRepository) {
969
- this.authService = authService;
970
- this.userRepository = userRepository;
971
- }
972
- Authentication.prototype.signIn = function (_b, signInMethod) {
973
- var email = _b.email, password = _b.password;
974
- return __awaiter(this, void 0, void 0, function () {
975
- var method, userAuth, user;
976
- return __generator(this, function (_b) {
977
- switch (_b.label) {
978
- case 0:
979
- method = this.getServiceByMethod(signInMethod);
980
- return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
981
- case 1:
982
- userAuth = _b.sent();
983
- user = this.userRepository.get(userAuth);
984
- if (!lodash.isNil(user))
985
- return [2 /*return*/, user];
986
- if (/^.+@b4a.com.br$/.test(userAuth.email))
987
- return [2 /*return*/, this.createsUserByCredential(userAuth)];
988
- throw new UnauthorizedError('Invalid credentials');
989
- }
990
- });
991
- });
992
- };
993
- Authentication.prototype.getServiceByMethod = function (signInMethod) {
994
- return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
995
- };
996
- Authentication.prototype.createsUserByCredential = function (user) {
997
- var _a;
998
- return __awaiter(this, void 0, void 0, function () {
999
- var _b, firstName, lastName, person;
1000
- return __generator(this, function (_c) {
1001
- _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1002
- person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1003
- lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1004
- return [2 /*return*/, this.userRepository.create(person)];
1005
- });
1006
- });
1007
- };
1008
- return Authentication;
983
+ exports.SignInMethods = void 0;
984
+ (function (SignInMethods) {
985
+ SignInMethods["EMAIL_PASSWORD"] = "email_password";
986
+ SignInMethods["GOOGLE"] = "google";
987
+ })(exports.SignInMethods || (exports.SignInMethods = {}));
988
+ var Authentication = /** @class */ (function () {
989
+ function Authentication(authService, userRepository) {
990
+ this.authService = authService;
991
+ this.userRepository = userRepository;
992
+ }
993
+ Authentication.prototype.signIn = function (_b, signInMethod) {
994
+ var email = _b.email, password = _b.password;
995
+ return __awaiter(this, void 0, void 0, function () {
996
+ var method, userAuth, user;
997
+ return __generator(this, function (_b) {
998
+ switch (_b.label) {
999
+ case 0:
1000
+ method = this.getServiceByMethod(signInMethod);
1001
+ return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
1002
+ case 1:
1003
+ userAuth = _b.sent();
1004
+ user = this.userRepository.get(userAuth);
1005
+ if (!lodash.isNil(user))
1006
+ return [2 /*return*/, user];
1007
+ if (/^.+@b4a.com.br$/.test(userAuth.email))
1008
+ return [2 /*return*/, this.createsUserByCredential(userAuth)];
1009
+ throw new UnauthorizedError('Invalid credentials');
1010
+ }
1011
+ });
1012
+ });
1013
+ };
1014
+ Authentication.prototype.getServiceByMethod = function (signInMethod) {
1015
+ return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
1016
+ };
1017
+ Authentication.prototype.createsUserByCredential = function (user) {
1018
+ var _a;
1019
+ return __awaiter(this, void 0, void 0, function () {
1020
+ var _b, firstName, lastName, person;
1021
+ return __generator(this, function (_c) {
1022
+ _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1023
+ person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1024
+ lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1025
+ return [2 /*return*/, this.userRepository.create(person)];
1026
+ });
1027
+ });
1028
+ };
1029
+ return Authentication;
1009
1030
  }());
1010
1031
 
1011
- var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1012
- __extends(UserAlreadyRegisteredError, _super);
1013
- function UserAlreadyRegisteredError(message) {
1014
- var _this = _super.call(this, message) || this;
1015
- _this.message = message;
1016
- return _this;
1017
- }
1018
- return UserAlreadyRegisteredError;
1032
+ var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1033
+ __extends(UserAlreadyRegisteredError, _super);
1034
+ function UserAlreadyRegisteredError(message) {
1035
+ var _this = _super.call(this, message) || this;
1036
+ _this.message = message;
1037
+ return _this;
1038
+ }
1039
+ return UserAlreadyRegisteredError;
1019
1040
  }(Error));
1020
1041
 
1021
- var WeakPasswordError = /** @class */ (function (_super) {
1022
- __extends(WeakPasswordError, _super);
1023
- function WeakPasswordError(message) {
1024
- if (message === void 0) { message = 'Weak password'; }
1025
- var _this = _super.call(this, message) || this;
1026
- _this.message = message;
1027
- return _this;
1028
- }
1029
- return WeakPasswordError;
1042
+ var WeakPasswordError = /** @class */ (function (_super) {
1043
+ __extends(WeakPasswordError, _super);
1044
+ function WeakPasswordError(message) {
1045
+ if (message === void 0) { message = 'Weak password'; }
1046
+ var _this = _super.call(this, message) || this;
1047
+ _this.message = message;
1048
+ return _this;
1049
+ }
1050
+ return WeakPasswordError;
1030
1051
  }(Error));
1031
1052
 
1032
- var Register = /** @class */ (function () {
1033
- function Register(registerService, userRepository) {
1034
- this.registerService = registerService;
1035
- this.userRepository = userRepository;
1036
- }
1037
- Register.prototype.register = function (params) {
1038
- return __awaiter(this, void 0, void 0, function () {
1039
- var email, displayName, auth, user;
1040
- return __generator(this, function (_a) {
1041
- switch (_a.label) {
1042
- case 0:
1043
- email = params.email.toLocaleLowerCase();
1044
- displayName = params.firstName + " " + params.lastName;
1045
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1046
- case 1:
1047
- if (_a.sent())
1048
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1049
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1050
- case 2:
1051
- if (_a.sent())
1052
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1053
- return [4 /*yield*/, this.registerService.register({
1054
- birthday: params.birthday,
1055
- email: email,
1056
- firstName: params.firstName,
1057
- lastName: params.lastName,
1058
- cpf: params.cpf,
1059
- displayName: displayName,
1060
- phone: params.phone,
1061
- password: params.password,
1062
- })];
1063
- case 3:
1064
- auth = _a.sent();
1065
- delete params.password;
1066
- return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1067
- displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1068
- case 4:
1069
- user = _a.sent();
1070
- return [2 /*return*/, user];
1071
- }
1072
- });
1073
- });
1074
- };
1075
- return Register;
1076
- }());
1077
-
1078
- var SignOut = /** @class */ (function () {
1079
- function SignOut(authService) {
1080
- this.authService = authService;
1081
- }
1082
- SignOut.prototype.signOut = function () {
1083
- return __awaiter(this, void 0, void 0, function () {
1084
- return __generator(this, function (_a) {
1085
- switch (_a.label) {
1086
- case 0: return [4 /*yield*/, this.authService.signOut()];
1087
- case 1:
1088
- _a.sent();
1089
- return [2 /*return*/];
1090
- }
1091
- });
1092
- });
1093
- };
1094
- return SignOut;
1053
+ var Register = /** @class */ (function () {
1054
+ function Register(registerService, userRepository) {
1055
+ this.registerService = registerService;
1056
+ this.userRepository = userRepository;
1057
+ }
1058
+ Register.prototype.register = function (params) {
1059
+ return __awaiter(this, void 0, void 0, function () {
1060
+ var email, displayName, auth, user;
1061
+ return __generator(this, function (_a) {
1062
+ switch (_a.label) {
1063
+ case 0:
1064
+ email = params.email.toLocaleLowerCase();
1065
+ displayName = params.firstName + " " + params.lastName;
1066
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1067
+ case 1:
1068
+ if (_a.sent())
1069
+ throw new UserAlreadyRegisteredError("User with CPF " + params.cpf + " already registered");
1070
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1071
+ case 2:
1072
+ if (_a.sent())
1073
+ throw new UserAlreadyRegisteredError("User with E-mail " + params.email + " already registered");
1074
+ return [4 /*yield*/, this.registerService.register({
1075
+ birthday: params.birthday,
1076
+ email: email,
1077
+ firstName: params.firstName,
1078
+ lastName: params.lastName,
1079
+ cpf: params.cpf,
1080
+ displayName: displayName,
1081
+ phone: params.phone,
1082
+ password: params.password,
1083
+ })];
1084
+ case 3:
1085
+ auth = _a.sent();
1086
+ delete params.password;
1087
+ return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1088
+ displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1089
+ case 4:
1090
+ user = _a.sent();
1091
+ return [2 /*return*/, user];
1092
+ }
1093
+ });
1094
+ });
1095
+ };
1096
+ return Register;
1095
1097
  }());
1096
1098
 
1097
- var RecoveryPassword = /** @class */ (function () {
1098
- function RecoveryPassword(authService) {
1099
- this.authService = authService;
1100
- }
1101
- RecoveryPassword.prototype.sendEmail = function (email) {
1102
- return __awaiter(this, void 0, void 0, function () {
1103
- return __generator(this, function (_a) {
1104
- switch (_a.label) {
1105
- case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1106
- case 1:
1107
- _a.sent();
1108
- return [2 /*return*/];
1109
- }
1110
- });
1111
- });
1112
- };
1113
- return RecoveryPassword;
1099
+ var SignOut = /** @class */ (function () {
1100
+ function SignOut(authService) {
1101
+ this.authService = authService;
1102
+ }
1103
+ SignOut.prototype.signOut = function () {
1104
+ return __awaiter(this, void 0, void 0, function () {
1105
+ return __generator(this, function (_a) {
1106
+ switch (_a.label) {
1107
+ case 0: return [4 /*yield*/, this.authService.signOut()];
1108
+ case 1:
1109
+ _a.sent();
1110
+ return [2 /*return*/];
1111
+ }
1112
+ });
1113
+ });
1114
+ };
1115
+ return SignOut;
1114
1116
  }());
1115
1117
 
1116
- exports.Shops = void 0;
1117
- (function (Shops) {
1118
- Shops["MENSMARKET"] = "mensmarket";
1119
- Shops["GLAMSHOP"] = "Glamshop";
1120
- Shops["GLAMPOINTS"] = "Glampoints";
1118
+ exports.Shops = void 0;
1119
+ (function (Shops) {
1120
+ Shops["MENSMARKET"] = "mensmarket";
1121
+ Shops["GLAMSHOP"] = "Glamshop";
1121
1122
  })(exports.Shops || (exports.Shops = {}));
1122
1123
 
1123
- var Category = /** @class */ (function (_super) {
1124
- __extends(Category, _super);
1125
- function Category() {
1126
- return _super !== null && _super.apply(this, arguments) || this;
1127
- }
1128
- Category.prototype.identifierFields = function () {
1129
- return ['id'];
1130
- };
1131
- return Category;
1124
+ var Category = /** @class */ (function (_super) {
1125
+ __extends(Category, _super);
1126
+ function Category() {
1127
+ return _super !== null && _super.apply(this, arguments) || this;
1128
+ }
1129
+ Category.prototype.identifierFields = function () {
1130
+ return ['id'];
1131
+ };
1132
+ return Category;
1132
1133
  }(BaseModel));
1133
1134
 
1134
- var Product = /** @class */ (function (_super) {
1135
- __extends(Product, _super);
1136
- function Product() {
1137
- return _super !== null && _super.apply(this, arguments) || this;
1138
- }
1139
- Product.prototype.identifierFields = function () {
1140
- return ['id'];
1141
- };
1142
- Product.prototype.getInfoByShop = function (shop) {
1143
- var _a, _b, _c, _d, _e, _f;
1144
- return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
1145
- };
1146
- return Product;
1135
+ var Product = /** @class */ (function (_super) {
1136
+ __extends(Product, _super);
1137
+ function Product() {
1138
+ return _super !== null && _super.apply(this, arguments) || this;
1139
+ }
1140
+ Product.prototype.identifierFields = function () {
1141
+ return ['id'];
1142
+ };
1143
+ Product.prototype.getInfoByShop = function (shop) {
1144
+ var _a, _b, _c, _d, _e, _f;
1145
+ return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
1146
+ };
1147
+ return Product;
1147
1148
  }(BaseModel));
1148
1149
 
1149
- var Variant = /** @class */ (function (_super) {
1150
- __extends(Variant, _super);
1151
- function Variant() {
1152
- return _super !== null && _super.apply(this, arguments) || this;
1153
- }
1154
- Variant.prototype.identifierFields = function () {
1155
- return ['id'];
1156
- };
1157
- return Variant;
1150
+ var Variant = /** @class */ (function (_super) {
1151
+ __extends(Variant, _super);
1152
+ function Variant() {
1153
+ return _super !== null && _super.apply(this, arguments) || this;
1154
+ }
1155
+ Variant.prototype.identifierFields = function () {
1156
+ return ['id'];
1157
+ };
1158
+ return Variant;
1158
1159
  }(BaseModel));
1159
1160
 
1160
- exports.CouponTypes = void 0;
1161
- (function (CouponTypes) {
1162
- CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
1163
- CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
1164
- CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
1165
- CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
1166
- })(exports.CouponTypes || (exports.CouponTypes = {}));
1167
-
1168
- exports.CouponSubtypes = void 0;
1169
- (function (CouponSubtypes) {
1170
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1171
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1172
- })(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
1173
-
1174
- exports.Exclusivities = void 0;
1175
- (function (Exclusivities) {
1176
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
1177
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
1178
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
1179
- })(exports.Exclusivities || (exports.Exclusivities = {}));
1180
-
1181
- exports.CheckoutTypes = void 0;
1182
- (function (CheckoutTypes) {
1183
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1184
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1161
+ exports.CheckoutTypes = void 0;
1162
+ (function (CheckoutTypes) {
1163
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1164
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1185
1165
  })(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
1186
1166
 
1187
- var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
1188
- var FinancialCoupon = /** @class */ (function (_super) {
1189
- __extends(FinancialCoupon, _super);
1190
- function FinancialCoupon() {
1191
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1192
- _this.type = exports.CouponTypes.FINANCIAL;
1193
- return _this;
1194
- }
1195
- FinancialCoupon.isFinancialCoupon = function (coupon) {
1196
- return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
1197
- };
1198
- FinancialCoupon.createCoupon = function (userId) {
1199
- return this.toInstance({
1200
- name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
1201
- nickname: "" + Date.now(),
1202
- type: exports.CouponTypes.FINANCIAL,
1203
- subtype: exports.CouponSubtypes.PERCENTAGE,
1204
- checkoutType: exports.CheckoutTypes.ECOMMERCE,
1205
- discount: 30,
1206
- user: userId,
1207
- createdAt: new Date(Date.now()),
1208
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
1209
- });
1210
- };
1211
- return FinancialCoupon;
1167
+ var ClubCoupon = /** @class */ (function (_super) {
1168
+ __extends(ClubCoupon, _super);
1169
+ function ClubCoupon() {
1170
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1171
+ _this.checkoutType = exports.CheckoutTypes.SUBSCRIPTION;
1172
+ return _this;
1173
+ }
1174
+ ClubCoupon.isClubCoupon = function (coupon) {
1175
+ return coupon instanceof ClubCoupon;
1176
+ };
1177
+ return ClubCoupon;
1212
1178
  }(Coupon));
1213
-
1214
- exports.OrderStatus = void 0;
1215
- (function (OrderStatus) {
1216
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1217
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
1218
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1219
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1220
- OrderStatus["ENVIADO"] = "Pedido Enviado";
1221
- OrderStatus["ENTREGUE"] = "Pedido entregue";
1222
- OrderStatus["CANCELADO"] = "Cancelado";
1223
- OrderStatus["CREDIT_CARD"] = "credit_card";
1179
+ __decorate([
1180
+ classTransformer.Expose({ name: 'checkout_type' }),
1181
+ __metadata("design:type", Object)
1182
+ ], ClubCoupon.prototype, "checkoutType", void 0);
1183
+ __decorate([
1184
+ classTransformer.Type(function () { return Category; }),
1185
+ __metadata("design:type", Array)
1186
+ ], ClubCoupon.prototype, "categories", void 0);
1187
+
1188
+ var StoreCoupon = /** @class */ (function (_super) {
1189
+ __extends(StoreCoupon, _super);
1190
+ function StoreCoupon() {
1191
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1192
+ _this.checkoutType = exports.CheckoutTypes.ECOMMERCE;
1193
+ return _this;
1194
+ }
1195
+ StoreCoupon.isStoreCoupon = function (coupon) {
1196
+ return coupon instanceof StoreCoupon;
1197
+ };
1198
+ return StoreCoupon;
1199
+ }(Coupon));
1200
+ __decorate([
1201
+ classTransformer.Expose({ name: 'checkout_type' }),
1202
+ __metadata("design:type", Object)
1203
+ ], StoreCoupon.prototype, "checkoutType", void 0);
1204
+ __decorate([
1205
+ classTransformer.Type(function () { return Category; }),
1206
+ __metadata("design:type", Array)
1207
+ ], StoreCoupon.prototype, "categories", void 0);
1208
+
1209
+ exports.OrderStatus = void 0;
1210
+ (function (OrderStatus) {
1211
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1212
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
1213
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1214
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1215
+ OrderStatus["ENVIADO"] = "Pedido Enviado";
1216
+ OrderStatus["ENTREGUE"] = "Pedido entregue";
1217
+ OrderStatus["CANCELADO"] = "Cancelado";
1218
+ OrderStatus["CREDIT_CARD"] = "credit_card";
1224
1219
  })(exports.OrderStatus || (exports.OrderStatus = {}));
1225
1220
 
1226
- var LineItem = /** @class */ (function (_super) {
1227
- __extends(LineItem, _super);
1228
- function LineItem() {
1229
- return _super !== null && _super.apply(this, arguments) || this;
1230
- }
1231
- return LineItem;
1221
+ var LineItem = /** @class */ (function (_super) {
1222
+ __extends(LineItem, _super);
1223
+ function LineItem() {
1224
+ return _super !== null && _super.apply(this, arguments) || this;
1225
+ }
1226
+ return LineItem;
1232
1227
  }(Product));
1233
1228
 
1234
- var ShippingMethod = /** @class */ (function (_super) {
1235
- __extends(ShippingMethod, _super);
1236
- function ShippingMethod() {
1237
- return _super !== null && _super.apply(this, arguments) || this;
1238
- }
1239
- ShippingMethod.prototype.identifierFields = function () {
1240
- return ['id'];
1241
- };
1242
- return ShippingMethod;
1229
+ var ShippingMethod = /** @class */ (function (_super) {
1230
+ __extends(ShippingMethod, _super);
1231
+ function ShippingMethod() {
1232
+ return _super !== null && _super.apply(this, arguments) || this;
1233
+ }
1234
+ ShippingMethod.prototype.identifierFields = function () {
1235
+ return ['id'];
1236
+ };
1237
+ return ShippingMethod;
1243
1238
  }(BaseModel));
1244
1239
 
1245
- var Checkout = /** @class */ (function (_super) {
1246
- __extends(Checkout, _super);
1247
- function Checkout() {
1248
- return _super !== null && _super.apply(this, arguments) || this;
1249
- }
1250
- Checkout.prototype.identifierFields = function () {
1251
- return ['id'];
1252
- };
1253
- return Checkout;
1254
- }(BaseModel));
1255
- __decorate([
1256
- classTransformer.Type(function () { return LineItem; }),
1257
- __metadata("design:type", Array)
1258
- ], Checkout.prototype, "lineItems", void 0);
1259
- __decorate([
1260
- classTransformer.Type(function () { return User; }),
1261
- __metadata("design:type", User)
1262
- ], Checkout.prototype, "user", void 0);
1263
- __decorate([
1264
- classTransformer.Type(function () { return Address; }),
1265
- __metadata("design:type", Address)
1266
- ], Checkout.prototype, "shippingAddress", void 0);
1267
- __decorate([
1268
- classTransformer.Type(function () { return Address; }),
1269
- __metadata("design:type", Address)
1270
- ], Checkout.prototype, "billingAddress", void 0);
1271
- __decorate([
1272
- classTransformer.Type(function () { return ShippingMethod; }),
1273
- __metadata("design:type", ShippingMethod)
1274
- ], Checkout.prototype, "shipping", void 0);
1275
- __decorate([
1276
- classTransformer.Type(function () { return Coupon; }),
1277
- __metadata("design:type", Coupon)
1240
+ var Checkout = /** @class */ (function (_super) {
1241
+ __extends(Checkout, _super);
1242
+ function Checkout() {
1243
+ return _super !== null && _super.apply(this, arguments) || this;
1244
+ }
1245
+ Checkout.prototype.identifierFields = function () {
1246
+ return ['id'];
1247
+ };
1248
+ return Checkout;
1249
+ }(BaseModel));
1250
+ __decorate([
1251
+ classTransformer.Type(function () { return LineItem; }),
1252
+ __metadata("design:type", Array)
1253
+ ], Checkout.prototype, "lineItems", void 0);
1254
+ __decorate([
1255
+ classTransformer.Type(function () { return User; }),
1256
+ __metadata("design:type", User)
1257
+ ], Checkout.prototype, "user", void 0);
1258
+ __decorate([
1259
+ classTransformer.Type(function () { return Address; }),
1260
+ __metadata("design:type", Address)
1261
+ ], Checkout.prototype, "shippingAddress", void 0);
1262
+ __decorate([
1263
+ classTransformer.Type(function () { return Address; }),
1264
+ __metadata("design:type", Address)
1265
+ ], Checkout.prototype, "billingAddress", void 0);
1266
+ __decorate([
1267
+ classTransformer.Type(function () { return ShippingMethod; }),
1268
+ __metadata("design:type", ShippingMethod)
1269
+ ], Checkout.prototype, "shipping", void 0);
1270
+ __decorate([
1271
+ classTransformer.Type(function () { return Coupon; }),
1272
+ __metadata("design:type", Coupon)
1278
1273
  ], Checkout.prototype, "coupon", void 0);
1279
1274
 
1280
- var Order = /** @class */ (function (_super) {
1281
- __extends(Order, _super);
1282
- function Order() {
1283
- return _super !== null && _super.apply(this, arguments) || this;
1284
- }
1285
- return Order;
1286
- }(Checkout));
1287
- __decorate([
1288
- classTransformer.Type(function () { return Payment; }),
1289
- __metadata("design:type", Payment)
1275
+ var Order = /** @class */ (function (_super) {
1276
+ __extends(Order, _super);
1277
+ function Order() {
1278
+ return _super !== null && _super.apply(this, arguments) || this;
1279
+ }
1280
+ return Order;
1281
+ }(Checkout));
1282
+ __decorate([
1283
+ classTransformer.Type(function () { return Payment; }),
1284
+ __metadata("design:type", Payment)
1290
1285
  ], Order.prototype, "payment", void 0);
1291
1286
 
1292
- var CheckoutSubscription = /** @class */ (function (_super) {
1293
- __extends(CheckoutSubscription, _super);
1294
- function CheckoutSubscription() {
1295
- return _super !== null && _super.apply(this, arguments) || this;
1296
- }
1297
- CheckoutSubscription.prototype.identifierFields = function () {
1298
- return ['id'];
1299
- };
1300
- return CheckoutSubscription;
1301
- }(BaseModel));
1302
- __decorate([
1303
- classTransformer.Type(function () { return Address; }),
1304
- __metadata("design:type", Address)
1305
- ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1306
- __decorate([
1307
- classTransformer.Type(function () { return Address; }),
1308
- __metadata("design:type", Address)
1309
- ], CheckoutSubscription.prototype, "billingAddress", void 0);
1310
- __decorate([
1311
- classTransformer.Type(function () { return SubscriptionPlan; }),
1312
- __metadata("design:type", SubscriptionPlan)
1313
- ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1314
- __decorate([
1315
- classTransformer.Type(function () { return Coupon; }),
1316
- __metadata("design:type", Coupon)
1287
+ var CheckoutSubscription = /** @class */ (function (_super) {
1288
+ __extends(CheckoutSubscription, _super);
1289
+ function CheckoutSubscription() {
1290
+ return _super !== null && _super.apply(this, arguments) || this;
1291
+ }
1292
+ CheckoutSubscription.prototype.identifierFields = function () {
1293
+ return ['id'];
1294
+ };
1295
+ return CheckoutSubscription;
1296
+ }(BaseModel));
1297
+ __decorate([
1298
+ classTransformer.Type(function () { return Address; }),
1299
+ __metadata("design:type", Address)
1300
+ ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1301
+ __decorate([
1302
+ classTransformer.Type(function () { return Address; }),
1303
+ __metadata("design:type", Address)
1304
+ ], CheckoutSubscription.prototype, "billingAddress", void 0);
1305
+ __decorate([
1306
+ classTransformer.Type(function () { return SubscriptionPlan; }),
1307
+ __metadata("design:type", SubscriptionPlan)
1308
+ ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1309
+ __decorate([
1310
+ classTransformer.Type(function () { return Coupon; }),
1311
+ __metadata("design:type", Coupon)
1317
1312
  ], CheckoutSubscription.prototype, "coupon", void 0);
1318
1313
 
1319
- var Buy2Win = /** @class */ (function (_super) {
1320
- __extends(Buy2Win, _super);
1321
- function Buy2Win() {
1322
- return _super !== null && _super.apply(this, arguments) || this;
1323
- }
1324
- Buy2Win.prototype.identifierFields = function () {
1325
- return ['id'];
1326
- };
1327
- return Buy2Win;
1328
- }(BaseModel));
1329
- __decorate([
1330
- classTransformer.Type(function () { return Category; }),
1331
- __metadata("design:type", Array)
1314
+ var Buy2Win = /** @class */ (function (_super) {
1315
+ __extends(Buy2Win, _super);
1316
+ function Buy2Win() {
1317
+ return _super !== null && _super.apply(this, arguments) || this;
1318
+ }
1319
+ Buy2Win.prototype.identifierFields = function () {
1320
+ return ['id'];
1321
+ };
1322
+ return Buy2Win;
1323
+ }(BaseModel));
1324
+ __decorate([
1325
+ classTransformer.Type(function () { return Category; }),
1326
+ __metadata("design:type", Array)
1332
1327
  ], Buy2Win.prototype, "categories", void 0);
1333
1328
 
1334
- exports.FilterType = void 0;
1335
- (function (FilterType) {
1336
- FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1337
- FilterType["BEARD_PROBLEMS"] = "beardProblems";
1338
- FilterType["BEARD_SIZE"] = "beardSize";
1339
- FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1340
- FilterType["BODY_PROBLEMS"] = "bodyProblems";
1341
- FilterType["BODY_SHAPE"] = "bodyShape";
1342
- FilterType["BODY_TATTOOS"] = "bodyTattoos";
1343
- FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1344
- FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1345
- FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1346
- FilterType["FAMILY_INCOME"] = "familyIncome";
1347
- FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1348
- FilterType["HAIR_COLOR"] = "hairColor";
1349
- FilterType["HAIR_PROBLEMS"] = "hairProblems";
1350
- FilterType["HAIR_STRANDS"] = "hairStrands";
1351
- FilterType["HAIR_TYPE"] = "hairType";
1352
- FilterType["PRODUCT_SPENT"] = "productSpent";
1329
+ exports.FilterType = void 0;
1330
+ (function (FilterType) {
1331
+ FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1332
+ FilterType["BEARD_PROBLEMS"] = "beardProblems";
1333
+ FilterType["BEARD_SIZE"] = "beardSize";
1334
+ FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1335
+ FilterType["BODY_PROBLEMS"] = "bodyProblems";
1336
+ FilterType["BODY_SHAPE"] = "bodyShape";
1337
+ FilterType["BODY_TATTOOS"] = "bodyTattoos";
1338
+ FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1339
+ FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1340
+ FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1341
+ FilterType["FAMILY_INCOME"] = "familyIncome";
1342
+ FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1343
+ FilterType["HAIR_COLOR"] = "hairColor";
1344
+ FilterType["HAIR_PROBLEMS"] = "hairProblems";
1345
+ FilterType["HAIR_STRANDS"] = "hairStrands";
1346
+ FilterType["HAIR_TYPE"] = "hairType";
1347
+ FilterType["PRODUCT_SPENT"] = "productSpent";
1353
1348
  })(exports.FilterType || (exports.FilterType = {}));
1354
1349
 
1355
- exports.QuestionsFilters = void 0;
1356
- (function (QuestionsFilters) {
1357
- QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1358
- QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1359
- QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1360
- QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1361
- QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1362
- QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1363
- QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1364
- QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1365
- QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1366
- QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1367
- QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1368
- QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1369
- QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1370
- QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1371
- QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1372
- QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1373
- QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1350
+ exports.QuestionsFilters = void 0;
1351
+ (function (QuestionsFilters) {
1352
+ QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1353
+ QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1354
+ QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1355
+ QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1356
+ QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1357
+ QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1358
+ QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1359
+ QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1360
+ QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1361
+ QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1362
+ QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1363
+ QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1364
+ QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1365
+ QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1366
+ QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1367
+ QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1368
+ QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1374
1369
  })(exports.QuestionsFilters || (exports.QuestionsFilters = {}));
1375
1370
 
1376
- var BeautyQuestionsHelper = /** @class */ (function () {
1377
- function BeautyQuestionsHelper() {
1378
- }
1379
- BeautyQuestionsHelper.getAnswers = function (filter) {
1380
- switch (filter) {
1381
- case exports.FilterType.ACCESSORY_IMPORTANCE:
1382
- return exports.AccessoryImportances;
1383
- case exports.FilterType.BEARD_PROBLEMS:
1384
- return exports.BeardProblems;
1385
- case exports.FilterType.BEARD_SIZE:
1386
- return exports.BeardSizes;
1387
- case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1388
- return exports.BeautyProductImportances;
1389
- case exports.FilterType.BODY_PROBLEMS:
1390
- return exports.BodyProblems;
1391
- case exports.FilterType.BODY_SHAPE:
1392
- return exports.BodyShapes;
1393
- case exports.FilterType.BODY_TATTOOS:
1394
- return exports.BodyTattoos;
1395
- case exports.FilterType.FACE_SKIN_OILINESS:
1396
- return exports.FaceSkinOilinesses;
1397
- case exports.FilterType.FACE_SKIN_PROBLEMS:
1398
- return exports.FaceSkinProblems;
1399
- case exports.FilterType.FACE_SKIN_TONE:
1400
- return exports.FaceSkinTones;
1401
- case exports.FilterType.FAMILY_INCOME:
1402
- return exports.FamilyIncomes;
1403
- case exports.FilterType.FRAGRANCE_IMPORTANCE:
1404
- return exports.FragranceImportances;
1405
- case exports.FilterType.HAIR_COLOR:
1406
- return exports.HairColors;
1407
- case exports.FilterType.HAIR_PROBLEMS:
1408
- return exports.HairProblems;
1409
- case exports.FilterType.HAIR_STRANDS:
1410
- return exports.HairStrands;
1411
- case exports.FilterType.HAIR_TYPE:
1412
- return exports.HairTypes;
1413
- case exports.FilterType.PRODUCT_SPENT:
1414
- return exports.ProductSpents;
1415
- }
1416
- };
1417
- BeautyQuestionsHelper.getQuestions = function (filter) {
1418
- return exports.QuestionsFilters[filter];
1419
- };
1420
- return BeautyQuestionsHelper;
1371
+ var BeautyQuestionsHelper = /** @class */ (function () {
1372
+ function BeautyQuestionsHelper() {
1373
+ }
1374
+ BeautyQuestionsHelper.getAnswers = function (filter) {
1375
+ switch (filter) {
1376
+ case exports.FilterType.ACCESSORY_IMPORTANCE:
1377
+ return exports.AccessoryImportances;
1378
+ case exports.FilterType.BEARD_PROBLEMS:
1379
+ return exports.BeardProblems;
1380
+ case exports.FilterType.BEARD_SIZE:
1381
+ return exports.BeardSizes;
1382
+ case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1383
+ return exports.BeautyProductImportances;
1384
+ case exports.FilterType.BODY_PROBLEMS:
1385
+ return exports.BodyProblems;
1386
+ case exports.FilterType.BODY_SHAPE:
1387
+ return exports.BodyShapes;
1388
+ case exports.FilterType.BODY_TATTOOS:
1389
+ return exports.BodyTattoos;
1390
+ case exports.FilterType.FACE_SKIN_OILINESS:
1391
+ return exports.FaceSkinOilinesses;
1392
+ case exports.FilterType.FACE_SKIN_PROBLEMS:
1393
+ return exports.FaceSkinProblems;
1394
+ case exports.FilterType.FACE_SKIN_TONE:
1395
+ return exports.FaceSkinTones;
1396
+ case exports.FilterType.FAMILY_INCOME:
1397
+ return exports.FamilyIncomes;
1398
+ case exports.FilterType.FRAGRANCE_IMPORTANCE:
1399
+ return exports.FragranceImportances;
1400
+ case exports.FilterType.HAIR_COLOR:
1401
+ return exports.HairColors;
1402
+ case exports.FilterType.HAIR_PROBLEMS:
1403
+ return exports.HairProblems;
1404
+ case exports.FilterType.HAIR_STRANDS:
1405
+ return exports.HairStrands;
1406
+ case exports.FilterType.HAIR_TYPE:
1407
+ return exports.HairTypes;
1408
+ case exports.FilterType.PRODUCT_SPENT:
1409
+ return exports.ProductSpents;
1410
+ }
1411
+ };
1412
+ BeautyQuestionsHelper.getQuestions = function (filter) {
1413
+ return exports.QuestionsFilters[filter];
1414
+ };
1415
+ return BeautyQuestionsHelper;
1421
1416
  }());
1422
1417
 
1423
- var Home = /** @class */ (function (_super) {
1424
- __extends(Home, _super);
1425
- function Home() {
1426
- return _super !== null && _super.apply(this, arguments) || this;
1427
- }
1428
- Home.prototype.identifierFields = function () {
1429
- return ['id'];
1430
- };
1431
- return Home;
1418
+ var Home = /** @class */ (function (_super) {
1419
+ __extends(Home, _super);
1420
+ function Home() {
1421
+ return _super !== null && _super.apply(this, arguments) || this;
1422
+ }
1423
+ Home.prototype.identifierFields = function () {
1424
+ return ['id'];
1425
+ };
1426
+ return Home;
1432
1427
  }(BaseModel));
1433
1428
 
1434
- var ShopMenu = /** @class */ (function (_super) {
1435
- __extends(ShopMenu, _super);
1436
- function ShopMenu() {
1437
- return _super !== null && _super.apply(this, arguments) || this;
1438
- }
1439
- ShopMenu.prototype.identifierFields = function () {
1440
- return ['id'];
1441
- };
1442
- return ShopMenu;
1429
+ var ShopMenu = /** @class */ (function (_super) {
1430
+ __extends(ShopMenu, _super);
1431
+ function ShopMenu() {
1432
+ return _super !== null && _super.apply(this, arguments) || this;
1433
+ }
1434
+ ShopMenu.prototype.identifierFields = function () {
1435
+ return ['id'];
1436
+ };
1437
+ return ShopMenu;
1443
1438
  }(BaseModel));
1444
1439
 
1445
- var ShopSettings = /** @class */ (function (_super) {
1446
- __extends(ShopSettings, _super);
1447
- function ShopSettings() {
1448
- return _super !== null && _super.apply(this, arguments) || this;
1449
- }
1450
- ShopSettings.prototype.identifierFields = function () {
1451
- return ['id'];
1452
- };
1453
- return ShopSettings;
1454
- }(BaseModel));
1455
-
1456
- var InvalidArgumentError = /** @class */ (function (_super) {
1457
- __extends(InvalidArgumentError, _super);
1458
- function InvalidArgumentError(message) {
1459
- var _this = _super.call(this, message) || this;
1460
- _this.message = message;
1461
- return _this;
1462
- }
1463
- return InvalidArgumentError;
1440
+ var InvalidArgumentError = /** @class */ (function (_super) {
1441
+ __extends(InvalidArgumentError, _super);
1442
+ function InvalidArgumentError(message) {
1443
+ var _this = _super.call(this, message) || this;
1444
+ _this.message = message;
1445
+ return _this;
1446
+ }
1447
+ return InvalidArgumentError;
1464
1448
  }(Error));
1465
1449
 
1466
- var RequiredArgumentError = /** @class */ (function (_super) {
1467
- __extends(RequiredArgumentError, _super);
1468
- function RequiredArgumentError(args) {
1469
- var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1470
- _this.args = args;
1471
- _this.arguments = args;
1472
- return _this;
1473
- }
1474
- return RequiredArgumentError;
1450
+ var RequiredArgumentError = /** @class */ (function (_super) {
1451
+ __extends(RequiredArgumentError, _super);
1452
+ function RequiredArgumentError(args) {
1453
+ var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1454
+ _this.args = args;
1455
+ _this.arguments = args;
1456
+ return _this;
1457
+ }
1458
+ return RequiredArgumentError;
1475
1459
  }(Error));
1476
1460
 
1477
- var NotFoundError = /** @class */ (function (_super) {
1478
- __extends(NotFoundError, _super);
1479
- function NotFoundError(message) {
1480
- var _this = _super.call(this, message) || this;
1481
- _this.message = message;
1482
- return _this;
1483
- }
1484
- return NotFoundError;
1461
+ var NotFoundError = /** @class */ (function (_super) {
1462
+ __extends(NotFoundError, _super);
1463
+ function NotFoundError(message) {
1464
+ var _this = _super.call(this, message) || this;
1465
+ _this.message = message;
1466
+ return _this;
1467
+ }
1468
+ return NotFoundError;
1485
1469
  }(Error));
1486
1470
 
1487
- var DuplicatedResultsError = /** @class */ (function (_super) {
1488
- __extends(DuplicatedResultsError, _super);
1489
- function DuplicatedResultsError(message) {
1490
- var _this = _super.call(this, message) || this;
1491
- _this.message = message;
1492
- return _this;
1493
- }
1494
- return DuplicatedResultsError;
1471
+ var DuplicatedResultsError = /** @class */ (function (_super) {
1472
+ __extends(DuplicatedResultsError, _super);
1473
+ function DuplicatedResultsError(message) {
1474
+ var _this = _super.call(this, message) || this;
1475
+ _this.message = message;
1476
+ return _this;
1477
+ }
1478
+ return DuplicatedResultsError;
1495
1479
  }(Error));
1496
1480
 
1497
- var AxiosAdapter = /** @class */ (function () {
1498
- function AxiosAdapter(config) {
1499
- this.config = config;
1500
- }
1501
- AxiosAdapter.prototype.query = function (index, query) {
1502
- return __awaiter(this, void 0, void 0, function () {
1503
- var data;
1504
- return __generator(this, function (_a) {
1505
- switch (_a.label) {
1506
- case 0: return [4 /*yield*/, axios__default["default"]({
1507
- url: this.config.url + "/" + index,
1508
- method: 'POST',
1509
- headers: { Authorization: "Basic " + this.config.credential },
1510
- data: query,
1511
- })];
1512
- case 1:
1513
- data = (_a.sent()).data;
1514
- return [2 /*return*/, {
1515
- total: data.hits.total.value,
1516
- hits: data.hits.hits,
1517
- }];
1518
- }
1519
- });
1520
- });
1521
- };
1522
- return AxiosAdapter;
1523
- }());
1524
-
1525
- var ProductsIndex = /** @class */ (function () {
1526
- function ProductsIndex(adapter) {
1527
- this.adapter = adapter;
1528
- }
1529
- ProductsIndex.prototype.findById = function (ids, options) {
1530
- return __awaiter(this, void 0, void 0, function () {
1531
- var publishedField, fields, hits;
1532
- var _a;
1533
- return __generator(this, function (_b) {
1534
- switch (_b.label) {
1535
- case 0:
1536
- publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1537
- fields = [
1538
- 'brand',
1539
- 'id',
1540
- 'images',
1541
- 'miniatures',
1542
- 'name',
1543
- 'price',
1544
- 'sku',
1545
- 'stock',
1546
- 'slug',
1547
- 'reviews',
1548
- 'pricePaid',
1549
- 'isGift',
1550
- 'stock',
1551
- 'weight',
1552
- 'tags',
1553
- 'hasVariants',
1554
- ];
1555
- return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1556
- bool: {
1557
- filter: __spreadArray([
1558
- {
1559
- terms: {
1560
- _id: ids,
1561
- },
1562
- },
1563
- {
1564
- term: (_a = {},
1565
- _a[publishedField] = true,
1566
- _a),
1567
- }
1568
- ], __read((options.hasStock
1569
- ? [
1570
- {
1571
- range: {
1572
- 'stock.quantity': {
1573
- gt: 0,
1574
- },
1575
- },
1576
- },
1577
- ]
1578
- : []))),
1579
- },
1580
- } }, (options.size ? { size: options.size } : {})))];
1581
- case 1:
1582
- hits = (_b.sent()).hits;
1583
- return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
1584
- }
1585
- });
1586
- });
1587
- };
1588
- return ProductsIndex;
1589
- }());
1590
-
1591
- var withFirestore = function (MixinBase) {
1592
- return /** @class */ (function (_super) {
1593
- __extends(class_1, _super);
1594
- function class_1() {
1595
- var args = [];
1596
- for (var _i = 0; _i < arguments.length; _i++) {
1597
- args[_i] = arguments[_i];
1598
- }
1599
- return _super.call(this, args) || this;
1600
- }
1601
- class_1.prototype.collection = function (path) {
1602
- return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1603
- };
1604
- class_1.prototype.buildModelInstance = function () {
1605
- var _this = this;
1606
- return {
1607
- toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1608
- fromFirestore: function (snap) {
1609
- var data = snap.data();
1610
- Object.keys(data).forEach(function (key) {
1611
- if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1612
- data[key] = data[key].toDate();
1613
- }
1614
- });
1615
- return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1616
- },
1617
- };
1618
- };
1619
- return class_1;
1620
- }(MixinBase));
1481
+ var withFirestore = function (MixinBase) {
1482
+ return /** @class */ (function (_super) {
1483
+ __extends(class_1, _super);
1484
+ function class_1() {
1485
+ var args = [];
1486
+ for (var _i = 0; _i < arguments.length; _i++) {
1487
+ args[_i] = arguments[_i];
1488
+ }
1489
+ return _super.call(this, args) || this;
1490
+ }
1491
+ class_1.prototype.collection = function (path) {
1492
+ return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1493
+ };
1494
+ class_1.prototype.buildModelInstance = function () {
1495
+ var _this = this;
1496
+ return {
1497
+ toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1498
+ fromFirestore: function (snap) {
1499
+ var data = snap.data();
1500
+ Object.keys(data).forEach(function (key) {
1501
+ if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1502
+ data[key] = data[key].toDate();
1503
+ }
1504
+ });
1505
+ return _this.model.toInstance(Object.assign({ id: snap.id }, data));
1506
+ },
1507
+ };
1508
+ };
1509
+ return class_1;
1510
+ }(MixinBase));
1621
1511
  };
1622
1512
 
1623
- var withHelpers = function (MixinBase) {
1624
- return /** @class */ (function (_super) {
1625
- __extends(class_1, _super);
1626
- function class_1() {
1627
- return _super !== null && _super.apply(this, arguments) || this;
1628
- }
1629
- class_1.prototype.toArray = function (snapShot) {
1630
- if (Array.isArray(snapShot)) {
1631
- return snapShot.map(function (doc) { return doc.data(); });
1632
- }
1633
- else {
1634
- return snapShot.docs.map(function (doc) { return doc.data(); });
1635
- }
1636
- };
1637
- class_1.prototype.isSubCollection = function (repository) {
1638
- return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1639
- };
1640
- return class_1;
1641
- }(MixinBase));
1513
+ var withHelpers = function (MixinBase) {
1514
+ return /** @class */ (function (_super) {
1515
+ __extends(class_1, _super);
1516
+ function class_1() {
1517
+ return _super !== null && _super.apply(this, arguments) || this;
1518
+ }
1519
+ class_1.prototype.toArray = function (snapShot) {
1520
+ if (Array.isArray(snapShot)) {
1521
+ return snapShot.map(function (doc) { return doc.data(); });
1522
+ }
1523
+ else {
1524
+ return snapShot.docs.map(function (doc) { return doc.data(); });
1525
+ }
1526
+ };
1527
+ class_1.prototype.isSubCollection = function (repository) {
1528
+ return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1529
+ };
1530
+ return class_1;
1531
+ }(MixinBase));
1642
1532
  };
1643
1533
 
1644
- var withGetFirestore = function (MixinBase) {
1645
- return /** @class */ (function (_super) {
1646
- __extends(GetFirestore, _super);
1647
- function GetFirestore() {
1648
- return _super !== null && _super.apply(this, arguments) || this;
1649
- }
1650
- GetFirestore.prototype.get = function (identifiers) {
1651
- return __awaiter(this, void 0, void 0, function () {
1652
- var doc, data;
1653
- return __generator(this, function (_a) {
1654
- switch (_a.label) {
1655
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1656
- .doc(Object.values(identifiers).shift().toString())
1657
- .get()];
1658
- case 1:
1659
- doc = _a.sent();
1660
- data = doc.data();
1661
- if (lodash.isNil(data))
1662
- throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1663
- return [2 /*return*/, data];
1664
- }
1665
- });
1666
- });
1667
- };
1668
- GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1669
- return this.isSubCollection(this)
1670
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1671
- : this.collectionName;
1672
- };
1673
- return GetFirestore;
1674
- }(MixinBase));
1534
+ var withGetFirestore = function (MixinBase) {
1535
+ return /** @class */ (function (_super) {
1536
+ __extends(GetFirestore, _super);
1537
+ function GetFirestore() {
1538
+ return _super !== null && _super.apply(this, arguments) || this;
1539
+ }
1540
+ GetFirestore.prototype.get = function (identifiers) {
1541
+ return __awaiter(this, void 0, void 0, function () {
1542
+ var doc, data;
1543
+ return __generator(this, function (_a) {
1544
+ switch (_a.label) {
1545
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1546
+ .doc(Object.values(identifiers).shift().toString())
1547
+ .get()];
1548
+ case 1:
1549
+ doc = _a.sent();
1550
+ data = doc.data();
1551
+ if (lodash.isNil(data))
1552
+ throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1553
+ return [2 /*return*/, data];
1554
+ }
1555
+ });
1556
+ });
1557
+ };
1558
+ GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1559
+ return this.isSubCollection(this)
1560
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1561
+ : this.collectionName;
1562
+ };
1563
+ return GetFirestore;
1564
+ }(MixinBase));
1675
1565
  };
1676
1566
 
1677
- var withFindFirestore = function (MixinBase) {
1678
- var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1679
- var getValueFromFilter = function (filter) {
1680
- return checkIfIsFilterOption(filter) ? filter.value : filter;
1681
- };
1682
- var getFinalValueFrom = function (value) { return lodash.isNumber(value) || lodash.isString(value) || lodash.isDate(value) || Array.isArray(value)
1683
- ? value
1684
- : Object.values(getFinalValueFrom); };
1685
- return /** @class */ (function (_super) {
1686
- __extends(FindFirestore, _super);
1687
- function FindFirestore() {
1688
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1689
- _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1690
- _this.buildWhereSentence = function (queryReference, fieldName, options) {
1691
- if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1692
- return queryReference;
1693
- var value = (options === null || options === void 0 ? void 0 : options.value) || options;
1694
- var object = {};
1695
- lodash.set(object, fieldName, value);
1696
- var plainInstance = new _this.model(object).toPlain();
1697
- var firestoreFieldName = fieldName.toString().indexOf('.') > -1
1698
- ? fieldName.toString()
1699
- : Object.keys(plainInstance).find(function (key) { return plainInstance[key]; });
1700
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1701
- if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1702
- return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
1703
- queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
1704
- queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
1705
- return queryReference;
1706
- }
1707
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1708
- return queryReference.where(firestoreFieldName, 'array-contains', options.value);
1709
- if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value)) {
1710
- return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1711
- }
1712
- return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1713
- };
1714
- return _this;
1715
- }
1716
- FindFirestore.prototype.find = function (filters, limits, orderBy) {
1717
- return __awaiter(this, void 0, void 0, function () {
1718
- var query, docs, data;
1719
- var _this = this;
1720
- return __generator(this, function (_b) {
1721
- switch (_b.label) {
1722
- case 0:
1723
- query = this.collection(this.buildCollectionPathForFind(filters));
1724
- filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1725
- orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach(function (orderer) { return Object.keys(orderer).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderer[fieldName])); }); });
1726
- return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1727
- case 1:
1728
- query = _b.sent();
1729
- return [4 /*yield*/, query.get()];
1730
- case 2:
1731
- docs = _b.sent();
1732
- data = docs.docs.map(function (doc) { return doc.data(); });
1733
- return [2 /*return*/, {
1734
- data: data,
1735
- count: this.calculateCount(data, limits),
1736
- }];
1737
- }
1738
- });
1739
- });
1740
- };
1741
- FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1742
- var _a;
1743
- if (!this.isSubCollection(this))
1744
- return this.collectionName;
1745
- var parentIdField = this.parentIdField;
1746
- var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1747
- return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1748
- };
1749
- FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1750
- return __awaiter(this, void 0, void 0, function () {
1751
- var _b, _c;
1752
- return __generator(this, function (_d) {
1753
- switch (_d.label) {
1754
- case 0:
1755
- if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1756
- if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1757
- _c = (_b = query).startAfter;
1758
- return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1759
- .doc(limits.offset[limits.offset.identifierFields().shift()])
1760
- .get()];
1761
- case 1:
1762
- query = _c.apply(_b, [_d.sent()]);
1763
- return [3 /*break*/, 3];
1764
- case 2:
1765
- if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1766
- query = query.startAt(limits.offset);
1767
- _d.label = 3;
1768
- case 3:
1769
- if (limits === null || limits === void 0 ? void 0 : limits.limit)
1770
- query = query.limit(limits.limit);
1771
- return [2 /*return*/, query];
1772
- }
1773
- });
1774
- });
1775
- };
1776
- FindFirestore.prototype.calculateCount = function (data, limits) {
1777
- if (data.length <= 0)
1778
- return 0;
1779
- if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1780
- return data.length;
1781
- return Infinity;
1782
- };
1783
- return FindFirestore;
1784
- }(MixinBase));
1567
+ var withFindFirestore = function (MixinBase) {
1568
+ var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1569
+ var getValueFromFilter = function (filter) {
1570
+ return checkIfIsFilterOption(filter) ? filter.value : filter;
1571
+ };
1572
+ return /** @class */ (function (_super) {
1573
+ __extends(FindFirestore, _super);
1574
+ function FindFirestore() {
1575
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1576
+ _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1577
+ _this.buildWhereSentence = function (queryReference, fieldName, options) {
1578
+ if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1579
+ return queryReference;
1580
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1581
+ if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1582
+ return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
1583
+ queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
1584
+ queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
1585
+ return queryReference;
1586
+ }
1587
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1588
+ return queryReference.where(fieldName.toString(), 'array-contains', options.value);
1589
+ if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
1590
+ return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1591
+ return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1592
+ };
1593
+ return _this;
1594
+ }
1595
+ FindFirestore.prototype.find = function (filters, limits, orderBy) {
1596
+ return __awaiter(this, void 0, void 0, function () {
1597
+ var query, docs, data;
1598
+ var _this = this;
1599
+ return __generator(this, function (_b) {
1600
+ switch (_b.label) {
1601
+ case 0:
1602
+ query = this.collection(this.buildCollectionPathForFind(filters));
1603
+ filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1604
+ orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach(function (orderer) { return Object.keys(orderer).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderer[fieldName])); }); });
1605
+ return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1606
+ case 1:
1607
+ query = _b.sent();
1608
+ return [4 /*yield*/, query.get()];
1609
+ case 2:
1610
+ docs = _b.sent();
1611
+ data = docs.docs.map(function (doc) { return doc.data(); });
1612
+ return [2 /*return*/, {
1613
+ data: data,
1614
+ count: this.calculateCount(data, limits),
1615
+ }];
1616
+ }
1617
+ });
1618
+ });
1619
+ };
1620
+ FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1621
+ var _a;
1622
+ if (!this.isSubCollection(this))
1623
+ return this.collectionName;
1624
+ var parentIdField = this.parentIdField;
1625
+ var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1626
+ return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1627
+ };
1628
+ FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1629
+ return __awaiter(this, void 0, void 0, function () {
1630
+ var _b, _c;
1631
+ return __generator(this, function (_d) {
1632
+ switch (_d.label) {
1633
+ case 0:
1634
+ if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1635
+ if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1636
+ _c = (_b = query).startAfter;
1637
+ return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1638
+ .doc(limits.offset[limits.offset.identifierFields().shift()])
1639
+ .get()];
1640
+ case 1:
1641
+ query = _c.apply(_b, [_d.sent()]);
1642
+ return [3 /*break*/, 3];
1643
+ case 2:
1644
+ if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1645
+ query = query.startAt(limits.offset);
1646
+ _d.label = 3;
1647
+ case 3:
1648
+ if (limits === null || limits === void 0 ? void 0 : limits.limit)
1649
+ query = query.limit(limits.limit);
1650
+ return [2 /*return*/, query];
1651
+ }
1652
+ });
1653
+ });
1654
+ };
1655
+ FindFirestore.prototype.calculateCount = function (data, limits) {
1656
+ if (data.length <= 0)
1657
+ return 0;
1658
+ if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1659
+ return data.length;
1660
+ return Infinity;
1661
+ };
1662
+ return FindFirestore;
1663
+ }(MixinBase));
1785
1664
  };
1786
1665
 
1787
- var withCreateFirestore = function (MixinBase) {
1788
- return /** @class */ (function (_super) {
1789
- __extends(CreateFirestore, _super);
1790
- function CreateFirestore() {
1791
- return _super !== null && _super.apply(this, arguments) || this;
1792
- }
1793
- CreateFirestore.prototype.create = function (data) {
1794
- return __awaiter(this, void 0, void 0, function () {
1795
- var docRef, doc;
1796
- return __generator(this, function (_b) {
1797
- switch (_b.label) {
1798
- case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1799
- case 1:
1800
- docRef = _b.sent();
1801
- return [4 /*yield*/, docRef.get()];
1802
- case 2:
1803
- doc = _b.sent();
1804
- return [2 /*return*/, doc.data()];
1805
- }
1806
- });
1807
- });
1808
- };
1809
- CreateFirestore.prototype.save = function (data) {
1810
- var _a;
1811
- return __awaiter(this, void 0, void 0, function () {
1812
- var id, collectionPath, docRef;
1813
- return __generator(this, function (_b) {
1814
- switch (_b.label) {
1815
- case 0:
1816
- id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1817
- collectionPath = this.buildCollectionPathForAdd(data);
1818
- if (lodash.isEmpty(id))
1819
- return [2 /*return*/, this.collection(collectionPath).add(data)];
1820
- docRef = this.collection(collectionPath).doc(id);
1821
- return [4 /*yield*/, docRef.set(data)];
1822
- case 1:
1823
- _b.sent();
1824
- return [2 /*return*/, docRef];
1825
- }
1826
- });
1827
- });
1828
- };
1829
- CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1830
- return this.isSubCollection(this)
1831
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1832
- : this.collectionName;
1833
- };
1834
- return CreateFirestore;
1835
- }(MixinBase));
1666
+ var withCreateFirestore = function (MixinBase) {
1667
+ return /** @class */ (function (_super) {
1668
+ __extends(CreateFirestore, _super);
1669
+ function CreateFirestore() {
1670
+ return _super !== null && _super.apply(this, arguments) || this;
1671
+ }
1672
+ CreateFirestore.prototype.create = function (data) {
1673
+ return __awaiter(this, void 0, void 0, function () {
1674
+ var docRef, doc;
1675
+ return __generator(this, function (_b) {
1676
+ switch (_b.label) {
1677
+ case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1678
+ case 1:
1679
+ docRef = _b.sent();
1680
+ return [4 /*yield*/, docRef.get()];
1681
+ case 2:
1682
+ doc = _b.sent();
1683
+ return [2 /*return*/, doc.data()];
1684
+ }
1685
+ });
1686
+ });
1687
+ };
1688
+ CreateFirestore.prototype.save = function (data) {
1689
+ var _a;
1690
+ return __awaiter(this, void 0, void 0, function () {
1691
+ var id, collectionPath, docRef;
1692
+ return __generator(this, function (_b) {
1693
+ switch (_b.label) {
1694
+ case 0:
1695
+ id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1696
+ collectionPath = this.buildCollectionPathForAdd(data);
1697
+ if (lodash.isEmpty(id))
1698
+ return [2 /*return*/, this.collection(collectionPath).add(data)];
1699
+ docRef = this.collection(collectionPath).doc(id);
1700
+ return [4 /*yield*/, docRef.set(data)];
1701
+ case 1:
1702
+ _b.sent();
1703
+ return [2 /*return*/, docRef];
1704
+ }
1705
+ });
1706
+ });
1707
+ };
1708
+ CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1709
+ return this.isSubCollection(this)
1710
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1711
+ : this.collectionName;
1712
+ };
1713
+ return CreateFirestore;
1714
+ }(MixinBase));
1836
1715
  };
1837
1716
 
1838
- var withUpdateFirestore = function (MixinBase) {
1839
- var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
1840
- var getValueByAction = function (options) {
1841
- var fieldValues = firebase__default["default"].firestore.FieldValue;
1842
- if (lodash.isNil(options.action))
1843
- return options;
1844
- if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1845
- return fieldValues.delete();
1846
- if (Array.isArray(options.value)) {
1847
- if (options.action === exports.UpdateOptionActions.MERGE)
1848
- return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1849
- if (options.action === exports.UpdateOptionActions.REMOVE)
1850
- return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1851
- }
1852
- return options.value;
1853
- };
1854
- return /** @class */ (function (_super) {
1855
- __extends(UpdateFirestore, _super);
1856
- function UpdateFirestore() {
1857
- return _super !== null && _super.apply(this, arguments) || this;
1858
- }
1859
- UpdateFirestore.prototype.update = function (data) {
1860
- return __awaiter(this, void 0, void 0, function () {
1861
- var model, keyField, docRef, doc;
1862
- return __generator(this, function (_b) {
1863
- switch (_b.label) {
1864
- case 0:
1865
- model = new this.model();
1866
- keyField = model.identifierFields().shift();
1867
- docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1868
- return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1869
- case 1:
1870
- _b.sent();
1871
- return [4 /*yield*/, docRef.get()];
1872
- case 2:
1873
- doc = _b.sent();
1874
- return [2 /*return*/, doc.data()];
1875
- }
1876
- });
1877
- });
1878
- };
1879
- UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1880
- return this.isSubCollection(this)
1881
- ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1882
- : this.collectionName;
1883
- };
1884
- UpdateFirestore.prototype.paramsToPlain = function (params) {
1885
- var model = this.model;
1886
- if (params instanceof model)
1887
- return params;
1888
- return Object.keys(params).reduce(function (data, currentKey) {
1889
- var _b;
1890
- return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1891
- }, {});
1892
- };
1893
- return UpdateFirestore;
1894
- }(MixinBase));
1717
+ var withUpdateFirestore = function (MixinBase) {
1718
+ var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
1719
+ var getValueByAction = function (options) {
1720
+ var fieldValues = firebase__default["default"].firestore.FieldValue;
1721
+ if (lodash.isNil(options.action))
1722
+ return options;
1723
+ if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1724
+ return fieldValues.delete();
1725
+ if (Array.isArray(options.value)) {
1726
+ if (options.action === exports.UpdateOptionActions.MERGE)
1727
+ return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1728
+ if (options.action === exports.UpdateOptionActions.REMOVE)
1729
+ return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1730
+ }
1731
+ return options.value;
1732
+ };
1733
+ return /** @class */ (function (_super) {
1734
+ __extends(UpdateFirestore, _super);
1735
+ function UpdateFirestore() {
1736
+ return _super !== null && _super.apply(this, arguments) || this;
1737
+ }
1738
+ UpdateFirestore.prototype.update = function (data) {
1739
+ return __awaiter(this, void 0, void 0, function () {
1740
+ var model, keyField, docRef, doc;
1741
+ return __generator(this, function (_b) {
1742
+ switch (_b.label) {
1743
+ case 0:
1744
+ model = new this.model();
1745
+ keyField = model.identifierFields().shift();
1746
+ docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1747
+ return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1748
+ case 1:
1749
+ _b.sent();
1750
+ return [4 /*yield*/, docRef.get()];
1751
+ case 2:
1752
+ doc = _b.sent();
1753
+ return [2 /*return*/, doc.data()];
1754
+ }
1755
+ });
1756
+ });
1757
+ };
1758
+ UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1759
+ return this.isSubCollection(this)
1760
+ ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1761
+ : this.collectionName;
1762
+ };
1763
+ UpdateFirestore.prototype.paramsToPlain = function (params) {
1764
+ var model = this.model;
1765
+ if (params instanceof model)
1766
+ return params;
1767
+ return Object.keys(params).reduce(function (data, currentKey) {
1768
+ var _b;
1769
+ return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1770
+ }, {});
1771
+ };
1772
+ return UpdateFirestore;
1773
+ }(MixinBase));
1895
1774
  };
1896
1775
 
1897
- var withDeleteFirestore = function (MixinBase) {
1898
- return /** @class */ (function (_super) {
1899
- __extends(DeleteFirestore, _super);
1900
- function DeleteFirestore() {
1901
- return _super !== null && _super.apply(this, arguments) || this;
1902
- }
1903
- DeleteFirestore.prototype.delete = function (identifiers) {
1904
- return __awaiter(this, void 0, void 0, function () {
1905
- return __generator(this, function (_a) {
1906
- switch (_a.label) {
1907
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1908
- .doc(Object.values(identifiers).shift().toString())
1909
- .delete()];
1910
- case 1:
1911
- _a.sent();
1912
- return [2 /*return*/];
1913
- }
1914
- });
1915
- });
1916
- };
1917
- DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1918
- return this.isSubCollection(this)
1919
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1920
- : this.collectionName;
1921
- };
1922
- return DeleteFirestore;
1923
- }(MixinBase));
1776
+ var withDeleteFirestore = function (MixinBase) {
1777
+ return /** @class */ (function (_super) {
1778
+ __extends(DeleteFirestore, _super);
1779
+ function DeleteFirestore() {
1780
+ return _super !== null && _super.apply(this, arguments) || this;
1781
+ }
1782
+ DeleteFirestore.prototype.delete = function (identifiers) {
1783
+ return __awaiter(this, void 0, void 0, function () {
1784
+ return __generator(this, function (_a) {
1785
+ switch (_a.label) {
1786
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1787
+ .doc(Object.values(identifiers).shift().toString())
1788
+ .delete()];
1789
+ case 1:
1790
+ _a.sent();
1791
+ return [2 /*return*/];
1792
+ }
1793
+ });
1794
+ });
1795
+ };
1796
+ DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1797
+ return this.isSubCollection(this)
1798
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1799
+ : this.collectionName;
1800
+ };
1801
+ return DeleteFirestore;
1802
+ }(MixinBase));
1924
1803
  };
1925
1804
 
1926
- var withSubCollection = function (MixinBase, ParentModel) {
1927
- return /** @class */ (function (_super) {
1928
- __extends(SubCollectionMix, _super);
1929
- function SubCollectionMix() {
1930
- var args = [];
1931
- for (var _i = 0; _i < arguments.length; _i++) {
1932
- args[_i] = arguments[_i];
1933
- }
1934
- return _super.call(this, args) || this;
1935
- }
1936
- SubCollectionMix.prototype.collection = function (path) {
1937
- return _super.prototype.collection.call(this, path);
1938
- };
1939
- return SubCollectionMix;
1940
- }(MixinBase));
1805
+ var withSubCollection = function (MixinBase, ParentModel) {
1806
+ return /** @class */ (function (_super) {
1807
+ __extends(SubCollectionMix, _super);
1808
+ function SubCollectionMix() {
1809
+ var args = [];
1810
+ for (var _i = 0; _i < arguments.length; _i++) {
1811
+ args[_i] = arguments[_i];
1812
+ }
1813
+ return _super.call(this, args) || this;
1814
+ }
1815
+ SubCollectionMix.prototype.collection = function (path) {
1816
+ return _super.prototype.collection.call(this, path);
1817
+ };
1818
+ return SubCollectionMix;
1819
+ }(MixinBase));
1941
1820
  };
1942
1821
 
1943
- var withCrudFirestore = function (MixinBase) {
1944
- return /** @class */ (function (_super) {
1945
- __extends(CrudFirestore, _super);
1946
- function CrudFirestore() {
1947
- return _super !== null && _super.apply(this, arguments) || this;
1948
- }
1949
- return CrudFirestore;
1950
- }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1822
+ var withCrudFirestore = function (MixinBase) {
1823
+ return /** @class */ (function (_super) {
1824
+ __extends(CrudFirestore, _super);
1825
+ function CrudFirestore() {
1826
+ return _super !== null && _super.apply(this, arguments) || this;
1827
+ }
1828
+ return CrudFirestore;
1829
+ }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1951
1830
  };
1952
1831
 
1953
- var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1954
- __extends(SubscriptionFirestoreRepository, _super);
1955
- function SubscriptionFirestoreRepository(firestore) {
1956
- var _this = _super.call(this) || this;
1957
- _this.firestore = firestore;
1958
- _this.collectionName = 'subscription';
1959
- _this.model = Subscription;
1960
- return _this;
1961
- }
1962
- return SubscriptionFirestoreRepository;
1832
+ var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1833
+ __extends(SubscriptionFirestoreRepository, _super);
1834
+ function SubscriptionFirestoreRepository(firestore) {
1835
+ var _this = _super.call(this) || this;
1836
+ _this.firestore = firestore;
1837
+ _this.collectionName = 'subscription';
1838
+ _this.model = Subscription;
1839
+ return _this;
1840
+ }
1841
+ return SubscriptionFirestoreRepository;
1963
1842
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1964
1843
 
1965
- var UserSearch = /** @class */ (function (_super) {
1966
- __extends(UserSearch, _super);
1967
- function UserSearch() {
1968
- return _super !== null && _super.apply(this, arguments) || this;
1969
- }
1970
- UserSearch.prototype.identifierFields = function () {
1971
- return ['id'];
1972
- };
1973
- return UserSearch;
1844
+ var UserSearch = /** @class */ (function (_super) {
1845
+ __extends(UserSearch, _super);
1846
+ function UserSearch() {
1847
+ return _super !== null && _super.apply(this, arguments) || this;
1848
+ }
1849
+ UserSearch.prototype.identifierFields = function () {
1850
+ return ['id'];
1851
+ };
1852
+ return UserSearch;
1974
1853
  }(BaseModel));
1975
1854
 
1976
- var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1977
- __extends(UserSearchFirestoreRepository, _super);
1978
- function UserSearchFirestoreRepository(firestore) {
1979
- var _this = _super.call(this) || this;
1980
- _this.firestore = firestore;
1981
- _this.collectionName = 'userSearch';
1982
- _this.model = UserSearch;
1983
- return _this;
1984
- }
1985
- return UserSearchFirestoreRepository;
1855
+ var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1856
+ __extends(UserSearchFirestoreRepository, _super);
1857
+ function UserSearchFirestoreRepository(firestore) {
1858
+ var _this = _super.call(this) || this;
1859
+ _this.firestore = firestore;
1860
+ _this.collectionName = 'userSearch';
1861
+ _this.model = UserSearch;
1862
+ return _this;
1863
+ }
1864
+ return UserSearchFirestoreRepository;
1986
1865
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1987
1866
 
1988
- var UserFirestoreRepository = /** @class */ (function (_super_1) {
1989
- __extends(UserFirestoreRepository, _super_1);
1990
- function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1991
- if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1992
- var _this = _super_1.call(this) || this;
1993
- _this.firestore = firestore;
1994
- _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1995
- _this.collectionName = 'users';
1996
- _this.model = User;
1997
- return _this;
1998
- }
1999
- UserFirestoreRepository.prototype.get = function (identifiers) {
2000
- var _super = Object.create(null, {
2001
- get: { get: function () { return _super_1.prototype.get; } }
2002
- });
2003
- return __awaiter(this, void 0, void 0, function () {
2004
- var user, _a, _b;
2005
- return __generator(this, function (_c) {
2006
- switch (_c.label) {
2007
- case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
2008
- case 1:
2009
- user = _c.sent();
2010
- _a = user;
2011
- return [4 /*yield*/, this.getBeautyProfile(user.id)];
2012
- case 2:
2013
- _a.beautyProfile = _c.sent();
2014
- _b = user;
2015
- return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
2016
- case 3:
2017
- _b.isSubscriber = _c.sent();
2018
- return [2 /*return*/, user];
2019
- }
2020
- });
2021
- });
2022
- };
2023
- UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
2024
- return __awaiter(this, void 0, void 0, function () {
2025
- var result;
2026
- var _a;
2027
- return __generator(this, function (_b) {
2028
- switch (_b.label) {
2029
- case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
2030
- case 1:
2031
- result = _b.sent();
2032
- return [2 /*return*/, result.count > 0];
2033
- }
2034
- });
2035
- });
2036
- };
2037
- UserFirestoreRepository.prototype.buildModelInstance = function () {
2038
- var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2039
- return {
2040
- toFirestore: function (data) {
2041
- var plain = toFirestore(data);
2042
- delete plain.isSubscriber;
2043
- return plain;
2044
- },
2045
- fromFirestore: fromFirestore,
2046
- };
2047
- };
2048
- UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
2049
- return __awaiter(this, void 0, void 0, function () {
2050
- var beautyProfile;
2051
- return __generator(this, function (_a) {
2052
- switch (_a.label) {
2053
- case 0: return [4 /*yield*/, this.collection()
2054
- .doc(userId)
2055
- .collection('CX')
2056
- .withConverter(this.buildBeautyProfileModelInstance())
2057
- .doc('beautyProfile')
2058
- .get()];
2059
- case 1:
2060
- beautyProfile = _a.sent();
2061
- return [2 /*return*/, beautyProfile.data()];
2062
- }
2063
- });
2064
- });
2065
- };
2066
- UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
2067
- return __awaiter(this, void 0, void 0, function () {
2068
- var docs;
2069
- return __generator(this, function (_a) {
2070
- switch (_a.label) {
2071
- case 0: return [4 /*yield*/, this.firestore
2072
- .collection('subscription')
2073
- .where('user.id', '==', userId)
2074
- .where('status', '==', 'active')
2075
- .get()];
2076
- case 1:
2077
- docs = _a.sent();
2078
- return [2 /*return*/, !!docs && !!docs.size];
2079
- }
2080
- });
2081
- });
2082
- };
2083
- UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
2084
- return {
2085
- toFirestore: function (data) { return data.toPlain(); },
2086
- fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
2087
- };
2088
- };
2089
- return UserFirestoreRepository;
1867
+ var UserFirestoreRepository = /** @class */ (function (_super_1) {
1868
+ __extends(UserFirestoreRepository, _super_1);
1869
+ function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1870
+ if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1871
+ var _this = _super_1.call(this) || this;
1872
+ _this.firestore = firestore;
1873
+ _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1874
+ _this.collectionName = 'users';
1875
+ _this.model = User;
1876
+ return _this;
1877
+ }
1878
+ UserFirestoreRepository.prototype.get = function (identifiers) {
1879
+ var _super = Object.create(null, {
1880
+ get: { get: function () { return _super_1.prototype.get; } }
1881
+ });
1882
+ return __awaiter(this, void 0, void 0, function () {
1883
+ var user, _a, _b;
1884
+ return __generator(this, function (_c) {
1885
+ switch (_c.label) {
1886
+ case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1887
+ case 1:
1888
+ user = _c.sent();
1889
+ _a = user;
1890
+ return [4 /*yield*/, this.getBeautyProfile(user.id)];
1891
+ case 2:
1892
+ _a.beautyProfile = _c.sent();
1893
+ _b = user;
1894
+ return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
1895
+ case 3:
1896
+ _b.isSubscriber = _c.sent();
1897
+ return [2 /*return*/, user];
1898
+ }
1899
+ });
1900
+ });
1901
+ };
1902
+ UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
1903
+ return __awaiter(this, void 0, void 0, function () {
1904
+ var result;
1905
+ var _a;
1906
+ return __generator(this, function (_b) {
1907
+ switch (_b.label) {
1908
+ case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
1909
+ case 1:
1910
+ result = _b.sent();
1911
+ return [2 /*return*/, result.count > 0];
1912
+ }
1913
+ });
1914
+ });
1915
+ };
1916
+ UserFirestoreRepository.prototype.buildModelInstance = function () {
1917
+ var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
1918
+ return {
1919
+ toFirestore: function (data) {
1920
+ var plain = toFirestore(data);
1921
+ delete plain.isSubscriber;
1922
+ return plain;
1923
+ },
1924
+ fromFirestore: fromFirestore,
1925
+ };
1926
+ };
1927
+ UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
1928
+ return __awaiter(this, void 0, void 0, function () {
1929
+ var beautyProfile;
1930
+ return __generator(this, function (_a) {
1931
+ switch (_a.label) {
1932
+ case 0: return [4 /*yield*/, this.collection()
1933
+ .doc(userId)
1934
+ .collection('CX')
1935
+ .withConverter(this.buildBeautyProfileModelInstance())
1936
+ .doc('beautyProfile')
1937
+ .get()];
1938
+ case 1:
1939
+ beautyProfile = _a.sent();
1940
+ return [2 /*return*/, beautyProfile.data()];
1941
+ }
1942
+ });
1943
+ });
1944
+ };
1945
+ UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
1946
+ return __awaiter(this, void 0, void 0, function () {
1947
+ var docs;
1948
+ return __generator(this, function (_a) {
1949
+ switch (_a.label) {
1950
+ case 0: return [4 /*yield*/, this.firestore
1951
+ .collection('subscription')
1952
+ .where('user.id', '==', userId)
1953
+ .where('status', '==', 'active')
1954
+ .get()];
1955
+ case 1:
1956
+ docs = _a.sent();
1957
+ return [2 /*return*/, !!docs && !!docs.size];
1958
+ }
1959
+ });
1960
+ });
1961
+ };
1962
+ UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
1963
+ return {
1964
+ toFirestore: function (data) { return data.toPlain(); },
1965
+ fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
1966
+ };
1967
+ };
1968
+ return UserFirestoreRepository;
2090
1969
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2091
1970
 
2092
- var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2093
- __extends(SubscriptionEditionFirestoreRepository, _super);
2094
- function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2095
- var _this = _super.call(this) || this;
2096
- _this.firestore = firestore;
2097
- _this.parentRepository = parentRepository;
2098
- _this.collectionName = 'editions';
2099
- _this.parentIdField = 'subscriptionId';
2100
- _this.model = Edition;
2101
- return _this;
2102
- }
2103
- return SubscriptionEditionFirestoreRepository;
1971
+ var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
1972
+ __extends(SubscriptionEditionFirestoreRepository, _super);
1973
+ function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
1974
+ var _this = _super.call(this) || this;
1975
+ _this.firestore = firestore;
1976
+ _this.parentRepository = parentRepository;
1977
+ _this.collectionName = 'editions';
1978
+ _this.parentIdField = 'subscriptionId';
1979
+ _this.model = Edition;
1980
+ return _this;
1981
+ }
1982
+ return SubscriptionEditionFirestoreRepository;
2104
1983
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2105
1984
 
2106
- var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2107
- __extends(UserBeautyProfileFirestoreRepository, _super);
2108
- function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2109
- var _this = _super.call(this) || this;
2110
- _this.firestore = firestore;
2111
- _this.parentRepository = parentRepository;
2112
- _this.collectionName = 'CX';
2113
- _this.parentIdField = 'userId';
2114
- _this.model = BeautyProfile;
2115
- return _this;
2116
- }
2117
- return UserBeautyProfileFirestoreRepository;
1985
+ var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
1986
+ __extends(UserBeautyProfileFirestoreRepository, _super);
1987
+ function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
1988
+ var _this = _super.call(this) || this;
1989
+ _this.firestore = firestore;
1990
+ _this.parentRepository = parentRepository;
1991
+ _this.collectionName = 'CX';
1992
+ _this.parentIdField = 'userId';
1993
+ _this.model = BeautyProfile;
1994
+ return _this;
1995
+ }
1996
+ return UserBeautyProfileFirestoreRepository;
2118
1997
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2119
1998
 
2120
- var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2121
- __extends(UserAddressFirestoreRepository, _super);
2122
- function UserAddressFirestoreRepository(firestore, parentRepository) {
2123
- var _this = _super.call(this) || this;
2124
- _this.firestore = firestore;
2125
- _this.parentRepository = parentRepository;
2126
- _this.collectionName = 'address';
2127
- _this.parentIdField = 'userId';
2128
- _this.model = UserAddress;
2129
- return _this;
2130
- }
2131
- return UserAddressFirestoreRepository;
1999
+ var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2000
+ __extends(UserAddressFirestoreRepository, _super);
2001
+ function UserAddressFirestoreRepository(firestore, parentRepository) {
2002
+ var _this = _super.call(this) || this;
2003
+ _this.firestore = firestore;
2004
+ _this.parentRepository = parentRepository;
2005
+ _this.collectionName = 'address';
2006
+ _this.parentIdField = 'userId';
2007
+ _this.model = UserAddress;
2008
+ return _this;
2009
+ }
2010
+ return UserAddressFirestoreRepository;
2132
2011
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2133
2012
 
2134
- var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2135
- __extends(UserPaymentMethodFirestoreRepository, _super);
2136
- function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2137
- var _this = _super.call(this) || this;
2138
- _this.firestore = firestore;
2139
- _this.parentRepository = parentRepository;
2140
- _this.collectionName = 'payment_method';
2141
- _this.parentIdField = 'userId';
2142
- _this.model = UserPaymentMethod;
2143
- return _this;
2144
- }
2145
- return UserPaymentMethodFirestoreRepository;
2013
+ var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2014
+ __extends(UserPaymentMethodFirestoreRepository, _super);
2015
+ function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2016
+ var _this = _super.call(this) || this;
2017
+ _this.firestore = firestore;
2018
+ _this.parentRepository = parentRepository;
2019
+ _this.collectionName = 'payment_method';
2020
+ _this.parentIdField = 'userId';
2021
+ _this.model = UserPaymentMethod;
2022
+ return _this;
2023
+ }
2024
+ return UserPaymentMethodFirestoreRepository;
2146
2025
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2147
2026
 
2148
- var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2149
- __extends(SubscriptionPaymentFirestoreRepository, _super);
2150
- function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2151
- var _this = _super.call(this) || this;
2152
- _this.firestore = firestore;
2153
- _this.parentRepository = parentRepository;
2154
- _this.collectionName = 'payments';
2155
- _this.parentIdField = 'subscriptionId';
2156
- _this.model = SubscriptionPayment;
2157
- return _this;
2158
- }
2159
- return SubscriptionPaymentFirestoreRepository;
2027
+ var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2028
+ __extends(SubscriptionPaymentFirestoreRepository, _super);
2029
+ function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2030
+ var _this = _super.call(this) || this;
2031
+ _this.firestore = firestore;
2032
+ _this.parentRepository = parentRepository;
2033
+ _this.collectionName = 'payments';
2034
+ _this.parentIdField = 'subscriptionId';
2035
+ _this.model = SubscriptionPayment;
2036
+ return _this;
2037
+ }
2038
+ return SubscriptionPaymentFirestoreRepository;
2160
2039
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2161
2040
 
2162
- var LeadFirestoreRepository = /** @class */ (function (_super) {
2163
- __extends(LeadFirestoreRepository, _super);
2164
- function LeadFirestoreRepository(firestore) {
2165
- var _this = _super.call(this) || this;
2166
- _this.firestore = firestore;
2167
- _this.collectionName = 'leads';
2168
- _this.model = Lead;
2169
- return _this;
2170
- }
2171
- return LeadFirestoreRepository;
2041
+ var LeadFirestoreRepository = /** @class */ (function (_super) {
2042
+ __extends(LeadFirestoreRepository, _super);
2043
+ function LeadFirestoreRepository(firestore) {
2044
+ var _this = _super.call(this) || this;
2045
+ _this.firestore = firestore;
2046
+ _this.collectionName = 'leads';
2047
+ _this.model = Lead;
2048
+ return _this;
2049
+ }
2050
+ return LeadFirestoreRepository;
2172
2051
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2173
2052
 
2174
- var CategoryFirestoreRepository = /** @class */ (function (_super) {
2175
- __extends(CategoryFirestoreRepository, _super);
2176
- function CategoryFirestoreRepository(firestore) {
2177
- var _this = _super.call(this) || this;
2178
- _this.firestore = firestore;
2179
- _this.collectionName = 'categories';
2180
- _this.model = Category;
2181
- return _this;
2182
- }
2183
- CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2184
- return this.collection(this.collectionName)
2185
- .where('slug', '==', slug)
2186
- .where('shop', '==', shop)
2187
- .where('published', '==', true)
2188
- .get()
2189
- .then(function (snap) {
2190
- if (snap.size > 1)
2191
- throw new DuplicatedResultsError('Query returned duplicated values');
2192
- if (snap.empty)
2193
- throw new NotFoundError("Document with slug " + slug + " not found");
2194
- return snap.docs[0].data();
2195
- })
2196
- .catch(function (error) { return error; });
2197
- };
2198
- CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2199
- if (limit === void 0) { limit = 4; }
2200
- return __awaiter(this, void 0, void 0, function () {
2201
- var categorySnap, categories, homeSections;
2202
- var _this = this;
2203
- return __generator(this, function (_a) {
2204
- switch (_a.label) {
2205
- case 0: return [4 /*yield*/, this.collection(this.collectionName)
2206
- .where('id', 'in', categoryIds.filter(Boolean))
2207
- .where('published', '==', true)
2208
- .get()];
2209
- case 1:
2210
- categorySnap = _a.sent();
2211
- if (categorySnap.empty)
2212
- throw new NotFoundError('Categories not found');
2213
- categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2214
- return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
2215
- var _a;
2216
- return __generator(this, function (_b) {
2217
- switch (_b.label) {
2218
- case 0:
2219
- _a = {
2220
- category: category
2221
- };
2222
- return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
2223
- case 1: return [2 /*return*/, (_a.products = _b.sent(),
2224
- _a)];
2225
- }
2226
- });
2227
- }); }))];
2228
- case 2:
2229
- homeSections = _a.sent();
2230
- return [2 /*return*/, homeSections];
2231
- }
2232
- });
2233
- });
2234
- };
2235
- CategoryFirestoreRepository.prototype.mountCategory = function (category, options) {
2236
- return __awaiter(this, void 0, void 0, function () {
2237
- var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, query, productSnap, e_1_1;
2238
- var e_1, _a;
2239
- return __generator(this, function (_b) {
2240
- switch (_b.label) {
2241
- case 0:
2242
- if (!category.products)
2243
- throw new RequiredArgumentError(['Category products is empty']);
2244
- chunks = lodash.chunk(category.products, 10);
2245
- products = [];
2246
- publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2247
- _b.label = 1;
2248
- case 1:
2249
- _b.trys.push([1, 7, 8, 9]);
2250
- chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
2251
- _b.label = 2;
2252
- case 2:
2253
- if (!!chunks_1_1.done) return [3 /*break*/, 6];
2254
- productIds = chunks_1_1.value;
2255
- if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
2256
- return [3 /*break*/, 6];
2257
- return [4 /*yield*/, this.collection('productsErpVitrine')
2258
- .where(publishedField, '==', true)
2259
- .where('id', 'in', productIds)];
2260
- case 3:
2261
- query = _b.sent();
2262
- if (options === null || options === void 0 ? void 0 : options.hasStock)
2263
- query = query.where('stock.quantity', '>', 0);
2264
- if (options === null || options === void 0 ? void 0 : options.limit)
2265
- query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
2266
- return [4 /*yield*/, query.get()];
2267
- case 4:
2268
- productSnap = _b.sent();
2269
- if (productSnap.empty)
2270
- return [3 /*break*/, 5];
2271
- products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2272
- _b.label = 5;
2273
- case 5:
2274
- chunks_1_1 = chunks_1.next();
2275
- return [3 /*break*/, 2];
2276
- case 6: return [3 /*break*/, 9];
2277
- case 7:
2278
- e_1_1 = _b.sent();
2279
- e_1 = { error: e_1_1 };
2280
- return [3 /*break*/, 9];
2281
- case 8:
2282
- try {
2283
- if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
2284
- }
2285
- finally { if (e_1) throw e_1.error; }
2286
- return [7 /*endfinally*/];
2287
- case 9: return [2 /*return*/, products];
2288
- }
2289
- });
2290
- });
2291
- };
2292
- return CategoryFirestoreRepository;
2053
+ var CategoryFirestoreRepository = /** @class */ (function (_super) {
2054
+ __extends(CategoryFirestoreRepository, _super);
2055
+ function CategoryFirestoreRepository(firestore) {
2056
+ var _this = _super.call(this) || this;
2057
+ _this.firestore = firestore;
2058
+ _this.collectionName = 'categories';
2059
+ _this.model = Category;
2060
+ return _this;
2061
+ }
2062
+ CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2063
+ return this.collection(this.collectionName)
2064
+ .where('slug', '==', slug)
2065
+ .where('shop', '==', shop)
2066
+ .where('published', '==', true)
2067
+ .get()
2068
+ .then(function (snap) {
2069
+ if (snap.size > 1)
2070
+ throw new DuplicatedResultsError('Query returned duplicated values');
2071
+ if (snap.empty)
2072
+ throw new NotFoundError("Document with slug " + slug + " not found");
2073
+ return snap.docs[0].data();
2074
+ })
2075
+ .catch(function (error) { return error; });
2076
+ };
2077
+ CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2078
+ if (limit === void 0) { limit = 4; }
2079
+ return __awaiter(this, void 0, void 0, function () {
2080
+ var categorySnap, categories, homeSections, categories_1, categories_1_1, category, publishedField, productSnap, products, e_1_1;
2081
+ var e_1, _a;
2082
+ return __generator(this, function (_b) {
2083
+ switch (_b.label) {
2084
+ case 0: return [4 /*yield*/, this.collection(this.collectionName)
2085
+ .where('id', 'in', categoryIds)
2086
+ .where('published', '==', true)
2087
+ .get()];
2088
+ case 1:
2089
+ categorySnap = _b.sent();
2090
+ if (categorySnap.empty)
2091
+ throw new NotFoundError('Categories not found');
2092
+ categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2093
+ homeSections = [];
2094
+ _b.label = 2;
2095
+ case 2:
2096
+ _b.trys.push([2, 7, 8, 9]);
2097
+ categories_1 = __values(categories), categories_1_1 = categories_1.next();
2098
+ _b.label = 3;
2099
+ case 3:
2100
+ if (!!categories_1_1.done) return [3 /*break*/, 6];
2101
+ category = categories_1_1.value;
2102
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2103
+ return [4 /*yield*/, this.collection('products')
2104
+ .where('categories', 'array-contains', category.id)
2105
+ .where(publishedField, '==', true)
2106
+ .where('stock.quantity', '>', 1)
2107
+ .limit(limit)
2108
+ .get()];
2109
+ case 4:
2110
+ productSnap = _b.sent();
2111
+ products = productSnap.docs.map(function (doc) { return doc.data(); });
2112
+ homeSections.push({ category: category, products: products });
2113
+ _b.label = 5;
2114
+ case 5:
2115
+ categories_1_1 = categories_1.next();
2116
+ return [3 /*break*/, 3];
2117
+ case 6: return [3 /*break*/, 9];
2118
+ case 7:
2119
+ e_1_1 = _b.sent();
2120
+ e_1 = { error: e_1_1 };
2121
+ return [3 /*break*/, 9];
2122
+ case 8:
2123
+ try {
2124
+ if (categories_1_1 && !categories_1_1.done && (_a = categories_1.return)) _a.call(categories_1);
2125
+ }
2126
+ finally { if (e_1) throw e_1.error; }
2127
+ return [7 /*endfinally*/];
2128
+ case 9: return [2 /*return*/, homeSections];
2129
+ }
2130
+ });
2131
+ });
2132
+ };
2133
+ CategoryFirestoreRepository.prototype.mountCategory = function (category) {
2134
+ return __awaiter(this, void 0, void 0, function () {
2135
+ var chunks, products, publishedField;
2136
+ var _this = this;
2137
+ return __generator(this, function (_a) {
2138
+ switch (_a.label) {
2139
+ case 0:
2140
+ if (!category.products)
2141
+ throw new RequiredArgumentError(['Category products is empty']);
2142
+ chunks = category.products.reduce(function (resultArray, item, index) {
2143
+ var chunkIndex = Math.floor(index / 10);
2144
+ if (!resultArray[chunkIndex])
2145
+ resultArray[chunkIndex] = [];
2146
+ resultArray[chunkIndex].push(item);
2147
+ return resultArray;
2148
+ }, []);
2149
+ products = [];
2150
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2151
+ return [4 /*yield*/, Promise.all(chunks.map(function (productIds) { return __awaiter(_this, void 0, void 0, function () {
2152
+ var productSnap;
2153
+ return __generator(this, function (_a) {
2154
+ switch (_a.label) {
2155
+ case 0: return [4 /*yield*/, this.collection('products')
2156
+ .where(publishedField, '==', true)
2157
+ .where('id', 'in', productIds)
2158
+ .get()];
2159
+ case 1:
2160
+ productSnap = _a.sent();
2161
+ if (productSnap.empty)
2162
+ return [2 /*return*/];
2163
+ products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2164
+ return [2 /*return*/];
2165
+ }
2166
+ });
2167
+ }); }))];
2168
+ case 1:
2169
+ _a.sent();
2170
+ return [2 /*return*/, products];
2171
+ }
2172
+ });
2173
+ });
2174
+ };
2175
+ return CategoryFirestoreRepository;
2293
2176
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2294
2177
 
2295
- var ProductFirestoreRepository = /** @class */ (function (_super) {
2296
- __extends(ProductFirestoreRepository, _super);
2297
- function ProductFirestoreRepository(firestore) {
2298
- var _this = _super.call(this) || this;
2299
- _this.firestore = firestore;
2300
- _this.collectionName = 'productsErpVitrine';
2301
- _this.model = Product;
2302
- return _this;
2303
- }
2304
- ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2305
- var _a;
2306
- return __awaiter(this, void 0, void 0, function () {
2307
- var result;
2308
- return __generator(this, function (_b) {
2309
- switch (_b.label) {
2310
- case 0: return [4 /*yield*/, this.find([
2311
- { slug: { operator: exports.Where.EQUALS, value: slug } },
2312
- { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2313
- ])];
2314
- case 1:
2315
- result = _b.sent();
2316
- return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2317
- }
2318
- });
2319
- });
2320
- };
2321
- return ProductFirestoreRepository;
2178
+ var ProductFirestoreRepository = /** @class */ (function (_super) {
2179
+ __extends(ProductFirestoreRepository, _super);
2180
+ function ProductFirestoreRepository(firestore) {
2181
+ var _this = _super.call(this) || this;
2182
+ _this.firestore = firestore;
2183
+ _this.collectionName = 'products';
2184
+ _this.model = Product;
2185
+ return _this;
2186
+ }
2187
+ ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2188
+ var _a;
2189
+ return __awaiter(this, void 0, void 0, function () {
2190
+ var result;
2191
+ return __generator(this, function (_b) {
2192
+ switch (_b.label) {
2193
+ case 0: return [4 /*yield*/, this.find([
2194
+ { slug: { operator: exports.Where.EQUALS, value: slug } },
2195
+ { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2196
+ ])];
2197
+ case 1:
2198
+ result = _b.sent();
2199
+ return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2200
+ }
2201
+ });
2202
+ });
2203
+ };
2204
+ return ProductFirestoreRepository;
2322
2205
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2323
2206
 
2324
- var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2325
- __extends(ProductVariantFirestoreRepository, _super);
2326
- function ProductVariantFirestoreRepository(firestore, parentRepository) {
2327
- var _this = _super.call(this) || this;
2328
- _this.firestore = firestore;
2329
- _this.parentRepository = parentRepository;
2330
- _this.collectionName = 'variants';
2331
- _this.parentIdField = 'productId';
2332
- _this.model = Variant;
2333
- return _this;
2334
- }
2335
- return ProductVariantFirestoreRepository;
2207
+ var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2208
+ __extends(ProductVariantFirestoreRepository, _super);
2209
+ function ProductVariantFirestoreRepository(firestore, parentRepository) {
2210
+ var _this = _super.call(this) || this;
2211
+ _this.firestore = firestore;
2212
+ _this.parentRepository = parentRepository;
2213
+ _this.collectionName = 'variants';
2214
+ _this.parentIdField = 'productId';
2215
+ _this.model = Variant;
2216
+ return _this;
2217
+ }
2218
+ return ProductVariantFirestoreRepository;
2336
2219
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
2337
2220
 
2338
- var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2339
- __extends(SubscriptionProductFirestoreRepository, _super);
2340
- function SubscriptionProductFirestoreRepository(firestore) {
2341
- var _this = _super.call(this) || this;
2342
- _this.firestore = firestore;
2343
- _this.collectionName = 'subscriptionProducts';
2344
- _this.model = Product;
2345
- return _this;
2346
- }
2347
- return SubscriptionProductFirestoreRepository;
2221
+ var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2222
+ __extends(SubscriptionProductFirestoreRepository, _super);
2223
+ function SubscriptionProductFirestoreRepository(firestore) {
2224
+ var _this = _super.call(this) || this;
2225
+ _this.firestore = firestore;
2226
+ _this.collectionName = 'subscriptionProducts';
2227
+ _this.model = Product;
2228
+ return _this;
2229
+ }
2230
+ return SubscriptionProductFirestoreRepository;
2348
2231
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2349
2232
 
2350
- var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2351
- __extends(CheckoutFirestoreRepository, _super);
2352
- function CheckoutFirestoreRepository(firestore) {
2353
- var _this = _super.call(this) || this;
2354
- _this.firestore = firestore;
2355
- _this.collectionName = 'checkouts';
2356
- _this.model = Checkout;
2357
- return _this;
2358
- }
2359
- return CheckoutFirestoreRepository;
2233
+ var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2234
+ __extends(CheckoutFirestoreRepository, _super);
2235
+ function CheckoutFirestoreRepository(firestore) {
2236
+ var _this = _super.call(this) || this;
2237
+ _this.firestore = firestore;
2238
+ _this.collectionName = 'checkouts';
2239
+ _this.model = Checkout;
2240
+ return _this;
2241
+ }
2242
+ return CheckoutFirestoreRepository;
2360
2243
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2361
2244
 
2362
- var CouponFirestoreRepository = /** @class */ (function (_super) {
2363
- __extends(CouponFirestoreRepository, _super);
2364
- function CouponFirestoreRepository(firestore) {
2365
- var _this = _super.call(this) || this;
2366
- _this.firestore = firestore;
2367
- _this.collectionName = 'coupons';
2368
- _this.model = Coupon;
2369
- return _this;
2370
- }
2371
- CouponFirestoreRepository.prototype.buildModelInstance = function () {
2372
- var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2373
- return {
2374
- toFirestore: function (data) {
2375
- var plain = toFirestore(data);
2376
- if (!!data.expiresIn)
2377
- plain.expiresIn = data.expiresIn.getTime();
2378
- return plain;
2379
- },
2380
- fromFirestore: function (snap) {
2381
- var instance = fromFirestore(snap);
2382
- if (!lodash.isNil(instance.expiresIn))
2383
- instance.expiresIn = new Date(snap.data().expiresIn);
2384
- return instance;
2385
- },
2386
- };
2387
- };
2388
- return CouponFirestoreRepository;
2245
+ var CouponFirestoreRepository = /** @class */ (function (_super) {
2246
+ __extends(CouponFirestoreRepository, _super);
2247
+ function CouponFirestoreRepository(firestore) {
2248
+ var _this = _super.call(this) || this;
2249
+ _this.firestore = firestore;
2250
+ _this.collectionName = 'coupons';
2251
+ _this.model = Coupon;
2252
+ return _this;
2253
+ }
2254
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
2255
+ var _this = this;
2256
+ return {
2257
+ toFirestore: function (data) {
2258
+ var _a;
2259
+ var plain = (data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data;
2260
+ if (!!plain.categories)
2261
+ plain.categories = (_a = plain === null || plain === void 0 ? void 0 : plain.categories) === null || _a === void 0 ? void 0 : _a.map(function (category) { return category.id; });
2262
+ return plain;
2263
+ },
2264
+ fromFirestore: function (snap) {
2265
+ var _a;
2266
+ var data = snap.data();
2267
+ Object.keys(data).forEach(function (key) {
2268
+ if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
2269
+ data[key] = data[key].toDate();
2270
+ }
2271
+ });
2272
+ data.categories = (_a = data === null || data === void 0 ? void 0 : data.categories) === null || _a === void 0 ? void 0 : _a.map(function (category) { return ({ id: category }); });
2273
+ if (data.checkout_type === exports.CheckoutTypes.SUBSCRIPTION)
2274
+ return ClubCoupon.toInstance(Object.assign({ id: snap.id }, data));
2275
+ if (data.checkout_type === exports.CheckoutTypes.ECOMMERCE)
2276
+ return StoreCoupon.toInstance(Object.assign({ id: snap.id }, data));
2277
+ return _this.model.toInstance(Object.assign({ id: snap.id }, data));
2278
+ },
2279
+ };
2280
+ };
2281
+ return CouponFirestoreRepository;
2389
2282
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2390
2283
 
2391
- var OrderFirestoreRepository = /** @class */ (function (_super) {
2392
- __extends(OrderFirestoreRepository, _super);
2393
- function OrderFirestoreRepository(firestore) {
2394
- var _this = _super.call(this) || this;
2395
- _this.firestore = firestore;
2396
- _this.collectionName = 'orders';
2397
- _this.model = Order;
2398
- return _this;
2399
- }
2400
- return OrderFirestoreRepository;
2284
+ var OrderFirestoreRepository = /** @class */ (function (_super) {
2285
+ __extends(OrderFirestoreRepository, _super);
2286
+ function OrderFirestoreRepository(firestore) {
2287
+ var _this = _super.call(this) || this;
2288
+ _this.firestore = firestore;
2289
+ _this.collectionName = 'orders';
2290
+ _this.model = Order;
2291
+ return _this;
2292
+ }
2293
+ return OrderFirestoreRepository;
2401
2294
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2402
2295
 
2403
- var PaymentFirestoreRepository = /** @class */ (function (_super) {
2404
- __extends(PaymentFirestoreRepository, _super);
2405
- function PaymentFirestoreRepository(firestore) {
2406
- var _this = _super.call(this) || this;
2407
- _this.firestore = firestore;
2408
- _this.collectionName = 'payments';
2409
- _this.model = Payment;
2410
- return _this;
2411
- }
2412
- return PaymentFirestoreRepository;
2296
+ var PaymentFirestoreRepository = /** @class */ (function (_super) {
2297
+ __extends(PaymentFirestoreRepository, _super);
2298
+ function PaymentFirestoreRepository(firestore) {
2299
+ var _this = _super.call(this) || this;
2300
+ _this.firestore = firestore;
2301
+ _this.collectionName = 'payments';
2302
+ _this.model = Payment;
2303
+ return _this;
2304
+ }
2305
+ return PaymentFirestoreRepository;
2413
2306
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2414
2307
 
2415
- var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2416
- __extends(CheckoutSubscriptionFirestoreRepository, _super);
2417
- function CheckoutSubscriptionFirestoreRepository(firestore) {
2418
- var _this = _super.call(this) || this;
2419
- _this.firestore = firestore;
2420
- _this.collectionName = 'checkoutsSubscription';
2421
- _this.model = CheckoutSubscription;
2422
- return _this;
2423
- }
2424
- return CheckoutSubscriptionFirestoreRepository;
2308
+ var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2309
+ __extends(CheckoutSubscriptionFirestoreRepository, _super);
2310
+ function CheckoutSubscriptionFirestoreRepository(firestore) {
2311
+ var _this = _super.call(this) || this;
2312
+ _this.firestore = firestore;
2313
+ _this.collectionName = 'checkoutsSubscription';
2314
+ _this.model = CheckoutSubscription;
2315
+ return _this;
2316
+ }
2317
+ return CheckoutSubscriptionFirestoreRepository;
2425
2318
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2426
2319
 
2427
- var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2428
- __extends(SubscriptionPlanFirestoreRepository, _super);
2429
- function SubscriptionPlanFirestoreRepository(firestore) {
2430
- var _this = _super.call(this) || this;
2431
- _this.firestore = firestore;
2432
- _this.collectionName = 'subscriptionPlans';
2433
- _this.model = SubscriptionPlan;
2434
- return _this;
2435
- }
2436
- return SubscriptionPlanFirestoreRepository;
2320
+ var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2321
+ __extends(SubscriptionPlanFirestoreRepository, _super);
2322
+ function SubscriptionPlanFirestoreRepository(firestore) {
2323
+ var _this = _super.call(this) || this;
2324
+ _this.firestore = firestore;
2325
+ _this.collectionName = 'subscriptionPlans';
2326
+ _this.model = SubscriptionPlan;
2327
+ return _this;
2328
+ }
2329
+ return SubscriptionPlanFirestoreRepository;
2437
2330
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2438
2331
 
2439
- var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2440
- __extends(Buy2WinFirestoreRepository, _super);
2441
- function Buy2WinFirestoreRepository(firestore) {
2442
- var _this = _super.call(this) || this;
2443
- _this.firestore = firestore;
2444
- _this.collectionName = 'buy2win';
2445
- _this.model = Buy2Win;
2446
- return _this;
2447
- }
2448
- return Buy2WinFirestoreRepository;
2332
+ var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2333
+ __extends(Buy2WinFirestoreRepository, _super);
2334
+ function Buy2WinFirestoreRepository(firestore) {
2335
+ var _this = _super.call(this) || this;
2336
+ _this.firestore = firestore;
2337
+ _this.collectionName = 'buy2win';
2338
+ _this.model = Buy2Win;
2339
+ return _this;
2340
+ }
2341
+ return Buy2WinFirestoreRepository;
2449
2342
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2450
2343
 
2451
- var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2452
- __extends(LegacyOrderFirestoreRepository, _super);
2453
- function LegacyOrderFirestoreRepository(firestore) {
2454
- var _this = _super.call(this, firestore) || this;
2455
- _this.firestore = firestore;
2456
- _this.collectionName = 'legacyOrders';
2457
- return _this;
2458
- }
2459
- return LegacyOrderFirestoreRepository;
2344
+ var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2345
+ __extends(LegacyOrderFirestoreRepository, _super);
2346
+ function LegacyOrderFirestoreRepository(firestore) {
2347
+ var _this = _super.call(this, firestore) || this;
2348
+ _this.firestore = firestore;
2349
+ _this.collectionName = 'legacyOrders';
2350
+ return _this;
2351
+ }
2352
+ return LegacyOrderFirestoreRepository;
2460
2353
  }(OrderFirestoreRepository));
2461
2354
 
2462
- var HomeFirestoreRepository = /** @class */ (function (_super) {
2463
- __extends(HomeFirestoreRepository, _super);
2464
- function HomeFirestoreRepository(firestore) {
2465
- var _this = _super.call(this) || this;
2466
- _this.firestore = firestore;
2467
- _this.homeToFirestore = function (home) {
2468
- var _a;
2469
- if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2470
- home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.homeCategoryGroupToPlain);
2471
- home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.homeCategoryGroupToPlain);
2472
- home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.homeCategoryGroupToPlain);
2473
- }
2474
- return home;
2475
- };
2476
- _this.homeCategoryGroupToPlain = function (homeCategoryGroup) { return ({
2477
- category: homeCategoryGroup.category.toPlain(),
2478
- products: homeCategoryGroup.products.map(function (product) { return product.toPlain(); }),
2479
- }); };
2480
- _this.homeFromFirestore = function (home) {
2481
- var _a;
2482
- if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2483
- home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.plainToHomeCategoryGroup);
2484
- home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.plainToHomeCategoryGroup);
2485
- home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.plainToHomeCategoryGroup);
2486
- home.data.createdAt =
2487
- home.data.createdAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
2488
- home.data.expiresAt =
2489
- home.data.expiresAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
2490
- }
2491
- return home;
2492
- };
2493
- _this.plainToHomeCategoryGroup = function (homeCategoryGroup) { return ({
2494
- category: Category.toInstance(homeCategoryGroup.category),
2495
- products: homeCategoryGroup.products.map(function (product) { return Product.toInstance(product); }),
2496
- }); };
2497
- _this.collectionName = 'dms';
2498
- _this.model = Home;
2499
- return _this;
2500
- }
2501
- HomeFirestoreRepository.prototype.buildModelInstance = function () {
2502
- var _this = this;
2503
- var _b = _super.prototype.buildModelInstance.call(this), fromFirestore = _b.fromFirestore, toFirestore = _b.toFirestore;
2504
- return {
2505
- toFirestore: function (data) {
2506
- var modifiedData = _this.homeToFirestore(data);
2507
- return toFirestore(modifiedData);
2508
- },
2509
- fromFirestore: function (snap) {
2510
- var instance = fromFirestore(snap);
2511
- return _this.homeFromFirestore(instance);
2512
- },
2513
- };
2514
- };
2515
- return HomeFirestoreRepository;
2516
- }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2517
-
2518
- var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2519
- __extends(ShopMenuFirestoreRepository, _super);
2520
- function ShopMenuFirestoreRepository(firestore) {
2521
- var _this = _super.call(this) || this;
2522
- _this.firestore = firestore;
2523
- _this.collectionName = 'shopMenus';
2524
- _this.model = ShopMenu;
2525
- return _this;
2526
- }
2527
- return ShopMenuFirestoreRepository;
2355
+ var HomeFirestoreRepository = /** @class */ (function (_super) {
2356
+ __extends(HomeFirestoreRepository, _super);
2357
+ function HomeFirestoreRepository(firestore) {
2358
+ var _this = _super.call(this) || this;
2359
+ _this.firestore = firestore;
2360
+ _this.collectionName = 'dms';
2361
+ _this.model = Home;
2362
+ return _this;
2363
+ }
2364
+ return HomeFirestoreRepository;
2528
2365
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2529
2366
 
2530
- var ShopSettingsFirestoreRepository = /** @class */ (function (_super) {
2531
- __extends(ShopSettingsFirestoreRepository, _super);
2532
- function ShopSettingsFirestoreRepository(firestore) {
2533
- var _this = _super.call(this) || this;
2534
- _this.firestore = firestore;
2535
- _this.collectionName = 'shopSettings';
2536
- _this.model = ShopSettings;
2537
- return _this;
2538
- }
2539
- return ShopSettingsFirestoreRepository;
2367
+ var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2368
+ __extends(ShopMenuFirestoreRepository, _super);
2369
+ function ShopMenuFirestoreRepository(firestore) {
2370
+ var _this = _super.call(this) || this;
2371
+ _this.firestore = firestore;
2372
+ _this.collectionName = 'shopMenus';
2373
+ _this.model = ShopMenu;
2374
+ return _this;
2375
+ }
2376
+ return ShopMenuFirestoreRepository;
2540
2377
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2541
2378
 
2542
- var AuthenticationFirebaseAuthService = /** @class */ (function () {
2543
- function AuthenticationFirebaseAuthService(firebaseAuth) {
2544
- this.firebaseAuth = firebaseAuth;
2545
- }
2546
- AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2547
- return __awaiter(this, void 0, void 0, function () {
2548
- var credentials, user;
2549
- return __generator(this, function (_a) {
2550
- switch (_a.label) {
2551
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2552
- case 1:
2553
- credentials = _a.sent();
2554
- user = credentials.user;
2555
- return [2 /*return*/, {
2556
- id: user.uid,
2557
- displayName: user.displayName,
2558
- email: user.email,
2559
- phone: user.phoneNumber,
2560
- isAnonymous: false,
2561
- }];
2562
- }
2563
- });
2564
- });
2565
- };
2566
- AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2567
- return __awaiter(this, void 0, void 0, function () {
2568
- var credentials, user;
2569
- return __generator(this, function (_a) {
2570
- switch (_a.label) {
2571
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2572
- case 1:
2573
- credentials = _a.sent();
2574
- user = credentials.user;
2575
- return [2 /*return*/, {
2576
- id: user.uid,
2577
- displayName: user.displayName,
2578
- email: user.email,
2579
- phone: user.phoneNumber,
2580
- isAnonymous: false,
2581
- }];
2582
- }
2583
- });
2584
- });
2585
- };
2586
- AuthenticationFirebaseAuthService.prototype.signOut = function () {
2587
- return __awaiter(this, void 0, void 0, function () {
2588
- return __generator(this, function (_a) {
2589
- this.firebaseAuth.signOut();
2590
- return [2 /*return*/];
2591
- });
2592
- });
2593
- };
2594
- AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2595
- return __awaiter(this, void 0, void 0, function () {
2596
- var auth, user;
2597
- return __generator(this, function (_a) {
2598
- switch (_a.label) {
2599
- case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2600
- case 1:
2601
- auth = _a.sent();
2602
- user = auth.user;
2603
- user.id = auth.user.uid;
2604
- return [2 /*return*/, user];
2605
- }
2606
- });
2607
- });
2608
- };
2609
- AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2610
- return __awaiter(this, void 0, void 0, function () {
2611
- return __generator(this, function (_a) {
2612
- return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2613
- });
2614
- });
2615
- };
2616
- return AuthenticationFirebaseAuthService;
2379
+ var AuthenticationFirebaseAuthService = /** @class */ (function () {
2380
+ function AuthenticationFirebaseAuthService(firebaseAuth) {
2381
+ this.firebaseAuth = firebaseAuth;
2382
+ }
2383
+ AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2384
+ return __awaiter(this, void 0, void 0, function () {
2385
+ var credentials, user;
2386
+ return __generator(this, function (_a) {
2387
+ switch (_a.label) {
2388
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2389
+ case 1:
2390
+ credentials = _a.sent();
2391
+ user = credentials.user;
2392
+ return [2 /*return*/, {
2393
+ id: user.uid,
2394
+ displayName: user.displayName,
2395
+ email: user.email,
2396
+ phone: user.phoneNumber,
2397
+ isAnonymous: false,
2398
+ }];
2399
+ }
2400
+ });
2401
+ });
2402
+ };
2403
+ AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2404
+ return __awaiter(this, void 0, void 0, function () {
2405
+ var credentials, user;
2406
+ return __generator(this, function (_a) {
2407
+ switch (_a.label) {
2408
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2409
+ case 1:
2410
+ credentials = _a.sent();
2411
+ user = credentials.user;
2412
+ return [2 /*return*/, {
2413
+ id: user.uid,
2414
+ displayName: user.displayName,
2415
+ email: user.email,
2416
+ phone: user.phoneNumber,
2417
+ isAnonymous: false,
2418
+ }];
2419
+ }
2420
+ });
2421
+ });
2422
+ };
2423
+ AuthenticationFirebaseAuthService.prototype.signOut = function () {
2424
+ return __awaiter(this, void 0, void 0, function () {
2425
+ return __generator(this, function (_a) {
2426
+ this.firebaseAuth.signOut();
2427
+ return [2 /*return*/];
2428
+ });
2429
+ });
2430
+ };
2431
+ AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2432
+ return __awaiter(this, void 0, void 0, function () {
2433
+ var auth, user;
2434
+ return __generator(this, function (_a) {
2435
+ switch (_a.label) {
2436
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2437
+ case 1:
2438
+ auth = _a.sent();
2439
+ user = auth.user;
2440
+ user.id = auth.user.uid;
2441
+ return [2 /*return*/, user];
2442
+ }
2443
+ });
2444
+ });
2445
+ };
2446
+ return AuthenticationFirebaseAuthService;
2617
2447
  }());
2618
2448
 
2619
- var RegisterFirebaseAuthService = /** @class */ (function () {
2620
- function RegisterFirebaseAuthService(firebaseAuth) {
2621
- this.firebaseAuth = firebaseAuth;
2622
- }
2623
- RegisterFirebaseAuthService.prototype.register = function (params) {
2624
- return __awaiter(this, void 0, void 0, function () {
2625
- var auth, user, error_1;
2626
- return __generator(this, function (_a) {
2627
- switch (_a.label) {
2628
- case 0:
2629
- _a.trys.push([0, 2, , 3]);
2630
- return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2631
- case 1:
2632
- auth = _a.sent();
2633
- user = auth.user;
2634
- user.sendEmailVerification();
2635
- user.id = auth.user.uid;
2636
- return [2 /*return*/, user];
2637
- case 2:
2638
- error_1 = _a.sent();
2639
- if (error_1.code === 'auth/email-already-in-use')
2640
- throw new UserAlreadyRegisteredError('Email already registered');
2641
- if (error_1.code === 'auth/weak-password')
2642
- throw new WeakPasswordError();
2643
- throw error_1;
2644
- case 3: return [2 /*return*/];
2645
- }
2646
- });
2647
- });
2648
- };
2649
- return RegisterFirebaseAuthService;
2449
+ var RegisterFirebaseAuthService = /** @class */ (function () {
2450
+ function RegisterFirebaseAuthService(firebaseAuth) {
2451
+ this.firebaseAuth = firebaseAuth;
2452
+ }
2453
+ RegisterFirebaseAuthService.prototype.register = function (params) {
2454
+ return __awaiter(this, void 0, void 0, function () {
2455
+ var auth, user, error_1;
2456
+ return __generator(this, function (_a) {
2457
+ switch (_a.label) {
2458
+ case 0:
2459
+ _a.trys.push([0, 2, , 3]);
2460
+ return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2461
+ case 1:
2462
+ auth = _a.sent();
2463
+ user = auth.user;
2464
+ user.sendEmailVerification();
2465
+ user.id = auth.user.uid;
2466
+ return [2 /*return*/, user];
2467
+ case 2:
2468
+ error_1 = _a.sent();
2469
+ if (error_1.code === 'auth/email-already-in-use')
2470
+ throw new UserAlreadyRegisteredError('Email already registered');
2471
+ if (error_1.code === 'auth/weak-password')
2472
+ throw new WeakPasswordError();
2473
+ throw error_1;
2474
+ case 3: return [2 /*return*/];
2475
+ }
2476
+ });
2477
+ });
2478
+ };
2479
+ return RegisterFirebaseAuthService;
2650
2480
  }());
2651
2481
 
2652
- /**
2653
- * Generated bundle index. Do not edit.
2482
+ /**
2483
+ * Generated bundle index. Do not edit.
2654
2484
  */
2655
2485
 
2656
- Object.defineProperty(exports, 'add', {
2657
- enumerable: true,
2658
- get: function () { return dateFns.add; }
2659
- });
2660
- Object.defineProperty(exports, 'sub', {
2661
- enumerable: true,
2662
- get: function () { return dateFns.sub; }
2663
- });
2664
2486
  Object.defineProperty(exports, 'chunk', {
2665
2487
  enumerable: true,
2666
2488
  get: function () { return lodash.chunk; }
2667
2489
  });
2668
- Object.defineProperty(exports, 'get', {
2669
- enumerable: true,
2670
- get: function () { return lodash.get; }
2671
- });
2672
- Object.defineProperty(exports, 'isDate', {
2673
- enumerable: true,
2674
- get: function () { return lodash.isDate; }
2675
- });
2676
2490
  Object.defineProperty(exports, 'isEmpty', {
2677
2491
  enumerable: true,
2678
2492
  get: function () { return lodash.isEmpty; }
@@ -2697,14 +2511,9 @@
2697
2511
  enumerable: true,
2698
2512
  get: function () { return lodash.pick; }
2699
2513
  });
2700
- Object.defineProperty(exports, 'set', {
2701
- enumerable: true,
2702
- get: function () { return lodash.set; }
2703
- });
2704
2514
  exports.Address = Address;
2705
2515
  exports.Authentication = Authentication;
2706
2516
  exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
2707
- exports.AxiosAdapter = AxiosAdapter;
2708
2517
  exports.Base = Base;
2709
2518
  exports.BaseModel = BaseModel;
2710
2519
  exports.BeautyProfile = BeautyProfile;
@@ -2717,11 +2526,11 @@
2717
2526
  exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
2718
2527
  exports.CheckoutSubscription = CheckoutSubscription;
2719
2528
  exports.CheckoutSubscriptionFirestoreRepository = CheckoutSubscriptionFirestoreRepository;
2529
+ exports.ClubCoupon = ClubCoupon;
2720
2530
  exports.Coupon = Coupon;
2721
2531
  exports.CouponFirestoreRepository = CouponFirestoreRepository;
2722
2532
  exports.DuplicatedResultsError = DuplicatedResultsError;
2723
2533
  exports.Edition = Edition;
2724
- exports.FinancialCoupon = FinancialCoupon;
2725
2534
  exports.Home = Home;
2726
2535
  exports.HomeFirestoreRepository = HomeFirestoreRepository;
2727
2536
  exports.InvalidArgumentError = InvalidArgumentError;
@@ -2737,17 +2546,14 @@
2737
2546
  exports.Product = Product;
2738
2547
  exports.ProductFirestoreRepository = ProductFirestoreRepository;
2739
2548
  exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
2740
- exports.ProductsIndex = ProductsIndex;
2741
- exports.RecoveryPassword = RecoveryPassword;
2742
2549
  exports.Register = Register;
2743
2550
  exports.RegisterFirebaseAuthService = RegisterFirebaseAuthService;
2744
2551
  exports.RequiredArgumentError = RequiredArgumentError;
2745
2552
  exports.ShippingMethod = ShippingMethod;
2746
2553
  exports.ShopMenu = ShopMenu;
2747
2554
  exports.ShopMenuFirestoreRepository = ShopMenuFirestoreRepository;
2748
- exports.ShopSettings = ShopSettings;
2749
- exports.ShopSettingsFirestoreRepository = ShopSettingsFirestoreRepository;
2750
2555
  exports.SignOut = SignOut;
2556
+ exports.StoreCoupon = StoreCoupon;
2751
2557
  exports.Subscription = Subscription;
2752
2558
  exports.SubscriptionEditionFirestoreRepository = SubscriptionEditionFirestoreRepository;
2753
2559
  exports.SubscriptionFirestoreRepository = SubscriptionFirestoreRepository;