@infrab4a/connect 0.14.1 → 0.14.2

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 (474) hide show
  1. package/README.md +24 -24
  2. package/bundles/infrab4a-connect.umd.js +2252 -2252
  3. package/bundles/infrab4a-connect.umd.js.map +1 -1
  4. package/esm2015/infrab4a-connect.js +4 -4
  5. package/esm2015/lib/domain/catalog/index.js +3 -3
  6. package/esm2015/lib/domain/catalog/models/category.js +7 -7
  7. package/esm2015/lib/domain/catalog/models/enums/index.js +2 -2
  8. package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -6
  9. package/esm2015/lib/domain/catalog/models/index.js +6 -6
  10. package/esm2015/lib/domain/catalog/models/product.js +11 -11
  11. package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -2
  12. package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -2
  13. package/esm2015/lib/domain/catalog/models/types/index.js +8 -8
  14. package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -2
  15. package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -2
  16. package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -2
  17. package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -2
  18. package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -2
  19. package/esm2015/lib/domain/catalog/models/variant.js +7 -7
  20. package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -2
  21. package/esm2015/lib/domain/catalog/repositories/index.js +5 -5
  22. package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -2
  23. package/esm2015/lib/domain/catalog/repositories/subscription-product.repository.js +2 -2
  24. package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -2
  25. package/esm2015/lib/domain/general/index.js +3 -3
  26. package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +2 -2
  27. package/esm2015/lib/domain/general/model/base.model.js +13 -13
  28. package/esm2015/lib/domain/general/model/identifier-fields.js +2 -2
  29. package/esm2015/lib/domain/general/model/index.js +5 -5
  30. package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +2 -2
  31. package/esm2015/lib/domain/general/model/types/index.js +4 -4
  32. package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +2 -2
  33. package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +2 -2
  34. package/esm2015/lib/domain/general/repository/create.repository.js +2 -2
  35. package/esm2015/lib/domain/general/repository/crud.repository.js +2 -2
  36. package/esm2015/lib/domain/general/repository/delete.repository.js +2 -2
  37. package/esm2015/lib/domain/general/repository/enums/index.js +3 -3
  38. package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +9 -9
  39. package/esm2015/lib/domain/general/repository/enums/where.enum.js +12 -12
  40. package/esm2015/lib/domain/general/repository/find.repository.js +2 -2
  41. package/esm2015/lib/domain/general/repository/get.repository.js +2 -2
  42. package/esm2015/lib/domain/general/repository/index.js +10 -10
  43. package/esm2015/lib/domain/general/repository/read.repository.js +2 -2
  44. package/esm2015/lib/domain/general/repository/types/index.js +6 -6
  45. package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +2 -2
  46. package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +2 -2
  47. package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +2 -2
  48. package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +2 -2
  49. package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +2 -2
  50. package/esm2015/lib/domain/general/repository/update.repository.js +2 -2
  51. package/esm2015/lib/domain/index.js +7 -7
  52. package/esm2015/lib/domain/location/index.js +2 -2
  53. package/esm2015/lib/domain/location/models/address.js +4 -4
  54. package/esm2015/lib/domain/location/models/index.js +3 -3
  55. package/esm2015/lib/domain/location/models/types/index.js +4 -4
  56. package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -2
  57. package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -2
  58. package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -2
  59. package/esm2015/lib/domain/shop-settings/enums/filter-type.enum.js +21 -21
  60. package/esm2015/lib/domain/shop-settings/enums/index.js +3 -3
  61. package/esm2015/lib/domain/shop-settings/enums/questions-filters.enum.js +21 -21
  62. package/esm2015/lib/domain/shop-settings/helpers/beauty-questions.helper.js +46 -46
  63. package/esm2015/lib/domain/shop-settings/helpers/index.js +2 -2
  64. package/esm2015/lib/domain/shop-settings/index.js +5 -5
  65. package/esm2015/lib/domain/shop-settings/models/home.js +7 -7
  66. package/esm2015/lib/domain/shop-settings/models/index.js +4 -4
  67. package/esm2015/lib/domain/shop-settings/models/shop-menu.js +7 -7
  68. package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +2 -2
  69. package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +2 -2
  70. package/esm2015/lib/domain/shop-settings/models/types/index.js +5 -5
  71. package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +2 -2
  72. package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +2 -2
  73. package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +2 -2
  74. package/esm2015/lib/domain/shop-settings/repositories/index.js +3 -3
  75. package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
  76. package/esm2015/lib/domain/shopping/index.js +3 -3
  77. package/esm2015/lib/domain/shopping/models/buy-2-win.js +14 -14
  78. package/esm2015/lib/domain/shopping/models/checkout.js +38 -38
  79. package/esm2015/lib/domain/shopping/models/coupons/coupon.js +23 -23
  80. package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
  81. package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-types.enum.js +8 -8
  82. package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -7
  83. package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +4 -4
  84. package/esm2015/lib/domain/shopping/models/coupons/financial-coupon.js +28 -28
  85. package/esm2015/lib/domain/shopping/models/coupons/index.js +4 -4
  86. package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -6
  87. package/esm2015/lib/domain/shopping/models/enums/index.js +3 -3
  88. package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -12
  89. package/esm2015/lib/domain/shopping/models/index.js +12 -12
  90. package/esm2015/lib/domain/shopping/models/line-item.js +4 -4
  91. package/esm2015/lib/domain/shopping/models/order.js +11 -11
  92. package/esm2015/lib/domain/shopping/models/payment.js +169 -169
  93. package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -7
  94. package/esm2015/lib/domain/shopping/models/subscription/checkout.js +28 -28
  95. package/esm2015/lib/domain/shopping/models/subscription/index.js +3 -3
  96. package/esm2015/lib/domain/shopping/models/subscription/plan.js +7 -7
  97. package/esm2015/lib/domain/shopping/models/types/index.js +8 -8
  98. package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -2
  99. package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -2
  100. package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -2
  101. package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -2
  102. package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -2
  103. package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -2
  104. package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -2
  105. package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +2 -2
  106. package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -2
  107. package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -2
  108. package/esm2015/lib/domain/shopping/repositories/index.js +8 -8
  109. package/esm2015/lib/domain/shopping/repositories/legacy-order.repository.js +2 -2
  110. package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -2
  111. package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -2
  112. package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
  113. package/esm2015/lib/domain/shopping/repositories/subscription/index.js +3 -3
  114. package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +2 -2
  115. package/esm2015/lib/domain/users/errors/index.js +4 -4
  116. package/esm2015/lib/domain/users/errors/unauthorized.error.js +7 -7
  117. package/esm2015/lib/domain/users/errors/user-already-registered.error.js +7 -7
  118. package/esm2015/lib/domain/users/errors/weak-password.error.js +7 -7
  119. package/esm2015/lib/domain/users/index.js +6 -6
  120. package/esm2015/lib/domain/users/models/beauty-profile.js +12 -12
  121. package/esm2015/lib/domain/users/models/enums/accessory-importances.enum.js +7 -7
  122. package/esm2015/lib/domain/users/models/enums/area.enum.js +13 -13
  123. package/esm2015/lib/domain/users/models/enums/beard-problems.enum.js +11 -11
  124. package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +9 -9
  125. package/esm2015/lib/domain/users/models/enums/beauty-product-importances.enum.js +8 -8
  126. package/esm2015/lib/domain/users/models/enums/body-problems.enum.js +13 -13
  127. package/esm2015/lib/domain/users/models/enums/body-shapes.enum.js +9 -9
  128. package/esm2015/lib/domain/users/models/enums/body-tattoos.enum.js +7 -7
  129. package/esm2015/lib/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -9
  130. package/esm2015/lib/domain/users/models/enums/face-skin-problems.enum.js +12 -12
  131. package/esm2015/lib/domain/users/models/enums/face-skin-tones.enum.js +10 -10
  132. package/esm2015/lib/domain/users/models/enums/family-incomes.enum.js +10 -10
  133. package/esm2015/lib/domain/users/models/enums/fragrance-importances.enum.js +7 -7
  134. package/esm2015/lib/domain/users/models/enums/hair-colors.enum.js +12 -12
  135. package/esm2015/lib/domain/users/models/enums/hair-problems.enum.js +12 -12
  136. package/esm2015/lib/domain/users/models/enums/hair-strands.enum.js +10 -10
  137. package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +9 -9
  138. package/esm2015/lib/domain/users/models/enums/index.js +21 -21
  139. package/esm2015/lib/domain/users/models/enums/office-position.enum.js +8 -8
  140. package/esm2015/lib/domain/users/models/enums/product-spents.enum.js +10 -10
  141. package/esm2015/lib/domain/users/models/enums/user-type.enum.js +10 -10
  142. package/esm2015/lib/domain/users/models/index.js +8 -8
  143. package/esm2015/lib/domain/users/models/lead.js +7 -7
  144. package/esm2015/lib/domain/users/models/subscription/edition.js +7 -7
  145. package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
  146. package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +6 -6
  147. package/esm2015/lib/domain/users/models/subscription/enums/index.js +5 -5
  148. package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
  149. package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +6 -6
  150. package/esm2015/lib/domain/users/models/subscription/index.js +5 -5
  151. package/esm2015/lib/domain/users/models/subscription/payment.js +14 -14
  152. package/esm2015/lib/domain/users/models/subscription/subscription.js +43 -43
  153. package/esm2015/lib/domain/users/models/user-address.js +7 -7
  154. package/esm2015/lib/domain/users/models/user-payment-method.js +7 -7
  155. package/esm2015/lib/domain/users/models/user.js +26 -26
  156. package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +2 -2
  157. package/esm2015/lib/domain/users/repositories/edition.repository.js +2 -2
  158. package/esm2015/lib/domain/users/repositories/index.js +9 -9
  159. package/esm2015/lib/domain/users/repositories/lead.repository.js +2 -2
  160. package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +2 -2
  161. package/esm2015/lib/domain/users/repositories/subscription.repository.js +2 -2
  162. package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -2
  163. package/esm2015/lib/domain/users/repositories/user-payment-method.repository.js +2 -2
  164. package/esm2015/lib/domain/users/repositories/user.repository.js +2 -2
  165. package/esm2015/lib/domain/users/services/authentication.service.js +2 -2
  166. package/esm2015/lib/domain/users/services/index.js +4 -4
  167. package/esm2015/lib/domain/users/services/register.service.js +2 -2
  168. package/esm2015/lib/domain/users/services/types/basic-user-data.type.js +2 -2
  169. package/esm2015/lib/domain/users/services/types/index.js +2 -2
  170. package/esm2015/lib/domain/users/use-cases/authentication.js +40 -40
  171. package/esm2015/lib/domain/users/use-cases/index.js +5 -5
  172. package/esm2015/lib/domain/users/use-cases/recovery-password.js +12 -12
  173. package/esm2015/lib/domain/users/use-cases/register.js +34 -34
  174. package/esm2015/lib/domain/users/use-cases/signout.js +12 -12
  175. package/esm2015/lib/errors/duplicated-results.error.js +7 -7
  176. package/esm2015/lib/errors/index.js +5 -5
  177. package/esm2015/lib/errors/invalid-argument.error.js +7 -7
  178. package/esm2015/lib/errors/not-found.error.js +7 -7
  179. package/esm2015/lib/errors/required-argument.error.js +8 -8
  180. package/esm2015/lib/index.js +5 -5
  181. package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +52 -52
  182. package/esm2015/lib/infra/firebase/auth/index.js +3 -3
  183. package/esm2015/lib/infra/firebase/auth/register-firebase-auth.service.js +26 -26
  184. package/esm2015/lib/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -2
  185. package/esm2015/lib/infra/firebase/firestore/index.js +4 -4
  186. package/esm2015/lib/infra/firebase/firestore/mixins/index.js +10 -10
  187. package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -31
  188. package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
  189. package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
  190. package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +76 -76
  191. package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
  192. package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
  193. package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
  194. package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
  195. package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -45
  196. package/esm2015/lib/infra/firebase/firestore/models/user-search.js +7 -7
  197. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +74 -74
  198. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +5 -5
  199. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
  200. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
  201. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -12
  202. package/esm2015/lib/infra/firebase/firestore/repositories/index.js +5 -5
  203. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +12 -12
  204. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
  205. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
  206. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
  207. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
  208. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
  209. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +29 -29
  210. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +9 -9
  211. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -9
  212. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
  213. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
  214. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
  215. package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +10 -10
  216. package/esm2015/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -12
  217. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
  218. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
  219. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
  220. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
  221. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
  222. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -70
  223. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -14
  224. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -12
  225. package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
  226. package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
  227. package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
  228. package/esm2015/lib/infra/firebase/firestore/types/index.js +4 -4
  229. package/esm2015/lib/infra/firebase/index.js +3 -3
  230. package/esm2015/lib/infra/index.js +2 -2
  231. package/esm2015/lib/utils/index.js +5 -5
  232. package/esm2015/lib/utils/mixins/base.mixin.js +6 -6
  233. package/esm2015/lib/utils/mixins/index.js +3 -3
  234. package/esm2015/lib/utils/mixins/mixin-ctor.type.js +2 -2
  235. package/esm2015/lib/utils/types/index.js +2 -2
  236. package/esm2015/lib/utils/types/prop.type.js +2 -2
  237. package/esm2015/public-api.js +3 -3
  238. package/fesm2015/infrab4a-connect.js +1530 -1530
  239. package/fesm2015/infrab4a-connect.js.map +1 -1
  240. package/infrab4a-connect.d.ts +5 -5
  241. package/lib/domain/catalog/index.d.ts +2 -2
  242. package/lib/domain/catalog/models/category.d.ts +22 -22
  243. package/lib/domain/catalog/models/enums/index.d.ts +1 -1
  244. package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -4
  245. package/lib/domain/catalog/models/index.d.ts +5 -5
  246. package/lib/domain/catalog/models/product.d.ts +35 -34
  247. package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -4
  248. package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -4
  249. package/lib/domain/catalog/models/types/index.d.ts +7 -7
  250. package/lib/domain/catalog/models/types/product-review.type.d.ts +14 -14
  251. package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -7
  252. package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -10
  253. package/lib/domain/catalog/models/types/stock.type.d.ts +3 -3
  254. package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -4
  255. package/lib/domain/catalog/models/variant.d.ts +14 -14
  256. package/lib/domain/catalog/repositories/category.repository.d.ts +12 -12
  257. package/lib/domain/catalog/repositories/index.d.ts +4 -4
  258. package/lib/domain/catalog/repositories/product.repository.d.ts +5 -5
  259. package/lib/domain/catalog/repositories/subscription-product.repository.d.ts +4 -4
  260. package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -4
  261. package/lib/domain/general/index.d.ts +2 -2
  262. package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +3 -3
  263. package/lib/domain/general/model/base.model.d.ts +6 -6
  264. package/lib/domain/general/model/identifier-fields.d.ts +4 -4
  265. package/lib/domain/general/model/index.d.ts +4 -4
  266. package/lib/domain/general/model/types/base-model-builder.type.d.ts +5 -5
  267. package/lib/domain/general/model/types/index.d.ts +3 -3
  268. package/lib/domain/general/model/types/non-function-properties.type.d.ts +2 -2
  269. package/lib/domain/general/model/types/non-function-property-name.type.d.ts +3 -3
  270. package/lib/domain/general/repository/create.repository.d.ts +5 -5
  271. package/lib/domain/general/repository/crud.repository.d.ts +7 -7
  272. package/lib/domain/general/repository/delete.repository.d.ts +5 -5
  273. package/lib/domain/general/repository/enums/index.d.ts +2 -2
  274. package/lib/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -7
  275. package/lib/domain/general/repository/enums/where.enum.d.ts +10 -10
  276. package/lib/domain/general/repository/find.repository.d.ts +5 -5
  277. package/lib/domain/general/repository/get.repository.d.ts +5 -5
  278. package/lib/domain/general/repository/index.d.ts +9 -9
  279. package/lib/domain/general/repository/read.repository.d.ts +5 -5
  280. package/lib/domain/general/repository/types/index.d.ts +5 -5
  281. package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +14 -14
  282. package/lib/domain/general/repository/types/repository-find-result.type.d.ts +4 -4
  283. package/lib/domain/general/repository/types/repository-limit-options.type.d.ts +4 -4
  284. package/lib/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -5
  285. package/lib/domain/general/repository/types/repository-update-params.type.d.ts +11 -11
  286. package/lib/domain/general/repository/update.repository.d.ts +5 -5
  287. package/lib/domain/index.d.ts +6 -6
  288. package/lib/domain/location/index.d.ts +1 -1
  289. package/lib/domain/location/models/address.d.ts +21 -21
  290. package/lib/domain/location/models/index.d.ts +2 -2
  291. package/lib/domain/location/models/types/index.d.ts +3 -3
  292. package/lib/domain/location/models/types/location-bound.type.d.ts +6 -6
  293. package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -7
  294. package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -4
  295. package/lib/domain/shop-settings/enums/filter-type.enum.d.ts +19 -19
  296. package/lib/domain/shop-settings/enums/index.d.ts +2 -2
  297. package/lib/domain/shop-settings/enums/questions-filters.enum.d.ts +19 -19
  298. package/lib/domain/shop-settings/helpers/beauty-questions.helper.d.ts +9 -9
  299. package/lib/domain/shop-settings/helpers/index.d.ts +1 -1
  300. package/lib/domain/shop-settings/index.d.ts +4 -4
  301. package/lib/domain/shop-settings/models/home.d.ts +17 -17
  302. package/lib/domain/shop-settings/models/index.d.ts +3 -3
  303. package/lib/domain/shop-settings/models/shop-menu.d.ts +7 -7
  304. package/lib/domain/shop-settings/models/types/banner.type.d.ts +6 -6
  305. package/lib/domain/shop-settings/models/types/benefit.type.d.ts +5 -5
  306. package/lib/domain/shop-settings/models/types/index.d.ts +4 -4
  307. package/lib/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -8
  308. package/lib/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -8
  309. package/lib/domain/shop-settings/repositories/home.repository.d.ts +4 -4
  310. package/lib/domain/shop-settings/repositories/index.d.ts +2 -2
  311. package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -4
  312. package/lib/domain/shopping/index.d.ts +2 -2
  313. package/lib/domain/shopping/models/buy-2-win.d.ts +18 -18
  314. package/lib/domain/shopping/models/checkout.d.ts +28 -28
  315. package/lib/domain/shopping/models/coupons/coupon.d.ts +28 -28
  316. package/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
  317. package/lib/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +6 -6
  318. package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -5
  319. package/lib/domain/shopping/models/coupons/enums/index.d.ts +3 -3
  320. package/lib/domain/shopping/models/coupons/financial-coupon.d.ts +8 -8
  321. package/lib/domain/shopping/models/coupons/index.d.ts +3 -3
  322. package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -4
  323. package/lib/domain/shopping/models/enums/index.d.ts +2 -2
  324. package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
  325. package/lib/domain/shopping/models/index.d.ts +11 -11
  326. package/lib/domain/shopping/models/line-item.d.ts +8 -8
  327. package/lib/domain/shopping/models/order.d.ts +9 -9
  328. package/lib/domain/shopping/models/payment.d.ts +69 -69
  329. package/lib/domain/shopping/models/shipping-method.d.ts +18 -18
  330. package/lib/domain/shopping/models/subscription/checkout.d.ts +23 -23
  331. package/lib/domain/shopping/models/subscription/index.d.ts +2 -2
  332. package/lib/domain/shopping/models/subscription/plan.d.ts +12 -12
  333. package/lib/domain/shopping/models/types/index.d.ts +7 -7
  334. package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -12
  335. package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
  336. package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -14
  337. package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
  338. package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -6
  339. package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -11
  340. package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
  341. package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
  342. package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -4
  343. package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -4
  344. package/lib/domain/shopping/repositories/index.d.ts +7 -7
  345. package/lib/domain/shopping/repositories/legacy-order.repository.d.ts +3 -3
  346. package/lib/domain/shopping/repositories/order.repository.d.ts +4 -4
  347. package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -4
  348. package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
  349. package/lib/domain/shopping/repositories/subscription/index.d.ts +2 -2
  350. package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
  351. package/lib/domain/users/errors/index.d.ts +3 -3
  352. package/lib/domain/users/errors/unauthorized.error.d.ts +4 -4
  353. package/lib/domain/users/errors/user-already-registered.error.d.ts +4 -4
  354. package/lib/domain/users/errors/weak-password.error.d.ts +4 -4
  355. package/lib/domain/users/index.d.ts +5 -5
  356. package/lib/domain/users/models/beauty-profile.d.ts +12 -12
  357. package/lib/domain/users/models/enums/accessory-importances.enum.d.ts +5 -5
  358. package/lib/domain/users/models/enums/area.enum.d.ts +11 -11
  359. package/lib/domain/users/models/enums/beard-problems.enum.d.ts +9 -9
  360. package/lib/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
  361. package/lib/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -6
  362. package/lib/domain/users/models/enums/body-problems.enum.d.ts +11 -11
  363. package/lib/domain/users/models/enums/body-shapes.enum.d.ts +7 -7
  364. package/lib/domain/users/models/enums/body-tattoos.enum.d.ts +5 -5
  365. package/lib/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -7
  366. package/lib/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -10
  367. package/lib/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -8
  368. package/lib/domain/users/models/enums/family-incomes.enum.d.ts +8 -8
  369. package/lib/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -5
  370. package/lib/domain/users/models/enums/hair-colors.enum.d.ts +10 -10
  371. package/lib/domain/users/models/enums/hair-problems.enum.d.ts +10 -10
  372. package/lib/domain/users/models/enums/hair-strands.enum.d.ts +8 -8
  373. package/lib/domain/users/models/enums/hair-types.enum.d.ts +7 -7
  374. package/lib/domain/users/models/enums/index.d.ts +20 -20
  375. package/lib/domain/users/models/enums/office-position.enum.d.ts +6 -6
  376. package/lib/domain/users/models/enums/product-spents.enum.d.ts +8 -8
  377. package/lib/domain/users/models/enums/user-type.enum.d.ts +8 -8
  378. package/lib/domain/users/models/index.d.ts +7 -7
  379. package/lib/domain/users/models/lead.d.ts +9 -9
  380. package/lib/domain/users/models/subscription/edition.d.ts +15 -15
  381. package/lib/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
  382. package/lib/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -4
  383. package/lib/domain/users/models/subscription/enums/index.d.ts +4 -4
  384. package/lib/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
  385. package/lib/domain/users/models/subscription/enums/status.enum.d.ts +4 -4
  386. package/lib/domain/users/models/subscription/index.d.ts +4 -4
  387. package/lib/domain/users/models/subscription/payment.d.ts +14 -14
  388. package/lib/domain/users/models/subscription/subscription.d.ts +30 -30
  389. package/lib/domain/users/models/user-address.d.ts +7 -7
  390. package/lib/domain/users/models/user-payment-method.d.ts +13 -13
  391. package/lib/domain/users/models/user.d.ts +24 -24
  392. package/lib/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
  393. package/lib/domain/users/repositories/edition.repository.d.ts +4 -4
  394. package/lib/domain/users/repositories/index.d.ts +8 -8
  395. package/lib/domain/users/repositories/lead.repository.d.ts +4 -4
  396. package/lib/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
  397. package/lib/domain/users/repositories/subscription.repository.d.ts +4 -4
  398. package/lib/domain/users/repositories/user-address.repository.d.ts +4 -4
  399. package/lib/domain/users/repositories/user-payment-method.repository.d.ts +4 -4
  400. package/lib/domain/users/repositories/user.repository.d.ts +6 -6
  401. package/lib/domain/users/services/authentication.service.d.ts +12 -12
  402. package/lib/domain/users/services/index.d.ts +3 -3
  403. package/lib/domain/users/services/register.service.d.ts +7 -7
  404. package/lib/domain/users/services/types/basic-user-data.type.d.ts +4 -4
  405. package/lib/domain/users/services/types/index.d.ts +1 -1
  406. package/lib/domain/users/use-cases/authentication.d.ts +21 -21
  407. package/lib/domain/users/use-cases/index.d.ts +4 -4
  408. package/lib/domain/users/use-cases/recovery-password.d.ts +6 -6
  409. package/lib/domain/users/use-cases/register.d.ts +13 -13
  410. package/lib/domain/users/use-cases/signout.d.ts +6 -6
  411. package/lib/errors/duplicated-results.error.d.ts +4 -4
  412. package/lib/errors/index.d.ts +4 -4
  413. package/lib/errors/invalid-argument.error.d.ts +4 -4
  414. package/lib/errors/not-found.error.d.ts +4 -4
  415. package/lib/errors/required-argument.error.d.ts +5 -5
  416. package/lib/index.d.ts +4 -4
  417. package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +12 -12
  418. package/lib/infra/firebase/auth/index.d.ts +2 -2
  419. package/lib/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -8
  420. package/lib/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -3
  421. package/lib/infra/firebase/firestore/index.d.ts +3 -3
  422. package/lib/infra/firebase/firestore/mixins/index.d.ts +9 -9
  423. package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
  424. package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
  425. package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
  426. package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
  427. package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
  428. package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
  429. package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
  430. package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
  431. package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
  432. package/lib/infra/firebase/firestore/models/user-search.d.ts +9 -9
  433. package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +55 -55
  434. package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -4
  435. package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
  436. package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
  437. package/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -49
  438. package/lib/infra/firebase/firestore/repositories/index.d.ts +4 -4
  439. package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +49 -49
  440. package/lib/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
  441. package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
  442. package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
  443. package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
  444. package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
  445. package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -53
  446. package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -8
  447. package/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -7
  448. package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
  449. package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
  450. package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
  451. package/lib/infra/firebase/firestore/repositories/users/index.d.ts +9 -9
  452. package/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -49
  453. package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
  454. package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
  455. package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
  456. package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
  457. package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
  458. package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -60
  459. package/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -60
  460. package/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -50
  461. package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
  462. package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
  463. package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
  464. package/lib/infra/firebase/firestore/types/index.d.ts +3 -3
  465. package/lib/infra/firebase/index.d.ts +2 -2
  466. package/lib/infra/index.d.ts +1 -1
  467. package/lib/utils/index.d.ts +4 -4
  468. package/lib/utils/mixins/base.mixin.d.ts +3 -3
  469. package/lib/utils/mixins/index.d.ts +2 -2
  470. package/lib/utils/mixins/mixin-ctor.type.d.ts +1 -1
  471. package/lib/utils/types/index.d.ts +1 -1
  472. package/lib/utils/types/prop.type.d.ts +1 -1
  473. package/package.json +1 -1
  474. package/public-api.d.ts +2 -2
@@ -9,2474 +9,2474 @@
9
9
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
10
10
  var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
11
11
 
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;
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;
23
23
  }());
24
24
 
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";
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";
35
35
  })(exports.Where || (exports.Where = {}));
36
36
 
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";
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";
44
44
  })(exports.UpdateOptionActions || (exports.UpdateOptionActions = {}));
45
45
 
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";
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";
51
51
  })(exports.AccessoryImportances || (exports.AccessoryImportances = {}));
52
52
 
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";
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";
64
64
  })(exports.Area || (exports.Area = {}));
65
65
 
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";
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";
75
75
  })(exports.BeardProblems || (exports.BeardProblems = {}));
76
76
 
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";
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";
84
84
  })(exports.BeardSizes || (exports.BeardSizes = {}));
85
85
 
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";
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";
92
92
  })(exports.BeautyProductImportances || (exports.BeautyProductImportances = {}));
93
93
 
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";
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";
105
105
  })(exports.BodyProblems || (exports.BodyProblems = {}));
106
106
 
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";
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";
114
114
  })(exports.BodyShapes || (exports.BodyShapes = {}));
115
115
 
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";
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";
121
121
  })(exports.BodyTattoos || (exports.BodyTattoos = {}));
122
122
 
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";
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";
130
130
  })(exports.FaceSkinOilinesses || (exports.FaceSkinOilinesses = {}));
131
131
 
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";
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";
142
142
  })(exports.FaceSkinProblems || (exports.FaceSkinProblems = {}));
143
143
 
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";
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";
152
152
  })(exports.FaceSkinTones || (exports.FaceSkinTones = {}));
153
153
 
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";
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";
162
162
  })(exports.FamilyIncomes || (exports.FamilyIncomes = {}));
163
163
 
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";
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";
169
169
  })(exports.FragranceImportances || (exports.FragranceImportances = {}));
170
170
 
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";
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";
181
181
  })(exports.HairColors || (exports.HairColors = {}));
182
182
 
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";
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";
193
193
  })(exports.HairProblems || (exports.HairProblems = {}));
194
194
 
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";
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";
203
203
  })(exports.HairStrands || (exports.HairStrands = {}));
204
204
 
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";
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";
212
212
  })(exports.HairTypes || (exports.HairTypes = {}));
213
213
 
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";
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";
220
220
  })(exports.OfficePosition || (exports.OfficePosition = {}));
221
221
 
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";
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";
230
230
  })(exports.ProductSpents || (exports.ProductSpents = {}));
231
231
 
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";
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";
240
240
  })(exports.UserType || (exports.UserType = {}));
241
241
 
242
- exports.BillingStatus = void 0;
243
- (function (BillingStatus) {
244
- BillingStatus["PAYED"] = "PAGO";
242
+ exports.BillingStatus = void 0;
243
+ (function (BillingStatus) {
244
+ BillingStatus["PAYED"] = "PAGO";
245
245
  })(exports.BillingStatus || (exports.BillingStatus = {}));
246
246
 
247
- exports.EditionStatus = void 0;
248
- (function (EditionStatus) {
249
- EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
250
- EditionStatus["SHIPPED"] = "Enviado";
247
+ exports.EditionStatus = void 0;
248
+ (function (EditionStatus) {
249
+ EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
250
+ EditionStatus["SHIPPED"] = "Enviado";
251
251
  })(exports.EditionStatus || (exports.EditionStatus = {}));
252
252
 
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";
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";
258
258
  })(exports.PaymentType || (exports.PaymentType = {}));
259
259
 
260
- exports.Status = void 0;
261
- (function (Status) {
262
- Status["ACTIVE"] = "active";
263
- Status["CANCELLED"] = "Cancelado";
260
+ exports.Status = void 0;
261
+ (function (Status) {
262
+ Status["ACTIVE"] = "active";
263
+ Status["CANCELLED"] = "Cancelado";
264
264
  })(exports.Status || (exports.Status = {}));
265
265
 
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;
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;
582
582
  }
583
583
 
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;
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;
593
593
  }(BaseModel));
594
594
 
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)
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)
764
764
  ], Payment.prototype, "pixExpirationDate", void 0);
765
765
 
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)
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)
779
779
  ], SubscriptionPayment.prototype, "payment", void 0);
780
780
 
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;
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;
787
787
  }(BaseModel));
788
788
 
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;
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;
798
798
  }());
799
799
 
800
- var Coupon = /** @class */ (function (_super) {
801
- __extends(Coupon, _super);
802
- function Coupon() {
803
- return _super !== null && _super.apply(this, arguments) || this;
804
- }
805
- Object.defineProperty(Coupon.prototype, "isInfluencer", {
806
- get: function () {
807
- return !lodash.isNil(this.influencerEmail);
808
- },
809
- enumerable: false,
810
- configurable: true
811
- });
812
- Coupon.prototype.identifierFields = function () {
813
- return ['id'];
814
- };
815
- return Coupon;
816
- }(BaseModel));
817
- __decorate([
818
- classTransformer.Expose({ name: 'checkout_type' }),
819
- __metadata("design:type", Number)
820
- ], Coupon.prototype, "checkoutType", void 0);
821
- __decorate([
822
- classTransformer.Expose({ name: 'exclusivity_type' }),
823
- __metadata("design:type", Number)
800
+ var Coupon = /** @class */ (function (_super) {
801
+ __extends(Coupon, _super);
802
+ function Coupon() {
803
+ return _super !== null && _super.apply(this, arguments) || this;
804
+ }
805
+ Object.defineProperty(Coupon.prototype, "isInfluencer", {
806
+ get: function () {
807
+ return !lodash.isNil(this.influencerEmail);
808
+ },
809
+ enumerable: false,
810
+ configurable: true
811
+ });
812
+ Coupon.prototype.identifierFields = function () {
813
+ return ['id'];
814
+ };
815
+ return Coupon;
816
+ }(BaseModel));
817
+ __decorate([
818
+ classTransformer.Expose({ name: 'checkout_type' }),
819
+ __metadata("design:type", Number)
820
+ ], Coupon.prototype, "checkoutType", void 0);
821
+ __decorate([
822
+ classTransformer.Expose({ name: 'exclusivity_type' }),
823
+ __metadata("design:type", Number)
824
824
  ], Coupon.prototype, "exclusivityType", void 0);
825
825
 
826
- var SubscriptionPlan = /** @class */ (function (_super) {
827
- __extends(SubscriptionPlan, _super);
828
- function SubscriptionPlan() {
829
- return _super !== null && _super.apply(this, arguments) || this;
830
- }
831
- SubscriptionPlan.prototype.identifierFields = function () {
832
- return ['id'];
833
- };
834
- return SubscriptionPlan;
826
+ var SubscriptionPlan = /** @class */ (function (_super) {
827
+ __extends(SubscriptionPlan, _super);
828
+ function SubscriptionPlan() {
829
+ return _super !== null && _super.apply(this, arguments) || this;
830
+ }
831
+ SubscriptionPlan.prototype.identifierFields = function () {
832
+ return ['id'];
833
+ };
834
+ return SubscriptionPlan;
835
835
  }(BaseModel));
836
836
 
837
- var BeautyProfile = /** @class */ (function (_super) {
838
- __extends(BeautyProfile, _super);
839
- function BeautyProfile() {
840
- return _super !== null && _super.apply(this, arguments) || this;
841
- }
842
- BeautyProfile.prototype.toPlain = function () {
843
- var plain = _super.prototype.toPlain.call(this);
844
- delete plain.id;
845
- return plain;
846
- };
847
- BeautyProfile.prototype.identifierFields = function () {
848
- return ['id'];
849
- };
850
- return BeautyProfile;
837
+ var BeautyProfile = /** @class */ (function (_super) {
838
+ __extends(BeautyProfile, _super);
839
+ function BeautyProfile() {
840
+ return _super !== null && _super.apply(this, arguments) || this;
841
+ }
842
+ BeautyProfile.prototype.toPlain = function () {
843
+ var plain = _super.prototype.toPlain.call(this);
844
+ delete plain.id;
845
+ return plain;
846
+ };
847
+ BeautyProfile.prototype.identifierFields = function () {
848
+ return ['id'];
849
+ };
850
+ return BeautyProfile;
851
851
  }(BaseModel));
852
852
 
853
- var User = /** @class */ (function (_super) {
854
- __extends(User, _super);
855
- function User() {
856
- return _super !== null && _super.apply(this, arguments) || this;
857
- }
858
- User.toInstance = function (data) {
859
- var instance = _super.toInstance.call(this, data);
860
- if (!lodash.isNil(data.firstName))
861
- instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
862
- return instance;
863
- };
864
- User.prototype.identifierFields = function () {
865
- return ['id'];
866
- };
867
- User.prototype.toPlain = function () {
868
- var plain = _super.prototype.toPlain.call(this);
869
- delete plain.beautyProfile;
870
- return plain;
871
- };
872
- return User;
873
- }(BaseModel));
874
- __decorate([
875
- classTransformer.Type(function () { return BeautyProfile; }),
876
- __metadata("design:type", BeautyProfile)
853
+ var User = /** @class */ (function (_super) {
854
+ __extends(User, _super);
855
+ function User() {
856
+ return _super !== null && _super.apply(this, arguments) || this;
857
+ }
858
+ User.toInstance = function (data) {
859
+ var instance = _super.toInstance.call(this, data);
860
+ if (!lodash.isNil(data.firstName))
861
+ instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
862
+ return instance;
863
+ };
864
+ User.prototype.identifierFields = function () {
865
+ return ['id'];
866
+ };
867
+ User.prototype.toPlain = function () {
868
+ var plain = _super.prototype.toPlain.call(this);
869
+ delete plain.beautyProfile;
870
+ return plain;
871
+ };
872
+ return User;
873
+ }(BaseModel));
874
+ __decorate([
875
+ classTransformer.Type(function () { return BeautyProfile; }),
876
+ __metadata("design:type", BeautyProfile)
877
877
  ], User.prototype, "beautyProfile", void 0);
878
878
 
879
- var Subscription = /** @class */ (function (_super) {
880
- __extends(Subscription, _super);
881
- function Subscription() {
882
- return _super !== null && _super.apply(this, arguments) || this;
883
- }
884
- Subscription.prototype.identifierFields = function () {
885
- return ['id'];
886
- };
887
- return Subscription;
888
- }(BaseModel));
889
- __decorate([
890
- classTransformer.Type(function () { return User; }),
891
- __metadata("design:type", User)
892
- ], Subscription.prototype, "user", void 0);
893
- __decorate([
894
- classTransformer.Type(function () { return SubscriptionPlan; }),
895
- __metadata("design:type", SubscriptionPlan)
896
- ], Subscription.prototype, "subscriptionPlan", void 0);
897
- __decorate([
898
- classTransformer.Type(function () { return Address; }),
899
- __metadata("design:type", Address)
900
- ], Subscription.prototype, "shippingAddress", void 0);
901
- __decorate([
902
- classTransformer.Type(function () { return Address; }),
903
- __metadata("design:type", Address)
904
- ], Subscription.prototype, "billingAddress", void 0);
905
- __decorate([
906
- classTransformer.Type(function () { return Coupon; }),
907
- __metadata("design:type", Coupon)
908
- ], Subscription.prototype, "coupon", void 0);
909
- __decorate([
910
- classTransformer.Type(function () { return Edition; }),
911
- __metadata("design:type", Array)
912
- ], Subscription.prototype, "editions", void 0);
913
- __decorate([
914
- classTransformer.Type(function () { return SubscriptionPayment; }),
915
- __metadata("design:type", Array)
879
+ var Subscription = /** @class */ (function (_super) {
880
+ __extends(Subscription, _super);
881
+ function Subscription() {
882
+ return _super !== null && _super.apply(this, arguments) || this;
883
+ }
884
+ Subscription.prototype.identifierFields = function () {
885
+ return ['id'];
886
+ };
887
+ return Subscription;
888
+ }(BaseModel));
889
+ __decorate([
890
+ classTransformer.Type(function () { return User; }),
891
+ __metadata("design:type", User)
892
+ ], Subscription.prototype, "user", void 0);
893
+ __decorate([
894
+ classTransformer.Type(function () { return SubscriptionPlan; }),
895
+ __metadata("design:type", SubscriptionPlan)
896
+ ], Subscription.prototype, "subscriptionPlan", void 0);
897
+ __decorate([
898
+ classTransformer.Type(function () { return Address; }),
899
+ __metadata("design:type", Address)
900
+ ], Subscription.prototype, "shippingAddress", void 0);
901
+ __decorate([
902
+ classTransformer.Type(function () { return Address; }),
903
+ __metadata("design:type", Address)
904
+ ], Subscription.prototype, "billingAddress", void 0);
905
+ __decorate([
906
+ classTransformer.Type(function () { return Coupon; }),
907
+ __metadata("design:type", Coupon)
908
+ ], Subscription.prototype, "coupon", void 0);
909
+ __decorate([
910
+ classTransformer.Type(function () { return Edition; }),
911
+ __metadata("design:type", Array)
912
+ ], Subscription.prototype, "editions", void 0);
913
+ __decorate([
914
+ classTransformer.Type(function () { return SubscriptionPayment; }),
915
+ __metadata("design:type", Array)
916
916
  ], Subscription.prototype, "payment", void 0);
917
917
 
918
- var UserAddress = /** @class */ (function (_super) {
919
- __extends(UserAddress, _super);
920
- function UserAddress() {
921
- return _super !== null && _super.apply(this, arguments) || this;
922
- }
923
- UserAddress.prototype.identifierFields = function () {
924
- return ['id'];
925
- };
926
- return UserAddress;
918
+ var UserAddress = /** @class */ (function (_super) {
919
+ __extends(UserAddress, _super);
920
+ function UserAddress() {
921
+ return _super !== null && _super.apply(this, arguments) || this;
922
+ }
923
+ UserAddress.prototype.identifierFields = function () {
924
+ return ['id'];
925
+ };
926
+ return UserAddress;
927
927
  }(Address));
928
928
 
929
- var UserPaymentMethod = /** @class */ (function (_super) {
930
- __extends(UserPaymentMethod, _super);
931
- function UserPaymentMethod() {
932
- return _super !== null && _super.apply(this, arguments) || this;
933
- }
934
- UserPaymentMethod.prototype.identifierFields = function () {
935
- return ['id'];
936
- };
937
- return UserPaymentMethod;
929
+ var UserPaymentMethod = /** @class */ (function (_super) {
930
+ __extends(UserPaymentMethod, _super);
931
+ function UserPaymentMethod() {
932
+ return _super !== null && _super.apply(this, arguments) || this;
933
+ }
934
+ UserPaymentMethod.prototype.identifierFields = function () {
935
+ return ['id'];
936
+ };
937
+ return UserPaymentMethod;
938
938
  }(BaseModel));
939
939
 
940
- var Lead = /** @class */ (function (_super) {
941
- __extends(Lead, _super);
942
- function Lead() {
943
- return _super !== null && _super.apply(this, arguments) || this;
944
- }
945
- Lead.prototype.identifierFields = function () {
946
- return ['id'];
947
- };
948
- return Lead;
940
+ var Lead = /** @class */ (function (_super) {
941
+ __extends(Lead, _super);
942
+ function Lead() {
943
+ return _super !== null && _super.apply(this, arguments) || this;
944
+ }
945
+ Lead.prototype.identifierFields = function () {
946
+ return ['id'];
947
+ };
948
+ return Lead;
949
949
  }(BaseModel));
950
950
 
951
- var UnauthorizedError = /** @class */ (function (_super) {
952
- __extends(UnauthorizedError, _super);
953
- function UnauthorizedError(message) {
954
- var _this = _super.call(this, message) || this;
955
- _this.message = message;
956
- return _this;
957
- }
958
- return UnauthorizedError;
951
+ var UnauthorizedError = /** @class */ (function (_super) {
952
+ __extends(UnauthorizedError, _super);
953
+ function UnauthorizedError(message) {
954
+ var _this = _super.call(this, message) || this;
955
+ _this.message = message;
956
+ return _this;
957
+ }
958
+ return UnauthorizedError;
959
959
  }(Error));
960
960
 
961
- exports.SignInMethods = void 0;
962
- (function (SignInMethods) {
963
- SignInMethods["EMAIL_PASSWORD"] = "email_password";
964
- SignInMethods["GOOGLE"] = "google";
965
- })(exports.SignInMethods || (exports.SignInMethods = {}));
966
- var Authentication = /** @class */ (function () {
967
- function Authentication(authService, userRepository) {
968
- this.authService = authService;
969
- this.userRepository = userRepository;
970
- }
971
- Authentication.prototype.signIn = function (_b, signInMethod) {
972
- var email = _b.email, password = _b.password;
973
- return __awaiter(this, void 0, void 0, function () {
974
- var method, userAuth, user;
975
- return __generator(this, function (_b) {
976
- switch (_b.label) {
977
- case 0:
978
- method = this.getServiceByMethod(signInMethod);
979
- return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
980
- case 1:
981
- userAuth = _b.sent();
982
- user = this.userRepository.get(userAuth);
983
- if (!lodash.isNil(user))
984
- return [2 /*return*/, user];
985
- if (/^.+@b4a.com.br$/.test(userAuth.email))
986
- return [2 /*return*/, this.createsUserByCredential(userAuth)];
987
- throw new UnauthorizedError('Invalid credentials');
988
- }
989
- });
990
- });
991
- };
992
- Authentication.prototype.getServiceByMethod = function (signInMethod) {
993
- return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
994
- };
995
- Authentication.prototype.createsUserByCredential = function (user) {
996
- var _a;
997
- return __awaiter(this, void 0, void 0, function () {
998
- var _b, firstName, lastName, person;
999
- return __generator(this, function (_c) {
1000
- _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1001
- person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1002
- lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1003
- return [2 /*return*/, this.userRepository.create(person)];
1004
- });
1005
- });
1006
- };
1007
- return Authentication;
961
+ exports.SignInMethods = void 0;
962
+ (function (SignInMethods) {
963
+ SignInMethods["EMAIL_PASSWORD"] = "email_password";
964
+ SignInMethods["GOOGLE"] = "google";
965
+ })(exports.SignInMethods || (exports.SignInMethods = {}));
966
+ var Authentication = /** @class */ (function () {
967
+ function Authentication(authService, userRepository) {
968
+ this.authService = authService;
969
+ this.userRepository = userRepository;
970
+ }
971
+ Authentication.prototype.signIn = function (_b, signInMethod) {
972
+ var email = _b.email, password = _b.password;
973
+ return __awaiter(this, void 0, void 0, function () {
974
+ var method, userAuth, user;
975
+ return __generator(this, function (_b) {
976
+ switch (_b.label) {
977
+ case 0:
978
+ method = this.getServiceByMethod(signInMethod);
979
+ return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
980
+ case 1:
981
+ userAuth = _b.sent();
982
+ user = this.userRepository.get(userAuth);
983
+ if (!lodash.isNil(user))
984
+ return [2 /*return*/, user];
985
+ if (/^.+@b4a.com.br$/.test(userAuth.email))
986
+ return [2 /*return*/, this.createsUserByCredential(userAuth)];
987
+ throw new UnauthorizedError('Invalid credentials');
988
+ }
989
+ });
990
+ });
991
+ };
992
+ Authentication.prototype.getServiceByMethod = function (signInMethod) {
993
+ return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
994
+ };
995
+ Authentication.prototype.createsUserByCredential = function (user) {
996
+ var _a;
997
+ return __awaiter(this, void 0, void 0, function () {
998
+ var _b, firstName, lastName, person;
999
+ return __generator(this, function (_c) {
1000
+ _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1001
+ person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1002
+ lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1003
+ return [2 /*return*/, this.userRepository.create(person)];
1004
+ });
1005
+ });
1006
+ };
1007
+ return Authentication;
1008
1008
  }());
1009
1009
 
1010
- var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1011
- __extends(UserAlreadyRegisteredError, _super);
1012
- function UserAlreadyRegisteredError(message) {
1013
- var _this = _super.call(this, message) || this;
1014
- _this.message = message;
1015
- return _this;
1016
- }
1017
- return UserAlreadyRegisteredError;
1010
+ var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1011
+ __extends(UserAlreadyRegisteredError, _super);
1012
+ function UserAlreadyRegisteredError(message) {
1013
+ var _this = _super.call(this, message) || this;
1014
+ _this.message = message;
1015
+ return _this;
1016
+ }
1017
+ return UserAlreadyRegisteredError;
1018
1018
  }(Error));
1019
1019
 
1020
- var WeakPasswordError = /** @class */ (function (_super) {
1021
- __extends(WeakPasswordError, _super);
1022
- function WeakPasswordError(message) {
1023
- if (message === void 0) { message = 'Weak password'; }
1024
- var _this = _super.call(this, message) || this;
1025
- _this.message = message;
1026
- return _this;
1027
- }
1028
- return WeakPasswordError;
1020
+ var WeakPasswordError = /** @class */ (function (_super) {
1021
+ __extends(WeakPasswordError, _super);
1022
+ function WeakPasswordError(message) {
1023
+ if (message === void 0) { message = 'Weak password'; }
1024
+ var _this = _super.call(this, message) || this;
1025
+ _this.message = message;
1026
+ return _this;
1027
+ }
1028
+ return WeakPasswordError;
1029
1029
  }(Error));
1030
1030
 
1031
- var Register = /** @class */ (function () {
1032
- function Register(registerService, userRepository) {
1033
- this.registerService = registerService;
1034
- this.userRepository = userRepository;
1035
- }
1036
- Register.prototype.register = function (params) {
1037
- return __awaiter(this, void 0, void 0, function () {
1038
- var email, displayName, auth, user;
1039
- return __generator(this, function (_a) {
1040
- switch (_a.label) {
1041
- case 0:
1042
- email = params.email.toLocaleLowerCase();
1043
- displayName = params.firstName + " " + params.lastName;
1044
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1045
- case 1:
1046
- if (_a.sent())
1047
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1048
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1049
- case 2:
1050
- if (_a.sent())
1051
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1052
- return [4 /*yield*/, this.registerService.register({
1053
- birthday: params.birthday,
1054
- email: email,
1055
- firstName: params.firstName,
1056
- lastName: params.lastName,
1057
- cpf: params.cpf,
1058
- displayName: displayName,
1059
- phone: params.phone,
1060
- password: params.password,
1061
- })];
1062
- case 3:
1063
- auth = _a.sent();
1064
- delete params.password;
1065
- return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1066
- displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1067
- case 4:
1068
- user = _a.sent();
1069
- return [2 /*return*/, user];
1070
- }
1071
- });
1072
- });
1073
- };
1074
- return Register;
1031
+ var Register = /** @class */ (function () {
1032
+ function Register(registerService, userRepository) {
1033
+ this.registerService = registerService;
1034
+ this.userRepository = userRepository;
1035
+ }
1036
+ Register.prototype.register = function (params) {
1037
+ return __awaiter(this, void 0, void 0, function () {
1038
+ var email, displayName, auth, user;
1039
+ return __generator(this, function (_a) {
1040
+ switch (_a.label) {
1041
+ case 0:
1042
+ email = params.email.toLocaleLowerCase();
1043
+ displayName = params.firstName + " " + params.lastName;
1044
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1045
+ case 1:
1046
+ if (_a.sent())
1047
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1048
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1049
+ case 2:
1050
+ if (_a.sent())
1051
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1052
+ return [4 /*yield*/, this.registerService.register({
1053
+ birthday: params.birthday,
1054
+ email: email,
1055
+ firstName: params.firstName,
1056
+ lastName: params.lastName,
1057
+ cpf: params.cpf,
1058
+ displayName: displayName,
1059
+ phone: params.phone,
1060
+ password: params.password,
1061
+ })];
1062
+ case 3:
1063
+ auth = _a.sent();
1064
+ delete params.password;
1065
+ return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1066
+ displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1067
+ case 4:
1068
+ user = _a.sent();
1069
+ return [2 /*return*/, user];
1070
+ }
1071
+ });
1072
+ });
1073
+ };
1074
+ return Register;
1075
1075
  }());
1076
1076
 
1077
- var SignOut = /** @class */ (function () {
1078
- function SignOut(authService) {
1079
- this.authService = authService;
1080
- }
1081
- SignOut.prototype.signOut = function () {
1082
- return __awaiter(this, void 0, void 0, function () {
1083
- return __generator(this, function (_a) {
1084
- switch (_a.label) {
1085
- case 0: return [4 /*yield*/, this.authService.signOut()];
1086
- case 1:
1087
- _a.sent();
1088
- return [2 /*return*/];
1089
- }
1090
- });
1091
- });
1092
- };
1093
- return SignOut;
1077
+ var SignOut = /** @class */ (function () {
1078
+ function SignOut(authService) {
1079
+ this.authService = authService;
1080
+ }
1081
+ SignOut.prototype.signOut = function () {
1082
+ return __awaiter(this, void 0, void 0, function () {
1083
+ return __generator(this, function (_a) {
1084
+ switch (_a.label) {
1085
+ case 0: return [4 /*yield*/, this.authService.signOut()];
1086
+ case 1:
1087
+ _a.sent();
1088
+ return [2 /*return*/];
1089
+ }
1090
+ });
1091
+ });
1092
+ };
1093
+ return SignOut;
1094
1094
  }());
1095
1095
 
1096
- var RecoveryPassword = /** @class */ (function () {
1097
- function RecoveryPassword(authService) {
1098
- this.authService = authService;
1099
- }
1100
- RecoveryPassword.prototype.sendEmail = function (email) {
1101
- return __awaiter(this, void 0, void 0, function () {
1102
- return __generator(this, function (_a) {
1103
- switch (_a.label) {
1104
- case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1105
- case 1:
1106
- _a.sent();
1107
- return [2 /*return*/];
1108
- }
1109
- });
1110
- });
1111
- };
1112
- return RecoveryPassword;
1096
+ var RecoveryPassword = /** @class */ (function () {
1097
+ function RecoveryPassword(authService) {
1098
+ this.authService = authService;
1099
+ }
1100
+ RecoveryPassword.prototype.sendEmail = function (email) {
1101
+ return __awaiter(this, void 0, void 0, function () {
1102
+ return __generator(this, function (_a) {
1103
+ switch (_a.label) {
1104
+ case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1105
+ case 1:
1106
+ _a.sent();
1107
+ return [2 /*return*/];
1108
+ }
1109
+ });
1110
+ });
1111
+ };
1112
+ return RecoveryPassword;
1113
1113
  }());
1114
1114
 
1115
- exports.Shops = void 0;
1116
- (function (Shops) {
1117
- Shops["MENSMARKET"] = "mensmarket";
1118
- Shops["GLAMSHOP"] = "Glamshop";
1115
+ exports.Shops = void 0;
1116
+ (function (Shops) {
1117
+ Shops["MENSMARKET"] = "mensmarket";
1118
+ Shops["GLAMSHOP"] = "Glamshop";
1119
1119
  })(exports.Shops || (exports.Shops = {}));
1120
1120
 
1121
- var Category = /** @class */ (function (_super) {
1122
- __extends(Category, _super);
1123
- function Category() {
1124
- return _super !== null && _super.apply(this, arguments) || this;
1125
- }
1126
- Category.prototype.identifierFields = function () {
1127
- return ['id'];
1128
- };
1129
- return Category;
1121
+ var Category = /** @class */ (function (_super) {
1122
+ __extends(Category, _super);
1123
+ function Category() {
1124
+ return _super !== null && _super.apply(this, arguments) || this;
1125
+ }
1126
+ Category.prototype.identifierFields = function () {
1127
+ return ['id'];
1128
+ };
1129
+ return Category;
1130
1130
  }(BaseModel));
1131
1131
 
1132
- var Product = /** @class */ (function (_super) {
1133
- __extends(Product, _super);
1134
- function Product() {
1135
- return _super !== null && _super.apply(this, arguments) || this;
1136
- }
1137
- Product.prototype.identifierFields = function () {
1138
- return ['id'];
1139
- };
1140
- Product.prototype.getInfoByShop = function (shop) {
1141
- var _a, _b, _c, _d, _e, _f;
1142
- 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]) || {}));
1143
- };
1144
- return Product;
1132
+ var Product = /** @class */ (function (_super) {
1133
+ __extends(Product, _super);
1134
+ function Product() {
1135
+ return _super !== null && _super.apply(this, arguments) || this;
1136
+ }
1137
+ Product.prototype.identifierFields = function () {
1138
+ return ['id'];
1139
+ };
1140
+ Product.prototype.getInfoByShop = function (shop) {
1141
+ var _a, _b, _c, _d, _e, _f;
1142
+ 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]) || {}));
1143
+ };
1144
+ return Product;
1145
1145
  }(BaseModel));
1146
1146
 
1147
- var Variant = /** @class */ (function (_super) {
1148
- __extends(Variant, _super);
1149
- function Variant() {
1150
- return _super !== null && _super.apply(this, arguments) || this;
1151
- }
1152
- Variant.prototype.identifierFields = function () {
1153
- return ['id'];
1154
- };
1155
- return Variant;
1147
+ var Variant = /** @class */ (function (_super) {
1148
+ __extends(Variant, _super);
1149
+ function Variant() {
1150
+ return _super !== null && _super.apply(this, arguments) || this;
1151
+ }
1152
+ Variant.prototype.identifierFields = function () {
1153
+ return ['id'];
1154
+ };
1155
+ return Variant;
1156
1156
  }(BaseModel));
1157
1157
 
1158
- exports.CouponTypes = void 0;
1159
- (function (CouponTypes) {
1160
- CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
1161
- CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
1162
- CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
1163
- CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
1158
+ exports.CouponTypes = void 0;
1159
+ (function (CouponTypes) {
1160
+ CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
1161
+ CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
1162
+ CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
1163
+ CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
1164
1164
  })(exports.CouponTypes || (exports.CouponTypes = {}));
1165
1165
 
1166
- exports.CouponSubtypes = void 0;
1167
- (function (CouponSubtypes) {
1168
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1169
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1166
+ exports.CouponSubtypes = void 0;
1167
+ (function (CouponSubtypes) {
1168
+ CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1169
+ CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1170
1170
  })(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
1171
1171
 
1172
- exports.Exclusivities = void 0;
1173
- (function (Exclusivities) {
1174
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
1175
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
1176
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
1172
+ exports.Exclusivities = void 0;
1173
+ (function (Exclusivities) {
1174
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
1175
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
1176
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
1177
1177
  })(exports.Exclusivities || (exports.Exclusivities = {}));
1178
1178
 
1179
- exports.CheckoutTypes = void 0;
1180
- (function (CheckoutTypes) {
1181
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1182
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1179
+ exports.CheckoutTypes = void 0;
1180
+ (function (CheckoutTypes) {
1181
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1182
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1183
1183
  })(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
1184
1184
 
1185
- var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
1186
- var FinancialCoupon = /** @class */ (function (_super) {
1187
- __extends(FinancialCoupon, _super);
1188
- function FinancialCoupon() {
1189
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1190
- _this.type = exports.CouponTypes.FINANCIAL;
1191
- return _this;
1192
- }
1193
- FinancialCoupon.isFinancialCoupon = function (coupon) {
1194
- return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
1195
- };
1196
- FinancialCoupon.createCoupon = function (userId) {
1197
- return this.toInstance({
1198
- name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
1199
- nickname: "" + Date.now(),
1200
- type: exports.CouponTypes.FINANCIAL,
1201
- subtype: exports.CouponSubtypes.PERCENTAGE,
1202
- checkoutType: exports.CheckoutTypes.ECOMMERCE,
1203
- discount: 30,
1204
- user: userId,
1205
- createdAt: new Date(Date.now()),
1206
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
1207
- });
1208
- };
1209
- return FinancialCoupon;
1185
+ var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
1186
+ var FinancialCoupon = /** @class */ (function (_super) {
1187
+ __extends(FinancialCoupon, _super);
1188
+ function FinancialCoupon() {
1189
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1190
+ _this.type = exports.CouponTypes.FINANCIAL;
1191
+ return _this;
1192
+ }
1193
+ FinancialCoupon.isFinancialCoupon = function (coupon) {
1194
+ return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
1195
+ };
1196
+ FinancialCoupon.createCoupon = function (userId) {
1197
+ return this.toInstance({
1198
+ name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
1199
+ nickname: "" + Date.now(),
1200
+ type: exports.CouponTypes.FINANCIAL,
1201
+ subtype: exports.CouponSubtypes.PERCENTAGE,
1202
+ checkoutType: exports.CheckoutTypes.ECOMMERCE,
1203
+ discount: 30,
1204
+ user: userId,
1205
+ createdAt: new Date(Date.now()),
1206
+ expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
1207
+ });
1208
+ };
1209
+ return FinancialCoupon;
1210
1210
  }(Coupon));
1211
1211
 
1212
- exports.OrderStatus = void 0;
1213
- (function (OrderStatus) {
1214
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1215
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
1216
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1217
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1218
- OrderStatus["ENVIADO"] = "Pedido Enviado";
1219
- OrderStatus["ENTREGUE"] = "Pedido entregue";
1220
- OrderStatus["CANCELADO"] = "Cancelado";
1221
- OrderStatus["CREDIT_CARD"] = "credit_card";
1212
+ exports.OrderStatus = void 0;
1213
+ (function (OrderStatus) {
1214
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1215
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
1216
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1217
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1218
+ OrderStatus["ENVIADO"] = "Pedido Enviado";
1219
+ OrderStatus["ENTREGUE"] = "Pedido entregue";
1220
+ OrderStatus["CANCELADO"] = "Cancelado";
1221
+ OrderStatus["CREDIT_CARD"] = "credit_card";
1222
1222
  })(exports.OrderStatus || (exports.OrderStatus = {}));
1223
1223
 
1224
- var LineItem = /** @class */ (function (_super) {
1225
- __extends(LineItem, _super);
1226
- function LineItem() {
1227
- return _super !== null && _super.apply(this, arguments) || this;
1228
- }
1229
- return LineItem;
1224
+ var LineItem = /** @class */ (function (_super) {
1225
+ __extends(LineItem, _super);
1226
+ function LineItem() {
1227
+ return _super !== null && _super.apply(this, arguments) || this;
1228
+ }
1229
+ return LineItem;
1230
1230
  }(Product));
1231
1231
 
1232
- var ShippingMethod = /** @class */ (function (_super) {
1233
- __extends(ShippingMethod, _super);
1234
- function ShippingMethod() {
1235
- return _super !== null && _super.apply(this, arguments) || this;
1236
- }
1237
- ShippingMethod.prototype.identifierFields = function () {
1238
- return ['id'];
1239
- };
1240
- return ShippingMethod;
1232
+ var ShippingMethod = /** @class */ (function (_super) {
1233
+ __extends(ShippingMethod, _super);
1234
+ function ShippingMethod() {
1235
+ return _super !== null && _super.apply(this, arguments) || this;
1236
+ }
1237
+ ShippingMethod.prototype.identifierFields = function () {
1238
+ return ['id'];
1239
+ };
1240
+ return ShippingMethod;
1241
1241
  }(BaseModel));
1242
1242
 
1243
- var Checkout = /** @class */ (function (_super) {
1244
- __extends(Checkout, _super);
1245
- function Checkout() {
1246
- return _super !== null && _super.apply(this, arguments) || this;
1247
- }
1248
- Checkout.prototype.identifierFields = function () {
1249
- return ['id'];
1250
- };
1251
- return Checkout;
1252
- }(BaseModel));
1253
- __decorate([
1254
- classTransformer.Type(function () { return LineItem; }),
1255
- __metadata("design:type", Array)
1256
- ], Checkout.prototype, "lineItems", void 0);
1257
- __decorate([
1258
- classTransformer.Type(function () { return User; }),
1259
- __metadata("design:type", User)
1260
- ], Checkout.prototype, "user", void 0);
1261
- __decorate([
1262
- classTransformer.Type(function () { return Address; }),
1263
- __metadata("design:type", Address)
1264
- ], Checkout.prototype, "shippingAddress", void 0);
1265
- __decorate([
1266
- classTransformer.Type(function () { return Address; }),
1267
- __metadata("design:type", Address)
1268
- ], Checkout.prototype, "billingAddress", void 0);
1269
- __decorate([
1270
- classTransformer.Type(function () { return ShippingMethod; }),
1271
- __metadata("design:type", ShippingMethod)
1272
- ], Checkout.prototype, "shipping", void 0);
1273
- __decorate([
1274
- classTransformer.Type(function () { return Coupon; }),
1275
- __metadata("design:type", Coupon)
1243
+ var Checkout = /** @class */ (function (_super) {
1244
+ __extends(Checkout, _super);
1245
+ function Checkout() {
1246
+ return _super !== null && _super.apply(this, arguments) || this;
1247
+ }
1248
+ Checkout.prototype.identifierFields = function () {
1249
+ return ['id'];
1250
+ };
1251
+ return Checkout;
1252
+ }(BaseModel));
1253
+ __decorate([
1254
+ classTransformer.Type(function () { return LineItem; }),
1255
+ __metadata("design:type", Array)
1256
+ ], Checkout.prototype, "lineItems", void 0);
1257
+ __decorate([
1258
+ classTransformer.Type(function () { return User; }),
1259
+ __metadata("design:type", User)
1260
+ ], Checkout.prototype, "user", void 0);
1261
+ __decorate([
1262
+ classTransformer.Type(function () { return Address; }),
1263
+ __metadata("design:type", Address)
1264
+ ], Checkout.prototype, "shippingAddress", void 0);
1265
+ __decorate([
1266
+ classTransformer.Type(function () { return Address; }),
1267
+ __metadata("design:type", Address)
1268
+ ], Checkout.prototype, "billingAddress", void 0);
1269
+ __decorate([
1270
+ classTransformer.Type(function () { return ShippingMethod; }),
1271
+ __metadata("design:type", ShippingMethod)
1272
+ ], Checkout.prototype, "shipping", void 0);
1273
+ __decorate([
1274
+ classTransformer.Type(function () { return Coupon; }),
1275
+ __metadata("design:type", Coupon)
1276
1276
  ], Checkout.prototype, "coupon", void 0);
1277
1277
 
1278
- var Order = /** @class */ (function (_super) {
1279
- __extends(Order, _super);
1280
- function Order() {
1281
- return _super !== null && _super.apply(this, arguments) || this;
1282
- }
1283
- return Order;
1284
- }(Checkout));
1285
- __decorate([
1286
- classTransformer.Type(function () { return Payment; }),
1287
- __metadata("design:type", Payment)
1278
+ var Order = /** @class */ (function (_super) {
1279
+ __extends(Order, _super);
1280
+ function Order() {
1281
+ return _super !== null && _super.apply(this, arguments) || this;
1282
+ }
1283
+ return Order;
1284
+ }(Checkout));
1285
+ __decorate([
1286
+ classTransformer.Type(function () { return Payment; }),
1287
+ __metadata("design:type", Payment)
1288
1288
  ], Order.prototype, "payment", void 0);
1289
1289
 
1290
- var CheckoutSubscription = /** @class */ (function (_super) {
1291
- __extends(CheckoutSubscription, _super);
1292
- function CheckoutSubscription() {
1293
- return _super !== null && _super.apply(this, arguments) || this;
1294
- }
1295
- CheckoutSubscription.prototype.identifierFields = function () {
1296
- return ['id'];
1297
- };
1298
- return CheckoutSubscription;
1299
- }(BaseModel));
1300
- __decorate([
1301
- classTransformer.Type(function () { return Address; }),
1302
- __metadata("design:type", Address)
1303
- ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1304
- __decorate([
1305
- classTransformer.Type(function () { return Address; }),
1306
- __metadata("design:type", Address)
1307
- ], CheckoutSubscription.prototype, "billingAddress", void 0);
1308
- __decorate([
1309
- classTransformer.Type(function () { return SubscriptionPlan; }),
1310
- __metadata("design:type", SubscriptionPlan)
1311
- ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1312
- __decorate([
1313
- classTransformer.Type(function () { return Coupon; }),
1314
- __metadata("design:type", Coupon)
1290
+ var CheckoutSubscription = /** @class */ (function (_super) {
1291
+ __extends(CheckoutSubscription, _super);
1292
+ function CheckoutSubscription() {
1293
+ return _super !== null && _super.apply(this, arguments) || this;
1294
+ }
1295
+ CheckoutSubscription.prototype.identifierFields = function () {
1296
+ return ['id'];
1297
+ };
1298
+ return CheckoutSubscription;
1299
+ }(BaseModel));
1300
+ __decorate([
1301
+ classTransformer.Type(function () { return Address; }),
1302
+ __metadata("design:type", Address)
1303
+ ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1304
+ __decorate([
1305
+ classTransformer.Type(function () { return Address; }),
1306
+ __metadata("design:type", Address)
1307
+ ], CheckoutSubscription.prototype, "billingAddress", void 0);
1308
+ __decorate([
1309
+ classTransformer.Type(function () { return SubscriptionPlan; }),
1310
+ __metadata("design:type", SubscriptionPlan)
1311
+ ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1312
+ __decorate([
1313
+ classTransformer.Type(function () { return Coupon; }),
1314
+ __metadata("design:type", Coupon)
1315
1315
  ], CheckoutSubscription.prototype, "coupon", void 0);
1316
1316
 
1317
- var Buy2Win = /** @class */ (function (_super) {
1318
- __extends(Buy2Win, _super);
1319
- function Buy2Win() {
1320
- return _super !== null && _super.apply(this, arguments) || this;
1321
- }
1322
- Buy2Win.prototype.identifierFields = function () {
1323
- return ['id'];
1324
- };
1325
- return Buy2Win;
1326
- }(BaseModel));
1327
- __decorate([
1328
- classTransformer.Type(function () { return Category; }),
1329
- __metadata("design:type", Array)
1317
+ var Buy2Win = /** @class */ (function (_super) {
1318
+ __extends(Buy2Win, _super);
1319
+ function Buy2Win() {
1320
+ return _super !== null && _super.apply(this, arguments) || this;
1321
+ }
1322
+ Buy2Win.prototype.identifierFields = function () {
1323
+ return ['id'];
1324
+ };
1325
+ return Buy2Win;
1326
+ }(BaseModel));
1327
+ __decorate([
1328
+ classTransformer.Type(function () { return Category; }),
1329
+ __metadata("design:type", Array)
1330
1330
  ], Buy2Win.prototype, "categories", void 0);
1331
1331
 
1332
- exports.FilterType = void 0;
1333
- (function (FilterType) {
1334
- FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1335
- FilterType["BEARD_PROBLEMS"] = "beardProblems";
1336
- FilterType["BEARD_SIZE"] = "beardSize";
1337
- FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1338
- FilterType["BODY_PROBLEMS"] = "bodyProblems";
1339
- FilterType["BODY_SHAPE"] = "bodyShape";
1340
- FilterType["BODY_TATTOOS"] = "bodyTattoos";
1341
- FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1342
- FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1343
- FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1344
- FilterType["FAMILY_INCOME"] = "familyIncome";
1345
- FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1346
- FilterType["HAIR_COLOR"] = "hairColor";
1347
- FilterType["HAIR_PROBLEMS"] = "hairProblems";
1348
- FilterType["HAIR_STRANDS"] = "hairStrands";
1349
- FilterType["HAIR_TYPE"] = "hairType";
1350
- FilterType["PRODUCT_SPENT"] = "productSpent";
1332
+ exports.FilterType = void 0;
1333
+ (function (FilterType) {
1334
+ FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1335
+ FilterType["BEARD_PROBLEMS"] = "beardProblems";
1336
+ FilterType["BEARD_SIZE"] = "beardSize";
1337
+ FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1338
+ FilterType["BODY_PROBLEMS"] = "bodyProblems";
1339
+ FilterType["BODY_SHAPE"] = "bodyShape";
1340
+ FilterType["BODY_TATTOOS"] = "bodyTattoos";
1341
+ FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1342
+ FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1343
+ FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1344
+ FilterType["FAMILY_INCOME"] = "familyIncome";
1345
+ FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1346
+ FilterType["HAIR_COLOR"] = "hairColor";
1347
+ FilterType["HAIR_PROBLEMS"] = "hairProblems";
1348
+ FilterType["HAIR_STRANDS"] = "hairStrands";
1349
+ FilterType["HAIR_TYPE"] = "hairType";
1350
+ FilterType["PRODUCT_SPENT"] = "productSpent";
1351
1351
  })(exports.FilterType || (exports.FilterType = {}));
1352
1352
 
1353
- exports.QuestionsFilters = void 0;
1354
- (function (QuestionsFilters) {
1355
- QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1356
- QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1357
- QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1358
- QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1359
- QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1360
- QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1361
- QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1362
- QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1363
- QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1364
- QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1365
- QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1366
- QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1367
- QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1368
- QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1369
- QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1370
- QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1371
- QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1353
+ exports.QuestionsFilters = void 0;
1354
+ (function (QuestionsFilters) {
1355
+ QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1356
+ QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1357
+ QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1358
+ QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1359
+ QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1360
+ QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1361
+ QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1362
+ QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1363
+ QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1364
+ QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1365
+ QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1366
+ QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1367
+ QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1368
+ QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1369
+ QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1370
+ QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1371
+ QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1372
1372
  })(exports.QuestionsFilters || (exports.QuestionsFilters = {}));
1373
1373
 
1374
- var BeautyQuestionsHelper = /** @class */ (function () {
1375
- function BeautyQuestionsHelper() {
1376
- }
1377
- BeautyQuestionsHelper.getAnswers = function (filter) {
1378
- switch (filter) {
1379
- case exports.FilterType.ACCESSORY_IMPORTANCE:
1380
- return exports.AccessoryImportances;
1381
- case exports.FilterType.BEARD_PROBLEMS:
1382
- return exports.BeardProblems;
1383
- case exports.FilterType.BEARD_SIZE:
1384
- return exports.BeardSizes;
1385
- case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1386
- return exports.BeautyProductImportances;
1387
- case exports.FilterType.BODY_PROBLEMS:
1388
- return exports.BodyProblems;
1389
- case exports.FilterType.BODY_SHAPE:
1390
- return exports.BodyShapes;
1391
- case exports.FilterType.BODY_TATTOOS:
1392
- return exports.BodyTattoos;
1393
- case exports.FilterType.FACE_SKIN_OILINESS:
1394
- return exports.FaceSkinOilinesses;
1395
- case exports.FilterType.FACE_SKIN_PROBLEMS:
1396
- return exports.FaceSkinProblems;
1397
- case exports.FilterType.FACE_SKIN_TONE:
1398
- return exports.FaceSkinTones;
1399
- case exports.FilterType.FAMILY_INCOME:
1400
- return exports.FamilyIncomes;
1401
- case exports.FilterType.FRAGRANCE_IMPORTANCE:
1402
- return exports.FragranceImportances;
1403
- case exports.FilterType.HAIR_COLOR:
1404
- return exports.HairColors;
1405
- case exports.FilterType.HAIR_PROBLEMS:
1406
- return exports.HairProblems;
1407
- case exports.FilterType.HAIR_STRANDS:
1408
- return exports.HairStrands;
1409
- case exports.FilterType.HAIR_TYPE:
1410
- return exports.HairTypes;
1411
- case exports.FilterType.PRODUCT_SPENT:
1412
- return exports.ProductSpents;
1413
- }
1414
- };
1415
- BeautyQuestionsHelper.getQuestions = function (filter) {
1416
- return exports.QuestionsFilters[filter];
1417
- };
1418
- return BeautyQuestionsHelper;
1374
+ var BeautyQuestionsHelper = /** @class */ (function () {
1375
+ function BeautyQuestionsHelper() {
1376
+ }
1377
+ BeautyQuestionsHelper.getAnswers = function (filter) {
1378
+ switch (filter) {
1379
+ case exports.FilterType.ACCESSORY_IMPORTANCE:
1380
+ return exports.AccessoryImportances;
1381
+ case exports.FilterType.BEARD_PROBLEMS:
1382
+ return exports.BeardProblems;
1383
+ case exports.FilterType.BEARD_SIZE:
1384
+ return exports.BeardSizes;
1385
+ case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1386
+ return exports.BeautyProductImportances;
1387
+ case exports.FilterType.BODY_PROBLEMS:
1388
+ return exports.BodyProblems;
1389
+ case exports.FilterType.BODY_SHAPE:
1390
+ return exports.BodyShapes;
1391
+ case exports.FilterType.BODY_TATTOOS:
1392
+ return exports.BodyTattoos;
1393
+ case exports.FilterType.FACE_SKIN_OILINESS:
1394
+ return exports.FaceSkinOilinesses;
1395
+ case exports.FilterType.FACE_SKIN_PROBLEMS:
1396
+ return exports.FaceSkinProblems;
1397
+ case exports.FilterType.FACE_SKIN_TONE:
1398
+ return exports.FaceSkinTones;
1399
+ case exports.FilterType.FAMILY_INCOME:
1400
+ return exports.FamilyIncomes;
1401
+ case exports.FilterType.FRAGRANCE_IMPORTANCE:
1402
+ return exports.FragranceImportances;
1403
+ case exports.FilterType.HAIR_COLOR:
1404
+ return exports.HairColors;
1405
+ case exports.FilterType.HAIR_PROBLEMS:
1406
+ return exports.HairProblems;
1407
+ case exports.FilterType.HAIR_STRANDS:
1408
+ return exports.HairStrands;
1409
+ case exports.FilterType.HAIR_TYPE:
1410
+ return exports.HairTypes;
1411
+ case exports.FilterType.PRODUCT_SPENT:
1412
+ return exports.ProductSpents;
1413
+ }
1414
+ };
1415
+ BeautyQuestionsHelper.getQuestions = function (filter) {
1416
+ return exports.QuestionsFilters[filter];
1417
+ };
1418
+ return BeautyQuestionsHelper;
1419
1419
  }());
1420
1420
 
1421
- var Home = /** @class */ (function (_super) {
1422
- __extends(Home, _super);
1423
- function Home() {
1424
- return _super !== null && _super.apply(this, arguments) || this;
1425
- }
1426
- Home.prototype.identifierFields = function () {
1427
- return ['id'];
1428
- };
1429
- return Home;
1421
+ var Home = /** @class */ (function (_super) {
1422
+ __extends(Home, _super);
1423
+ function Home() {
1424
+ return _super !== null && _super.apply(this, arguments) || this;
1425
+ }
1426
+ Home.prototype.identifierFields = function () {
1427
+ return ['id'];
1428
+ };
1429
+ return Home;
1430
1430
  }(BaseModel));
1431
1431
 
1432
- var ShopMenu = /** @class */ (function (_super) {
1433
- __extends(ShopMenu, _super);
1434
- function ShopMenu() {
1435
- return _super !== null && _super.apply(this, arguments) || this;
1436
- }
1437
- ShopMenu.prototype.identifierFields = function () {
1438
- return ['id'];
1439
- };
1440
- return ShopMenu;
1432
+ var ShopMenu = /** @class */ (function (_super) {
1433
+ __extends(ShopMenu, _super);
1434
+ function ShopMenu() {
1435
+ return _super !== null && _super.apply(this, arguments) || this;
1436
+ }
1437
+ ShopMenu.prototype.identifierFields = function () {
1438
+ return ['id'];
1439
+ };
1440
+ return ShopMenu;
1441
1441
  }(BaseModel));
1442
1442
 
1443
- var InvalidArgumentError = /** @class */ (function (_super) {
1444
- __extends(InvalidArgumentError, _super);
1445
- function InvalidArgumentError(message) {
1446
- var _this = _super.call(this, message) || this;
1447
- _this.message = message;
1448
- return _this;
1449
- }
1450
- return InvalidArgumentError;
1443
+ var InvalidArgumentError = /** @class */ (function (_super) {
1444
+ __extends(InvalidArgumentError, _super);
1445
+ function InvalidArgumentError(message) {
1446
+ var _this = _super.call(this, message) || this;
1447
+ _this.message = message;
1448
+ return _this;
1449
+ }
1450
+ return InvalidArgumentError;
1451
1451
  }(Error));
1452
1452
 
1453
- var RequiredArgumentError = /** @class */ (function (_super) {
1454
- __extends(RequiredArgumentError, _super);
1455
- function RequiredArgumentError(args) {
1456
- var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1457
- _this.args = args;
1458
- _this.arguments = args;
1459
- return _this;
1460
- }
1461
- return RequiredArgumentError;
1453
+ var RequiredArgumentError = /** @class */ (function (_super) {
1454
+ __extends(RequiredArgumentError, _super);
1455
+ function RequiredArgumentError(args) {
1456
+ var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1457
+ _this.args = args;
1458
+ _this.arguments = args;
1459
+ return _this;
1460
+ }
1461
+ return RequiredArgumentError;
1462
1462
  }(Error));
1463
1463
 
1464
- var NotFoundError = /** @class */ (function (_super) {
1465
- __extends(NotFoundError, _super);
1466
- function NotFoundError(message) {
1467
- var _this = _super.call(this, message) || this;
1468
- _this.message = message;
1469
- return _this;
1470
- }
1471
- return NotFoundError;
1464
+ var NotFoundError = /** @class */ (function (_super) {
1465
+ __extends(NotFoundError, _super);
1466
+ function NotFoundError(message) {
1467
+ var _this = _super.call(this, message) || this;
1468
+ _this.message = message;
1469
+ return _this;
1470
+ }
1471
+ return NotFoundError;
1472
1472
  }(Error));
1473
1473
 
1474
- var DuplicatedResultsError = /** @class */ (function (_super) {
1475
- __extends(DuplicatedResultsError, _super);
1476
- function DuplicatedResultsError(message) {
1477
- var _this = _super.call(this, message) || this;
1478
- _this.message = message;
1479
- return _this;
1480
- }
1481
- return DuplicatedResultsError;
1474
+ var DuplicatedResultsError = /** @class */ (function (_super) {
1475
+ __extends(DuplicatedResultsError, _super);
1476
+ function DuplicatedResultsError(message) {
1477
+ var _this = _super.call(this, message) || this;
1478
+ _this.message = message;
1479
+ return _this;
1480
+ }
1481
+ return DuplicatedResultsError;
1482
1482
  }(Error));
1483
1483
 
1484
- var withFirestore = function (MixinBase) {
1485
- return /** @class */ (function (_super) {
1486
- __extends(class_1, _super);
1487
- function class_1() {
1488
- var args = [];
1489
- for (var _i = 0; _i < arguments.length; _i++) {
1490
- args[_i] = arguments[_i];
1491
- }
1492
- return _super.call(this, args) || this;
1493
- }
1494
- class_1.prototype.collection = function (path) {
1495
- return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1496
- };
1497
- class_1.prototype.buildModelInstance = function () {
1498
- var _this = this;
1499
- return {
1500
- toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1501
- fromFirestore: function (snap) {
1502
- var data = snap.data();
1503
- Object.keys(data).forEach(function (key) {
1504
- if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1505
- data[key] = data[key].toDate();
1506
- }
1507
- });
1508
- return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1509
- },
1510
- };
1511
- };
1512
- return class_1;
1513
- }(MixinBase));
1484
+ var withFirestore = function (MixinBase) {
1485
+ return /** @class */ (function (_super) {
1486
+ __extends(class_1, _super);
1487
+ function class_1() {
1488
+ var args = [];
1489
+ for (var _i = 0; _i < arguments.length; _i++) {
1490
+ args[_i] = arguments[_i];
1491
+ }
1492
+ return _super.call(this, args) || this;
1493
+ }
1494
+ class_1.prototype.collection = function (path) {
1495
+ return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1496
+ };
1497
+ class_1.prototype.buildModelInstance = function () {
1498
+ var _this = this;
1499
+ return {
1500
+ toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1501
+ fromFirestore: function (snap) {
1502
+ var data = snap.data();
1503
+ Object.keys(data).forEach(function (key) {
1504
+ if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1505
+ data[key] = data[key].toDate();
1506
+ }
1507
+ });
1508
+ return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1509
+ },
1510
+ };
1511
+ };
1512
+ return class_1;
1513
+ }(MixinBase));
1514
1514
  };
1515
1515
 
1516
- var withHelpers = function (MixinBase) {
1517
- return /** @class */ (function (_super) {
1518
- __extends(class_1, _super);
1519
- function class_1() {
1520
- return _super !== null && _super.apply(this, arguments) || this;
1521
- }
1522
- class_1.prototype.toArray = function (snapShot) {
1523
- if (Array.isArray(snapShot)) {
1524
- return snapShot.map(function (doc) { return doc.data(); });
1525
- }
1526
- else {
1527
- return snapShot.docs.map(function (doc) { return doc.data(); });
1528
- }
1529
- };
1530
- class_1.prototype.isSubCollection = function (repository) {
1531
- return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1532
- };
1533
- return class_1;
1534
- }(MixinBase));
1516
+ var withHelpers = function (MixinBase) {
1517
+ return /** @class */ (function (_super) {
1518
+ __extends(class_1, _super);
1519
+ function class_1() {
1520
+ return _super !== null && _super.apply(this, arguments) || this;
1521
+ }
1522
+ class_1.prototype.toArray = function (snapShot) {
1523
+ if (Array.isArray(snapShot)) {
1524
+ return snapShot.map(function (doc) { return doc.data(); });
1525
+ }
1526
+ else {
1527
+ return snapShot.docs.map(function (doc) { return doc.data(); });
1528
+ }
1529
+ };
1530
+ class_1.prototype.isSubCollection = function (repository) {
1531
+ return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1532
+ };
1533
+ return class_1;
1534
+ }(MixinBase));
1535
1535
  };
1536
1536
 
1537
- var withGetFirestore = function (MixinBase) {
1538
- return /** @class */ (function (_super) {
1539
- __extends(GetFirestore, _super);
1540
- function GetFirestore() {
1541
- return _super !== null && _super.apply(this, arguments) || this;
1542
- }
1543
- GetFirestore.prototype.get = function (identifiers) {
1544
- return __awaiter(this, void 0, void 0, function () {
1545
- var doc, data;
1546
- return __generator(this, function (_a) {
1547
- switch (_a.label) {
1548
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1549
- .doc(Object.values(identifiers).shift().toString())
1550
- .get()];
1551
- case 1:
1552
- doc = _a.sent();
1553
- data = doc.data();
1554
- if (lodash.isNil(data))
1555
- throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1556
- return [2 /*return*/, data];
1557
- }
1558
- });
1559
- });
1560
- };
1561
- GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1562
- return this.isSubCollection(this)
1563
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1564
- : this.collectionName;
1565
- };
1566
- return GetFirestore;
1567
- }(MixinBase));
1537
+ var withGetFirestore = function (MixinBase) {
1538
+ return /** @class */ (function (_super) {
1539
+ __extends(GetFirestore, _super);
1540
+ function GetFirestore() {
1541
+ return _super !== null && _super.apply(this, arguments) || this;
1542
+ }
1543
+ GetFirestore.prototype.get = function (identifiers) {
1544
+ return __awaiter(this, void 0, void 0, function () {
1545
+ var doc, data;
1546
+ return __generator(this, function (_a) {
1547
+ switch (_a.label) {
1548
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1549
+ .doc(Object.values(identifiers).shift().toString())
1550
+ .get()];
1551
+ case 1:
1552
+ doc = _a.sent();
1553
+ data = doc.data();
1554
+ if (lodash.isNil(data))
1555
+ throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1556
+ return [2 /*return*/, data];
1557
+ }
1558
+ });
1559
+ });
1560
+ };
1561
+ GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1562
+ return this.isSubCollection(this)
1563
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1564
+ : this.collectionName;
1565
+ };
1566
+ return GetFirestore;
1567
+ }(MixinBase));
1568
1568
  };
1569
1569
 
1570
- var withFindFirestore = function (MixinBase) {
1571
- var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1572
- var getValueFromFilter = function (filter) {
1573
- return checkIfIsFilterOption(filter) ? filter.value : filter;
1574
- };
1575
- return /** @class */ (function (_super) {
1576
- __extends(FindFirestore, _super);
1577
- function FindFirestore() {
1578
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1579
- _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1580
- _this.buildWhereSentence = function (queryReference, fieldName, options) {
1581
- if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1582
- return queryReference;
1583
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1584
- if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1585
- return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
1586
- queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
1587
- queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
1588
- return queryReference;
1589
- }
1590
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1591
- return queryReference.where(fieldName.toString(), 'array-contains', options.value);
1592
- 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))
1593
- return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1594
- return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1595
- };
1596
- return _this;
1597
- }
1598
- FindFirestore.prototype.find = function (filters, limits, orderBy) {
1599
- return __awaiter(this, void 0, void 0, function () {
1600
- var query, docs, data;
1601
- var _this = this;
1602
- return __generator(this, function (_b) {
1603
- switch (_b.label) {
1604
- case 0:
1605
- query = this.collection(this.buildCollectionPathForFind(filters));
1606
- filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1607
- 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])); }); });
1608
- return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1609
- case 1:
1610
- query = _b.sent();
1611
- return [4 /*yield*/, query.get()];
1612
- case 2:
1613
- docs = _b.sent();
1614
- data = docs.docs.map(function (doc) { return doc.data(); });
1615
- return [2 /*return*/, {
1616
- data: data,
1617
- count: this.calculateCount(data, limits),
1618
- }];
1619
- }
1620
- });
1621
- });
1622
- };
1623
- FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1624
- var _a;
1625
- if (!this.isSubCollection(this))
1626
- return this.collectionName;
1627
- var parentIdField = this.parentIdField;
1628
- var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1629
- return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1630
- };
1631
- FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1632
- return __awaiter(this, void 0, void 0, function () {
1633
- var _b, _c;
1634
- return __generator(this, function (_d) {
1635
- switch (_d.label) {
1636
- case 0:
1637
- if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1638
- if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1639
- _c = (_b = query).startAfter;
1640
- return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1641
- .doc(limits.offset[limits.offset.identifierFields().shift()])
1642
- .get()];
1643
- case 1:
1644
- query = _c.apply(_b, [_d.sent()]);
1645
- return [3 /*break*/, 3];
1646
- case 2:
1647
- if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1648
- query = query.startAt(limits.offset);
1649
- _d.label = 3;
1650
- case 3:
1651
- if (limits === null || limits === void 0 ? void 0 : limits.limit)
1652
- query = query.limit(limits.limit);
1653
- return [2 /*return*/, query];
1654
- }
1655
- });
1656
- });
1657
- };
1658
- FindFirestore.prototype.calculateCount = function (data, limits) {
1659
- if (data.length <= 0)
1660
- return 0;
1661
- if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1662
- return data.length;
1663
- return Infinity;
1664
- };
1665
- return FindFirestore;
1666
- }(MixinBase));
1570
+ var withFindFirestore = function (MixinBase) {
1571
+ var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1572
+ var getValueFromFilter = function (filter) {
1573
+ return checkIfIsFilterOption(filter) ? filter.value : filter;
1574
+ };
1575
+ return /** @class */ (function (_super) {
1576
+ __extends(FindFirestore, _super);
1577
+ function FindFirestore() {
1578
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1579
+ _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1580
+ _this.buildWhereSentence = function (queryReference, fieldName, options) {
1581
+ if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1582
+ return queryReference;
1583
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1584
+ if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1585
+ return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
1586
+ queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
1587
+ queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
1588
+ return queryReference;
1589
+ }
1590
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1591
+ return queryReference.where(fieldName.toString(), 'array-contains', options.value);
1592
+ 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))
1593
+ return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1594
+ return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1595
+ };
1596
+ return _this;
1597
+ }
1598
+ FindFirestore.prototype.find = function (filters, limits, orderBy) {
1599
+ return __awaiter(this, void 0, void 0, function () {
1600
+ var query, docs, data;
1601
+ var _this = this;
1602
+ return __generator(this, function (_b) {
1603
+ switch (_b.label) {
1604
+ case 0:
1605
+ query = this.collection(this.buildCollectionPathForFind(filters));
1606
+ filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1607
+ 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])); }); });
1608
+ return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1609
+ case 1:
1610
+ query = _b.sent();
1611
+ return [4 /*yield*/, query.get()];
1612
+ case 2:
1613
+ docs = _b.sent();
1614
+ data = docs.docs.map(function (doc) { return doc.data(); });
1615
+ return [2 /*return*/, {
1616
+ data: data,
1617
+ count: this.calculateCount(data, limits),
1618
+ }];
1619
+ }
1620
+ });
1621
+ });
1622
+ };
1623
+ FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1624
+ var _a;
1625
+ if (!this.isSubCollection(this))
1626
+ return this.collectionName;
1627
+ var parentIdField = this.parentIdField;
1628
+ var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1629
+ return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1630
+ };
1631
+ FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1632
+ return __awaiter(this, void 0, void 0, function () {
1633
+ var _b, _c;
1634
+ return __generator(this, function (_d) {
1635
+ switch (_d.label) {
1636
+ case 0:
1637
+ if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1638
+ if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1639
+ _c = (_b = query).startAfter;
1640
+ return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1641
+ .doc(limits.offset[limits.offset.identifierFields().shift()])
1642
+ .get()];
1643
+ case 1:
1644
+ query = _c.apply(_b, [_d.sent()]);
1645
+ return [3 /*break*/, 3];
1646
+ case 2:
1647
+ if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1648
+ query = query.startAt(limits.offset);
1649
+ _d.label = 3;
1650
+ case 3:
1651
+ if (limits === null || limits === void 0 ? void 0 : limits.limit)
1652
+ query = query.limit(limits.limit);
1653
+ return [2 /*return*/, query];
1654
+ }
1655
+ });
1656
+ });
1657
+ };
1658
+ FindFirestore.prototype.calculateCount = function (data, limits) {
1659
+ if (data.length <= 0)
1660
+ return 0;
1661
+ if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1662
+ return data.length;
1663
+ return Infinity;
1664
+ };
1665
+ return FindFirestore;
1666
+ }(MixinBase));
1667
1667
  };
1668
1668
 
1669
- var withCreateFirestore = function (MixinBase) {
1670
- return /** @class */ (function (_super) {
1671
- __extends(CreateFirestore, _super);
1672
- function CreateFirestore() {
1673
- return _super !== null && _super.apply(this, arguments) || this;
1674
- }
1675
- CreateFirestore.prototype.create = function (data) {
1676
- return __awaiter(this, void 0, void 0, function () {
1677
- var docRef, doc;
1678
- return __generator(this, function (_b) {
1679
- switch (_b.label) {
1680
- case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1681
- case 1:
1682
- docRef = _b.sent();
1683
- return [4 /*yield*/, docRef.get()];
1684
- case 2:
1685
- doc = _b.sent();
1686
- return [2 /*return*/, doc.data()];
1687
- }
1688
- });
1689
- });
1690
- };
1691
- CreateFirestore.prototype.save = function (data) {
1692
- var _a;
1693
- return __awaiter(this, void 0, void 0, function () {
1694
- var id, collectionPath, docRef;
1695
- return __generator(this, function (_b) {
1696
- switch (_b.label) {
1697
- case 0:
1698
- id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1699
- collectionPath = this.buildCollectionPathForAdd(data);
1700
- if (lodash.isEmpty(id))
1701
- return [2 /*return*/, this.collection(collectionPath).add(data)];
1702
- docRef = this.collection(collectionPath).doc(id);
1703
- return [4 /*yield*/, docRef.set(data)];
1704
- case 1:
1705
- _b.sent();
1706
- return [2 /*return*/, docRef];
1707
- }
1708
- });
1709
- });
1710
- };
1711
- CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1712
- return this.isSubCollection(this)
1713
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1714
- : this.collectionName;
1715
- };
1716
- return CreateFirestore;
1717
- }(MixinBase));
1669
+ var withCreateFirestore = function (MixinBase) {
1670
+ return /** @class */ (function (_super) {
1671
+ __extends(CreateFirestore, _super);
1672
+ function CreateFirestore() {
1673
+ return _super !== null && _super.apply(this, arguments) || this;
1674
+ }
1675
+ CreateFirestore.prototype.create = function (data) {
1676
+ return __awaiter(this, void 0, void 0, function () {
1677
+ var docRef, doc;
1678
+ return __generator(this, function (_b) {
1679
+ switch (_b.label) {
1680
+ case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1681
+ case 1:
1682
+ docRef = _b.sent();
1683
+ return [4 /*yield*/, docRef.get()];
1684
+ case 2:
1685
+ doc = _b.sent();
1686
+ return [2 /*return*/, doc.data()];
1687
+ }
1688
+ });
1689
+ });
1690
+ };
1691
+ CreateFirestore.prototype.save = function (data) {
1692
+ var _a;
1693
+ return __awaiter(this, void 0, void 0, function () {
1694
+ var id, collectionPath, docRef;
1695
+ return __generator(this, function (_b) {
1696
+ switch (_b.label) {
1697
+ case 0:
1698
+ id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1699
+ collectionPath = this.buildCollectionPathForAdd(data);
1700
+ if (lodash.isEmpty(id))
1701
+ return [2 /*return*/, this.collection(collectionPath).add(data)];
1702
+ docRef = this.collection(collectionPath).doc(id);
1703
+ return [4 /*yield*/, docRef.set(data)];
1704
+ case 1:
1705
+ _b.sent();
1706
+ return [2 /*return*/, docRef];
1707
+ }
1708
+ });
1709
+ });
1710
+ };
1711
+ CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1712
+ return this.isSubCollection(this)
1713
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1714
+ : this.collectionName;
1715
+ };
1716
+ return CreateFirestore;
1717
+ }(MixinBase));
1718
1718
  };
1719
1719
 
1720
- var withUpdateFirestore = function (MixinBase) {
1721
- 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; };
1722
- var getValueByAction = function (options) {
1723
- var fieldValues = firebase__default["default"].firestore.FieldValue;
1724
- if (lodash.isNil(options.action))
1725
- return options;
1726
- if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1727
- return fieldValues.delete();
1728
- if (Array.isArray(options.value)) {
1729
- if (options.action === exports.UpdateOptionActions.MERGE)
1730
- return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1731
- if (options.action === exports.UpdateOptionActions.REMOVE)
1732
- return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1733
- }
1734
- return options.value;
1735
- };
1736
- return /** @class */ (function (_super) {
1737
- __extends(UpdateFirestore, _super);
1738
- function UpdateFirestore() {
1739
- return _super !== null && _super.apply(this, arguments) || this;
1740
- }
1741
- UpdateFirestore.prototype.update = function (data) {
1742
- return __awaiter(this, void 0, void 0, function () {
1743
- var model, keyField, docRef, doc;
1744
- return __generator(this, function (_b) {
1745
- switch (_b.label) {
1746
- case 0:
1747
- model = new this.model();
1748
- keyField = model.identifierFields().shift();
1749
- docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1750
- return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1751
- case 1:
1752
- _b.sent();
1753
- return [4 /*yield*/, docRef.get()];
1754
- case 2:
1755
- doc = _b.sent();
1756
- return [2 /*return*/, doc.data()];
1757
- }
1758
- });
1759
- });
1760
- };
1761
- UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1762
- return this.isSubCollection(this)
1763
- ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1764
- : this.collectionName;
1765
- };
1766
- UpdateFirestore.prototype.paramsToPlain = function (params) {
1767
- var model = this.model;
1768
- if (params instanceof model)
1769
- return params;
1770
- return Object.keys(params).reduce(function (data, currentKey) {
1771
- var _b;
1772
- return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1773
- }, {});
1774
- };
1775
- return UpdateFirestore;
1776
- }(MixinBase));
1720
+ var withUpdateFirestore = function (MixinBase) {
1721
+ 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; };
1722
+ var getValueByAction = function (options) {
1723
+ var fieldValues = firebase__default["default"].firestore.FieldValue;
1724
+ if (lodash.isNil(options.action))
1725
+ return options;
1726
+ if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1727
+ return fieldValues.delete();
1728
+ if (Array.isArray(options.value)) {
1729
+ if (options.action === exports.UpdateOptionActions.MERGE)
1730
+ return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1731
+ if (options.action === exports.UpdateOptionActions.REMOVE)
1732
+ return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1733
+ }
1734
+ return options.value;
1735
+ };
1736
+ return /** @class */ (function (_super) {
1737
+ __extends(UpdateFirestore, _super);
1738
+ function UpdateFirestore() {
1739
+ return _super !== null && _super.apply(this, arguments) || this;
1740
+ }
1741
+ UpdateFirestore.prototype.update = function (data) {
1742
+ return __awaiter(this, void 0, void 0, function () {
1743
+ var model, keyField, docRef, doc;
1744
+ return __generator(this, function (_b) {
1745
+ switch (_b.label) {
1746
+ case 0:
1747
+ model = new this.model();
1748
+ keyField = model.identifierFields().shift();
1749
+ docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1750
+ return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1751
+ case 1:
1752
+ _b.sent();
1753
+ return [4 /*yield*/, docRef.get()];
1754
+ case 2:
1755
+ doc = _b.sent();
1756
+ return [2 /*return*/, doc.data()];
1757
+ }
1758
+ });
1759
+ });
1760
+ };
1761
+ UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1762
+ return this.isSubCollection(this)
1763
+ ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1764
+ : this.collectionName;
1765
+ };
1766
+ UpdateFirestore.prototype.paramsToPlain = function (params) {
1767
+ var model = this.model;
1768
+ if (params instanceof model)
1769
+ return params;
1770
+ return Object.keys(params).reduce(function (data, currentKey) {
1771
+ var _b;
1772
+ return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1773
+ }, {});
1774
+ };
1775
+ return UpdateFirestore;
1776
+ }(MixinBase));
1777
1777
  };
1778
1778
 
1779
- var withDeleteFirestore = function (MixinBase) {
1780
- return /** @class */ (function (_super) {
1781
- __extends(DeleteFirestore, _super);
1782
- function DeleteFirestore() {
1783
- return _super !== null && _super.apply(this, arguments) || this;
1784
- }
1785
- DeleteFirestore.prototype.delete = function (identifiers) {
1786
- return __awaiter(this, void 0, void 0, function () {
1787
- return __generator(this, function (_a) {
1788
- switch (_a.label) {
1789
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1790
- .doc(Object.values(identifiers).shift().toString())
1791
- .delete()];
1792
- case 1:
1793
- _a.sent();
1794
- return [2 /*return*/];
1795
- }
1796
- });
1797
- });
1798
- };
1799
- DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1800
- return this.isSubCollection(this)
1801
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1802
- : this.collectionName;
1803
- };
1804
- return DeleteFirestore;
1805
- }(MixinBase));
1779
+ var withDeleteFirestore = function (MixinBase) {
1780
+ return /** @class */ (function (_super) {
1781
+ __extends(DeleteFirestore, _super);
1782
+ function DeleteFirestore() {
1783
+ return _super !== null && _super.apply(this, arguments) || this;
1784
+ }
1785
+ DeleteFirestore.prototype.delete = function (identifiers) {
1786
+ return __awaiter(this, void 0, void 0, function () {
1787
+ return __generator(this, function (_a) {
1788
+ switch (_a.label) {
1789
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1790
+ .doc(Object.values(identifiers).shift().toString())
1791
+ .delete()];
1792
+ case 1:
1793
+ _a.sent();
1794
+ return [2 /*return*/];
1795
+ }
1796
+ });
1797
+ });
1798
+ };
1799
+ DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1800
+ return this.isSubCollection(this)
1801
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1802
+ : this.collectionName;
1803
+ };
1804
+ return DeleteFirestore;
1805
+ }(MixinBase));
1806
1806
  };
1807
1807
 
1808
- var withSubCollection = function (MixinBase, ParentModel) {
1809
- return /** @class */ (function (_super) {
1810
- __extends(SubCollectionMix, _super);
1811
- function SubCollectionMix() {
1812
- var args = [];
1813
- for (var _i = 0; _i < arguments.length; _i++) {
1814
- args[_i] = arguments[_i];
1815
- }
1816
- return _super.call(this, args) || this;
1817
- }
1818
- SubCollectionMix.prototype.collection = function (path) {
1819
- return _super.prototype.collection.call(this, path);
1820
- };
1821
- return SubCollectionMix;
1822
- }(MixinBase));
1808
+ var withSubCollection = function (MixinBase, ParentModel) {
1809
+ return /** @class */ (function (_super) {
1810
+ __extends(SubCollectionMix, _super);
1811
+ function SubCollectionMix() {
1812
+ var args = [];
1813
+ for (var _i = 0; _i < arguments.length; _i++) {
1814
+ args[_i] = arguments[_i];
1815
+ }
1816
+ return _super.call(this, args) || this;
1817
+ }
1818
+ SubCollectionMix.prototype.collection = function (path) {
1819
+ return _super.prototype.collection.call(this, path);
1820
+ };
1821
+ return SubCollectionMix;
1822
+ }(MixinBase));
1823
1823
  };
1824
1824
 
1825
- var withCrudFirestore = function (MixinBase) {
1826
- return /** @class */ (function (_super) {
1827
- __extends(CrudFirestore, _super);
1828
- function CrudFirestore() {
1829
- return _super !== null && _super.apply(this, arguments) || this;
1830
- }
1831
- return CrudFirestore;
1832
- }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1825
+ var withCrudFirestore = function (MixinBase) {
1826
+ return /** @class */ (function (_super) {
1827
+ __extends(CrudFirestore, _super);
1828
+ function CrudFirestore() {
1829
+ return _super !== null && _super.apply(this, arguments) || this;
1830
+ }
1831
+ return CrudFirestore;
1832
+ }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1833
1833
  };
1834
1834
 
1835
- var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1836
- __extends(SubscriptionFirestoreRepository, _super);
1837
- function SubscriptionFirestoreRepository(firestore) {
1838
- var _this = _super.call(this) || this;
1839
- _this.firestore = firestore;
1840
- _this.collectionName = 'subscription';
1841
- _this.model = Subscription;
1842
- return _this;
1843
- }
1844
- return SubscriptionFirestoreRepository;
1835
+ var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1836
+ __extends(SubscriptionFirestoreRepository, _super);
1837
+ function SubscriptionFirestoreRepository(firestore) {
1838
+ var _this = _super.call(this) || this;
1839
+ _this.firestore = firestore;
1840
+ _this.collectionName = 'subscription';
1841
+ _this.model = Subscription;
1842
+ return _this;
1843
+ }
1844
+ return SubscriptionFirestoreRepository;
1845
1845
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1846
1846
 
1847
- var UserSearch = /** @class */ (function (_super) {
1848
- __extends(UserSearch, _super);
1849
- function UserSearch() {
1850
- return _super !== null && _super.apply(this, arguments) || this;
1851
- }
1852
- UserSearch.prototype.identifierFields = function () {
1853
- return ['id'];
1854
- };
1855
- return UserSearch;
1847
+ var UserSearch = /** @class */ (function (_super) {
1848
+ __extends(UserSearch, _super);
1849
+ function UserSearch() {
1850
+ return _super !== null && _super.apply(this, arguments) || this;
1851
+ }
1852
+ UserSearch.prototype.identifierFields = function () {
1853
+ return ['id'];
1854
+ };
1855
+ return UserSearch;
1856
1856
  }(BaseModel));
1857
1857
 
1858
- var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1859
- __extends(UserSearchFirestoreRepository, _super);
1860
- function UserSearchFirestoreRepository(firestore) {
1861
- var _this = _super.call(this) || this;
1862
- _this.firestore = firestore;
1863
- _this.collectionName = 'userSearch';
1864
- _this.model = UserSearch;
1865
- return _this;
1866
- }
1867
- return UserSearchFirestoreRepository;
1858
+ var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1859
+ __extends(UserSearchFirestoreRepository, _super);
1860
+ function UserSearchFirestoreRepository(firestore) {
1861
+ var _this = _super.call(this) || this;
1862
+ _this.firestore = firestore;
1863
+ _this.collectionName = 'userSearch';
1864
+ _this.model = UserSearch;
1865
+ return _this;
1866
+ }
1867
+ return UserSearchFirestoreRepository;
1868
1868
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1869
1869
 
1870
- var UserFirestoreRepository = /** @class */ (function (_super_1) {
1871
- __extends(UserFirestoreRepository, _super_1);
1872
- function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1873
- if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1874
- var _this = _super_1.call(this) || this;
1875
- _this.firestore = firestore;
1876
- _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1877
- _this.collectionName = 'users';
1878
- _this.model = User;
1879
- return _this;
1880
- }
1881
- UserFirestoreRepository.prototype.get = function (identifiers) {
1882
- var _super = Object.create(null, {
1883
- get: { get: function () { return _super_1.prototype.get; } }
1884
- });
1885
- return __awaiter(this, void 0, void 0, function () {
1886
- var user, _a, _b;
1887
- return __generator(this, function (_c) {
1888
- switch (_c.label) {
1889
- case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1890
- case 1:
1891
- user = _c.sent();
1892
- _a = user;
1893
- return [4 /*yield*/, this.getBeautyProfile(user.id)];
1894
- case 2:
1895
- _a.beautyProfile = _c.sent();
1896
- _b = user;
1897
- return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
1898
- case 3:
1899
- _b.isSubscriber = _c.sent();
1900
- return [2 /*return*/, user];
1901
- }
1902
- });
1903
- });
1904
- };
1905
- UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
1906
- return __awaiter(this, void 0, void 0, function () {
1907
- var result;
1908
- var _a;
1909
- return __generator(this, function (_b) {
1910
- switch (_b.label) {
1911
- case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
1912
- case 1:
1913
- result = _b.sent();
1914
- return [2 /*return*/, result.count > 0];
1915
- }
1916
- });
1917
- });
1918
- };
1919
- UserFirestoreRepository.prototype.buildModelInstance = function () {
1920
- var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
1921
- return {
1922
- toFirestore: function (data) {
1923
- var plain = toFirestore(data);
1924
- delete plain.isSubscriber;
1925
- return plain;
1926
- },
1927
- fromFirestore: fromFirestore,
1928
- };
1929
- };
1930
- UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
1931
- return __awaiter(this, void 0, void 0, function () {
1932
- var beautyProfile;
1933
- return __generator(this, function (_a) {
1934
- switch (_a.label) {
1935
- case 0: return [4 /*yield*/, this.collection()
1936
- .doc(userId)
1937
- .collection('CX')
1938
- .withConverter(this.buildBeautyProfileModelInstance())
1939
- .doc('beautyProfile')
1940
- .get()];
1941
- case 1:
1942
- beautyProfile = _a.sent();
1943
- return [2 /*return*/, beautyProfile.data()];
1944
- }
1945
- });
1946
- });
1947
- };
1948
- UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
1949
- return __awaiter(this, void 0, void 0, function () {
1950
- var docs;
1951
- return __generator(this, function (_a) {
1952
- switch (_a.label) {
1953
- case 0: return [4 /*yield*/, this.firestore
1954
- .collection('subscription')
1955
- .where('user.id', '==', userId)
1956
- .where('status', '==', 'active')
1957
- .get()];
1958
- case 1:
1959
- docs = _a.sent();
1960
- return [2 /*return*/, !!docs && !!docs.size];
1961
- }
1962
- });
1963
- });
1964
- };
1965
- UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
1966
- return {
1967
- toFirestore: function (data) { return data.toPlain(); },
1968
- fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
1969
- };
1970
- };
1971
- return UserFirestoreRepository;
1870
+ var UserFirestoreRepository = /** @class */ (function (_super_1) {
1871
+ __extends(UserFirestoreRepository, _super_1);
1872
+ function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1873
+ if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1874
+ var _this = _super_1.call(this) || this;
1875
+ _this.firestore = firestore;
1876
+ _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1877
+ _this.collectionName = 'users';
1878
+ _this.model = User;
1879
+ return _this;
1880
+ }
1881
+ UserFirestoreRepository.prototype.get = function (identifiers) {
1882
+ var _super = Object.create(null, {
1883
+ get: { get: function () { return _super_1.prototype.get; } }
1884
+ });
1885
+ return __awaiter(this, void 0, void 0, function () {
1886
+ var user, _a, _b;
1887
+ return __generator(this, function (_c) {
1888
+ switch (_c.label) {
1889
+ case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1890
+ case 1:
1891
+ user = _c.sent();
1892
+ _a = user;
1893
+ return [4 /*yield*/, this.getBeautyProfile(user.id)];
1894
+ case 2:
1895
+ _a.beautyProfile = _c.sent();
1896
+ _b = user;
1897
+ return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
1898
+ case 3:
1899
+ _b.isSubscriber = _c.sent();
1900
+ return [2 /*return*/, user];
1901
+ }
1902
+ });
1903
+ });
1904
+ };
1905
+ UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
1906
+ return __awaiter(this, void 0, void 0, function () {
1907
+ var result;
1908
+ var _a;
1909
+ return __generator(this, function (_b) {
1910
+ switch (_b.label) {
1911
+ case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
1912
+ case 1:
1913
+ result = _b.sent();
1914
+ return [2 /*return*/, result.count > 0];
1915
+ }
1916
+ });
1917
+ });
1918
+ };
1919
+ UserFirestoreRepository.prototype.buildModelInstance = function () {
1920
+ var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
1921
+ return {
1922
+ toFirestore: function (data) {
1923
+ var plain = toFirestore(data);
1924
+ delete plain.isSubscriber;
1925
+ return plain;
1926
+ },
1927
+ fromFirestore: fromFirestore,
1928
+ };
1929
+ };
1930
+ UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
1931
+ return __awaiter(this, void 0, void 0, function () {
1932
+ var beautyProfile;
1933
+ return __generator(this, function (_a) {
1934
+ switch (_a.label) {
1935
+ case 0: return [4 /*yield*/, this.collection()
1936
+ .doc(userId)
1937
+ .collection('CX')
1938
+ .withConverter(this.buildBeautyProfileModelInstance())
1939
+ .doc('beautyProfile')
1940
+ .get()];
1941
+ case 1:
1942
+ beautyProfile = _a.sent();
1943
+ return [2 /*return*/, beautyProfile.data()];
1944
+ }
1945
+ });
1946
+ });
1947
+ };
1948
+ UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
1949
+ return __awaiter(this, void 0, void 0, function () {
1950
+ var docs;
1951
+ return __generator(this, function (_a) {
1952
+ switch (_a.label) {
1953
+ case 0: return [4 /*yield*/, this.firestore
1954
+ .collection('subscription')
1955
+ .where('user.id', '==', userId)
1956
+ .where('status', '==', 'active')
1957
+ .get()];
1958
+ case 1:
1959
+ docs = _a.sent();
1960
+ return [2 /*return*/, !!docs && !!docs.size];
1961
+ }
1962
+ });
1963
+ });
1964
+ };
1965
+ UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
1966
+ return {
1967
+ toFirestore: function (data) { return data.toPlain(); },
1968
+ fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
1969
+ };
1970
+ };
1971
+ return UserFirestoreRepository;
1972
1972
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1973
1973
 
1974
- var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
1975
- __extends(SubscriptionEditionFirestoreRepository, _super);
1976
- function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
1977
- var _this = _super.call(this) || this;
1978
- _this.firestore = firestore;
1979
- _this.parentRepository = parentRepository;
1980
- _this.collectionName = 'editions';
1981
- _this.parentIdField = 'subscriptionId';
1982
- _this.model = Edition;
1983
- return _this;
1984
- }
1985
- return SubscriptionEditionFirestoreRepository;
1974
+ var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
1975
+ __extends(SubscriptionEditionFirestoreRepository, _super);
1976
+ function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
1977
+ var _this = _super.call(this) || this;
1978
+ _this.firestore = firestore;
1979
+ _this.parentRepository = parentRepository;
1980
+ _this.collectionName = 'editions';
1981
+ _this.parentIdField = 'subscriptionId';
1982
+ _this.model = Edition;
1983
+ return _this;
1984
+ }
1985
+ return SubscriptionEditionFirestoreRepository;
1986
1986
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
1987
1987
 
1988
- var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
1989
- __extends(UserBeautyProfileFirestoreRepository, _super);
1990
- function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
1991
- var _this = _super.call(this) || this;
1992
- _this.firestore = firestore;
1993
- _this.parentRepository = parentRepository;
1994
- _this.collectionName = 'CX';
1995
- _this.parentIdField = 'userId';
1996
- _this.model = BeautyProfile;
1997
- return _this;
1998
- }
1999
- return UserBeautyProfileFirestoreRepository;
1988
+ var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
1989
+ __extends(UserBeautyProfileFirestoreRepository, _super);
1990
+ function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
1991
+ var _this = _super.call(this) || this;
1992
+ _this.firestore = firestore;
1993
+ _this.parentRepository = parentRepository;
1994
+ _this.collectionName = 'CX';
1995
+ _this.parentIdField = 'userId';
1996
+ _this.model = BeautyProfile;
1997
+ return _this;
1998
+ }
1999
+ return UserBeautyProfileFirestoreRepository;
2000
2000
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2001
2001
 
2002
- var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2003
- __extends(UserAddressFirestoreRepository, _super);
2004
- function UserAddressFirestoreRepository(firestore, parentRepository) {
2005
- var _this = _super.call(this) || this;
2006
- _this.firestore = firestore;
2007
- _this.parentRepository = parentRepository;
2008
- _this.collectionName = 'address';
2009
- _this.parentIdField = 'userId';
2010
- _this.model = UserAddress;
2011
- return _this;
2012
- }
2013
- return UserAddressFirestoreRepository;
2002
+ var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2003
+ __extends(UserAddressFirestoreRepository, _super);
2004
+ function UserAddressFirestoreRepository(firestore, parentRepository) {
2005
+ var _this = _super.call(this) || this;
2006
+ _this.firestore = firestore;
2007
+ _this.parentRepository = parentRepository;
2008
+ _this.collectionName = 'address';
2009
+ _this.parentIdField = 'userId';
2010
+ _this.model = UserAddress;
2011
+ return _this;
2012
+ }
2013
+ return UserAddressFirestoreRepository;
2014
2014
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2015
2015
 
2016
- var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2017
- __extends(UserPaymentMethodFirestoreRepository, _super);
2018
- function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2019
- var _this = _super.call(this) || this;
2020
- _this.firestore = firestore;
2021
- _this.parentRepository = parentRepository;
2022
- _this.collectionName = 'payment_method';
2023
- _this.parentIdField = 'userId';
2024
- _this.model = UserPaymentMethod;
2025
- return _this;
2026
- }
2027
- return UserPaymentMethodFirestoreRepository;
2016
+ var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2017
+ __extends(UserPaymentMethodFirestoreRepository, _super);
2018
+ function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2019
+ var _this = _super.call(this) || this;
2020
+ _this.firestore = firestore;
2021
+ _this.parentRepository = parentRepository;
2022
+ _this.collectionName = 'payment_method';
2023
+ _this.parentIdField = 'userId';
2024
+ _this.model = UserPaymentMethod;
2025
+ return _this;
2026
+ }
2027
+ return UserPaymentMethodFirestoreRepository;
2028
2028
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2029
2029
 
2030
- var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2031
- __extends(SubscriptionPaymentFirestoreRepository, _super);
2032
- function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2033
- var _this = _super.call(this) || this;
2034
- _this.firestore = firestore;
2035
- _this.parentRepository = parentRepository;
2036
- _this.collectionName = 'payments';
2037
- _this.parentIdField = 'subscriptionId';
2038
- _this.model = SubscriptionPayment;
2039
- return _this;
2040
- }
2041
- return SubscriptionPaymentFirestoreRepository;
2030
+ var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2031
+ __extends(SubscriptionPaymentFirestoreRepository, _super);
2032
+ function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2033
+ var _this = _super.call(this) || this;
2034
+ _this.firestore = firestore;
2035
+ _this.parentRepository = parentRepository;
2036
+ _this.collectionName = 'payments';
2037
+ _this.parentIdField = 'subscriptionId';
2038
+ _this.model = SubscriptionPayment;
2039
+ return _this;
2040
+ }
2041
+ return SubscriptionPaymentFirestoreRepository;
2042
2042
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2043
2043
 
2044
- var LeadFirestoreRepository = /** @class */ (function (_super) {
2045
- __extends(LeadFirestoreRepository, _super);
2046
- function LeadFirestoreRepository(firestore) {
2047
- var _this = _super.call(this) || this;
2048
- _this.firestore = firestore;
2049
- _this.collectionName = 'leads';
2050
- _this.model = Lead;
2051
- return _this;
2052
- }
2053
- return LeadFirestoreRepository;
2044
+ var LeadFirestoreRepository = /** @class */ (function (_super) {
2045
+ __extends(LeadFirestoreRepository, _super);
2046
+ function LeadFirestoreRepository(firestore) {
2047
+ var _this = _super.call(this) || this;
2048
+ _this.firestore = firestore;
2049
+ _this.collectionName = 'leads';
2050
+ _this.model = Lead;
2051
+ return _this;
2052
+ }
2053
+ return LeadFirestoreRepository;
2054
2054
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2055
2055
 
2056
- var CategoryFirestoreRepository = /** @class */ (function (_super) {
2057
- __extends(CategoryFirestoreRepository, _super);
2058
- function CategoryFirestoreRepository(firestore) {
2059
- var _this = _super.call(this) || this;
2060
- _this.firestore = firestore;
2061
- _this.collectionName = 'categories';
2062
- _this.model = Category;
2063
- return _this;
2064
- }
2065
- CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2066
- return this.collection(this.collectionName)
2067
- .where('slug', '==', slug)
2068
- .where('shop', '==', shop)
2069
- .where('published', '==', true)
2070
- .get()
2071
- .then(function (snap) {
2072
- if (snap.size > 1)
2073
- throw new DuplicatedResultsError('Query returned duplicated values');
2074
- if (snap.empty)
2075
- throw new NotFoundError("Document with slug " + slug + " not found");
2076
- return snap.docs[0].data();
2077
- })
2078
- .catch(function (error) { return error; });
2079
- };
2080
- CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2081
- if (limit === void 0) { limit = 4; }
2082
- return __awaiter(this, void 0, void 0, function () {
2083
- var categorySnap, categories, homeSections, categories_1, categories_1_1, category, products, e_1_1;
2084
- var e_1, _a;
2085
- return __generator(this, function (_b) {
2086
- switch (_b.label) {
2087
- case 0: return [4 /*yield*/, this.collection(this.collectionName)
2088
- .where('id', 'in', categoryIds)
2089
- .where('published', '==', true)
2090
- .get()];
2091
- case 1:
2092
- categorySnap = _b.sent();
2093
- if (categorySnap.empty)
2094
- throw new NotFoundError('Categories not found');
2095
- categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2096
- homeSections = [];
2097
- _b.label = 2;
2098
- case 2:
2099
- _b.trys.push([2, 7, 8, 9]);
2100
- categories_1 = __values(categories), categories_1_1 = categories_1.next();
2101
- _b.label = 3;
2102
- case 3:
2103
- if (!!categories_1_1.done) return [3 /*break*/, 6];
2104
- category = categories_1_1.value;
2105
- return [4 /*yield*/, this.mountCategory(category)];
2106
- case 4:
2107
- products = _b.sent();
2108
- homeSections.push({
2109
- category: category,
2110
- products: products.filter(function (product) { return product.stock.quantity > 0; }).splice(0, limit),
2111
- });
2112
- _b.label = 5;
2113
- case 5:
2114
- categories_1_1 = categories_1.next();
2115
- return [3 /*break*/, 3];
2116
- case 6: return [3 /*break*/, 9];
2117
- case 7:
2118
- e_1_1 = _b.sent();
2119
- e_1 = { error: e_1_1 };
2120
- return [3 /*break*/, 9];
2121
- case 8:
2122
- try {
2123
- if (categories_1_1 && !categories_1_1.done && (_a = categories_1.return)) _a.call(categories_1);
2124
- }
2125
- finally { if (e_1) throw e_1.error; }
2126
- return [7 /*endfinally*/];
2127
- case 9: return [2 /*return*/, homeSections];
2128
- }
2129
- });
2130
- });
2131
- };
2132
- CategoryFirestoreRepository.prototype.mountCategory = function (category) {
2133
- return __awaiter(this, void 0, void 0, function () {
2134
- var chunks, products, publishedField;
2135
- var _this = this;
2136
- return __generator(this, function (_a) {
2137
- switch (_a.label) {
2138
- case 0:
2139
- if (!category.products)
2140
- throw new RequiredArgumentError(['Category products is empty']);
2141
- chunks = category.products.reduce(function (resultArray, item, index) {
2142
- var chunkIndex = Math.floor(index / 10);
2143
- if (!resultArray[chunkIndex])
2144
- resultArray[chunkIndex] = [];
2145
- resultArray[chunkIndex].push(item);
2146
- return resultArray;
2147
- }, []);
2148
- products = [];
2149
- publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2150
- return [4 /*yield*/, Promise.all(chunks.map(function (productIds) { return __awaiter(_this, void 0, void 0, function () {
2151
- var productSnap;
2152
- return __generator(this, function (_a) {
2153
- switch (_a.label) {
2154
- case 0: return [4 /*yield*/, this.collection('products')
2155
- .where(publishedField, '==', true)
2156
- .where('id', 'in', productIds)
2157
- .get()];
2158
- case 1:
2159
- productSnap = _a.sent();
2160
- if (productSnap.empty)
2161
- return [2 /*return*/];
2162
- products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2163
- return [2 /*return*/];
2164
- }
2165
- });
2166
- }); }))];
2167
- case 1:
2168
- _a.sent();
2169
- return [2 /*return*/, products];
2170
- }
2171
- });
2172
- });
2173
- };
2174
- return CategoryFirestoreRepository;
2056
+ var CategoryFirestoreRepository = /** @class */ (function (_super) {
2057
+ __extends(CategoryFirestoreRepository, _super);
2058
+ function CategoryFirestoreRepository(firestore) {
2059
+ var _this = _super.call(this) || this;
2060
+ _this.firestore = firestore;
2061
+ _this.collectionName = 'categories';
2062
+ _this.model = Category;
2063
+ return _this;
2064
+ }
2065
+ CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2066
+ return this.collection(this.collectionName)
2067
+ .where('slug', '==', slug)
2068
+ .where('shop', '==', shop)
2069
+ .where('published', '==', true)
2070
+ .get()
2071
+ .then(function (snap) {
2072
+ if (snap.size > 1)
2073
+ throw new DuplicatedResultsError('Query returned duplicated values');
2074
+ if (snap.empty)
2075
+ throw new NotFoundError("Document with slug " + slug + " not found");
2076
+ return snap.docs[0].data();
2077
+ })
2078
+ .catch(function (error) { return error; });
2079
+ };
2080
+ CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2081
+ if (limit === void 0) { limit = 4; }
2082
+ return __awaiter(this, void 0, void 0, function () {
2083
+ var categorySnap, categories, homeSections, categories_1, categories_1_1, category, products, e_1_1;
2084
+ var e_1, _a;
2085
+ return __generator(this, function (_b) {
2086
+ switch (_b.label) {
2087
+ case 0: return [4 /*yield*/, this.collection(this.collectionName)
2088
+ .where('id', 'in', categoryIds)
2089
+ .where('published', '==', true)
2090
+ .get()];
2091
+ case 1:
2092
+ categorySnap = _b.sent();
2093
+ if (categorySnap.empty)
2094
+ throw new NotFoundError('Categories not found');
2095
+ categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2096
+ homeSections = [];
2097
+ _b.label = 2;
2098
+ case 2:
2099
+ _b.trys.push([2, 7, 8, 9]);
2100
+ categories_1 = __values(categories), categories_1_1 = categories_1.next();
2101
+ _b.label = 3;
2102
+ case 3:
2103
+ if (!!categories_1_1.done) return [3 /*break*/, 6];
2104
+ category = categories_1_1.value;
2105
+ return [4 /*yield*/, this.mountCategory(category)];
2106
+ case 4:
2107
+ products = _b.sent();
2108
+ homeSections.push({
2109
+ category: category,
2110
+ products: products.filter(function (product) { return product.stock.quantity > 0; }).splice(0, limit),
2111
+ });
2112
+ _b.label = 5;
2113
+ case 5:
2114
+ categories_1_1 = categories_1.next();
2115
+ return [3 /*break*/, 3];
2116
+ case 6: return [3 /*break*/, 9];
2117
+ case 7:
2118
+ e_1_1 = _b.sent();
2119
+ e_1 = { error: e_1_1 };
2120
+ return [3 /*break*/, 9];
2121
+ case 8:
2122
+ try {
2123
+ if (categories_1_1 && !categories_1_1.done && (_a = categories_1.return)) _a.call(categories_1);
2124
+ }
2125
+ finally { if (e_1) throw e_1.error; }
2126
+ return [7 /*endfinally*/];
2127
+ case 9: return [2 /*return*/, homeSections];
2128
+ }
2129
+ });
2130
+ });
2131
+ };
2132
+ CategoryFirestoreRepository.prototype.mountCategory = function (category) {
2133
+ return __awaiter(this, void 0, void 0, function () {
2134
+ var chunks, products, publishedField;
2135
+ var _this = this;
2136
+ return __generator(this, function (_a) {
2137
+ switch (_a.label) {
2138
+ case 0:
2139
+ if (!category.products)
2140
+ throw new RequiredArgumentError(['Category products is empty']);
2141
+ chunks = category.products.reduce(function (resultArray, item, index) {
2142
+ var chunkIndex = Math.floor(index / 10);
2143
+ if (!resultArray[chunkIndex])
2144
+ resultArray[chunkIndex] = [];
2145
+ resultArray[chunkIndex].push(item);
2146
+ return resultArray;
2147
+ }, []);
2148
+ products = [];
2149
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2150
+ return [4 /*yield*/, Promise.all(chunks.map(function (productIds) { return __awaiter(_this, void 0, void 0, function () {
2151
+ var productSnap;
2152
+ return __generator(this, function (_a) {
2153
+ switch (_a.label) {
2154
+ case 0: return [4 /*yield*/, this.collection('products')
2155
+ .where(publishedField, '==', true)
2156
+ .where('id', 'in', productIds)
2157
+ .get()];
2158
+ case 1:
2159
+ productSnap = _a.sent();
2160
+ if (productSnap.empty)
2161
+ return [2 /*return*/];
2162
+ products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2163
+ return [2 /*return*/];
2164
+ }
2165
+ });
2166
+ }); }))];
2167
+ case 1:
2168
+ _a.sent();
2169
+ return [2 /*return*/, products];
2170
+ }
2171
+ });
2172
+ });
2173
+ };
2174
+ return CategoryFirestoreRepository;
2175
2175
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2176
2176
 
2177
- var ProductFirestoreRepository = /** @class */ (function (_super) {
2178
- __extends(ProductFirestoreRepository, _super);
2179
- function ProductFirestoreRepository(firestore) {
2180
- var _this = _super.call(this) || this;
2181
- _this.firestore = firestore;
2182
- _this.collectionName = 'products';
2183
- _this.model = Product;
2184
- return _this;
2185
- }
2186
- ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2187
- var _a;
2188
- return __awaiter(this, void 0, void 0, function () {
2189
- var result;
2190
- return __generator(this, function (_b) {
2191
- switch (_b.label) {
2192
- case 0: return [4 /*yield*/, this.find([
2193
- { slug: { operator: exports.Where.EQUALS, value: slug } },
2194
- { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2195
- ])];
2196
- case 1:
2197
- result = _b.sent();
2198
- return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2199
- }
2200
- });
2201
- });
2202
- };
2203
- return ProductFirestoreRepository;
2177
+ var ProductFirestoreRepository = /** @class */ (function (_super) {
2178
+ __extends(ProductFirestoreRepository, _super);
2179
+ function ProductFirestoreRepository(firestore) {
2180
+ var _this = _super.call(this) || this;
2181
+ _this.firestore = firestore;
2182
+ _this.collectionName = 'products';
2183
+ _this.model = Product;
2184
+ return _this;
2185
+ }
2186
+ ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2187
+ var _a;
2188
+ return __awaiter(this, void 0, void 0, function () {
2189
+ var result;
2190
+ return __generator(this, function (_b) {
2191
+ switch (_b.label) {
2192
+ case 0: return [4 /*yield*/, this.find([
2193
+ { slug: { operator: exports.Where.EQUALS, value: slug } },
2194
+ { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2195
+ ])];
2196
+ case 1:
2197
+ result = _b.sent();
2198
+ return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2199
+ }
2200
+ });
2201
+ });
2202
+ };
2203
+ return ProductFirestoreRepository;
2204
2204
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2205
2205
 
2206
- var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2207
- __extends(ProductVariantFirestoreRepository, _super);
2208
- function ProductVariantFirestoreRepository(firestore, parentRepository) {
2209
- var _this = _super.call(this) || this;
2210
- _this.firestore = firestore;
2211
- _this.parentRepository = parentRepository;
2212
- _this.collectionName = 'variants';
2213
- _this.parentIdField = 'productId';
2214
- _this.model = Variant;
2215
- return _this;
2216
- }
2217
- return ProductVariantFirestoreRepository;
2206
+ var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2207
+ __extends(ProductVariantFirestoreRepository, _super);
2208
+ function ProductVariantFirestoreRepository(firestore, parentRepository) {
2209
+ var _this = _super.call(this) || this;
2210
+ _this.firestore = firestore;
2211
+ _this.parentRepository = parentRepository;
2212
+ _this.collectionName = 'variants';
2213
+ _this.parentIdField = 'productId';
2214
+ _this.model = Variant;
2215
+ return _this;
2216
+ }
2217
+ return ProductVariantFirestoreRepository;
2218
2218
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
2219
2219
 
2220
- var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2221
- __extends(SubscriptionProductFirestoreRepository, _super);
2222
- function SubscriptionProductFirestoreRepository(firestore) {
2223
- var _this = _super.call(this) || this;
2224
- _this.firestore = firestore;
2225
- _this.collectionName = 'subscriptionProducts';
2226
- _this.model = Product;
2227
- return _this;
2228
- }
2229
- return SubscriptionProductFirestoreRepository;
2220
+ var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2221
+ __extends(SubscriptionProductFirestoreRepository, _super);
2222
+ function SubscriptionProductFirestoreRepository(firestore) {
2223
+ var _this = _super.call(this) || this;
2224
+ _this.firestore = firestore;
2225
+ _this.collectionName = 'subscriptionProducts';
2226
+ _this.model = Product;
2227
+ return _this;
2228
+ }
2229
+ return SubscriptionProductFirestoreRepository;
2230
2230
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2231
2231
 
2232
- var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2233
- __extends(CheckoutFirestoreRepository, _super);
2234
- function CheckoutFirestoreRepository(firestore) {
2235
- var _this = _super.call(this) || this;
2236
- _this.firestore = firestore;
2237
- _this.collectionName = 'checkouts';
2238
- _this.model = Checkout;
2239
- return _this;
2240
- }
2241
- return CheckoutFirestoreRepository;
2232
+ var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2233
+ __extends(CheckoutFirestoreRepository, _super);
2234
+ function CheckoutFirestoreRepository(firestore) {
2235
+ var _this = _super.call(this) || this;
2236
+ _this.firestore = firestore;
2237
+ _this.collectionName = 'checkouts';
2238
+ _this.model = Checkout;
2239
+ return _this;
2240
+ }
2241
+ return CheckoutFirestoreRepository;
2242
2242
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2243
2243
 
2244
- var CouponFirestoreRepository = /** @class */ (function (_super) {
2245
- __extends(CouponFirestoreRepository, _super);
2246
- function CouponFirestoreRepository(firestore) {
2247
- var _this = _super.call(this) || this;
2248
- _this.firestore = firestore;
2249
- _this.collectionName = 'coupons';
2250
- _this.model = Coupon;
2251
- return _this;
2252
- }
2253
- CouponFirestoreRepository.prototype.buildModelInstance = function () {
2254
- var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2255
- return {
2256
- toFirestore: function (data) {
2257
- var plain = toFirestore(data);
2258
- if (!!data.expiresIn)
2259
- plain.expiresIn = data.expiresIn.getTime();
2260
- return plain;
2261
- },
2262
- fromFirestore: function (snap) {
2263
- var instance = fromFirestore(snap);
2264
- if (!lodash.isNil(instance.expiresIn))
2265
- instance.expiresIn = new Date(snap.data().expiresIn);
2266
- return instance;
2267
- },
2268
- };
2269
- };
2270
- return CouponFirestoreRepository;
2244
+ var CouponFirestoreRepository = /** @class */ (function (_super) {
2245
+ __extends(CouponFirestoreRepository, _super);
2246
+ function CouponFirestoreRepository(firestore) {
2247
+ var _this = _super.call(this) || this;
2248
+ _this.firestore = firestore;
2249
+ _this.collectionName = 'coupons';
2250
+ _this.model = Coupon;
2251
+ return _this;
2252
+ }
2253
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
2254
+ var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2255
+ return {
2256
+ toFirestore: function (data) {
2257
+ var plain = toFirestore(data);
2258
+ if (!!data.expiresIn)
2259
+ plain.expiresIn = data.expiresIn.getTime();
2260
+ return plain;
2261
+ },
2262
+ fromFirestore: function (snap) {
2263
+ var instance = fromFirestore(snap);
2264
+ if (!lodash.isNil(instance.expiresIn))
2265
+ instance.expiresIn = new Date(snap.data().expiresIn);
2266
+ return instance;
2267
+ },
2268
+ };
2269
+ };
2270
+ return CouponFirestoreRepository;
2271
2271
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2272
2272
 
2273
- var OrderFirestoreRepository = /** @class */ (function (_super) {
2274
- __extends(OrderFirestoreRepository, _super);
2275
- function OrderFirestoreRepository(firestore) {
2276
- var _this = _super.call(this) || this;
2277
- _this.firestore = firestore;
2278
- _this.collectionName = 'orders';
2279
- _this.model = Order;
2280
- return _this;
2281
- }
2282
- return OrderFirestoreRepository;
2273
+ var OrderFirestoreRepository = /** @class */ (function (_super) {
2274
+ __extends(OrderFirestoreRepository, _super);
2275
+ function OrderFirestoreRepository(firestore) {
2276
+ var _this = _super.call(this) || this;
2277
+ _this.firestore = firestore;
2278
+ _this.collectionName = 'orders';
2279
+ _this.model = Order;
2280
+ return _this;
2281
+ }
2282
+ return OrderFirestoreRepository;
2283
2283
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2284
2284
 
2285
- var PaymentFirestoreRepository = /** @class */ (function (_super) {
2286
- __extends(PaymentFirestoreRepository, _super);
2287
- function PaymentFirestoreRepository(firestore) {
2288
- var _this = _super.call(this) || this;
2289
- _this.firestore = firestore;
2290
- _this.collectionName = 'payments';
2291
- _this.model = Payment;
2292
- return _this;
2293
- }
2294
- return PaymentFirestoreRepository;
2285
+ var PaymentFirestoreRepository = /** @class */ (function (_super) {
2286
+ __extends(PaymentFirestoreRepository, _super);
2287
+ function PaymentFirestoreRepository(firestore) {
2288
+ var _this = _super.call(this) || this;
2289
+ _this.firestore = firestore;
2290
+ _this.collectionName = 'payments';
2291
+ _this.model = Payment;
2292
+ return _this;
2293
+ }
2294
+ return PaymentFirestoreRepository;
2295
2295
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2296
2296
 
2297
- var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2298
- __extends(CheckoutSubscriptionFirestoreRepository, _super);
2299
- function CheckoutSubscriptionFirestoreRepository(firestore) {
2300
- var _this = _super.call(this) || this;
2301
- _this.firestore = firestore;
2302
- _this.collectionName = 'checkoutsSubscription';
2303
- _this.model = CheckoutSubscription;
2304
- return _this;
2305
- }
2306
- return CheckoutSubscriptionFirestoreRepository;
2297
+ var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2298
+ __extends(CheckoutSubscriptionFirestoreRepository, _super);
2299
+ function CheckoutSubscriptionFirestoreRepository(firestore) {
2300
+ var _this = _super.call(this) || this;
2301
+ _this.firestore = firestore;
2302
+ _this.collectionName = 'checkoutsSubscription';
2303
+ _this.model = CheckoutSubscription;
2304
+ return _this;
2305
+ }
2306
+ return CheckoutSubscriptionFirestoreRepository;
2307
2307
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2308
2308
 
2309
- var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2310
- __extends(SubscriptionPlanFirestoreRepository, _super);
2311
- function SubscriptionPlanFirestoreRepository(firestore) {
2312
- var _this = _super.call(this) || this;
2313
- _this.firestore = firestore;
2314
- _this.collectionName = 'subscriptionPlans';
2315
- _this.model = SubscriptionPlan;
2316
- return _this;
2317
- }
2318
- return SubscriptionPlanFirestoreRepository;
2309
+ var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2310
+ __extends(SubscriptionPlanFirestoreRepository, _super);
2311
+ function SubscriptionPlanFirestoreRepository(firestore) {
2312
+ var _this = _super.call(this) || this;
2313
+ _this.firestore = firestore;
2314
+ _this.collectionName = 'subscriptionPlans';
2315
+ _this.model = SubscriptionPlan;
2316
+ return _this;
2317
+ }
2318
+ return SubscriptionPlanFirestoreRepository;
2319
2319
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2320
2320
 
2321
- var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2322
- __extends(Buy2WinFirestoreRepository, _super);
2323
- function Buy2WinFirestoreRepository(firestore) {
2324
- var _this = _super.call(this) || this;
2325
- _this.firestore = firestore;
2326
- _this.collectionName = 'buy2win';
2327
- _this.model = Buy2Win;
2328
- return _this;
2329
- }
2330
- return Buy2WinFirestoreRepository;
2321
+ var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2322
+ __extends(Buy2WinFirestoreRepository, _super);
2323
+ function Buy2WinFirestoreRepository(firestore) {
2324
+ var _this = _super.call(this) || this;
2325
+ _this.firestore = firestore;
2326
+ _this.collectionName = 'buy2win';
2327
+ _this.model = Buy2Win;
2328
+ return _this;
2329
+ }
2330
+ return Buy2WinFirestoreRepository;
2331
2331
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2332
2332
 
2333
- var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2334
- __extends(LegacyOrderFirestoreRepository, _super);
2335
- function LegacyOrderFirestoreRepository(firestore) {
2336
- var _this = _super.call(this, firestore) || this;
2337
- _this.firestore = firestore;
2338
- _this.collectionName = 'legacyOrders';
2339
- return _this;
2340
- }
2341
- return LegacyOrderFirestoreRepository;
2333
+ var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2334
+ __extends(LegacyOrderFirestoreRepository, _super);
2335
+ function LegacyOrderFirestoreRepository(firestore) {
2336
+ var _this = _super.call(this, firestore) || this;
2337
+ _this.firestore = firestore;
2338
+ _this.collectionName = 'legacyOrders';
2339
+ return _this;
2340
+ }
2341
+ return LegacyOrderFirestoreRepository;
2342
2342
  }(OrderFirestoreRepository));
2343
2343
 
2344
- var HomeFirestoreRepository = /** @class */ (function (_super) {
2345
- __extends(HomeFirestoreRepository, _super);
2346
- function HomeFirestoreRepository(firestore) {
2347
- var _this = _super.call(this) || this;
2348
- _this.firestore = firestore;
2349
- _this.collectionName = 'dms';
2350
- _this.model = Home;
2351
- return _this;
2352
- }
2353
- return HomeFirestoreRepository;
2344
+ var HomeFirestoreRepository = /** @class */ (function (_super) {
2345
+ __extends(HomeFirestoreRepository, _super);
2346
+ function HomeFirestoreRepository(firestore) {
2347
+ var _this = _super.call(this) || this;
2348
+ _this.firestore = firestore;
2349
+ _this.collectionName = 'dms';
2350
+ _this.model = Home;
2351
+ return _this;
2352
+ }
2353
+ return HomeFirestoreRepository;
2354
2354
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2355
2355
 
2356
- var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2357
- __extends(ShopMenuFirestoreRepository, _super);
2358
- function ShopMenuFirestoreRepository(firestore) {
2359
- var _this = _super.call(this) || this;
2360
- _this.firestore = firestore;
2361
- _this.collectionName = 'shopMenus';
2362
- _this.model = ShopMenu;
2363
- return _this;
2364
- }
2365
- return ShopMenuFirestoreRepository;
2356
+ var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2357
+ __extends(ShopMenuFirestoreRepository, _super);
2358
+ function ShopMenuFirestoreRepository(firestore) {
2359
+ var _this = _super.call(this) || this;
2360
+ _this.firestore = firestore;
2361
+ _this.collectionName = 'shopMenus';
2362
+ _this.model = ShopMenu;
2363
+ return _this;
2364
+ }
2365
+ return ShopMenuFirestoreRepository;
2366
2366
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2367
2367
 
2368
- var AuthenticationFirebaseAuthService = /** @class */ (function () {
2369
- function AuthenticationFirebaseAuthService(firebaseAuth) {
2370
- this.firebaseAuth = firebaseAuth;
2371
- }
2372
- AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2373
- return __awaiter(this, void 0, void 0, function () {
2374
- var credentials, user;
2375
- return __generator(this, function (_a) {
2376
- switch (_a.label) {
2377
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2378
- case 1:
2379
- credentials = _a.sent();
2380
- user = credentials.user;
2381
- return [2 /*return*/, {
2382
- id: user.uid,
2383
- displayName: user.displayName,
2384
- email: user.email,
2385
- phone: user.phoneNumber,
2386
- isAnonymous: false,
2387
- }];
2388
- }
2389
- });
2390
- });
2391
- };
2392
- AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2393
- return __awaiter(this, void 0, void 0, function () {
2394
- var credentials, user;
2395
- return __generator(this, function (_a) {
2396
- switch (_a.label) {
2397
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2398
- case 1:
2399
- credentials = _a.sent();
2400
- user = credentials.user;
2401
- return [2 /*return*/, {
2402
- id: user.uid,
2403
- displayName: user.displayName,
2404
- email: user.email,
2405
- phone: user.phoneNumber,
2406
- isAnonymous: false,
2407
- }];
2408
- }
2409
- });
2410
- });
2411
- };
2412
- AuthenticationFirebaseAuthService.prototype.signOut = function () {
2413
- return __awaiter(this, void 0, void 0, function () {
2414
- return __generator(this, function (_a) {
2415
- this.firebaseAuth.signOut();
2416
- return [2 /*return*/];
2417
- });
2418
- });
2419
- };
2420
- AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2421
- return __awaiter(this, void 0, void 0, function () {
2422
- var auth, user;
2423
- return __generator(this, function (_a) {
2424
- switch (_a.label) {
2425
- case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2426
- case 1:
2427
- auth = _a.sent();
2428
- user = auth.user;
2429
- user.id = auth.user.uid;
2430
- return [2 /*return*/, user];
2431
- }
2432
- });
2433
- });
2434
- };
2435
- AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2436
- return __awaiter(this, void 0, void 0, function () {
2437
- return __generator(this, function (_a) {
2438
- return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2439
- });
2440
- });
2441
- };
2442
- return AuthenticationFirebaseAuthService;
2368
+ var AuthenticationFirebaseAuthService = /** @class */ (function () {
2369
+ function AuthenticationFirebaseAuthService(firebaseAuth) {
2370
+ this.firebaseAuth = firebaseAuth;
2371
+ }
2372
+ AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2373
+ return __awaiter(this, void 0, void 0, function () {
2374
+ var credentials, user;
2375
+ return __generator(this, function (_a) {
2376
+ switch (_a.label) {
2377
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2378
+ case 1:
2379
+ credentials = _a.sent();
2380
+ user = credentials.user;
2381
+ return [2 /*return*/, {
2382
+ id: user.uid,
2383
+ displayName: user.displayName,
2384
+ email: user.email,
2385
+ phone: user.phoneNumber,
2386
+ isAnonymous: false,
2387
+ }];
2388
+ }
2389
+ });
2390
+ });
2391
+ };
2392
+ AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2393
+ return __awaiter(this, void 0, void 0, function () {
2394
+ var credentials, user;
2395
+ return __generator(this, function (_a) {
2396
+ switch (_a.label) {
2397
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2398
+ case 1:
2399
+ credentials = _a.sent();
2400
+ user = credentials.user;
2401
+ return [2 /*return*/, {
2402
+ id: user.uid,
2403
+ displayName: user.displayName,
2404
+ email: user.email,
2405
+ phone: user.phoneNumber,
2406
+ isAnonymous: false,
2407
+ }];
2408
+ }
2409
+ });
2410
+ });
2411
+ };
2412
+ AuthenticationFirebaseAuthService.prototype.signOut = function () {
2413
+ return __awaiter(this, void 0, void 0, function () {
2414
+ return __generator(this, function (_a) {
2415
+ this.firebaseAuth.signOut();
2416
+ return [2 /*return*/];
2417
+ });
2418
+ });
2419
+ };
2420
+ AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2421
+ return __awaiter(this, void 0, void 0, function () {
2422
+ var auth, user;
2423
+ return __generator(this, function (_a) {
2424
+ switch (_a.label) {
2425
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2426
+ case 1:
2427
+ auth = _a.sent();
2428
+ user = auth.user;
2429
+ user.id = auth.user.uid;
2430
+ return [2 /*return*/, user];
2431
+ }
2432
+ });
2433
+ });
2434
+ };
2435
+ AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2436
+ return __awaiter(this, void 0, void 0, function () {
2437
+ return __generator(this, function (_a) {
2438
+ return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2439
+ });
2440
+ });
2441
+ };
2442
+ return AuthenticationFirebaseAuthService;
2443
2443
  }());
2444
2444
 
2445
- var RegisterFirebaseAuthService = /** @class */ (function () {
2446
- function RegisterFirebaseAuthService(firebaseAuth) {
2447
- this.firebaseAuth = firebaseAuth;
2448
- }
2449
- RegisterFirebaseAuthService.prototype.register = function (params) {
2450
- return __awaiter(this, void 0, void 0, function () {
2451
- var auth, user, error_1;
2452
- return __generator(this, function (_a) {
2453
- switch (_a.label) {
2454
- case 0:
2455
- _a.trys.push([0, 2, , 3]);
2456
- return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2457
- case 1:
2458
- auth = _a.sent();
2459
- user = auth.user;
2460
- user.sendEmailVerification();
2461
- user.id = auth.user.uid;
2462
- return [2 /*return*/, user];
2463
- case 2:
2464
- error_1 = _a.sent();
2465
- if (error_1.code === 'auth/email-already-in-use')
2466
- throw new UserAlreadyRegisteredError('Email already registered');
2467
- if (error_1.code === 'auth/weak-password')
2468
- throw new WeakPasswordError();
2469
- throw error_1;
2470
- case 3: return [2 /*return*/];
2471
- }
2472
- });
2473
- });
2474
- };
2475
- return RegisterFirebaseAuthService;
2445
+ var RegisterFirebaseAuthService = /** @class */ (function () {
2446
+ function RegisterFirebaseAuthService(firebaseAuth) {
2447
+ this.firebaseAuth = firebaseAuth;
2448
+ }
2449
+ RegisterFirebaseAuthService.prototype.register = function (params) {
2450
+ return __awaiter(this, void 0, void 0, function () {
2451
+ var auth, user, error_1;
2452
+ return __generator(this, function (_a) {
2453
+ switch (_a.label) {
2454
+ case 0:
2455
+ _a.trys.push([0, 2, , 3]);
2456
+ return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2457
+ case 1:
2458
+ auth = _a.sent();
2459
+ user = auth.user;
2460
+ user.sendEmailVerification();
2461
+ user.id = auth.user.uid;
2462
+ return [2 /*return*/, user];
2463
+ case 2:
2464
+ error_1 = _a.sent();
2465
+ if (error_1.code === 'auth/email-already-in-use')
2466
+ throw new UserAlreadyRegisteredError('Email already registered');
2467
+ if (error_1.code === 'auth/weak-password')
2468
+ throw new WeakPasswordError();
2469
+ throw error_1;
2470
+ case 3: return [2 /*return*/];
2471
+ }
2472
+ });
2473
+ });
2474
+ };
2475
+ return RegisterFirebaseAuthService;
2476
2476
  }());
2477
2477
 
2478
- /**
2479
- * Generated bundle index. Do not edit.
2478
+ /**
2479
+ * Generated bundle index. Do not edit.
2480
2480
  */
2481
2481
 
2482
2482
  Object.defineProperty(exports, 'chunk', {