@infrab4a/connect 0.17.0-beta.4 → 0.17.0-beta.6
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.
- package/README.md +24 -24
- package/bundles/infrab4a-connect.umd.js +2390 -2390
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/index.d.ts +2 -2
- package/domain/catalog/models/category.d.ts +22 -22
- package/domain/catalog/models/enums/index.d.ts +1 -1
- package/domain/catalog/models/enums/shops.enum.d.ts +6 -6
- package/domain/catalog/models/index.d.ts +5 -5
- package/domain/catalog/models/product.d.ts +35 -35
- package/domain/catalog/models/types/category-condition.type.d.ts +4 -4
- package/domain/catalog/models/types/category-filter.type.d.ts +4 -4
- package/domain/catalog/models/types/index.d.ts +7 -7
- package/domain/catalog/models/types/product-review.type.d.ts +15 -15
- package/domain/catalog/models/types/shops-description.type.d.ts +7 -7
- package/domain/catalog/models/types/shops-price.type.d.ts +10 -10
- package/domain/catalog/models/types/stock.type.d.ts +3 -3
- package/domain/catalog/models/types/variant-grade.type.d.ts +4 -4
- package/domain/catalog/models/variant.d.ts +14 -14
- package/domain/catalog/repositories/category.repository.d.ts +15 -15
- package/domain/catalog/repositories/index.d.ts +4 -4
- package/domain/catalog/repositories/product.repository.d.ts +5 -5
- package/domain/catalog/repositories/subscription-product.repository.d.ts +4 -4
- package/domain/catalog/repositories/variant.repository.d.ts +4 -4
- package/domain/general/index.d.ts +2 -2
- package/domain/general/model/base-model-with-identifier-fields.d.ts +3 -3
- package/domain/general/model/base.model.d.ts +6 -6
- package/domain/general/model/identifier-fields.d.ts +4 -4
- package/domain/general/model/index.d.ts +4 -4
- package/domain/general/model/types/base-model-builder.type.d.ts +5 -5
- package/domain/general/model/types/index.d.ts +3 -3
- package/domain/general/model/types/non-function-properties.type.d.ts +2 -2
- package/domain/general/model/types/non-function-property-name.type.d.ts +3 -3
- package/domain/general/repository/create.repository.d.ts +5 -5
- package/domain/general/repository/crud.repository.d.ts +7 -7
- package/domain/general/repository/delete.repository.d.ts +5 -5
- package/domain/general/repository/enums/index.d.ts +2 -2
- package/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -7
- package/domain/general/repository/enums/where.enum.d.ts +10 -10
- package/domain/general/repository/find.repository.d.ts +5 -5
- package/domain/general/repository/get.repository.d.ts +5 -5
- package/domain/general/repository/index.d.ts +9 -9
- package/domain/general/repository/read.repository.d.ts +5 -5
- package/domain/general/repository/types/index.d.ts +5 -5
- package/domain/general/repository/types/repository-find-filters.type.d.ts +14 -14
- package/domain/general/repository/types/repository-find-result.type.d.ts +4 -4
- package/domain/general/repository/types/repository-limit-options.type.d.ts +4 -4
- package/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -5
- package/domain/general/repository/types/repository-update-params.type.d.ts +11 -11
- package/domain/general/repository/update.repository.d.ts +5 -5
- package/domain/index.d.ts +6 -6
- package/domain/location/index.d.ts +1 -1
- package/domain/location/models/address.d.ts +21 -21
- package/domain/location/models/index.d.ts +2 -2
- package/domain/location/models/types/index.d.ts +3 -3
- package/domain/location/models/types/location-bound.type.d.ts +6 -6
- package/domain/location/models/types/location-geometry.type.d.ts +7 -7
- package/domain/location/models/types/location-lat-lng.type.d.ts +4 -4
- package/domain/shop-settings/enums/filter-type.enum.d.ts +19 -19
- package/domain/shop-settings/enums/index.d.ts +2 -2
- package/domain/shop-settings/enums/questions-filters.enum.d.ts +19 -19
- package/domain/shop-settings/helpers/beauty-questions.helper.d.ts +9 -9
- package/domain/shop-settings/helpers/index.d.ts +1 -1
- package/domain/shop-settings/index.d.ts +4 -4
- package/domain/shop-settings/models/home.d.ts +17 -17
- package/domain/shop-settings/models/index.d.ts +3 -3
- package/domain/shop-settings/models/shop-menu.d.ts +7 -7
- package/domain/shop-settings/models/types/banner.type.d.ts +6 -6
- package/domain/shop-settings/models/types/benefit.type.d.ts +5 -5
- package/domain/shop-settings/models/types/home-data.type.d.ts +15 -15
- package/domain/shop-settings/models/types/index.d.ts +5 -5
- package/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -8
- package/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -8
- package/domain/shop-settings/repositories/home.repository.d.ts +4 -4
- package/domain/shop-settings/repositories/index.d.ts +2 -2
- package/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -4
- package/domain/shopping/index.d.ts +2 -2
- package/domain/shopping/models/buy-2-win.d.ts +18 -18
- package/domain/shopping/models/checkout.d.ts +29 -29
- package/domain/shopping/models/coupons/coupon.d.ts +32 -30
- package/domain/shopping/models/coupons/enums/coupon-club-mens.enum.d.ts +5 -0
- package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
- package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +4 -4
- package/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -5
- package/domain/shopping/models/coupons/enums/index.d.ts +3 -3
- package/domain/shopping/models/coupons/index.d.ts +2 -2
- package/domain/shopping/models/enums/checkout-types.enum.d.ts +5 -5
- package/domain/shopping/models/enums/index.d.ts +2 -2
- package/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
- package/domain/shopping/models/index.d.ts +11 -11
- package/domain/shopping/models/line-item.d.ts +8 -8
- package/domain/shopping/models/order.d.ts +9 -9
- package/domain/shopping/models/payment.d.ts +69 -69
- package/domain/shopping/models/shipping-method.d.ts +18 -18
- package/domain/shopping/models/subscription/checkout.d.ts +23 -23
- package/domain/shopping/models/subscription/index.d.ts +2 -2
- package/domain/shopping/models/subscription/plan.d.ts +12 -12
- package/domain/shopping/models/types/index.d.ts +7 -7
- package/domain/shopping/models/types/payment-address.type.d.ts +12 -12
- package/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
- package/domain/shopping/models/types/payment-card.type.d.ts +14 -14
- package/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
- package/domain/shopping/models/types/payment-document.type.d.ts +6 -6
- package/domain/shopping/models/types/payment-item.type.d.ts +11 -11
- package/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
- package/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
- package/domain/shopping/repositories/checkout.repository.d.ts +4 -4
- package/domain/shopping/repositories/coupon.repository.d.ts +4 -4
- package/domain/shopping/repositories/index.d.ts +7 -7
- package/domain/shopping/repositories/legacy-order.repository.d.ts +3 -3
- package/domain/shopping/repositories/order.repository.d.ts +4 -4
- package/domain/shopping/repositories/payment.repository.d.ts +4 -4
- package/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
- package/domain/shopping/repositories/subscription/index.d.ts +2 -2
- package/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
- package/domain/users/errors/index.d.ts +3 -3
- package/domain/users/errors/unauthorized.error.d.ts +4 -4
- package/domain/users/errors/user-already-registered.error.d.ts +4 -4
- package/domain/users/errors/weak-password.error.d.ts +4 -4
- package/domain/users/index.d.ts +5 -5
- package/domain/users/models/beauty-profile.d.ts +12 -12
- package/domain/users/models/enums/accessory-importances.enum.d.ts +5 -5
- package/domain/users/models/enums/area.enum.d.ts +11 -11
- package/domain/users/models/enums/beard-problems.enum.d.ts +9 -9
- package/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
- package/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -6
- package/domain/users/models/enums/body-problems.enum.d.ts +11 -11
- package/domain/users/models/enums/body-shapes.enum.d.ts +7 -7
- package/domain/users/models/enums/body-tattoos.enum.d.ts +5 -5
- package/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -7
- package/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -10
- package/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -8
- package/domain/users/models/enums/family-incomes.enum.d.ts +8 -8
- package/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -5
- package/domain/users/models/enums/hair-colors.enum.d.ts +10 -10
- package/domain/users/models/enums/hair-problems.enum.d.ts +10 -10
- package/domain/users/models/enums/hair-strands.enum.d.ts +8 -8
- package/domain/users/models/enums/hair-types.enum.d.ts +7 -7
- package/domain/users/models/enums/index.d.ts +20 -20
- package/domain/users/models/enums/office-position.enum.d.ts +6 -6
- package/domain/users/models/enums/product-spents.enum.d.ts +8 -8
- package/domain/users/models/enums/user-type.enum.d.ts +8 -8
- package/domain/users/models/index.d.ts +7 -7
- package/domain/users/models/lead.d.ts +9 -9
- package/domain/users/models/subscription/edition.d.ts +17 -17
- package/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
- package/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -4
- package/domain/users/models/subscription/enums/index.d.ts +4 -4
- package/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
- package/domain/users/models/subscription/enums/status.enum.d.ts +4 -4
- package/domain/users/models/subscription/index.d.ts +4 -4
- package/domain/users/models/subscription/payment.d.ts +14 -14
- package/domain/users/models/subscription/subscription.d.ts +30 -30
- package/domain/users/models/user-address.d.ts +7 -7
- package/domain/users/models/user-payment-method.d.ts +14 -14
- package/domain/users/models/user.d.ts +25 -25
- package/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
- package/domain/users/repositories/edition.repository.d.ts +4 -4
- package/domain/users/repositories/index.d.ts +8 -8
- package/domain/users/repositories/lead.repository.d.ts +4 -4
- package/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
- package/domain/users/repositories/subscription.repository.d.ts +4 -4
- package/domain/users/repositories/user-address.repository.d.ts +4 -4
- package/domain/users/repositories/user-payment-method.repository.d.ts +4 -4
- package/domain/users/repositories/user.repository.d.ts +6 -6
- package/domain/users/services/authentication.service.d.ts +12 -12
- package/domain/users/services/index.d.ts +3 -3
- package/domain/users/services/register.service.d.ts +7 -7
- package/domain/users/services/types/basic-user-data.type.d.ts +4 -4
- package/domain/users/services/types/index.d.ts +1 -1
- package/domain/users/use-cases/authentication.d.ts +21 -21
- package/domain/users/use-cases/index.d.ts +4 -4
- package/domain/users/use-cases/recovery-password.d.ts +6 -6
- package/domain/users/use-cases/register.d.ts +13 -13
- package/domain/users/use-cases/signout.d.ts +6 -6
- package/errors/duplicated-results.error.d.ts +4 -4
- package/errors/index.d.ts +4 -4
- package/errors/invalid-argument.error.d.ts +4 -4
- package/errors/not-found.error.d.ts +4 -4
- package/errors/required-argument.error.d.ts +5 -5
- package/esm2015/domain/catalog/index.js +3 -3
- package/esm2015/domain/catalog/models/category.js +7 -7
- package/esm2015/domain/catalog/models/enums/index.js +2 -2
- package/esm2015/domain/catalog/models/enums/shops.enum.js +8 -8
- package/esm2015/domain/catalog/models/index.js +6 -6
- package/esm2015/domain/catalog/models/product.js +11 -11
- package/esm2015/domain/catalog/models/types/category-condition.type.js +2 -2
- package/esm2015/domain/catalog/models/types/category-filter.type.js +2 -2
- package/esm2015/domain/catalog/models/types/index.js +8 -8
- package/esm2015/domain/catalog/models/types/product-review.type.js +2 -2
- package/esm2015/domain/catalog/models/types/shops-description.type.js +2 -2
- package/esm2015/domain/catalog/models/types/shops-price.type.js +2 -2
- package/esm2015/domain/catalog/models/types/stock.type.js +2 -2
- package/esm2015/domain/catalog/models/types/variant-grade.type.js +2 -2
- package/esm2015/domain/catalog/models/variant.js +7 -7
- package/esm2015/domain/catalog/repositories/category.repository.js +2 -2
- package/esm2015/domain/catalog/repositories/index.js +5 -5
- package/esm2015/domain/catalog/repositories/product.repository.js +2 -2
- package/esm2015/domain/catalog/repositories/subscription-product.repository.js +2 -2
- package/esm2015/domain/catalog/repositories/variant.repository.js +2 -2
- package/esm2015/domain/general/index.js +3 -3
- package/esm2015/domain/general/model/base-model-with-identifier-fields.js +2 -2
- package/esm2015/domain/general/model/base.model.js +13 -13
- package/esm2015/domain/general/model/identifier-fields.js +2 -2
- package/esm2015/domain/general/model/index.js +5 -5
- package/esm2015/domain/general/model/types/base-model-builder.type.js +2 -2
- package/esm2015/domain/general/model/types/index.js +4 -4
- package/esm2015/domain/general/model/types/non-function-properties.type.js +2 -2
- package/esm2015/domain/general/model/types/non-function-property-name.type.js +2 -2
- package/esm2015/domain/general/repository/create.repository.js +2 -2
- package/esm2015/domain/general/repository/crud.repository.js +2 -2
- package/esm2015/domain/general/repository/delete.repository.js +2 -2
- package/esm2015/domain/general/repository/enums/index.js +3 -3
- package/esm2015/domain/general/repository/enums/update-option-actions.enum.js +9 -9
- package/esm2015/domain/general/repository/enums/where.enum.js +12 -12
- package/esm2015/domain/general/repository/find.repository.js +2 -2
- package/esm2015/domain/general/repository/get.repository.js +2 -2
- package/esm2015/domain/general/repository/index.js +10 -10
- package/esm2015/domain/general/repository/read.repository.js +2 -2
- package/esm2015/domain/general/repository/types/index.js +6 -6
- package/esm2015/domain/general/repository/types/repository-find-filters.type.js +2 -2
- package/esm2015/domain/general/repository/types/repository-find-result.type.js +2 -2
- package/esm2015/domain/general/repository/types/repository-limit-options.type.js +2 -2
- package/esm2015/domain/general/repository/types/repository-order-by-list.type.js +2 -2
- package/esm2015/domain/general/repository/types/repository-update-params.type.js +2 -2
- package/esm2015/domain/general/repository/update.repository.js +2 -2
- package/esm2015/domain/index.js +7 -7
- package/esm2015/domain/location/index.js +2 -2
- package/esm2015/domain/location/models/address.js +4 -4
- package/esm2015/domain/location/models/index.js +3 -3
- package/esm2015/domain/location/models/types/index.js +4 -4
- package/esm2015/domain/location/models/types/location-bound.type.js +2 -2
- package/esm2015/domain/location/models/types/location-geometry.type.js +2 -2
- package/esm2015/domain/location/models/types/location-lat-lng.type.js +2 -2
- package/esm2015/domain/shop-settings/enums/filter-type.enum.js +21 -21
- package/esm2015/domain/shop-settings/enums/index.js +3 -3
- package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +21 -21
- package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +46 -46
- package/esm2015/domain/shop-settings/helpers/index.js +2 -2
- package/esm2015/domain/shop-settings/index.js +5 -5
- package/esm2015/domain/shop-settings/models/home.js +7 -7
- package/esm2015/domain/shop-settings/models/index.js +4 -4
- package/esm2015/domain/shop-settings/models/shop-menu.js +7 -7
- package/esm2015/domain/shop-settings/models/types/banner.type.js +2 -2
- package/esm2015/domain/shop-settings/models/types/benefit.type.js +2 -2
- package/esm2015/domain/shop-settings/models/types/home-data.type.js +2 -2
- package/esm2015/domain/shop-settings/models/types/index.js +6 -6
- package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +2 -2
- package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +2 -2
- package/esm2015/domain/shop-settings/repositories/home.repository.js +2 -2
- package/esm2015/domain/shop-settings/repositories/index.js +3 -3
- package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
- package/esm2015/domain/shopping/index.js +3 -3
- package/esm2015/domain/shopping/models/buy-2-win.js +14 -14
- package/esm2015/domain/shopping/models/checkout.js +38 -38
- package/esm2015/domain/shopping/models/coupons/coupon.js +38 -38
- package/esm2015/domain/shopping/models/coupons/enums/coupon-club-mens.enum.js +7 -0
- package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
- package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +10 -10
- package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -7
- package/esm2015/domain/shopping/models/coupons/enums/index.js +4 -4
- package/esm2015/domain/shopping/models/coupons/index.js +3 -3
- package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +7 -7
- package/esm2015/domain/shopping/models/enums/index.js +3 -3
- package/esm2015/domain/shopping/models/enums/order-status.enum.js +12 -12
- package/esm2015/domain/shopping/models/index.js +12 -12
- package/esm2015/domain/shopping/models/line-item.js +4 -4
- package/esm2015/domain/shopping/models/order.js +11 -11
- package/esm2015/domain/shopping/models/payment.js +169 -169
- package/esm2015/domain/shopping/models/shipping-method.js +7 -7
- package/esm2015/domain/shopping/models/subscription/checkout.js +28 -28
- package/esm2015/domain/shopping/models/subscription/index.js +3 -3
- package/esm2015/domain/shopping/models/subscription/plan.js +7 -7
- package/esm2015/domain/shopping/models/types/index.js +8 -8
- package/esm2015/domain/shopping/models/types/payment-address.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-billing.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-card.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-customer.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-document.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-item.type.js +2 -2
- package/esm2015/domain/shopping/models/types/payment-shipping.type.js +2 -2
- package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/checkout.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/coupon.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/index.js +8 -8
- package/esm2015/domain/shopping/repositories/legacy-order.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/order.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/payment.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
- package/esm2015/domain/shopping/repositories/subscription/index.js +3 -3
- package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +2 -2
- package/esm2015/domain/users/errors/index.js +4 -4
- package/esm2015/domain/users/errors/unauthorized.error.js +7 -7
- package/esm2015/domain/users/errors/user-already-registered.error.js +7 -7
- package/esm2015/domain/users/errors/weak-password.error.js +7 -7
- package/esm2015/domain/users/index.js +6 -6
- package/esm2015/domain/users/models/beauty-profile.js +12 -12
- package/esm2015/domain/users/models/enums/accessory-importances.enum.js +7 -7
- package/esm2015/domain/users/models/enums/area.enum.js +13 -13
- package/esm2015/domain/users/models/enums/beard-problems.enum.js +11 -11
- package/esm2015/domain/users/models/enums/beard-sizes.enum.js +9 -9
- package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +8 -8
- package/esm2015/domain/users/models/enums/body-problems.enum.js +13 -13
- package/esm2015/domain/users/models/enums/body-shapes.enum.js +9 -9
- package/esm2015/domain/users/models/enums/body-tattoos.enum.js +7 -7
- package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -9
- package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +12 -12
- package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +10 -10
- package/esm2015/domain/users/models/enums/family-incomes.enum.js +10 -10
- package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +7 -7
- package/esm2015/domain/users/models/enums/hair-colors.enum.js +12 -12
- package/esm2015/domain/users/models/enums/hair-problems.enum.js +12 -12
- package/esm2015/domain/users/models/enums/hair-strands.enum.js +10 -10
- package/esm2015/domain/users/models/enums/hair-types.enum.js +9 -9
- package/esm2015/domain/users/models/enums/index.js +21 -21
- package/esm2015/domain/users/models/enums/office-position.enum.js +8 -8
- package/esm2015/domain/users/models/enums/product-spents.enum.js +10 -10
- package/esm2015/domain/users/models/enums/user-type.enum.js +10 -10
- package/esm2015/domain/users/models/index.js +8 -8
- package/esm2015/domain/users/models/lead.js +7 -7
- package/esm2015/domain/users/models/subscription/edition.js +7 -7
- package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
- package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +6 -6
- package/esm2015/domain/users/models/subscription/enums/index.js +5 -5
- package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
- package/esm2015/domain/users/models/subscription/enums/status.enum.js +6 -6
- package/esm2015/domain/users/models/subscription/index.js +5 -5
- package/esm2015/domain/users/models/subscription/payment.js +14 -14
- package/esm2015/domain/users/models/subscription/subscription.js +43 -43
- package/esm2015/domain/users/models/user-address.js +7 -7
- package/esm2015/domain/users/models/user-payment-method.js +7 -7
- package/esm2015/domain/users/models/user.js +26 -26
- package/esm2015/domain/users/repositories/beauty-profile.repository.js +2 -2
- package/esm2015/domain/users/repositories/edition.repository.js +2 -2
- package/esm2015/domain/users/repositories/index.js +9 -9
- package/esm2015/domain/users/repositories/lead.repository.js +2 -2
- package/esm2015/domain/users/repositories/subscription-payment.repository.js +2 -2
- package/esm2015/domain/users/repositories/subscription.repository.js +2 -2
- package/esm2015/domain/users/repositories/user-address.repository.js +2 -2
- package/esm2015/domain/users/repositories/user-payment-method.repository.js +2 -2
- package/esm2015/domain/users/repositories/user.repository.js +2 -2
- package/esm2015/domain/users/services/authentication.service.js +2 -2
- package/esm2015/domain/users/services/index.js +4 -4
- package/esm2015/domain/users/services/register.service.js +2 -2
- package/esm2015/domain/users/services/types/basic-user-data.type.js +2 -2
- package/esm2015/domain/users/services/types/index.js +2 -2
- package/esm2015/domain/users/use-cases/authentication.js +40 -40
- package/esm2015/domain/users/use-cases/index.js +5 -5
- package/esm2015/domain/users/use-cases/recovery-password.js +12 -12
- package/esm2015/domain/users/use-cases/register.js +34 -34
- package/esm2015/domain/users/use-cases/signout.js +12 -12
- package/esm2015/errors/duplicated-results.error.js +7 -7
- package/esm2015/errors/index.js +5 -5
- package/esm2015/errors/invalid-argument.error.js +7 -7
- package/esm2015/errors/not-found.error.js +7 -7
- package/esm2015/errors/required-argument.error.js +8 -8
- package/esm2015/index.js +6 -6
- package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +22 -22
- package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +2 -2
- package/esm2015/infra/elasticsearch/adapters/index.js +3 -3
- package/esm2015/infra/elasticsearch/index.js +4 -4
- package/esm2015/infra/elasticsearch/indexes/index.js +2 -2
- package/esm2015/infra/elasticsearch/indexes/products-index.js +59 -59
- package/esm2015/infra/elasticsearch/types/elastic-search-result.js +2 -2
- package/esm2015/infra/elasticsearch/types/index.js +2 -2
- package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +52 -52
- package/esm2015/infra/firebase/auth/index.js +3 -3
- package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +26 -26
- package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -2
- package/esm2015/infra/firebase/firestore/index.js +4 -4
- package/esm2015/infra/firebase/firestore/mixins/index.js +10 -10
- package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -31
- package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
- package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +87 -87
- package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
- package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
- package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
- package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
- package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -45
- package/esm2015/infra/firebase/firestore/models/user-search.js +7 -7
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +70 -70
- package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +5 -5
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/index.js +5 -5
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +56 -56
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +29 -29
- package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +9 -9
- package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -9
- package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/users/index.js +10 -10
- package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -70
- package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -12
- package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
- package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
- package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
- package/esm2015/infra/firebase/firestore/types/index.js +4 -4
- package/esm2015/infra/firebase/index.js +3 -3
- package/esm2015/infra/index.js +3 -3
- package/esm2015/infrab4a-connect.js +4 -4
- package/esm2015/utils/index.js +6 -6
- package/esm2015/utils/mixins/base.mixin.js +6 -6
- package/esm2015/utils/mixins/index.js +3 -3
- package/esm2015/utils/mixins/mixin-ctor.type.js +2 -2
- package/esm2015/utils/types/index.js +2 -2
- package/esm2015/utils/types/prop.type.js +2 -2
- package/fesm2015/infrab4a-connect.js +1653 -1653
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/index.d.ts +5 -5
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +11 -11
- package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +4 -4
- package/infra/elasticsearch/adapters/index.d.ts +2 -2
- package/infra/elasticsearch/index.d.ts +3 -3
- package/infra/elasticsearch/indexes/index.d.ts +1 -1
- package/infra/elasticsearch/indexes/products-index.d.ts +11 -11
- package/infra/elasticsearch/types/elastic-search-result.d.ts +7 -7
- package/infra/elasticsearch/types/index.d.ts +1 -1
- package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +12 -12
- package/infra/firebase/auth/index.d.ts +2 -2
- package/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -8
- package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -3
- package/infra/firebase/firestore/index.d.ts +3 -3
- package/infra/firebase/firestore/mixins/index.d.ts +9 -9
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
- package/infra/firebase/firestore/models/user-search.d.ts +9 -9
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +58 -58
- package/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -4
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/index.d.ts +4 -4
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +57 -57
- package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -53
- package/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -8
- package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -7
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/users/index.d.ts +9 -9
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -60
- package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -50
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
- package/infra/firebase/firestore/types/index.d.ts +3 -3
- package/infra/firebase/index.d.ts +2 -2
- package/infra/index.d.ts +2 -2
- package/infrab4a-connect.d.ts +5 -5
- package/package.json +1 -1
- package/utils/index.d.ts +6 -6
- package/utils/mixins/base.mixin.d.ts +3 -3
- package/utils/mixins/index.d.ts +2 -2
- package/utils/mixins/mixin-ctor.type.d.ts +1 -1
- package/utils/types/index.d.ts +1 -1
- package/utils/types/prop.type.d.ts +1 -1
- package/index.d.ts.map +0 -1
- package/infra/firebase/auth/authentication-firebase-auth.service.d.ts.map +0 -1
- package/infra/firebase/auth/index.d.ts.map +0 -1
- package/infra/firebase/auth/register-firebase-auth.service.d.ts.map +0 -1
- package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts.map +0 -1
- package/infra/firebase/firestore/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/catalog/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shop-settings/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/index.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts.map +0 -1
- package/infra/firebase/index.d.ts.map +0 -1
- package/infra/index.d.ts.map +0 -1
- package/infrab4a-connect.d.ts.map +0 -1
|
@@ -8,1767 +8,1767 @@ import axios from 'axios';
|
|
|
8
8
|
import firebase from 'firebase';
|
|
9
9
|
import firebase$1 from 'firebase/app';
|
|
10
10
|
|
|
11
|
-
class BaseModel {
|
|
12
|
-
constructor(args) {
|
|
13
|
-
Object.assign(this, args);
|
|
14
|
-
}
|
|
15
|
-
static toInstance(data) {
|
|
16
|
-
return plainToClass(this, data);
|
|
17
|
-
}
|
|
18
|
-
toPlain() {
|
|
19
|
-
return classToPlain(this, { exposeUnsetFields: false });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var Where;
|
|
24
|
-
(function (Where) {
|
|
25
|
-
Where["EQUALS"] = "==";
|
|
26
|
-
Where["NOTEQUALS"] = "!=";
|
|
27
|
-
Where["GT"] = ">";
|
|
28
|
-
Where["GTE"] = ">=";
|
|
29
|
-
Where["IN"] = "in";
|
|
30
|
-
Where["LT"] = "<";
|
|
31
|
-
Where["LTE"] = "<=";
|
|
32
|
-
Where["LIKE"] = "like";
|
|
11
|
+
class BaseModel {
|
|
12
|
+
constructor(args) {
|
|
13
|
+
Object.assign(this, args);
|
|
14
|
+
}
|
|
15
|
+
static toInstance(data) {
|
|
16
|
+
return plainToClass(this, data);
|
|
17
|
+
}
|
|
18
|
+
toPlain() {
|
|
19
|
+
return classToPlain(this, { exposeUnsetFields: false });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var Where;
|
|
24
|
+
(function (Where) {
|
|
25
|
+
Where["EQUALS"] = "==";
|
|
26
|
+
Where["NOTEQUALS"] = "!=";
|
|
27
|
+
Where["GT"] = ">";
|
|
28
|
+
Where["GTE"] = ">=";
|
|
29
|
+
Where["IN"] = "in";
|
|
30
|
+
Where["LT"] = "<";
|
|
31
|
+
Where["LTE"] = "<=";
|
|
32
|
+
Where["LIKE"] = "like";
|
|
33
33
|
})(Where || (Where = {}));
|
|
34
34
|
|
|
35
|
-
var UpdateOptionActions;
|
|
36
|
-
(function (UpdateOptionActions) {
|
|
37
|
-
UpdateOptionActions["UPDATE"] = "update";
|
|
38
|
-
UpdateOptionActions["MERGE"] = "merge";
|
|
39
|
-
UpdateOptionActions["REMOVE"] = "remove";
|
|
40
|
-
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
41
|
-
UpdateOptionActions["NULL"] = "null";
|
|
35
|
+
var UpdateOptionActions;
|
|
36
|
+
(function (UpdateOptionActions) {
|
|
37
|
+
UpdateOptionActions["UPDATE"] = "update";
|
|
38
|
+
UpdateOptionActions["MERGE"] = "merge";
|
|
39
|
+
UpdateOptionActions["REMOVE"] = "remove";
|
|
40
|
+
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
41
|
+
UpdateOptionActions["NULL"] = "null";
|
|
42
42
|
})(UpdateOptionActions || (UpdateOptionActions = {}));
|
|
43
43
|
|
|
44
|
-
var AccessoryImportances;
|
|
45
|
-
(function (AccessoryImportances) {
|
|
46
|
-
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
47
|
-
AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
|
|
48
|
-
AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
|
|
44
|
+
var AccessoryImportances;
|
|
45
|
+
(function (AccessoryImportances) {
|
|
46
|
+
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
47
|
+
AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
|
|
48
|
+
AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
|
|
49
49
|
})(AccessoryImportances || (AccessoryImportances = {}));
|
|
50
50
|
|
|
51
|
-
var Area;
|
|
52
|
-
(function (Area) {
|
|
53
|
-
Area["GP"] = "Geral";
|
|
54
|
-
Area["CRM"] = "CRM";
|
|
55
|
-
Area["MediaProd"] = "Media Production";
|
|
56
|
-
Area["Tech"] = "Tecnologia";
|
|
57
|
-
Area["Transactional"] = "Transacional";
|
|
58
|
-
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
59
|
-
Area["Sales"] = "Comercial";
|
|
60
|
-
Area["Finantial"] = "Financeiro";
|
|
61
|
-
Area["HR"] = "RH";
|
|
51
|
+
var Area;
|
|
52
|
+
(function (Area) {
|
|
53
|
+
Area["GP"] = "Geral";
|
|
54
|
+
Area["CRM"] = "CRM";
|
|
55
|
+
Area["MediaProd"] = "Media Production";
|
|
56
|
+
Area["Tech"] = "Tecnologia";
|
|
57
|
+
Area["Transactional"] = "Transacional";
|
|
58
|
+
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
59
|
+
Area["Sales"] = "Comercial";
|
|
60
|
+
Area["Finantial"] = "Financeiro";
|
|
61
|
+
Area["HR"] = "RH";
|
|
62
62
|
})(Area || (Area = {}));
|
|
63
63
|
|
|
64
|
-
var BeardProblems;
|
|
65
|
-
(function (BeardProblems) {
|
|
66
|
-
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
67
|
-
BeardProblems["DRY"] = "Barba Seca";
|
|
68
|
-
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
69
|
-
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
70
|
-
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
71
|
-
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
72
|
-
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
64
|
+
var BeardProblems;
|
|
65
|
+
(function (BeardProblems) {
|
|
66
|
+
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
67
|
+
BeardProblems["DRY"] = "Barba Seca";
|
|
68
|
+
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
69
|
+
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
70
|
+
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
71
|
+
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
72
|
+
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
73
73
|
})(BeardProblems || (BeardProblems = {}));
|
|
74
74
|
|
|
75
|
-
var BeardSizes;
|
|
76
|
-
(function (BeardSizes) {
|
|
77
|
-
BeardSizes["BIG"] = "Grande";
|
|
78
|
-
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
79
|
-
BeardSizes["SHORT"] = "Curta";
|
|
80
|
-
BeardSizes["MUSTACHE"] = "Bigode";
|
|
81
|
-
BeardSizes["NOTHING"] = "Sem Barba";
|
|
75
|
+
var BeardSizes;
|
|
76
|
+
(function (BeardSizes) {
|
|
77
|
+
BeardSizes["BIG"] = "Grande";
|
|
78
|
+
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
79
|
+
BeardSizes["SHORT"] = "Curta";
|
|
80
|
+
BeardSizes["MUSTACHE"] = "Bigode";
|
|
81
|
+
BeardSizes["NOTHING"] = "Sem Barba";
|
|
82
82
|
})(BeardSizes || (BeardSizes = {}));
|
|
83
83
|
|
|
84
|
-
var BeautyProductImportances;
|
|
85
|
-
(function (BeautyProductImportances) {
|
|
86
|
-
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
87
|
-
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
88
|
-
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";
|
|
89
|
-
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
84
|
+
var BeautyProductImportances;
|
|
85
|
+
(function (BeautyProductImportances) {
|
|
86
|
+
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
87
|
+
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
88
|
+
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";
|
|
89
|
+
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
90
90
|
})(BeautyProductImportances || (BeautyProductImportances = {}));
|
|
91
91
|
|
|
92
|
-
var BodyProblems;
|
|
93
|
-
(function (BodyProblems) {
|
|
94
|
-
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
95
|
-
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
96
|
-
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
97
|
-
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
98
|
-
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
99
|
-
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
100
|
-
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
101
|
-
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
102
|
-
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
92
|
+
var BodyProblems;
|
|
93
|
+
(function (BodyProblems) {
|
|
94
|
+
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
95
|
+
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
96
|
+
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
97
|
+
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
98
|
+
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
99
|
+
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
100
|
+
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
101
|
+
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
102
|
+
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
103
103
|
})(BodyProblems || (BodyProblems = {}));
|
|
104
104
|
|
|
105
|
-
var BodyShapes;
|
|
106
|
-
(function (BodyShapes) {
|
|
107
|
-
BodyShapes["LEAN"] = "Magro";
|
|
108
|
-
BodyShapes["REGULAR"] = "Regular";
|
|
109
|
-
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
110
|
-
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
111
|
-
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
105
|
+
var BodyShapes;
|
|
106
|
+
(function (BodyShapes) {
|
|
107
|
+
BodyShapes["LEAN"] = "Magro";
|
|
108
|
+
BodyShapes["REGULAR"] = "Regular";
|
|
109
|
+
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
110
|
+
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
111
|
+
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
112
112
|
})(BodyShapes || (BodyShapes = {}));
|
|
113
113
|
|
|
114
|
-
var BodyTattoos;
|
|
115
|
-
(function (BodyTattoos) {
|
|
116
|
-
BodyTattoos["NONE"] = "Nenhuma";
|
|
117
|
-
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
118
|
-
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
114
|
+
var BodyTattoos;
|
|
115
|
+
(function (BodyTattoos) {
|
|
116
|
+
BodyTattoos["NONE"] = "Nenhuma";
|
|
117
|
+
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
118
|
+
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
119
119
|
})(BodyTattoos || (BodyTattoos = {}));
|
|
120
120
|
|
|
121
|
-
var FaceSkinOilinesses;
|
|
122
|
-
(function (FaceSkinOilinesses) {
|
|
123
|
-
FaceSkinOilinesses["DRY"] = "Seca";
|
|
124
|
-
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
125
|
-
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
126
|
-
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
127
|
-
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
121
|
+
var FaceSkinOilinesses;
|
|
122
|
+
(function (FaceSkinOilinesses) {
|
|
123
|
+
FaceSkinOilinesses["DRY"] = "Seca";
|
|
124
|
+
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
125
|
+
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
126
|
+
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
127
|
+
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
128
128
|
})(FaceSkinOilinesses || (FaceSkinOilinesses = {}));
|
|
129
129
|
|
|
130
|
-
var FaceSkinProblems;
|
|
131
|
-
(function (FaceSkinProblems) {
|
|
132
|
-
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
133
|
-
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
134
|
-
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
135
|
-
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
136
|
-
FaceSkinProblems["STAINS"] = "Manchas";
|
|
137
|
-
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
138
|
-
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
139
|
-
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
130
|
+
var FaceSkinProblems;
|
|
131
|
+
(function (FaceSkinProblems) {
|
|
132
|
+
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
133
|
+
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
134
|
+
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
135
|
+
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
136
|
+
FaceSkinProblems["STAINS"] = "Manchas";
|
|
137
|
+
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
138
|
+
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
139
|
+
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
140
140
|
})(FaceSkinProblems || (FaceSkinProblems = {}));
|
|
141
141
|
|
|
142
|
-
var FaceSkinTones;
|
|
143
|
-
(function (FaceSkinTones) {
|
|
144
|
-
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
145
|
-
FaceSkinTones["CLEAR"] = "Clara";
|
|
146
|
-
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
147
|
-
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
148
|
-
FaceSkinTones["DARK"] = "Escura";
|
|
149
|
-
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
142
|
+
var FaceSkinTones;
|
|
143
|
+
(function (FaceSkinTones) {
|
|
144
|
+
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
145
|
+
FaceSkinTones["CLEAR"] = "Clara";
|
|
146
|
+
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
147
|
+
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
148
|
+
FaceSkinTones["DARK"] = "Escura";
|
|
149
|
+
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
150
150
|
})(FaceSkinTones || (FaceSkinTones = {}));
|
|
151
151
|
|
|
152
|
-
var FamilyIncomes;
|
|
153
|
-
(function (FamilyIncomes) {
|
|
154
|
-
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
155
|
-
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
156
|
-
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
157
|
-
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
158
|
-
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
159
|
-
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
152
|
+
var FamilyIncomes;
|
|
153
|
+
(function (FamilyIncomes) {
|
|
154
|
+
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
155
|
+
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
156
|
+
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
157
|
+
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
158
|
+
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
159
|
+
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
160
160
|
})(FamilyIncomes || (FamilyIncomes = {}));
|
|
161
161
|
|
|
162
|
-
var FragranceImportances;
|
|
163
|
-
(function (FragranceImportances) {
|
|
164
|
-
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
165
|
-
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
166
|
-
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
162
|
+
var FragranceImportances;
|
|
163
|
+
(function (FragranceImportances) {
|
|
164
|
+
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
165
|
+
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
166
|
+
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
167
167
|
})(FragranceImportances || (FragranceImportances = {}));
|
|
168
168
|
|
|
169
|
-
var HairColors;
|
|
170
|
-
(function (HairColors) {
|
|
171
|
-
HairColors["BLACK"] = "Preto";
|
|
172
|
-
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
173
|
-
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
174
|
-
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
175
|
-
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
176
|
-
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
177
|
-
HairColors["REDHEAD"] = "Ruivo";
|
|
178
|
-
HairColors["OTHER"] = "RuiOutroo";
|
|
169
|
+
var HairColors;
|
|
170
|
+
(function (HairColors) {
|
|
171
|
+
HairColors["BLACK"] = "Preto";
|
|
172
|
+
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
173
|
+
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
174
|
+
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
175
|
+
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
176
|
+
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
177
|
+
HairColors["REDHEAD"] = "Ruivo";
|
|
178
|
+
HairColors["OTHER"] = "RuiOutroo";
|
|
179
179
|
})(HairColors || (HairColors = {}));
|
|
180
180
|
|
|
181
|
-
var HairProblems;
|
|
182
|
-
(function (HairProblems) {
|
|
183
|
-
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
184
|
-
HairProblems["DANCRUFF"] = "Caspa";
|
|
185
|
-
HairProblems["LOSS"] = "Queda";
|
|
186
|
-
HairProblems["OILY"] = "Oleosidade";
|
|
187
|
-
HairProblems["DRYNESS"] = "Ressecamento";
|
|
188
|
-
HairProblems["CHEMICAL"] = "Quimica";
|
|
189
|
-
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
190
|
-
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
181
|
+
var HairProblems;
|
|
182
|
+
(function (HairProblems) {
|
|
183
|
+
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
184
|
+
HairProblems["DANCRUFF"] = "Caspa";
|
|
185
|
+
HairProblems["LOSS"] = "Queda";
|
|
186
|
+
HairProblems["OILY"] = "Oleosidade";
|
|
187
|
+
HairProblems["DRYNESS"] = "Ressecamento";
|
|
188
|
+
HairProblems["CHEMICAL"] = "Quimica";
|
|
189
|
+
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
190
|
+
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
191
191
|
})(HairProblems || (HairProblems = {}));
|
|
192
192
|
|
|
193
|
-
var HairStrands;
|
|
194
|
-
(function (HairStrands) {
|
|
195
|
-
HairStrands["NORMAL"] = "Fio Normal";
|
|
196
|
-
HairStrands["DRY"] = "Fio Seco";
|
|
197
|
-
HairStrands["OILY"] = "Fio Oleoso";
|
|
198
|
-
HairStrands["MIXED"] = "Fio Misto";
|
|
199
|
-
HairStrands["FINE"] = "Fio Fino";
|
|
200
|
-
HairStrands["THICK"] = "Fio Grosso";
|
|
193
|
+
var HairStrands;
|
|
194
|
+
(function (HairStrands) {
|
|
195
|
+
HairStrands["NORMAL"] = "Fio Normal";
|
|
196
|
+
HairStrands["DRY"] = "Fio Seco";
|
|
197
|
+
HairStrands["OILY"] = "Fio Oleoso";
|
|
198
|
+
HairStrands["MIXED"] = "Fio Misto";
|
|
199
|
+
HairStrands["FINE"] = "Fio Fino";
|
|
200
|
+
HairStrands["THICK"] = "Fio Grosso";
|
|
201
201
|
})(HairStrands || (HairStrands = {}));
|
|
202
202
|
|
|
203
|
-
var HairTypes;
|
|
204
|
-
(function (HairTypes) {
|
|
205
|
-
HairTypes["Smooth"] = "Liso";
|
|
206
|
-
HairTypes["WAVY"] = "Ondulado";
|
|
207
|
-
HairTypes["CURLY"] = "Cacheado";
|
|
208
|
-
HairTypes["FRIZZY"] = "Crespo";
|
|
209
|
-
HairTypes["BALD"] = "Sou careca";
|
|
203
|
+
var HairTypes;
|
|
204
|
+
(function (HairTypes) {
|
|
205
|
+
HairTypes["Smooth"] = "Liso";
|
|
206
|
+
HairTypes["WAVY"] = "Ondulado";
|
|
207
|
+
HairTypes["CURLY"] = "Cacheado";
|
|
208
|
+
HairTypes["FRIZZY"] = "Crespo";
|
|
209
|
+
HairTypes["BALD"] = "Sou careca";
|
|
210
210
|
})(HairTypes || (HairTypes = {}));
|
|
211
211
|
|
|
212
|
-
var OfficePosition;
|
|
213
|
-
(function (OfficePosition) {
|
|
214
|
-
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
215
|
-
OfficePosition["Analyst"] = "Analista";
|
|
216
|
-
OfficePosition["Manager"] = "Gerente";
|
|
217
|
-
OfficePosition["Director"] = "Diretor";
|
|
212
|
+
var OfficePosition;
|
|
213
|
+
(function (OfficePosition) {
|
|
214
|
+
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
215
|
+
OfficePosition["Analyst"] = "Analista";
|
|
216
|
+
OfficePosition["Manager"] = "Gerente";
|
|
217
|
+
OfficePosition["Director"] = "Diretor";
|
|
218
218
|
})(OfficePosition || (OfficePosition = {}));
|
|
219
219
|
|
|
220
|
-
var ProductSpents;
|
|
221
|
-
(function (ProductSpents) {
|
|
222
|
-
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
223
|
-
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
224
|
-
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
225
|
-
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
226
|
-
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
227
|
-
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
220
|
+
var ProductSpents;
|
|
221
|
+
(function (ProductSpents) {
|
|
222
|
+
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
223
|
+
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
224
|
+
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
225
|
+
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
226
|
+
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
227
|
+
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
228
228
|
})(ProductSpents || (ProductSpents = {}));
|
|
229
229
|
|
|
230
|
-
var UserType;
|
|
231
|
-
(function (UserType) {
|
|
232
|
-
UserType["B2C"] = "Cliente Transacional";
|
|
233
|
-
UserType["GlamGirl"] = "Glamgirl";
|
|
234
|
-
UserType["MensBoy"] = "Mensboy";
|
|
235
|
-
UserType["B2B"] = "Company";
|
|
236
|
-
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
237
|
-
UserType["Influencer"] = "Influencer";
|
|
230
|
+
var UserType;
|
|
231
|
+
(function (UserType) {
|
|
232
|
+
UserType["B2C"] = "Cliente Transacional";
|
|
233
|
+
UserType["GlamGirl"] = "Glamgirl";
|
|
234
|
+
UserType["MensBoy"] = "Mensboy";
|
|
235
|
+
UserType["B2B"] = "Company";
|
|
236
|
+
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
237
|
+
UserType["Influencer"] = "Influencer";
|
|
238
238
|
})(UserType || (UserType = {}));
|
|
239
239
|
|
|
240
|
-
var BillingStatus;
|
|
241
|
-
(function (BillingStatus) {
|
|
242
|
-
BillingStatus["PAYED"] = "PAGO";
|
|
240
|
+
var BillingStatus;
|
|
241
|
+
(function (BillingStatus) {
|
|
242
|
+
BillingStatus["PAYED"] = "PAGO";
|
|
243
243
|
})(BillingStatus || (BillingStatus = {}));
|
|
244
244
|
|
|
245
|
-
var EditionStatus;
|
|
246
|
-
(function (EditionStatus) {
|
|
247
|
-
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
248
|
-
EditionStatus["SHIPPED"] = "Enviado";
|
|
245
|
+
var EditionStatus;
|
|
246
|
+
(function (EditionStatus) {
|
|
247
|
+
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
248
|
+
EditionStatus["SHIPPED"] = "Enviado";
|
|
249
249
|
})(EditionStatus || (EditionStatus = {}));
|
|
250
250
|
|
|
251
|
-
var PaymentType;
|
|
252
|
-
(function (PaymentType) {
|
|
253
|
-
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
254
|
-
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
255
|
-
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
251
|
+
var PaymentType;
|
|
252
|
+
(function (PaymentType) {
|
|
253
|
+
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
254
|
+
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
255
|
+
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
256
256
|
})(PaymentType || (PaymentType = {}));
|
|
257
257
|
|
|
258
|
-
var Status;
|
|
259
|
-
(function (Status) {
|
|
260
|
-
Status["ACTIVE"] = "active";
|
|
261
|
-
Status["CANCELLED"] = "Cancelado";
|
|
258
|
+
var Status;
|
|
259
|
+
(function (Status) {
|
|
260
|
+
Status["ACTIVE"] = "active";
|
|
261
|
+
Status["CANCELLED"] = "Cancelado";
|
|
262
262
|
})(Status || (Status = {}));
|
|
263
263
|
|
|
264
|
-
class Edition extends BaseModel {
|
|
265
|
-
identifierFields() {
|
|
266
|
-
return ['id'];
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
class Payment extends BaseModel {
|
|
271
|
-
identifierFields() {
|
|
272
|
-
return ['id'];
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
__decorate([
|
|
276
|
-
Expose({ name: 'refuse_reason' }),
|
|
277
|
-
__metadata("design:type", String)
|
|
278
|
-
], Payment.prototype, "refuseReason", void 0);
|
|
279
|
-
__decorate([
|
|
280
|
-
Expose({ name: 'status_reason' }),
|
|
281
|
-
__metadata("design:type", String)
|
|
282
|
-
], Payment.prototype, "statusReason", void 0);
|
|
283
|
-
__decorate([
|
|
284
|
-
Expose({ name: 'acquirer_response_code' }),
|
|
285
|
-
__metadata("design:type", String)
|
|
286
|
-
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
287
|
-
__decorate([
|
|
288
|
-
Expose({ name: 'acquirer_name' }),
|
|
289
|
-
__metadata("design:type", String)
|
|
290
|
-
], Payment.prototype, "acquirerName", void 0);
|
|
291
|
-
__decorate([
|
|
292
|
-
Expose({ name: 'acquirer_id' }),
|
|
293
|
-
__metadata("design:type", String)
|
|
294
|
-
], Payment.prototype, "acquirerId", void 0);
|
|
295
|
-
__decorate([
|
|
296
|
-
Expose({ name: 'authorization_code' }),
|
|
297
|
-
__metadata("design:type", String)
|
|
298
|
-
], Payment.prototype, "authorizationCode", void 0);
|
|
299
|
-
__decorate([
|
|
300
|
-
Expose({ name: 'soft_descriptor' }),
|
|
301
|
-
__metadata("design:type", String)
|
|
302
|
-
], Payment.prototype, "softDescriptor", void 0);
|
|
303
|
-
__decorate([
|
|
304
|
-
Expose({ name: 'date_created' }),
|
|
305
|
-
__metadata("design:type", String)
|
|
306
|
-
], Payment.prototype, "dateCreated", void 0);
|
|
307
|
-
__decorate([
|
|
308
|
-
Expose({ name: 'date_updated' }),
|
|
309
|
-
__metadata("design:type", String)
|
|
310
|
-
], Payment.prototype, "dateUpdated", void 0);
|
|
311
|
-
__decorate([
|
|
312
|
-
Expose({ name: 'authorized_amount' }),
|
|
313
|
-
__metadata("design:type", Number)
|
|
314
|
-
], Payment.prototype, "authorizedAmount", void 0);
|
|
315
|
-
__decorate([
|
|
316
|
-
Expose({ name: 'paid_amount' }),
|
|
317
|
-
__metadata("design:type", Number)
|
|
318
|
-
], Payment.prototype, "paidAmount", void 0);
|
|
319
|
-
__decorate([
|
|
320
|
-
Expose({ name: 'refunded_amount' }),
|
|
321
|
-
__metadata("design:type", Number)
|
|
322
|
-
], Payment.prototype, "refundedAmount", void 0);
|
|
323
|
-
__decorate([
|
|
324
|
-
Expose({ name: 'card_holder_name' }),
|
|
325
|
-
__metadata("design:type", String)
|
|
326
|
-
], Payment.prototype, "cardHolderName", void 0);
|
|
327
|
-
__decorate([
|
|
328
|
-
Expose({ name: 'card_last_digits' }),
|
|
329
|
-
__metadata("design:type", String)
|
|
330
|
-
], Payment.prototype, "cardLastDigits", void 0);
|
|
331
|
-
__decorate([
|
|
332
|
-
Expose({ name: 'card_first_digits' }),
|
|
333
|
-
__metadata("design:type", String)
|
|
334
|
-
], Payment.prototype, "cardFirstDigits", void 0);
|
|
335
|
-
__decorate([
|
|
336
|
-
Expose({ name: 'card_brand' }),
|
|
337
|
-
__metadata("design:type", String)
|
|
338
|
-
], Payment.prototype, "cardBrand", void 0);
|
|
339
|
-
__decorate([
|
|
340
|
-
Expose({ name: 'card_pin_mode' }),
|
|
341
|
-
__metadata("design:type", String)
|
|
342
|
-
], Payment.prototype, "cardPinMode", void 0);
|
|
343
|
-
__decorate([
|
|
344
|
-
Expose({ name: 'card_magstripe_fallback' }),
|
|
345
|
-
__metadata("design:type", Boolean)
|
|
346
|
-
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
347
|
-
__decorate([
|
|
348
|
-
Expose({ name: 'cvm_pin' }),
|
|
349
|
-
__metadata("design:type", Boolean)
|
|
350
|
-
], Payment.prototype, "cvmPin", void 0);
|
|
351
|
-
__decorate([
|
|
352
|
-
Expose({ name: 'postback_url' }),
|
|
353
|
-
__metadata("design:type", String)
|
|
354
|
-
], Payment.prototype, "postbackUrl", void 0);
|
|
355
|
-
__decorate([
|
|
356
|
-
Expose({ name: 'payment_method' }),
|
|
357
|
-
__metadata("design:type", String)
|
|
358
|
-
], Payment.prototype, "paymentMethod", void 0);
|
|
359
|
-
__decorate([
|
|
360
|
-
Expose({ name: 'capture_method' }),
|
|
361
|
-
__metadata("design:type", String)
|
|
362
|
-
], Payment.prototype, "captureMethod", void 0);
|
|
363
|
-
__decorate([
|
|
364
|
-
Expose({ name: 'antifraud_score' }),
|
|
365
|
-
__metadata("design:type", String)
|
|
366
|
-
], Payment.prototype, "antifraudScore", void 0);
|
|
367
|
-
__decorate([
|
|
368
|
-
Expose({ name: 'boleto_url' }),
|
|
369
|
-
__metadata("design:type", String)
|
|
370
|
-
], Payment.prototype, "boletoUrl", void 0);
|
|
371
|
-
__decorate([
|
|
372
|
-
Expose({ name: 'boleto_barcode' }),
|
|
373
|
-
__metadata("design:type", String)
|
|
374
|
-
], Payment.prototype, "boletoBarcode", void 0);
|
|
375
|
-
__decorate([
|
|
376
|
-
Expose({ name: 'boleto_expiration_date' }),
|
|
377
|
-
__metadata("design:type", String)
|
|
378
|
-
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
379
|
-
__decorate([
|
|
380
|
-
Expose({ name: 'subscription_id' }),
|
|
381
|
-
__metadata("design:type", String)
|
|
382
|
-
], Payment.prototype, "subscriptionId", void 0);
|
|
383
|
-
__decorate([
|
|
384
|
-
Expose({ name: 'split_rules' }),
|
|
385
|
-
__metadata("design:type", String)
|
|
386
|
-
], Payment.prototype, "splitRules", void 0);
|
|
387
|
-
__decorate([
|
|
388
|
-
Expose({ name: 'antifraud_metadata' }),
|
|
389
|
-
__metadata("design:type", Object)
|
|
390
|
-
], Payment.prototype, "antifraudMetadata", void 0);
|
|
391
|
-
__decorate([
|
|
392
|
-
Expose({ name: 'reference_key' }),
|
|
393
|
-
__metadata("design:type", String)
|
|
394
|
-
], Payment.prototype, "referenceKey", void 0);
|
|
395
|
-
__decorate([
|
|
396
|
-
Expose({ name: 'local_transaction_id' }),
|
|
397
|
-
__metadata("design:type", String)
|
|
398
|
-
], Payment.prototype, "localTransactionId", void 0);
|
|
399
|
-
__decorate([
|
|
400
|
-
Expose({ name: 'local_time' }),
|
|
401
|
-
__metadata("design:type", String)
|
|
402
|
-
], Payment.prototype, "localTime", void 0);
|
|
403
|
-
__decorate([
|
|
404
|
-
Expose({ name: 'fraud_covered' }),
|
|
405
|
-
__metadata("design:type", Boolean)
|
|
406
|
-
], Payment.prototype, "fraudCovered", void 0);
|
|
407
|
-
__decorate([
|
|
408
|
-
Expose({ name: 'fraud_reimbursed' }),
|
|
409
|
-
__metadata("design:type", String)
|
|
410
|
-
], Payment.prototype, "fraudReimbursed", void 0);
|
|
411
|
-
__decorate([
|
|
412
|
-
Expose({ name: 'order_id' }),
|
|
413
|
-
__metadata("design:type", String)
|
|
414
|
-
], Payment.prototype, "orderId", void 0);
|
|
415
|
-
__decorate([
|
|
416
|
-
Expose({ name: 'risk_level' }),
|
|
417
|
-
__metadata("design:type", String)
|
|
418
|
-
], Payment.prototype, "riskLevel", void 0);
|
|
419
|
-
__decorate([
|
|
420
|
-
Expose({ name: 'receipt_url' }),
|
|
421
|
-
__metadata("design:type", String)
|
|
422
|
-
], Payment.prototype, "receiptUrl", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
Expose({ name: 'private_label' }),
|
|
425
|
-
__metadata("design:type", String)
|
|
426
|
-
], Payment.prototype, "privateLabel", void 0);
|
|
427
|
-
__decorate([
|
|
428
|
-
Expose({ name: 'pix_qr_code' }),
|
|
429
|
-
__metadata("design:type", String)
|
|
430
|
-
], Payment.prototype, "pixQrCode", void 0);
|
|
431
|
-
__decorate([
|
|
432
|
-
Expose({ name: 'pix_expiration_date' }),
|
|
433
|
-
__metadata("design:type", String)
|
|
264
|
+
class Edition extends BaseModel {
|
|
265
|
+
identifierFields() {
|
|
266
|
+
return ['id'];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
class Payment extends BaseModel {
|
|
271
|
+
identifierFields() {
|
|
272
|
+
return ['id'];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
__decorate([
|
|
276
|
+
Expose({ name: 'refuse_reason' }),
|
|
277
|
+
__metadata("design:type", String)
|
|
278
|
+
], Payment.prototype, "refuseReason", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
Expose({ name: 'status_reason' }),
|
|
281
|
+
__metadata("design:type", String)
|
|
282
|
+
], Payment.prototype, "statusReason", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
Expose({ name: 'acquirer_response_code' }),
|
|
285
|
+
__metadata("design:type", String)
|
|
286
|
+
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
Expose({ name: 'acquirer_name' }),
|
|
289
|
+
__metadata("design:type", String)
|
|
290
|
+
], Payment.prototype, "acquirerName", void 0);
|
|
291
|
+
__decorate([
|
|
292
|
+
Expose({ name: 'acquirer_id' }),
|
|
293
|
+
__metadata("design:type", String)
|
|
294
|
+
], Payment.prototype, "acquirerId", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
Expose({ name: 'authorization_code' }),
|
|
297
|
+
__metadata("design:type", String)
|
|
298
|
+
], Payment.prototype, "authorizationCode", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
Expose({ name: 'soft_descriptor' }),
|
|
301
|
+
__metadata("design:type", String)
|
|
302
|
+
], Payment.prototype, "softDescriptor", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
Expose({ name: 'date_created' }),
|
|
305
|
+
__metadata("design:type", String)
|
|
306
|
+
], Payment.prototype, "dateCreated", void 0);
|
|
307
|
+
__decorate([
|
|
308
|
+
Expose({ name: 'date_updated' }),
|
|
309
|
+
__metadata("design:type", String)
|
|
310
|
+
], Payment.prototype, "dateUpdated", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
Expose({ name: 'authorized_amount' }),
|
|
313
|
+
__metadata("design:type", Number)
|
|
314
|
+
], Payment.prototype, "authorizedAmount", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
Expose({ name: 'paid_amount' }),
|
|
317
|
+
__metadata("design:type", Number)
|
|
318
|
+
], Payment.prototype, "paidAmount", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
Expose({ name: 'refunded_amount' }),
|
|
321
|
+
__metadata("design:type", Number)
|
|
322
|
+
], Payment.prototype, "refundedAmount", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
Expose({ name: 'card_holder_name' }),
|
|
325
|
+
__metadata("design:type", String)
|
|
326
|
+
], Payment.prototype, "cardHolderName", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
Expose({ name: 'card_last_digits' }),
|
|
329
|
+
__metadata("design:type", String)
|
|
330
|
+
], Payment.prototype, "cardLastDigits", void 0);
|
|
331
|
+
__decorate([
|
|
332
|
+
Expose({ name: 'card_first_digits' }),
|
|
333
|
+
__metadata("design:type", String)
|
|
334
|
+
], Payment.prototype, "cardFirstDigits", void 0);
|
|
335
|
+
__decorate([
|
|
336
|
+
Expose({ name: 'card_brand' }),
|
|
337
|
+
__metadata("design:type", String)
|
|
338
|
+
], Payment.prototype, "cardBrand", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
Expose({ name: 'card_pin_mode' }),
|
|
341
|
+
__metadata("design:type", String)
|
|
342
|
+
], Payment.prototype, "cardPinMode", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
Expose({ name: 'card_magstripe_fallback' }),
|
|
345
|
+
__metadata("design:type", Boolean)
|
|
346
|
+
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
Expose({ name: 'cvm_pin' }),
|
|
349
|
+
__metadata("design:type", Boolean)
|
|
350
|
+
], Payment.prototype, "cvmPin", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
Expose({ name: 'postback_url' }),
|
|
353
|
+
__metadata("design:type", String)
|
|
354
|
+
], Payment.prototype, "postbackUrl", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
Expose({ name: 'payment_method' }),
|
|
357
|
+
__metadata("design:type", String)
|
|
358
|
+
], Payment.prototype, "paymentMethod", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
Expose({ name: 'capture_method' }),
|
|
361
|
+
__metadata("design:type", String)
|
|
362
|
+
], Payment.prototype, "captureMethod", void 0);
|
|
363
|
+
__decorate([
|
|
364
|
+
Expose({ name: 'antifraud_score' }),
|
|
365
|
+
__metadata("design:type", String)
|
|
366
|
+
], Payment.prototype, "antifraudScore", void 0);
|
|
367
|
+
__decorate([
|
|
368
|
+
Expose({ name: 'boleto_url' }),
|
|
369
|
+
__metadata("design:type", String)
|
|
370
|
+
], Payment.prototype, "boletoUrl", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
Expose({ name: 'boleto_barcode' }),
|
|
373
|
+
__metadata("design:type", String)
|
|
374
|
+
], Payment.prototype, "boletoBarcode", void 0);
|
|
375
|
+
__decorate([
|
|
376
|
+
Expose({ name: 'boleto_expiration_date' }),
|
|
377
|
+
__metadata("design:type", String)
|
|
378
|
+
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
Expose({ name: 'subscription_id' }),
|
|
381
|
+
__metadata("design:type", String)
|
|
382
|
+
], Payment.prototype, "subscriptionId", void 0);
|
|
383
|
+
__decorate([
|
|
384
|
+
Expose({ name: 'split_rules' }),
|
|
385
|
+
__metadata("design:type", String)
|
|
386
|
+
], Payment.prototype, "splitRules", void 0);
|
|
387
|
+
__decorate([
|
|
388
|
+
Expose({ name: 'antifraud_metadata' }),
|
|
389
|
+
__metadata("design:type", Object)
|
|
390
|
+
], Payment.prototype, "antifraudMetadata", void 0);
|
|
391
|
+
__decorate([
|
|
392
|
+
Expose({ name: 'reference_key' }),
|
|
393
|
+
__metadata("design:type", String)
|
|
394
|
+
], Payment.prototype, "referenceKey", void 0);
|
|
395
|
+
__decorate([
|
|
396
|
+
Expose({ name: 'local_transaction_id' }),
|
|
397
|
+
__metadata("design:type", String)
|
|
398
|
+
], Payment.prototype, "localTransactionId", void 0);
|
|
399
|
+
__decorate([
|
|
400
|
+
Expose({ name: 'local_time' }),
|
|
401
|
+
__metadata("design:type", String)
|
|
402
|
+
], Payment.prototype, "localTime", void 0);
|
|
403
|
+
__decorate([
|
|
404
|
+
Expose({ name: 'fraud_covered' }),
|
|
405
|
+
__metadata("design:type", Boolean)
|
|
406
|
+
], Payment.prototype, "fraudCovered", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
Expose({ name: 'fraud_reimbursed' }),
|
|
409
|
+
__metadata("design:type", String)
|
|
410
|
+
], Payment.prototype, "fraudReimbursed", void 0);
|
|
411
|
+
__decorate([
|
|
412
|
+
Expose({ name: 'order_id' }),
|
|
413
|
+
__metadata("design:type", String)
|
|
414
|
+
], Payment.prototype, "orderId", void 0);
|
|
415
|
+
__decorate([
|
|
416
|
+
Expose({ name: 'risk_level' }),
|
|
417
|
+
__metadata("design:type", String)
|
|
418
|
+
], Payment.prototype, "riskLevel", void 0);
|
|
419
|
+
__decorate([
|
|
420
|
+
Expose({ name: 'receipt_url' }),
|
|
421
|
+
__metadata("design:type", String)
|
|
422
|
+
], Payment.prototype, "receiptUrl", void 0);
|
|
423
|
+
__decorate([
|
|
424
|
+
Expose({ name: 'private_label' }),
|
|
425
|
+
__metadata("design:type", String)
|
|
426
|
+
], Payment.prototype, "privateLabel", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
Expose({ name: 'pix_qr_code' }),
|
|
429
|
+
__metadata("design:type", String)
|
|
430
|
+
], Payment.prototype, "pixQrCode", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
Expose({ name: 'pix_expiration_date' }),
|
|
433
|
+
__metadata("design:type", String)
|
|
434
434
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
435
435
|
|
|
436
|
-
class SubscriptionPayment extends BaseModel {
|
|
437
|
-
identifierFields() {
|
|
438
|
-
return ['id'];
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
__decorate([
|
|
442
|
-
Type(() => Payment),
|
|
443
|
-
__metadata("design:type", Payment)
|
|
436
|
+
class SubscriptionPayment extends BaseModel {
|
|
437
|
+
identifierFields() {
|
|
438
|
+
return ['id'];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
__decorate([
|
|
442
|
+
Type(() => Payment),
|
|
443
|
+
__metadata("design:type", Payment)
|
|
444
444
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
445
445
|
|
|
446
|
-
class Address extends BaseModel {
|
|
446
|
+
class Address extends BaseModel {
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
var CheckoutTypes;
|
|
450
|
-
(function (CheckoutTypes) {
|
|
451
|
-
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
452
|
-
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
453
|
-
CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
|
|
449
|
+
var CheckoutTypes;
|
|
450
|
+
(function (CheckoutTypes) {
|
|
451
|
+
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
452
|
+
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
453
|
+
CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
|
|
454
454
|
})(CheckoutTypes || (CheckoutTypes = {}));
|
|
455
455
|
|
|
456
|
-
class Base {
|
|
457
|
-
constructor(...args) {
|
|
458
|
-
Object.assign(this, ...args);
|
|
459
|
-
}
|
|
456
|
+
class Base {
|
|
457
|
+
constructor(...args) {
|
|
458
|
+
Object.assign(this, ...args);
|
|
459
|
+
}
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
var CouponTypes;
|
|
463
|
-
(function (CouponTypes) {
|
|
464
|
-
CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
465
|
-
CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
466
|
-
// FINANCIAL = 1,
|
|
467
|
-
// PRODUCT,
|
|
468
|
-
// GIFTCARD,
|
|
469
|
-
// VOUCHER,
|
|
462
|
+
var CouponTypes;
|
|
463
|
+
(function (CouponTypes) {
|
|
464
|
+
CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
465
|
+
CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
466
|
+
// FINANCIAL = 1,
|
|
467
|
+
// PRODUCT,
|
|
468
|
+
// GIFTCARD,
|
|
469
|
+
// VOUCHER,
|
|
470
470
|
})(CouponTypes || (CouponTypes = {}));
|
|
471
471
|
|
|
472
|
-
var CouponSubtypes;
|
|
473
|
-
(function (CouponSubtypes) {
|
|
474
|
-
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
475
|
-
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
472
|
+
var CouponSubtypes;
|
|
473
|
+
(function (CouponSubtypes) {
|
|
474
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
475
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
476
476
|
})(CouponSubtypes || (CouponSubtypes = {}));
|
|
477
477
|
|
|
478
|
-
var Exclusivities;
|
|
479
|
-
(function (Exclusivities) {
|
|
480
|
-
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
481
|
-
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
482
|
-
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
478
|
+
var Exclusivities;
|
|
479
|
+
(function (Exclusivities) {
|
|
480
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
481
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
482
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
483
483
|
})(Exclusivities || (Exclusivities = {}));
|
|
484
484
|
|
|
485
|
-
const COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
486
|
-
class Coupon extends BaseModel {
|
|
487
|
-
get isInfluencer() {
|
|
488
|
-
return !isNil(this.influencerEmail);
|
|
489
|
-
}
|
|
490
|
-
identifierFields() {
|
|
491
|
-
return ['id'];
|
|
492
|
-
}
|
|
493
|
-
static createCoupon(userId) {
|
|
494
|
-
return this.toInstance({
|
|
495
|
-
nickname: `${Date.now()}`,
|
|
496
|
-
type: CouponTypes.ABSOLUTE,
|
|
497
|
-
checkoutType: CheckoutTypes.ECOMMERCE,
|
|
498
|
-
discount: 30,
|
|
499
|
-
user: userId,
|
|
500
|
-
useLimit: 1,
|
|
501
|
-
useLimitPerUser: 1,
|
|
502
|
-
createdAt: new Date(Date.now()),
|
|
503
|
-
beginAt: new Date(Date.now()),
|
|
504
|
-
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
__decorate([
|
|
509
|
-
Expose({ name: 'checkout_type' }),
|
|
510
|
-
__metadata("design:type", Number)
|
|
511
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
512
|
-
__decorate([
|
|
513
|
-
Expose({ name: 'exclusivity_type' }),
|
|
514
|
-
__metadata("design:type", Number)
|
|
485
|
+
const COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
486
|
+
class Coupon extends BaseModel {
|
|
487
|
+
get isInfluencer() {
|
|
488
|
+
return !isNil(this.influencerEmail);
|
|
489
|
+
}
|
|
490
|
+
identifierFields() {
|
|
491
|
+
return ['id'];
|
|
492
|
+
}
|
|
493
|
+
static createCoupon(userId) {
|
|
494
|
+
return this.toInstance({
|
|
495
|
+
nickname: `${Date.now()}`,
|
|
496
|
+
type: CouponTypes.ABSOLUTE,
|
|
497
|
+
checkoutType: CheckoutTypes.ECOMMERCE,
|
|
498
|
+
discount: 30,
|
|
499
|
+
user: userId,
|
|
500
|
+
useLimit: 1,
|
|
501
|
+
useLimitPerUser: 1,
|
|
502
|
+
createdAt: new Date(Date.now()),
|
|
503
|
+
beginAt: new Date(Date.now()),
|
|
504
|
+
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
__decorate([
|
|
509
|
+
Expose({ name: 'checkout_type' }),
|
|
510
|
+
__metadata("design:type", Number)
|
|
511
|
+
], Coupon.prototype, "checkoutType", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
Expose({ name: 'exclusivity_type' }),
|
|
514
|
+
__metadata("design:type", Number)
|
|
515
515
|
], Coupon.prototype, "exclusivityType", void 0);
|
|
516
516
|
|
|
517
|
-
class SubscriptionPlan extends BaseModel {
|
|
518
|
-
identifierFields() {
|
|
519
|
-
return ['id'];
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
class BeautyProfile extends BaseModel {
|
|
524
|
-
toPlain() {
|
|
525
|
-
const plain = super.toPlain();
|
|
526
|
-
delete plain.id;
|
|
527
|
-
return plain;
|
|
528
|
-
}
|
|
529
|
-
identifierFields() {
|
|
530
|
-
return ['id'];
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
class User extends BaseModel {
|
|
535
|
-
static toInstance(data) {
|
|
536
|
-
const instance = super.toInstance(data);
|
|
537
|
-
if (!isNil(data.firstName))
|
|
538
|
-
instance.displayName = `${data.firstName}${!isNil(data.lastName) ? ` ${data.lastName}` : ''}`;
|
|
539
|
-
return instance;
|
|
540
|
-
}
|
|
541
|
-
identifierFields() {
|
|
542
|
-
return ['id'];
|
|
543
|
-
}
|
|
544
|
-
toPlain() {
|
|
545
|
-
const plain = super.toPlain();
|
|
546
|
-
delete plain.beautyProfile;
|
|
547
|
-
return plain;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
__decorate([
|
|
551
|
-
Type(() => BeautyProfile),
|
|
552
|
-
__metadata("design:type", BeautyProfile)
|
|
517
|
+
class SubscriptionPlan extends BaseModel {
|
|
518
|
+
identifierFields() {
|
|
519
|
+
return ['id'];
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
class BeautyProfile extends BaseModel {
|
|
524
|
+
toPlain() {
|
|
525
|
+
const plain = super.toPlain();
|
|
526
|
+
delete plain.id;
|
|
527
|
+
return plain;
|
|
528
|
+
}
|
|
529
|
+
identifierFields() {
|
|
530
|
+
return ['id'];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
class User extends BaseModel {
|
|
535
|
+
static toInstance(data) {
|
|
536
|
+
const instance = super.toInstance(data);
|
|
537
|
+
if (!isNil(data.firstName))
|
|
538
|
+
instance.displayName = `${data.firstName}${!isNil(data.lastName) ? ` ${data.lastName}` : ''}`;
|
|
539
|
+
return instance;
|
|
540
|
+
}
|
|
541
|
+
identifierFields() {
|
|
542
|
+
return ['id'];
|
|
543
|
+
}
|
|
544
|
+
toPlain() {
|
|
545
|
+
const plain = super.toPlain();
|
|
546
|
+
delete plain.beautyProfile;
|
|
547
|
+
return plain;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
__decorate([
|
|
551
|
+
Type(() => BeautyProfile),
|
|
552
|
+
__metadata("design:type", BeautyProfile)
|
|
553
553
|
], User.prototype, "beautyProfile", void 0);
|
|
554
554
|
|
|
555
|
-
class Subscription extends BaseModel {
|
|
556
|
-
identifierFields() {
|
|
557
|
-
return ['id'];
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
__decorate([
|
|
561
|
-
Type(() => User),
|
|
562
|
-
__metadata("design:type", User)
|
|
563
|
-
], Subscription.prototype, "user", void 0);
|
|
564
|
-
__decorate([
|
|
565
|
-
Type(() => SubscriptionPlan),
|
|
566
|
-
__metadata("design:type", SubscriptionPlan)
|
|
567
|
-
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
568
|
-
__decorate([
|
|
569
|
-
Type(() => Address),
|
|
570
|
-
__metadata("design:type", Address)
|
|
571
|
-
], Subscription.prototype, "shippingAddress", void 0);
|
|
572
|
-
__decorate([
|
|
573
|
-
Type(() => Address),
|
|
574
|
-
__metadata("design:type", Address)
|
|
575
|
-
], Subscription.prototype, "billingAddress", void 0);
|
|
576
|
-
__decorate([
|
|
577
|
-
Type(() => Coupon),
|
|
578
|
-
__metadata("design:type", Coupon)
|
|
579
|
-
], Subscription.prototype, "coupon", void 0);
|
|
580
|
-
__decorate([
|
|
581
|
-
Type(() => Edition),
|
|
582
|
-
__metadata("design:type", Array)
|
|
583
|
-
], Subscription.prototype, "editions", void 0);
|
|
584
|
-
__decorate([
|
|
585
|
-
Type(() => SubscriptionPayment),
|
|
586
|
-
__metadata("design:type", Array)
|
|
555
|
+
class Subscription extends BaseModel {
|
|
556
|
+
identifierFields() {
|
|
557
|
+
return ['id'];
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
__decorate([
|
|
561
|
+
Type(() => User),
|
|
562
|
+
__metadata("design:type", User)
|
|
563
|
+
], Subscription.prototype, "user", void 0);
|
|
564
|
+
__decorate([
|
|
565
|
+
Type(() => SubscriptionPlan),
|
|
566
|
+
__metadata("design:type", SubscriptionPlan)
|
|
567
|
+
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
568
|
+
__decorate([
|
|
569
|
+
Type(() => Address),
|
|
570
|
+
__metadata("design:type", Address)
|
|
571
|
+
], Subscription.prototype, "shippingAddress", void 0);
|
|
572
|
+
__decorate([
|
|
573
|
+
Type(() => Address),
|
|
574
|
+
__metadata("design:type", Address)
|
|
575
|
+
], Subscription.prototype, "billingAddress", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
Type(() => Coupon),
|
|
578
|
+
__metadata("design:type", Coupon)
|
|
579
|
+
], Subscription.prototype, "coupon", void 0);
|
|
580
|
+
__decorate([
|
|
581
|
+
Type(() => Edition),
|
|
582
|
+
__metadata("design:type", Array)
|
|
583
|
+
], Subscription.prototype, "editions", void 0);
|
|
584
|
+
__decorate([
|
|
585
|
+
Type(() => SubscriptionPayment),
|
|
586
|
+
__metadata("design:type", Array)
|
|
587
587
|
], Subscription.prototype, "payment", void 0);
|
|
588
588
|
|
|
589
|
-
class UserAddress extends Address {
|
|
590
|
-
identifierFields() {
|
|
591
|
-
return ['id'];
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
class UserPaymentMethod extends BaseModel {
|
|
596
|
-
identifierFields() {
|
|
597
|
-
return ['id'];
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
class Lead extends BaseModel {
|
|
602
|
-
identifierFields() {
|
|
603
|
-
return ['id'];
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
class UnauthorizedError extends Error {
|
|
608
|
-
constructor(message) {
|
|
609
|
-
super(message);
|
|
610
|
-
this.message = message;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
var SignInMethods;
|
|
615
|
-
(function (SignInMethods) {
|
|
616
|
-
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
617
|
-
SignInMethods["GOOGLE"] = "google";
|
|
618
|
-
})(SignInMethods || (SignInMethods = {}));
|
|
619
|
-
class Authentication {
|
|
620
|
-
constructor(authService, userRepository) {
|
|
621
|
-
this.authService = authService;
|
|
622
|
-
this.userRepository = userRepository;
|
|
623
|
-
}
|
|
624
|
-
signIn({ email, password }, signInMethod) {
|
|
625
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
626
|
-
const method = this.getServiceByMethod(signInMethod);
|
|
627
|
-
const userAuth = yield this.authService[method]({ email, password });
|
|
628
|
-
const user = this.userRepository.get(userAuth);
|
|
629
|
-
if (!isNil(user))
|
|
630
|
-
return user;
|
|
631
|
-
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
632
|
-
return this.createsUserByCredential(userAuth);
|
|
633
|
-
throw new UnauthorizedError('Invalid credentials');
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
getServiceByMethod(signInMethod) {
|
|
637
|
-
return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
638
|
-
}
|
|
639
|
-
createsUserByCredential(user) {
|
|
640
|
-
var _a;
|
|
641
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
642
|
-
const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
|
|
643
|
-
const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
|
|
644
|
-
lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
|
|
645
|
-
return this.userRepository.create(person);
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
class UserAlreadyRegisteredError extends Error {
|
|
651
|
-
constructor(message) {
|
|
652
|
-
super(message);
|
|
653
|
-
this.message = message;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
class WeakPasswordError extends Error {
|
|
658
|
-
constructor(message = 'Weak password') {
|
|
659
|
-
super(message);
|
|
660
|
-
this.message = message;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
class Register {
|
|
665
|
-
constructor(registerService, userRepository) {
|
|
666
|
-
this.registerService = registerService;
|
|
667
|
-
this.userRepository = userRepository;
|
|
668
|
-
}
|
|
669
|
-
register(params) {
|
|
670
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
671
|
-
const email = params.email.toLocaleLowerCase();
|
|
672
|
-
const displayName = `${params.firstName} ${params.lastName}`;
|
|
673
|
-
if (yield this.userRepository.checkIfExistsByField('cpf', params.cpf))
|
|
674
|
-
throw new UserAlreadyRegisteredError(`Usuário com CPF ${params.cpf} já registrado.`);
|
|
675
|
-
if (yield this.userRepository.checkIfExistsByField('email', params.email))
|
|
676
|
-
throw new UserAlreadyRegisteredError(`Usuário com e-mail ${params.email} já registrado.`);
|
|
677
|
-
const auth = yield this.registerService.register({
|
|
678
|
-
birthday: params.birthday,
|
|
679
|
-
email,
|
|
680
|
-
firstName: params.firstName,
|
|
681
|
-
lastName: params.lastName,
|
|
682
|
-
cpf: params.cpf,
|
|
683
|
-
displayName,
|
|
684
|
-
phone: params.phone,
|
|
685
|
-
password: params.password,
|
|
686
|
-
});
|
|
687
|
-
delete params.password;
|
|
688
|
-
const user = yield this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email,
|
|
689
|
-
displayName, type: UserType.B2C, dateCreated: new Date(), dateModified: new Date() }));
|
|
690
|
-
return user;
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
class SignOut {
|
|
696
|
-
constructor(authService) {
|
|
697
|
-
this.authService = authService;
|
|
698
|
-
}
|
|
699
|
-
signOut() {
|
|
700
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
-
yield this.authService.signOut();
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
class RecoveryPassword {
|
|
707
|
-
constructor(authService) {
|
|
708
|
-
this.authService = authService;
|
|
709
|
-
}
|
|
710
|
-
sendEmail(email) {
|
|
711
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
712
|
-
yield this.authService.sendPasswordResetEmail(email);
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
var Shops;
|
|
718
|
-
(function (Shops) {
|
|
719
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
720
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
721
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
722
|
-
Shops["ALL"] = "ALL";
|
|
589
|
+
class UserAddress extends Address {
|
|
590
|
+
identifierFields() {
|
|
591
|
+
return ['id'];
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
class UserPaymentMethod extends BaseModel {
|
|
596
|
+
identifierFields() {
|
|
597
|
+
return ['id'];
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
class Lead extends BaseModel {
|
|
602
|
+
identifierFields() {
|
|
603
|
+
return ['id'];
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
class UnauthorizedError extends Error {
|
|
608
|
+
constructor(message) {
|
|
609
|
+
super(message);
|
|
610
|
+
this.message = message;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
var SignInMethods;
|
|
615
|
+
(function (SignInMethods) {
|
|
616
|
+
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
617
|
+
SignInMethods["GOOGLE"] = "google";
|
|
618
|
+
})(SignInMethods || (SignInMethods = {}));
|
|
619
|
+
class Authentication {
|
|
620
|
+
constructor(authService, userRepository) {
|
|
621
|
+
this.authService = authService;
|
|
622
|
+
this.userRepository = userRepository;
|
|
623
|
+
}
|
|
624
|
+
signIn({ email, password }, signInMethod) {
|
|
625
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
626
|
+
const method = this.getServiceByMethod(signInMethod);
|
|
627
|
+
const userAuth = yield this.authService[method]({ email, password });
|
|
628
|
+
const user = this.userRepository.get(userAuth);
|
|
629
|
+
if (!isNil(user))
|
|
630
|
+
return user;
|
|
631
|
+
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
632
|
+
return this.createsUserByCredential(userAuth);
|
|
633
|
+
throw new UnauthorizedError('Invalid credentials');
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
getServiceByMethod(signInMethod) {
|
|
637
|
+
return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
638
|
+
}
|
|
639
|
+
createsUserByCredential(user) {
|
|
640
|
+
var _a;
|
|
641
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
642
|
+
const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
|
|
643
|
+
const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
|
|
644
|
+
lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
|
|
645
|
+
return this.userRepository.create(person);
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
class UserAlreadyRegisteredError extends Error {
|
|
651
|
+
constructor(message) {
|
|
652
|
+
super(message);
|
|
653
|
+
this.message = message;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
class WeakPasswordError extends Error {
|
|
658
|
+
constructor(message = 'Weak password') {
|
|
659
|
+
super(message);
|
|
660
|
+
this.message = message;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
class Register {
|
|
665
|
+
constructor(registerService, userRepository) {
|
|
666
|
+
this.registerService = registerService;
|
|
667
|
+
this.userRepository = userRepository;
|
|
668
|
+
}
|
|
669
|
+
register(params) {
|
|
670
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
671
|
+
const email = params.email.toLocaleLowerCase();
|
|
672
|
+
const displayName = `${params.firstName} ${params.lastName}`;
|
|
673
|
+
if (yield this.userRepository.checkIfExistsByField('cpf', params.cpf))
|
|
674
|
+
throw new UserAlreadyRegisteredError(`Usuário com CPF ${params.cpf} já registrado.`);
|
|
675
|
+
if (yield this.userRepository.checkIfExistsByField('email', params.email))
|
|
676
|
+
throw new UserAlreadyRegisteredError(`Usuário com e-mail ${params.email} já registrado.`);
|
|
677
|
+
const auth = yield this.registerService.register({
|
|
678
|
+
birthday: params.birthday,
|
|
679
|
+
email,
|
|
680
|
+
firstName: params.firstName,
|
|
681
|
+
lastName: params.lastName,
|
|
682
|
+
cpf: params.cpf,
|
|
683
|
+
displayName,
|
|
684
|
+
phone: params.phone,
|
|
685
|
+
password: params.password,
|
|
686
|
+
});
|
|
687
|
+
delete params.password;
|
|
688
|
+
const user = yield this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email,
|
|
689
|
+
displayName, type: UserType.B2C, dateCreated: new Date(), dateModified: new Date() }));
|
|
690
|
+
return user;
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
class SignOut {
|
|
696
|
+
constructor(authService) {
|
|
697
|
+
this.authService = authService;
|
|
698
|
+
}
|
|
699
|
+
signOut() {
|
|
700
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
+
yield this.authService.signOut();
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
class RecoveryPassword {
|
|
707
|
+
constructor(authService) {
|
|
708
|
+
this.authService = authService;
|
|
709
|
+
}
|
|
710
|
+
sendEmail(email) {
|
|
711
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
712
|
+
yield this.authService.sendPasswordResetEmail(email);
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
var Shops;
|
|
718
|
+
(function (Shops) {
|
|
719
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
720
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
721
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
722
|
+
Shops["ALL"] = "ALL";
|
|
723
723
|
})(Shops || (Shops = {}));
|
|
724
724
|
|
|
725
|
-
class Category extends BaseModel {
|
|
726
|
-
identifierFields() {
|
|
727
|
-
return ['id'];
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
class Product extends BaseModel {
|
|
732
|
-
identifierFields() {
|
|
733
|
-
return ['id'];
|
|
734
|
-
}
|
|
735
|
-
getInfoByShop(shop) {
|
|
736
|
-
var _a, _b, _c, _d, _e, _f;
|
|
737
|
-
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]) || {}));
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
class Variant extends BaseModel {
|
|
742
|
-
identifierFields() {
|
|
743
|
-
return ['id'];
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
var OrderStatus;
|
|
748
|
-
(function (OrderStatus) {
|
|
749
|
-
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
750
|
-
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
751
|
-
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
752
|
-
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
753
|
-
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
754
|
-
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
755
|
-
OrderStatus["CANCELADO"] = "Cancelado";
|
|
756
|
-
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
725
|
+
class Category extends BaseModel {
|
|
726
|
+
identifierFields() {
|
|
727
|
+
return ['id'];
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
class Product extends BaseModel {
|
|
732
|
+
identifierFields() {
|
|
733
|
+
return ['id'];
|
|
734
|
+
}
|
|
735
|
+
getInfoByShop(shop) {
|
|
736
|
+
var _a, _b, _c, _d, _e, _f;
|
|
737
|
+
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]) || {}));
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
class Variant extends BaseModel {
|
|
742
|
+
identifierFields() {
|
|
743
|
+
return ['id'];
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
var OrderStatus;
|
|
748
|
+
(function (OrderStatus) {
|
|
749
|
+
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
750
|
+
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
751
|
+
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
752
|
+
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
753
|
+
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
754
|
+
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
755
|
+
OrderStatus["CANCELADO"] = "Cancelado";
|
|
756
|
+
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
757
757
|
})(OrderStatus || (OrderStatus = {}));
|
|
758
758
|
|
|
759
|
-
class LineItem extends Product {
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
class ShippingMethod extends BaseModel {
|
|
763
|
-
identifierFields() {
|
|
764
|
-
return ['id'];
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
class Checkout extends BaseModel {
|
|
769
|
-
identifierFields() {
|
|
770
|
-
return ['id'];
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
__decorate([
|
|
774
|
-
Type(() => LineItem),
|
|
775
|
-
__metadata("design:type", Array)
|
|
776
|
-
], Checkout.prototype, "lineItems", void 0);
|
|
777
|
-
__decorate([
|
|
778
|
-
Type(() => User),
|
|
779
|
-
__metadata("design:type", User)
|
|
780
|
-
], Checkout.prototype, "user", void 0);
|
|
781
|
-
__decorate([
|
|
782
|
-
Type(() => Address),
|
|
783
|
-
__metadata("design:type", Address)
|
|
784
|
-
], Checkout.prototype, "shippingAddress", void 0);
|
|
785
|
-
__decorate([
|
|
786
|
-
Type(() => Address),
|
|
787
|
-
__metadata("design:type", Address)
|
|
788
|
-
], Checkout.prototype, "billingAddress", void 0);
|
|
789
|
-
__decorate([
|
|
790
|
-
Type(() => ShippingMethod),
|
|
791
|
-
__metadata("design:type", ShippingMethod)
|
|
792
|
-
], Checkout.prototype, "shipping", void 0);
|
|
793
|
-
__decorate([
|
|
794
|
-
Type(() => Coupon),
|
|
795
|
-
__metadata("design:type", Coupon)
|
|
759
|
+
class LineItem extends Product {
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
class ShippingMethod extends BaseModel {
|
|
763
|
+
identifierFields() {
|
|
764
|
+
return ['id'];
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
class Checkout extends BaseModel {
|
|
769
|
+
identifierFields() {
|
|
770
|
+
return ['id'];
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
__decorate([
|
|
774
|
+
Type(() => LineItem),
|
|
775
|
+
__metadata("design:type", Array)
|
|
776
|
+
], Checkout.prototype, "lineItems", void 0);
|
|
777
|
+
__decorate([
|
|
778
|
+
Type(() => User),
|
|
779
|
+
__metadata("design:type", User)
|
|
780
|
+
], Checkout.prototype, "user", void 0);
|
|
781
|
+
__decorate([
|
|
782
|
+
Type(() => Address),
|
|
783
|
+
__metadata("design:type", Address)
|
|
784
|
+
], Checkout.prototype, "shippingAddress", void 0);
|
|
785
|
+
__decorate([
|
|
786
|
+
Type(() => Address),
|
|
787
|
+
__metadata("design:type", Address)
|
|
788
|
+
], Checkout.prototype, "billingAddress", void 0);
|
|
789
|
+
__decorate([
|
|
790
|
+
Type(() => ShippingMethod),
|
|
791
|
+
__metadata("design:type", ShippingMethod)
|
|
792
|
+
], Checkout.prototype, "shipping", void 0);
|
|
793
|
+
__decorate([
|
|
794
|
+
Type(() => Coupon),
|
|
795
|
+
__metadata("design:type", Coupon)
|
|
796
796
|
], Checkout.prototype, "coupon", void 0);
|
|
797
797
|
|
|
798
|
-
class Order extends Checkout {
|
|
799
|
-
}
|
|
800
|
-
__decorate([
|
|
801
|
-
Type(() => Payment),
|
|
802
|
-
__metadata("design:type", Payment)
|
|
798
|
+
class Order extends Checkout {
|
|
799
|
+
}
|
|
800
|
+
__decorate([
|
|
801
|
+
Type(() => Payment),
|
|
802
|
+
__metadata("design:type", Payment)
|
|
803
803
|
], Order.prototype, "payment", void 0);
|
|
804
804
|
|
|
805
|
-
class CheckoutSubscription extends BaseModel {
|
|
806
|
-
identifierFields() {
|
|
807
|
-
return ['id'];
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
__decorate([
|
|
811
|
-
Type(() => Address),
|
|
812
|
-
__metadata("design:type", Address)
|
|
813
|
-
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
814
|
-
__decorate([
|
|
815
|
-
Type(() => Address),
|
|
816
|
-
__metadata("design:type", Address)
|
|
817
|
-
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
818
|
-
__decorate([
|
|
819
|
-
Type(() => SubscriptionPlan),
|
|
820
|
-
__metadata("design:type", SubscriptionPlan)
|
|
821
|
-
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
822
|
-
__decorate([
|
|
823
|
-
Type(() => Coupon),
|
|
824
|
-
__metadata("design:type", Coupon)
|
|
805
|
+
class CheckoutSubscription extends BaseModel {
|
|
806
|
+
identifierFields() {
|
|
807
|
+
return ['id'];
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
__decorate([
|
|
811
|
+
Type(() => Address),
|
|
812
|
+
__metadata("design:type", Address)
|
|
813
|
+
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
814
|
+
__decorate([
|
|
815
|
+
Type(() => Address),
|
|
816
|
+
__metadata("design:type", Address)
|
|
817
|
+
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
818
|
+
__decorate([
|
|
819
|
+
Type(() => SubscriptionPlan),
|
|
820
|
+
__metadata("design:type", SubscriptionPlan)
|
|
821
|
+
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
822
|
+
__decorate([
|
|
823
|
+
Type(() => Coupon),
|
|
824
|
+
__metadata("design:type", Coupon)
|
|
825
825
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
826
826
|
|
|
827
|
-
class Buy2Win extends BaseModel {
|
|
828
|
-
identifierFields() {
|
|
829
|
-
return ['id'];
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
__decorate([
|
|
833
|
-
Type(() => Category),
|
|
834
|
-
__metadata("design:type", Array)
|
|
827
|
+
class Buy2Win extends BaseModel {
|
|
828
|
+
identifierFields() {
|
|
829
|
+
return ['id'];
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
__decorate([
|
|
833
|
+
Type(() => Category),
|
|
834
|
+
__metadata("design:type", Array)
|
|
835
835
|
], Buy2Win.prototype, "categories", void 0);
|
|
836
836
|
|
|
837
|
-
var FilterType;
|
|
838
|
-
(function (FilterType) {
|
|
839
|
-
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
840
|
-
FilterType["BEARD_PROBLEMS"] = "beardProblems";
|
|
841
|
-
FilterType["BEARD_SIZE"] = "beardSize";
|
|
842
|
-
FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
|
|
843
|
-
FilterType["BODY_PROBLEMS"] = "bodyProblems";
|
|
844
|
-
FilterType["BODY_SHAPE"] = "bodyShape";
|
|
845
|
-
FilterType["BODY_TATTOOS"] = "bodyTattoos";
|
|
846
|
-
FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
|
|
847
|
-
FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
|
|
848
|
-
FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
|
|
849
|
-
FilterType["FAMILY_INCOME"] = "familyIncome";
|
|
850
|
-
FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
|
|
851
|
-
FilterType["HAIR_COLOR"] = "hairColor";
|
|
852
|
-
FilterType["HAIR_PROBLEMS"] = "hairProblems";
|
|
853
|
-
FilterType["HAIR_STRANDS"] = "hairStrands";
|
|
854
|
-
FilterType["HAIR_TYPE"] = "hairType";
|
|
855
|
-
FilterType["PRODUCT_SPENT"] = "productSpent";
|
|
837
|
+
var FilterType;
|
|
838
|
+
(function (FilterType) {
|
|
839
|
+
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
840
|
+
FilterType["BEARD_PROBLEMS"] = "beardProblems";
|
|
841
|
+
FilterType["BEARD_SIZE"] = "beardSize";
|
|
842
|
+
FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
|
|
843
|
+
FilterType["BODY_PROBLEMS"] = "bodyProblems";
|
|
844
|
+
FilterType["BODY_SHAPE"] = "bodyShape";
|
|
845
|
+
FilterType["BODY_TATTOOS"] = "bodyTattoos";
|
|
846
|
+
FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
|
|
847
|
+
FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
|
|
848
|
+
FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
|
|
849
|
+
FilterType["FAMILY_INCOME"] = "familyIncome";
|
|
850
|
+
FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
|
|
851
|
+
FilterType["HAIR_COLOR"] = "hairColor";
|
|
852
|
+
FilterType["HAIR_PROBLEMS"] = "hairProblems";
|
|
853
|
+
FilterType["HAIR_STRANDS"] = "hairStrands";
|
|
854
|
+
FilterType["HAIR_TYPE"] = "hairType";
|
|
855
|
+
FilterType["PRODUCT_SPENT"] = "productSpent";
|
|
856
856
|
})(FilterType || (FilterType = {}));
|
|
857
857
|
|
|
858
|
-
var QuestionsFilters;
|
|
859
|
-
(function (QuestionsFilters) {
|
|
860
|
-
QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
|
|
861
|
-
QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
|
|
862
|
-
QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
|
|
863
|
-
QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
|
|
864
|
-
QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
|
|
865
|
-
QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
|
|
866
|
-
QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
|
|
867
|
-
QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
|
|
868
|
-
QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
|
|
869
|
-
QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
|
|
870
|
-
QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
|
|
871
|
-
QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
|
|
872
|
-
QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
|
|
873
|
-
QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
|
|
874
|
-
QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
|
|
875
|
-
QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
|
|
876
|
-
QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
|
|
858
|
+
var QuestionsFilters;
|
|
859
|
+
(function (QuestionsFilters) {
|
|
860
|
+
QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
|
|
861
|
+
QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
|
|
862
|
+
QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
|
|
863
|
+
QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
|
|
864
|
+
QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
|
|
865
|
+
QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
|
|
866
|
+
QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
|
|
867
|
+
QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
|
|
868
|
+
QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
|
|
869
|
+
QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
|
|
870
|
+
QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
|
|
871
|
+
QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
|
|
872
|
+
QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
|
|
873
|
+
QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
|
|
874
|
+
QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
|
|
875
|
+
QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
|
|
876
|
+
QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
|
|
877
877
|
})(QuestionsFilters || (QuestionsFilters = {}));
|
|
878
878
|
|
|
879
|
-
class BeautyQuestionsHelper {
|
|
880
|
-
static getAnswers(filter) {
|
|
881
|
-
switch (filter) {
|
|
882
|
-
case FilterType.ACCESSORY_IMPORTANCE:
|
|
883
|
-
return AccessoryImportances;
|
|
884
|
-
case FilterType.BEARD_PROBLEMS:
|
|
885
|
-
return BeardProblems;
|
|
886
|
-
case FilterType.BEARD_SIZE:
|
|
887
|
-
return BeardSizes;
|
|
888
|
-
case FilterType.BEAUTY_PRODUCT_IMPORTANCE:
|
|
889
|
-
return BeautyProductImportances;
|
|
890
|
-
case FilterType.BODY_PROBLEMS:
|
|
891
|
-
return BodyProblems;
|
|
892
|
-
case FilterType.BODY_SHAPE:
|
|
893
|
-
return BodyShapes;
|
|
894
|
-
case FilterType.BODY_TATTOOS:
|
|
895
|
-
return BodyTattoos;
|
|
896
|
-
case FilterType.FACE_SKIN_OILINESS:
|
|
897
|
-
return FaceSkinOilinesses;
|
|
898
|
-
case FilterType.FACE_SKIN_PROBLEMS:
|
|
899
|
-
return FaceSkinProblems;
|
|
900
|
-
case FilterType.FACE_SKIN_TONE:
|
|
901
|
-
return FaceSkinTones;
|
|
902
|
-
case FilterType.FAMILY_INCOME:
|
|
903
|
-
return FamilyIncomes;
|
|
904
|
-
case FilterType.FRAGRANCE_IMPORTANCE:
|
|
905
|
-
return FragranceImportances;
|
|
906
|
-
case FilterType.HAIR_COLOR:
|
|
907
|
-
return HairColors;
|
|
908
|
-
case FilterType.HAIR_PROBLEMS:
|
|
909
|
-
return HairProblems;
|
|
910
|
-
case FilterType.HAIR_STRANDS:
|
|
911
|
-
return HairStrands;
|
|
912
|
-
case FilterType.HAIR_TYPE:
|
|
913
|
-
return HairTypes;
|
|
914
|
-
case FilterType.PRODUCT_SPENT:
|
|
915
|
-
return ProductSpents;
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
static getQuestions(filter) {
|
|
919
|
-
return QuestionsFilters[filter];
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
class Home extends BaseModel {
|
|
924
|
-
identifierFields() {
|
|
925
|
-
return ['id'];
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
class ShopMenu extends BaseModel {
|
|
930
|
-
identifierFields() {
|
|
931
|
-
return ['id'];
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
class InvalidArgumentError extends Error {
|
|
936
|
-
constructor(message) {
|
|
937
|
-
super(message);
|
|
938
|
-
this.message = message;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
class RequiredArgumentError extends Error {
|
|
943
|
-
constructor(args) {
|
|
944
|
-
super(`Required arguments: ${args.join(', ')}`);
|
|
945
|
-
this.args = args;
|
|
946
|
-
this.arguments = args;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
class NotFoundError extends Error {
|
|
951
|
-
constructor(message) {
|
|
952
|
-
super(message);
|
|
953
|
-
this.message = message;
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
class DuplicatedResultsError extends Error {
|
|
958
|
-
constructor(message) {
|
|
959
|
-
super(message);
|
|
960
|
-
this.message = message;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
class AxiosAdapter {
|
|
965
|
-
constructor(config) {
|
|
966
|
-
this.config = config;
|
|
967
|
-
}
|
|
968
|
-
query(index, query) {
|
|
969
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
970
|
-
const { data } = yield axios({
|
|
971
|
-
url: `${this.config.url}/${index}`,
|
|
972
|
-
method: 'POST',
|
|
973
|
-
headers: { Authorization: `Basic ${this.config.credential}` },
|
|
974
|
-
data: query,
|
|
975
|
-
});
|
|
976
|
-
return {
|
|
977
|
-
total: data.hits.total.value,
|
|
978
|
-
hits: data.hits.hits,
|
|
979
|
-
};
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
class ProductsIndex {
|
|
985
|
-
constructor(adapter) {
|
|
986
|
-
this.adapter = adapter;
|
|
987
|
-
}
|
|
988
|
-
findById(ids, options) {
|
|
989
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
990
|
-
const publishedField = options.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
991
|
-
const fields = [
|
|
992
|
-
'brand',
|
|
993
|
-
'id',
|
|
994
|
-
'images',
|
|
995
|
-
'miniatures',
|
|
996
|
-
'name',
|
|
997
|
-
'price',
|
|
998
|
-
'sku',
|
|
999
|
-
'stock',
|
|
1000
|
-
'slug',
|
|
1001
|
-
'reviews',
|
|
1002
|
-
'pricePaid',
|
|
1003
|
-
'isGift',
|
|
1004
|
-
'stock',
|
|
1005
|
-
'weight',
|
|
1006
|
-
'tags',
|
|
1007
|
-
'hasVariants',
|
|
1008
|
-
];
|
|
1009
|
-
const { hits } = yield this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
|
|
1010
|
-
bool: {
|
|
1011
|
-
filter: [
|
|
1012
|
-
{
|
|
1013
|
-
terms: {
|
|
1014
|
-
_id: ids,
|
|
1015
|
-
},
|
|
1016
|
-
},
|
|
1017
|
-
{
|
|
1018
|
-
term: {
|
|
1019
|
-
[publishedField]: true,
|
|
1020
|
-
},
|
|
1021
|
-
},
|
|
1022
|
-
...(options.hasStock
|
|
1023
|
-
? [
|
|
1024
|
-
{
|
|
1025
|
-
range: {
|
|
1026
|
-
'stock.quantity': {
|
|
1027
|
-
gt: 0,
|
|
1028
|
-
},
|
|
1029
|
-
},
|
|
1030
|
-
},
|
|
1031
|
-
]
|
|
1032
|
-
: []),
|
|
1033
|
-
],
|
|
1034
|
-
},
|
|
1035
|
-
} }, (options.size ? { size: options.size } : {})));
|
|
1036
|
-
return hits.map((hit) => Product.toInstance(hit._source));
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
const withFirestore = (MixinBase) => {
|
|
1042
|
-
return class extends MixinBase {
|
|
1043
|
-
constructor(...args) {
|
|
1044
|
-
super(args);
|
|
1045
|
-
}
|
|
1046
|
-
collection(path) {
|
|
1047
|
-
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1048
|
-
}
|
|
1049
|
-
buildModelInstance() {
|
|
1050
|
-
return {
|
|
1051
|
-
toFirestore: (data) => ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data),
|
|
1052
|
-
fromFirestore: (snap) => {
|
|
1053
|
-
const data = snap.data();
|
|
1054
|
-
Object.keys(data).forEach((key) => {
|
|
1055
|
-
if (data[key] instanceof firebase.firestore.Timestamp) {
|
|
1056
|
-
data[key] = data[key].toDate();
|
|
1057
|
-
}
|
|
1058
|
-
});
|
|
1059
|
-
return this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
|
|
1060
|
-
},
|
|
1061
|
-
};
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
879
|
+
class BeautyQuestionsHelper {
|
|
880
|
+
static getAnswers(filter) {
|
|
881
|
+
switch (filter) {
|
|
882
|
+
case FilterType.ACCESSORY_IMPORTANCE:
|
|
883
|
+
return AccessoryImportances;
|
|
884
|
+
case FilterType.BEARD_PROBLEMS:
|
|
885
|
+
return BeardProblems;
|
|
886
|
+
case FilterType.BEARD_SIZE:
|
|
887
|
+
return BeardSizes;
|
|
888
|
+
case FilterType.BEAUTY_PRODUCT_IMPORTANCE:
|
|
889
|
+
return BeautyProductImportances;
|
|
890
|
+
case FilterType.BODY_PROBLEMS:
|
|
891
|
+
return BodyProblems;
|
|
892
|
+
case FilterType.BODY_SHAPE:
|
|
893
|
+
return BodyShapes;
|
|
894
|
+
case FilterType.BODY_TATTOOS:
|
|
895
|
+
return BodyTattoos;
|
|
896
|
+
case FilterType.FACE_SKIN_OILINESS:
|
|
897
|
+
return FaceSkinOilinesses;
|
|
898
|
+
case FilterType.FACE_SKIN_PROBLEMS:
|
|
899
|
+
return FaceSkinProblems;
|
|
900
|
+
case FilterType.FACE_SKIN_TONE:
|
|
901
|
+
return FaceSkinTones;
|
|
902
|
+
case FilterType.FAMILY_INCOME:
|
|
903
|
+
return FamilyIncomes;
|
|
904
|
+
case FilterType.FRAGRANCE_IMPORTANCE:
|
|
905
|
+
return FragranceImportances;
|
|
906
|
+
case FilterType.HAIR_COLOR:
|
|
907
|
+
return HairColors;
|
|
908
|
+
case FilterType.HAIR_PROBLEMS:
|
|
909
|
+
return HairProblems;
|
|
910
|
+
case FilterType.HAIR_STRANDS:
|
|
911
|
+
return HairStrands;
|
|
912
|
+
case FilterType.HAIR_TYPE:
|
|
913
|
+
return HairTypes;
|
|
914
|
+
case FilterType.PRODUCT_SPENT:
|
|
915
|
+
return ProductSpents;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
static getQuestions(filter) {
|
|
919
|
+
return QuestionsFilters[filter];
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
class Home extends BaseModel {
|
|
924
|
+
identifierFields() {
|
|
925
|
+
return ['id'];
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
class ShopMenu extends BaseModel {
|
|
930
|
+
identifierFields() {
|
|
931
|
+
return ['id'];
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
class InvalidArgumentError extends Error {
|
|
936
|
+
constructor(message) {
|
|
937
|
+
super(message);
|
|
938
|
+
this.message = message;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
class RequiredArgumentError extends Error {
|
|
943
|
+
constructor(args) {
|
|
944
|
+
super(`Required arguments: ${args.join(', ')}`);
|
|
945
|
+
this.args = args;
|
|
946
|
+
this.arguments = args;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
class NotFoundError extends Error {
|
|
951
|
+
constructor(message) {
|
|
952
|
+
super(message);
|
|
953
|
+
this.message = message;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
class DuplicatedResultsError extends Error {
|
|
958
|
+
constructor(message) {
|
|
959
|
+
super(message);
|
|
960
|
+
this.message = message;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
class AxiosAdapter {
|
|
965
|
+
constructor(config) {
|
|
966
|
+
this.config = config;
|
|
967
|
+
}
|
|
968
|
+
query(index, query) {
|
|
969
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
970
|
+
const { data } = yield axios({
|
|
971
|
+
url: `${this.config.url}/${index}`,
|
|
972
|
+
method: 'POST',
|
|
973
|
+
headers: { Authorization: `Basic ${this.config.credential}` },
|
|
974
|
+
data: query,
|
|
975
|
+
});
|
|
976
|
+
return {
|
|
977
|
+
total: data.hits.total.value,
|
|
978
|
+
hits: data.hits.hits,
|
|
979
|
+
};
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
class ProductsIndex {
|
|
985
|
+
constructor(adapter) {
|
|
986
|
+
this.adapter = adapter;
|
|
987
|
+
}
|
|
988
|
+
findById(ids, options) {
|
|
989
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
990
|
+
const publishedField = options.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
991
|
+
const fields = [
|
|
992
|
+
'brand',
|
|
993
|
+
'id',
|
|
994
|
+
'images',
|
|
995
|
+
'miniatures',
|
|
996
|
+
'name',
|
|
997
|
+
'price',
|
|
998
|
+
'sku',
|
|
999
|
+
'stock',
|
|
1000
|
+
'slug',
|
|
1001
|
+
'reviews',
|
|
1002
|
+
'pricePaid',
|
|
1003
|
+
'isGift',
|
|
1004
|
+
'stock',
|
|
1005
|
+
'weight',
|
|
1006
|
+
'tags',
|
|
1007
|
+
'hasVariants',
|
|
1008
|
+
];
|
|
1009
|
+
const { hits } = yield this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
|
|
1010
|
+
bool: {
|
|
1011
|
+
filter: [
|
|
1012
|
+
{
|
|
1013
|
+
terms: {
|
|
1014
|
+
_id: ids,
|
|
1015
|
+
},
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
term: {
|
|
1019
|
+
[publishedField]: true,
|
|
1020
|
+
},
|
|
1021
|
+
},
|
|
1022
|
+
...(options.hasStock
|
|
1023
|
+
? [
|
|
1024
|
+
{
|
|
1025
|
+
range: {
|
|
1026
|
+
'stock.quantity': {
|
|
1027
|
+
gt: 0,
|
|
1028
|
+
},
|
|
1029
|
+
},
|
|
1030
|
+
},
|
|
1031
|
+
]
|
|
1032
|
+
: []),
|
|
1033
|
+
],
|
|
1034
|
+
},
|
|
1035
|
+
} }, (options.size ? { size: options.size } : {})));
|
|
1036
|
+
return hits.map((hit) => Product.toInstance(hit._source));
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
const withFirestore = (MixinBase) => {
|
|
1042
|
+
return class extends MixinBase {
|
|
1043
|
+
constructor(...args) {
|
|
1044
|
+
super(args);
|
|
1045
|
+
}
|
|
1046
|
+
collection(path) {
|
|
1047
|
+
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1048
|
+
}
|
|
1049
|
+
buildModelInstance() {
|
|
1050
|
+
return {
|
|
1051
|
+
toFirestore: (data) => ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data),
|
|
1052
|
+
fromFirestore: (snap) => {
|
|
1053
|
+
const data = snap.data();
|
|
1054
|
+
Object.keys(data).forEach((key) => {
|
|
1055
|
+
if (data[key] instanceof firebase.firestore.Timestamp) {
|
|
1056
|
+
data[key] = data[key].toDate();
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
return this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
|
|
1060
|
+
},
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
1064
|
};
|
|
1065
1065
|
|
|
1066
|
-
const withHelpers = (MixinBase) => {
|
|
1067
|
-
return class extends MixinBase {
|
|
1068
|
-
toArray(snapShot) {
|
|
1069
|
-
if (Array.isArray(snapShot)) {
|
|
1070
|
-
return snapShot.map((doc) => doc.data());
|
|
1071
|
-
}
|
|
1072
|
-
else {
|
|
1073
|
-
return snapShot.docs.map((doc) => doc.data());
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
isSubCollection(repository) {
|
|
1077
|
-
return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1066
|
+
const withHelpers = (MixinBase) => {
|
|
1067
|
+
return class extends MixinBase {
|
|
1068
|
+
toArray(snapShot) {
|
|
1069
|
+
if (Array.isArray(snapShot)) {
|
|
1070
|
+
return snapShot.map((doc) => doc.data());
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
return snapShot.docs.map((doc) => doc.data());
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
isSubCollection(repository) {
|
|
1077
|
+
return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
1080
|
};
|
|
1081
1081
|
|
|
1082
|
-
const withGetFirestore = (MixinBase) => {
|
|
1083
|
-
return class GetFirestore extends MixinBase {
|
|
1084
|
-
get(identifiers) {
|
|
1085
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1086
|
-
const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1087
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1088
|
-
.get();
|
|
1089
|
-
const data = doc.data();
|
|
1090
|
-
if (isNil(data))
|
|
1091
|
-
throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
|
|
1092
|
-
return data;
|
|
1093
|
-
});
|
|
1094
|
-
}
|
|
1095
|
-
buildCollectionPathForGet(identifiers) {
|
|
1096
|
-
return this.isSubCollection(this)
|
|
1097
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1098
|
-
: this.collectionName;
|
|
1099
|
-
}
|
|
1100
|
-
};
|
|
1082
|
+
const withGetFirestore = (MixinBase) => {
|
|
1083
|
+
return class GetFirestore extends MixinBase {
|
|
1084
|
+
get(identifiers) {
|
|
1085
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1086
|
+
const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1087
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1088
|
+
.get();
|
|
1089
|
+
const data = doc.data();
|
|
1090
|
+
if (isNil(data))
|
|
1091
|
+
throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
|
|
1092
|
+
return data;
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
buildCollectionPathForGet(identifiers) {
|
|
1096
|
+
return this.isSubCollection(this)
|
|
1097
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1098
|
+
: this.collectionName;
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
1101
|
};
|
|
1102
1102
|
|
|
1103
|
-
const withFindFirestore = (MixinBase) => {
|
|
1104
|
-
const checkIfIsFilterOption = (filter) => !isNil(filter === null || filter === void 0 ? void 0 : filter.operator);
|
|
1105
|
-
const getValueFromFilter = (filter) => {
|
|
1106
|
-
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1107
|
-
};
|
|
1108
|
-
const getFinalValueFrom = (value) => isNumber(value) || isString(value) || isDate(value) || Array.isArray(value)
|
|
1109
|
-
? value
|
|
1110
|
-
: Object.values(getFinalValueFrom);
|
|
1111
|
-
return class FindFirestore extends MixinBase {
|
|
1112
|
-
constructor() {
|
|
1113
|
-
super(...arguments);
|
|
1114
|
-
this.makeFirestoreWhere = (queryReference, filter) => Object.keys(filter).reduce((query, fieldName) => this.buildWhereSentence(query, fieldName, filter[fieldName]), queryReference);
|
|
1115
|
-
this.buildWhereSentence = (queryReference, fieldName, options) => {
|
|
1116
|
-
if (this.isSubCollection(this) && fieldName === this.parentIdField)
|
|
1117
|
-
return queryReference;
|
|
1118
|
-
const value = (options === null || options === void 0 ? void 0 : options.value) || options;
|
|
1119
|
-
const object = {};
|
|
1120
|
-
set(object, fieldName, value);
|
|
1121
|
-
const plainInstance = new this.model(object).toPlain();
|
|
1122
|
-
const firestoreFieldName = fieldName.toString().indexOf('.') > -1
|
|
1123
|
-
? fieldName.toString()
|
|
1124
|
-
: Object.keys(plainInstance).find((key) => plainInstance[key]);
|
|
1125
|
-
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
|
|
1126
|
-
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1127
|
-
return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
|
|
1128
|
-
queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
|
|
1129
|
-
queryReference = queryReference.where(firestoreFieldName, '<=', `${options.value}~`);
|
|
1130
|
-
return queryReference;
|
|
1131
|
-
}
|
|
1132
|
-
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1133
|
-
return queryReference.where(firestoreFieldName, 'array-contains', options.value);
|
|
1134
|
-
if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value)) {
|
|
1135
|
-
return Object.keys(options).reduce((queryReferenceWithWhere, key) => this.buildWhereSentence(queryReferenceWithWhere, `${fieldName}.${key}`, options[key]), queryReference);
|
|
1136
|
-
}
|
|
1137
|
-
return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1138
|
-
};
|
|
1139
|
-
}
|
|
1140
|
-
find(filters, limits, orderBy) {
|
|
1141
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1142
|
-
let query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1143
|
-
filters === null || filters === void 0 ? void 0 : filters.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)));
|
|
1144
|
-
orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach((orderer) => Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))));
|
|
1145
|
-
query = yield this.defineLimits(query, filters, limits);
|
|
1146
|
-
const docs = yield query.get();
|
|
1147
|
-
const data = docs.docs.map((doc) => doc.data());
|
|
1148
|
-
return {
|
|
1149
|
-
data,
|
|
1150
|
-
count: this.calculateCount(data, limits),
|
|
1151
|
-
};
|
|
1152
|
-
});
|
|
1153
|
-
}
|
|
1154
|
-
buildCollectionPathForFind(filters) {
|
|
1155
|
-
var _a;
|
|
1156
|
-
if (!this.isSubCollection(this))
|
|
1157
|
-
return this.collectionName;
|
|
1158
|
-
const parentIdField = this.parentIdField;
|
|
1159
|
-
const parentId = getValueFromFilter((_a = filters.find((groupFilter) => Boolean(getValueFromFilter(groupFilter[parentIdField])))) === null || _a === void 0 ? void 0 : _a[parentIdField]);
|
|
1160
|
-
return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
|
|
1161
|
-
}
|
|
1162
|
-
defineLimits(query, filters, limits) {
|
|
1163
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1164
|
-
if (limits === null || limits === void 0 ? void 0 : limits.offset) {
|
|
1165
|
-
if (limits.offset instanceof this.model)
|
|
1166
|
-
query = query.startAfter(yield this.collection(this.buildCollectionPathForFind(filters))
|
|
1167
|
-
.doc(limits.offset[limits.offset.identifierFields().shift()])
|
|
1168
|
-
.get());
|
|
1169
|
-
else if (isNumber(limits.offset) || isString(limits.offset))
|
|
1170
|
-
query = query.startAt(limits.offset);
|
|
1171
|
-
}
|
|
1172
|
-
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1173
|
-
query = query.limit(limits.limit);
|
|
1174
|
-
return query;
|
|
1175
|
-
});
|
|
1176
|
-
}
|
|
1177
|
-
calculateCount(data, limits) {
|
|
1178
|
-
if (data.length <= 0)
|
|
1179
|
-
return 0;
|
|
1180
|
-
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1181
|
-
return data.length;
|
|
1182
|
-
return Infinity;
|
|
1183
|
-
}
|
|
1184
|
-
};
|
|
1103
|
+
const withFindFirestore = (MixinBase) => {
|
|
1104
|
+
const checkIfIsFilterOption = (filter) => !isNil(filter === null || filter === void 0 ? void 0 : filter.operator);
|
|
1105
|
+
const getValueFromFilter = (filter) => {
|
|
1106
|
+
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1107
|
+
};
|
|
1108
|
+
const getFinalValueFrom = (value) => isNumber(value) || isString(value) || isDate(value) || Array.isArray(value)
|
|
1109
|
+
? value
|
|
1110
|
+
: Object.values(getFinalValueFrom);
|
|
1111
|
+
return class FindFirestore extends MixinBase {
|
|
1112
|
+
constructor() {
|
|
1113
|
+
super(...arguments);
|
|
1114
|
+
this.makeFirestoreWhere = (queryReference, filter) => Object.keys(filter).reduce((query, fieldName) => this.buildWhereSentence(query, fieldName, filter[fieldName]), queryReference);
|
|
1115
|
+
this.buildWhereSentence = (queryReference, fieldName, options) => {
|
|
1116
|
+
if (this.isSubCollection(this) && fieldName === this.parentIdField)
|
|
1117
|
+
return queryReference;
|
|
1118
|
+
const value = (options === null || options === void 0 ? void 0 : options.value) || options;
|
|
1119
|
+
const object = {};
|
|
1120
|
+
set(object, fieldName, value);
|
|
1121
|
+
const plainInstance = new this.model(object).toPlain();
|
|
1122
|
+
const firestoreFieldName = fieldName.toString().indexOf('.') > -1
|
|
1123
|
+
? fieldName.toString()
|
|
1124
|
+
: Object.keys(plainInstance).find((key) => plainInstance[key]);
|
|
1125
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
|
|
1126
|
+
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1127
|
+
return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
|
|
1128
|
+
queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
|
|
1129
|
+
queryReference = queryReference.where(firestoreFieldName, '<=', `${options.value}~`);
|
|
1130
|
+
return queryReference;
|
|
1131
|
+
}
|
|
1132
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1133
|
+
return queryReference.where(firestoreFieldName, 'array-contains', options.value);
|
|
1134
|
+
if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value)) {
|
|
1135
|
+
return Object.keys(options).reduce((queryReferenceWithWhere, key) => this.buildWhereSentence(queryReferenceWithWhere, `${fieldName}.${key}`, options[key]), queryReference);
|
|
1136
|
+
}
|
|
1137
|
+
return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
find(filters, limits, orderBy) {
|
|
1141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1142
|
+
let query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1143
|
+
filters === null || filters === void 0 ? void 0 : filters.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)));
|
|
1144
|
+
orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach((orderer) => Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))));
|
|
1145
|
+
query = yield this.defineLimits(query, filters, limits);
|
|
1146
|
+
const docs = yield query.get();
|
|
1147
|
+
const data = docs.docs.map((doc) => doc.data());
|
|
1148
|
+
return {
|
|
1149
|
+
data,
|
|
1150
|
+
count: this.calculateCount(data, limits),
|
|
1151
|
+
};
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
buildCollectionPathForFind(filters) {
|
|
1155
|
+
var _a;
|
|
1156
|
+
if (!this.isSubCollection(this))
|
|
1157
|
+
return this.collectionName;
|
|
1158
|
+
const parentIdField = this.parentIdField;
|
|
1159
|
+
const parentId = getValueFromFilter((_a = filters.find((groupFilter) => Boolean(getValueFromFilter(groupFilter[parentIdField])))) === null || _a === void 0 ? void 0 : _a[parentIdField]);
|
|
1160
|
+
return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
|
|
1161
|
+
}
|
|
1162
|
+
defineLimits(query, filters, limits) {
|
|
1163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1164
|
+
if (limits === null || limits === void 0 ? void 0 : limits.offset) {
|
|
1165
|
+
if (limits.offset instanceof this.model)
|
|
1166
|
+
query = query.startAfter(yield this.collection(this.buildCollectionPathForFind(filters))
|
|
1167
|
+
.doc(limits.offset[limits.offset.identifierFields().shift()])
|
|
1168
|
+
.get());
|
|
1169
|
+
else if (isNumber(limits.offset) || isString(limits.offset))
|
|
1170
|
+
query = query.startAt(limits.offset);
|
|
1171
|
+
}
|
|
1172
|
+
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1173
|
+
query = query.limit(limits.limit);
|
|
1174
|
+
return query;
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
calculateCount(data, limits) {
|
|
1178
|
+
if (data.length <= 0)
|
|
1179
|
+
return 0;
|
|
1180
|
+
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1181
|
+
return data.length;
|
|
1182
|
+
return Infinity;
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
1185
|
};
|
|
1186
1186
|
|
|
1187
|
-
const withCreateFirestore = (MixinBase) => {
|
|
1188
|
-
return class CreateFirestore extends MixinBase {
|
|
1189
|
-
create(data) {
|
|
1190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1191
|
-
const docRef = yield this.save(this.model.toInstance(data));
|
|
1192
|
-
const doc = yield docRef.get();
|
|
1193
|
-
return doc.data();
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
save(data) {
|
|
1197
|
-
var _a;
|
|
1198
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1199
|
-
const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1200
|
-
const collectionPath = this.buildCollectionPathForAdd(data);
|
|
1201
|
-
if (isEmpty(id))
|
|
1202
|
-
return this.collection(collectionPath).add(data);
|
|
1203
|
-
const docRef = this.collection(collectionPath).doc(id);
|
|
1204
|
-
yield docRef.set(data);
|
|
1205
|
-
return docRef;
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
buildCollectionPathForAdd(identifiers) {
|
|
1209
|
-
return this.isSubCollection(this)
|
|
1210
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1211
|
-
: this.collectionName;
|
|
1212
|
-
}
|
|
1213
|
-
};
|
|
1187
|
+
const withCreateFirestore = (MixinBase) => {
|
|
1188
|
+
return class CreateFirestore extends MixinBase {
|
|
1189
|
+
create(data) {
|
|
1190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1191
|
+
const docRef = yield this.save(this.model.toInstance(data));
|
|
1192
|
+
const doc = yield docRef.get();
|
|
1193
|
+
return doc.data();
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
save(data) {
|
|
1197
|
+
var _a;
|
|
1198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1199
|
+
const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1200
|
+
const collectionPath = this.buildCollectionPathForAdd(data);
|
|
1201
|
+
if (isEmpty(id))
|
|
1202
|
+
return this.collection(collectionPath).add(data);
|
|
1203
|
+
const docRef = this.collection(collectionPath).doc(id);
|
|
1204
|
+
yield docRef.set(data);
|
|
1205
|
+
return docRef;
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
buildCollectionPathForAdd(identifiers) {
|
|
1209
|
+
return this.isSubCollection(this)
|
|
1210
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1211
|
+
: this.collectionName;
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
1214
|
};
|
|
1215
1215
|
|
|
1216
|
-
const withUpdateFirestore = (MixinBase) => {
|
|
1217
|
-
const getValueFromParams = (params, field) => { var _a; return (isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1218
|
-
const getValueByAction = (options) => {
|
|
1219
|
-
const fieldValues = firebase.firestore.FieldValue;
|
|
1220
|
-
if (isNil(options.action))
|
|
1221
|
-
return options;
|
|
1222
|
-
if (options.action === UpdateOptionActions.REMOVE_FIELD)
|
|
1223
|
-
return fieldValues.delete();
|
|
1224
|
-
if (Array.isArray(options.value)) {
|
|
1225
|
-
if (options.action === UpdateOptionActions.MERGE)
|
|
1226
|
-
return fieldValues.arrayUnion(...options.value);
|
|
1227
|
-
if (options.action === UpdateOptionActions.REMOVE)
|
|
1228
|
-
return fieldValues.arrayRemove(...options.value);
|
|
1229
|
-
}
|
|
1230
|
-
return options.value;
|
|
1231
|
-
};
|
|
1232
|
-
return class UpdateFirestore extends MixinBase {
|
|
1233
|
-
update(data) {
|
|
1234
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1235
|
-
const model = new this.model();
|
|
1236
|
-
const keyField = model.identifierFields().shift();
|
|
1237
|
-
const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1238
|
-
yield docRef.set(this.paramsToPlain(data), { merge: true });
|
|
1239
|
-
const doc = yield docRef.get();
|
|
1240
|
-
return doc.data();
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
buildCollectionPathForUpdate(identifiers) {
|
|
1244
|
-
return this.isSubCollection(this)
|
|
1245
|
-
? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
|
|
1246
|
-
: this.collectionName;
|
|
1247
|
-
}
|
|
1248
|
-
paramsToPlain(params) {
|
|
1249
|
-
const model = this.model;
|
|
1250
|
-
if (params instanceof model)
|
|
1251
|
-
return params;
|
|
1252
|
-
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1216
|
+
const withUpdateFirestore = (MixinBase) => {
|
|
1217
|
+
const getValueFromParams = (params, field) => { var _a; return (isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1218
|
+
const getValueByAction = (options) => {
|
|
1219
|
+
const fieldValues = firebase.firestore.FieldValue;
|
|
1220
|
+
if (isNil(options.action))
|
|
1221
|
+
return options;
|
|
1222
|
+
if (options.action === UpdateOptionActions.REMOVE_FIELD)
|
|
1223
|
+
return fieldValues.delete();
|
|
1224
|
+
if (Array.isArray(options.value)) {
|
|
1225
|
+
if (options.action === UpdateOptionActions.MERGE)
|
|
1226
|
+
return fieldValues.arrayUnion(...options.value);
|
|
1227
|
+
if (options.action === UpdateOptionActions.REMOVE)
|
|
1228
|
+
return fieldValues.arrayRemove(...options.value);
|
|
1229
|
+
}
|
|
1230
|
+
return options.value;
|
|
1231
|
+
};
|
|
1232
|
+
return class UpdateFirestore extends MixinBase {
|
|
1233
|
+
update(data) {
|
|
1234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1235
|
+
const model = new this.model();
|
|
1236
|
+
const keyField = model.identifierFields().shift();
|
|
1237
|
+
const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1238
|
+
yield docRef.set(this.paramsToPlain(data), { merge: true });
|
|
1239
|
+
const doc = yield docRef.get();
|
|
1240
|
+
return doc.data();
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
buildCollectionPathForUpdate(identifiers) {
|
|
1244
|
+
return this.isSubCollection(this)
|
|
1245
|
+
? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
|
|
1246
|
+
: this.collectionName;
|
|
1247
|
+
}
|
|
1248
|
+
paramsToPlain(params) {
|
|
1249
|
+
const model = this.model;
|
|
1250
|
+
if (params instanceof model)
|
|
1251
|
+
return params;
|
|
1252
|
+
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
1255
|
};
|
|
1256
1256
|
|
|
1257
|
-
const withDeleteFirestore = (MixinBase) => {
|
|
1258
|
-
return class DeleteFirestore extends MixinBase {
|
|
1259
|
-
delete(identifiers) {
|
|
1260
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1261
|
-
yield this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1262
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1263
|
-
.delete();
|
|
1264
|
-
});
|
|
1265
|
-
}
|
|
1266
|
-
buildCollectionPathForRemove(identifiers) {
|
|
1267
|
-
return this.isSubCollection(this)
|
|
1268
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1269
|
-
: this.collectionName;
|
|
1270
|
-
}
|
|
1271
|
-
};
|
|
1257
|
+
const withDeleteFirestore = (MixinBase) => {
|
|
1258
|
+
return class DeleteFirestore extends MixinBase {
|
|
1259
|
+
delete(identifiers) {
|
|
1260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1261
|
+
yield this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1262
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1263
|
+
.delete();
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
buildCollectionPathForRemove(identifiers) {
|
|
1267
|
+
return this.isSubCollection(this)
|
|
1268
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1269
|
+
: this.collectionName;
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
1272
|
};
|
|
1273
1273
|
|
|
1274
|
-
const withSubCollection = (MixinBase, ParentModel) => {
|
|
1275
|
-
return class SubCollectionMix extends MixinBase {
|
|
1276
|
-
constructor(...args) {
|
|
1277
|
-
super(args);
|
|
1278
|
-
}
|
|
1279
|
-
collection(path) {
|
|
1280
|
-
return super.collection(path);
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1274
|
+
const withSubCollection = (MixinBase, ParentModel) => {
|
|
1275
|
+
return class SubCollectionMix extends MixinBase {
|
|
1276
|
+
constructor(...args) {
|
|
1277
|
+
super(args);
|
|
1278
|
+
}
|
|
1279
|
+
collection(path) {
|
|
1280
|
+
return super.collection(path);
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
1283
|
};
|
|
1284
1284
|
|
|
1285
|
-
const withCrudFirestore = (MixinBase) => {
|
|
1286
|
-
return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
|
|
1287
|
-
};
|
|
1285
|
+
const withCrudFirestore = (MixinBase) => {
|
|
1286
|
+
return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
|
|
1287
|
+
};
|
|
1288
1288
|
};
|
|
1289
1289
|
|
|
1290
|
-
class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1291
|
-
constructor(firestore) {
|
|
1292
|
-
super();
|
|
1293
|
-
this.firestore = firestore;
|
|
1294
|
-
this.collectionName = 'subscription';
|
|
1295
|
-
this.model = Subscription;
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
class UserSearch extends BaseModel {
|
|
1300
|
-
identifierFields() {
|
|
1301
|
-
return ['id'];
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
class UserSearchFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1306
|
-
constructor(firestore) {
|
|
1307
|
-
super();
|
|
1308
|
-
this.firestore = firestore;
|
|
1309
|
-
this.collectionName = 'userSearch';
|
|
1310
|
-
this.model = UserSearch;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1315
|
-
constructor(firestore, userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore)) {
|
|
1316
|
-
super();
|
|
1317
|
-
this.firestore = firestore;
|
|
1318
|
-
this.userSearchFirestoreRepository = userSearchFirestoreRepository;
|
|
1319
|
-
this.collectionName = 'users';
|
|
1320
|
-
this.model = User;
|
|
1321
|
-
}
|
|
1322
|
-
get(identifiers) {
|
|
1323
|
-
const _super = Object.create(null, {
|
|
1324
|
-
get: { get: () => super.get }
|
|
1325
|
-
});
|
|
1326
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1327
|
-
const user = yield _super.get.call(this, { id: identifiers.id });
|
|
1328
|
-
user.beautyProfile = yield this.getBeautyProfile(user.id);
|
|
1329
|
-
user.isSubscriber = yield this.checkIfIsSubscriber(user.id);
|
|
1330
|
-
return user;
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
checkIfExistsByField(field, value) {
|
|
1334
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1335
|
-
const result = yield this.userSearchFirestoreRepository.find([{ [field]: { operator: Where.EQUALS, value } }]);
|
|
1336
|
-
return result.count > 0;
|
|
1337
|
-
});
|
|
1338
|
-
}
|
|
1339
|
-
buildModelInstance() {
|
|
1340
|
-
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1341
|
-
return {
|
|
1342
|
-
toFirestore: (data) => {
|
|
1343
|
-
const plain = toFirestore(data);
|
|
1344
|
-
delete plain.isSubscriber;
|
|
1345
|
-
return plain;
|
|
1346
|
-
},
|
|
1347
|
-
fromFirestore,
|
|
1348
|
-
};
|
|
1349
|
-
}
|
|
1350
|
-
getBeautyProfile(userId) {
|
|
1351
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1352
|
-
const beautyProfile = yield this.collection()
|
|
1353
|
-
.doc(userId)
|
|
1354
|
-
.collection('CX')
|
|
1355
|
-
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1356
|
-
.doc('beautyProfile')
|
|
1357
|
-
.get();
|
|
1358
|
-
return beautyProfile.data();
|
|
1359
|
-
});
|
|
1360
|
-
}
|
|
1361
|
-
checkIfIsSubscriber(userId) {
|
|
1362
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1363
|
-
const docs = yield this.firestore
|
|
1364
|
-
.collection('subscription')
|
|
1365
|
-
.where('user.id', '==', userId)
|
|
1366
|
-
.where('status', '==', 'active')
|
|
1367
|
-
.get();
|
|
1368
|
-
return !!docs && !!docs.size;
|
|
1369
|
-
});
|
|
1370
|
-
}
|
|
1371
|
-
buildBeautyProfileModelInstance() {
|
|
1372
|
-
return {
|
|
1373
|
-
toFirestore: (data) => data.toPlain(),
|
|
1374
|
-
fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
|
|
1375
|
-
};
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1380
|
-
constructor(firestore, parentRepository) {
|
|
1381
|
-
super();
|
|
1382
|
-
this.firestore = firestore;
|
|
1383
|
-
this.parentRepository = parentRepository;
|
|
1384
|
-
this.collectionName = 'editions';
|
|
1385
|
-
this.parentIdField = 'subscriptionId';
|
|
1386
|
-
this.model = Edition;
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1391
|
-
constructor(firestore, parentRepository) {
|
|
1392
|
-
super();
|
|
1393
|
-
this.firestore = firestore;
|
|
1394
|
-
this.parentRepository = parentRepository;
|
|
1395
|
-
this.collectionName = 'CX';
|
|
1396
|
-
this.parentIdField = 'userId';
|
|
1397
|
-
this.model = BeautyProfile;
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1402
|
-
constructor(firestore, parentRepository) {
|
|
1403
|
-
super();
|
|
1404
|
-
this.firestore = firestore;
|
|
1405
|
-
this.parentRepository = parentRepository;
|
|
1406
|
-
this.collectionName = 'address';
|
|
1407
|
-
this.parentIdField = 'userId';
|
|
1408
|
-
this.model = UserAddress;
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1413
|
-
constructor(firestore, parentRepository) {
|
|
1414
|
-
super();
|
|
1415
|
-
this.firestore = firestore;
|
|
1416
|
-
this.parentRepository = parentRepository;
|
|
1417
|
-
this.collectionName = 'payment_method';
|
|
1418
|
-
this.parentIdField = 'userId';
|
|
1419
|
-
this.model = UserPaymentMethod;
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1424
|
-
constructor(firestore, parentRepository) {
|
|
1425
|
-
super();
|
|
1426
|
-
this.firestore = firestore;
|
|
1427
|
-
this.parentRepository = parentRepository;
|
|
1428
|
-
this.collectionName = 'payments';
|
|
1429
|
-
this.parentIdField = 'subscriptionId';
|
|
1430
|
-
this.model = SubscriptionPayment;
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1435
|
-
constructor(firestore) {
|
|
1436
|
-
super();
|
|
1437
|
-
this.firestore = firestore;
|
|
1438
|
-
this.collectionName = 'leads';
|
|
1439
|
-
this.model = Lead;
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1444
|
-
constructor(firestore) {
|
|
1445
|
-
super();
|
|
1446
|
-
this.firestore = firestore;
|
|
1447
|
-
this.collectionName = 'categories';
|
|
1448
|
-
this.model = Category;
|
|
1449
|
-
}
|
|
1450
|
-
getCategoryBySlug(slug, shop) {
|
|
1451
|
-
return this.collection(this.collectionName)
|
|
1452
|
-
.where('slug', '==', slug)
|
|
1453
|
-
.where('shop', '==', shop)
|
|
1454
|
-
.where('published', '==', true)
|
|
1455
|
-
.get()
|
|
1456
|
-
.then((snap) => {
|
|
1457
|
-
if (snap.size > 1)
|
|
1458
|
-
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
1459
|
-
if (snap.empty)
|
|
1460
|
-
throw new NotFoundError(`Document with slug ${slug} not found`);
|
|
1461
|
-
return snap.docs[0].data();
|
|
1462
|
-
})
|
|
1463
|
-
.catch((error) => error);
|
|
1464
|
-
}
|
|
1465
|
-
getCategoriesForHome(categoryIds, limit = 4) {
|
|
1466
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1467
|
-
const categorySnap = yield this.collection(this.collectionName)
|
|
1468
|
-
.where('id', 'in', categoryIds.filter(Boolean))
|
|
1469
|
-
.where('published', '==', true)
|
|
1470
|
-
.get();
|
|
1471
|
-
if (categorySnap.empty)
|
|
1472
|
-
throw new NotFoundError('Categories not found');
|
|
1473
|
-
const categories = categorySnap.docs.map((doc) => doc.data());
|
|
1474
|
-
const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
|
|
1475
|
-
return ({
|
|
1476
|
-
category,
|
|
1477
|
-
products: yield this.mountCategory(category, { limit, hasStock: true }),
|
|
1478
|
-
});
|
|
1479
|
-
})));
|
|
1480
|
-
return homeSections;
|
|
1481
|
-
});
|
|
1482
|
-
}
|
|
1483
|
-
mountCategory(category, options) {
|
|
1484
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1485
|
-
if (!category.products)
|
|
1486
|
-
throw new RequiredArgumentError(['Category products is empty']);
|
|
1487
|
-
const chunks = chunk(category.products, 10);
|
|
1488
|
-
const products = [];
|
|
1489
|
-
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1490
|
-
for (const productIds of chunks) {
|
|
1491
|
-
if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
|
|
1492
|
-
break;
|
|
1493
|
-
let query = yield this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds);
|
|
1494
|
-
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
1495
|
-
query = query.where('stock.quantity', '>', 0);
|
|
1496
|
-
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
1497
|
-
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
1498
|
-
const productSnap = yield query.get();
|
|
1499
|
-
if (productSnap.empty)
|
|
1500
|
-
continue;
|
|
1501
|
-
products.push(...productSnap.docs.map((doc) => doc.data()));
|
|
1502
|
-
}
|
|
1503
|
-
return products;
|
|
1504
|
-
});
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1509
|
-
constructor(firestore) {
|
|
1510
|
-
super();
|
|
1511
|
-
this.firestore = firestore;
|
|
1512
|
-
this.collectionName = 'products';
|
|
1513
|
-
this.model = Product;
|
|
1514
|
-
}
|
|
1515
|
-
getBySlug(slug, shop) {
|
|
1516
|
-
var _a;
|
|
1517
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1518
|
-
const result = yield this.find([
|
|
1519
|
-
{ slug: { operator: Where.EQUALS, value: slug } },
|
|
1520
|
-
{ shopAvailability: { operator: Where.IN, value: [shop] } },
|
|
1521
|
-
]);
|
|
1522
|
-
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
|
|
1528
|
-
constructor(firestore, parentRepository) {
|
|
1529
|
-
super();
|
|
1530
|
-
this.firestore = firestore;
|
|
1531
|
-
this.parentRepository = parentRepository;
|
|
1532
|
-
this.collectionName = 'variants';
|
|
1533
|
-
this.parentIdField = 'productId';
|
|
1534
|
-
this.model = Variant;
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1539
|
-
constructor(firestore) {
|
|
1540
|
-
super();
|
|
1541
|
-
this.firestore = firestore;
|
|
1542
|
-
this.collectionName = 'subscriptionProducts';
|
|
1543
|
-
this.model = Product;
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1548
|
-
constructor(firestore) {
|
|
1549
|
-
super();
|
|
1550
|
-
this.firestore = firestore;
|
|
1551
|
-
this.collectionName = 'checkouts';
|
|
1552
|
-
this.model = Checkout;
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1557
|
-
constructor(firestore) {
|
|
1558
|
-
super();
|
|
1559
|
-
this.firestore = firestore;
|
|
1560
|
-
this.collectionName = 'coupons';
|
|
1561
|
-
this.model = Coupon;
|
|
1562
|
-
}
|
|
1563
|
-
buildModelInstance() {
|
|
1564
|
-
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1565
|
-
return {
|
|
1566
|
-
toFirestore: (data) => {
|
|
1567
|
-
const plain = toFirestore(data);
|
|
1568
|
-
if (!!data.expiresIn)
|
|
1569
|
-
plain.expiresIn = data.expiresIn.getTime();
|
|
1570
|
-
return plain;
|
|
1571
|
-
},
|
|
1572
|
-
fromFirestore: (snap) => {
|
|
1573
|
-
const instance = fromFirestore(snap);
|
|
1574
|
-
if (!isNil(instance.expiresIn))
|
|
1575
|
-
instance.expiresIn = new Date(snap.data().expiresIn);
|
|
1576
|
-
return instance;
|
|
1577
|
-
},
|
|
1578
|
-
};
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1583
|
-
constructor(firestore) {
|
|
1584
|
-
super();
|
|
1585
|
-
this.firestore = firestore;
|
|
1586
|
-
this.collectionName = 'orders';
|
|
1587
|
-
this.model = Order;
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1592
|
-
constructor(firestore) {
|
|
1593
|
-
super();
|
|
1594
|
-
this.firestore = firestore;
|
|
1595
|
-
this.collectionName = 'payments';
|
|
1596
|
-
this.model = Payment;
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1601
|
-
constructor(firestore) {
|
|
1602
|
-
super();
|
|
1603
|
-
this.firestore = firestore;
|
|
1604
|
-
this.collectionName = 'checkoutsSubscription';
|
|
1605
|
-
this.model = CheckoutSubscription;
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1610
|
-
constructor(firestore) {
|
|
1611
|
-
super();
|
|
1612
|
-
this.firestore = firestore;
|
|
1613
|
-
this.collectionName = 'subscriptionPlans';
|
|
1614
|
-
this.model = SubscriptionPlan;
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1619
|
-
constructor(firestore) {
|
|
1620
|
-
super();
|
|
1621
|
-
this.firestore = firestore;
|
|
1622
|
-
this.collectionName = 'buy2win';
|
|
1623
|
-
this.model = Buy2Win;
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
1628
|
-
constructor(firestore) {
|
|
1629
|
-
super(firestore);
|
|
1630
|
-
this.firestore = firestore;
|
|
1631
|
-
this.collectionName = 'legacyOrders';
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1636
|
-
constructor(firestore) {
|
|
1637
|
-
super();
|
|
1638
|
-
this.firestore = firestore;
|
|
1639
|
-
this.homeToFirestore = (home) => {
|
|
1640
|
-
var _a;
|
|
1641
|
-
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1642
|
-
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.homeCategoryGroupToPlain);
|
|
1643
|
-
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.homeCategoryGroupToPlain);
|
|
1644
|
-
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.homeCategoryGroupToPlain);
|
|
1645
|
-
}
|
|
1646
|
-
return home;
|
|
1647
|
-
};
|
|
1648
|
-
this.homeCategoryGroupToPlain = (homeCategoryGroup) => ({
|
|
1649
|
-
category: homeCategoryGroup.category.toPlain(),
|
|
1650
|
-
products: homeCategoryGroup.products.map((product) => product.toPlain()),
|
|
1651
|
-
});
|
|
1652
|
-
this.homeFromFirestore = (home) => {
|
|
1653
|
-
var _a;
|
|
1654
|
-
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1655
|
-
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.plainToHomeCategoryGroup);
|
|
1656
|
-
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.plainToHomeCategoryGroup);
|
|
1657
|
-
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.plainToHomeCategoryGroup);
|
|
1658
|
-
home.data.createdAt =
|
|
1659
|
-
home.data.createdAt instanceof firebase.firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
|
|
1660
|
-
home.data.expiresAt =
|
|
1661
|
-
home.data.expiresAt instanceof firebase.firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
|
|
1662
|
-
}
|
|
1663
|
-
return home;
|
|
1664
|
-
};
|
|
1665
|
-
this.plainToHomeCategoryGroup = (homeCategoryGroup) => ({
|
|
1666
|
-
category: Category.toInstance(homeCategoryGroup.category),
|
|
1667
|
-
products: homeCategoryGroup.products.map((product) => Product.toInstance(product)),
|
|
1668
|
-
});
|
|
1669
|
-
this.collectionName = 'dms';
|
|
1670
|
-
this.model = Home;
|
|
1671
|
-
}
|
|
1672
|
-
buildModelInstance() {
|
|
1673
|
-
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1674
|
-
return {
|
|
1675
|
-
toFirestore: (data) => {
|
|
1676
|
-
const modifiedData = this.homeToFirestore(data);
|
|
1677
|
-
return toFirestore(modifiedData);
|
|
1678
|
-
},
|
|
1679
|
-
fromFirestore: (snap) => {
|
|
1680
|
-
const instance = fromFirestore(snap);
|
|
1681
|
-
return this.homeFromFirestore(instance);
|
|
1682
|
-
},
|
|
1683
|
-
};
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1688
|
-
constructor(firestore) {
|
|
1689
|
-
super();
|
|
1690
|
-
this.firestore = firestore;
|
|
1691
|
-
this.collectionName = 'shopMenus';
|
|
1692
|
-
this.model = ShopMenu;
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
class AuthenticationFirebaseAuthService {
|
|
1697
|
-
constructor(firebaseAuth) {
|
|
1698
|
-
this.firebaseAuth = firebaseAuth;
|
|
1699
|
-
}
|
|
1700
|
-
signInWithEmailAndPassword(data) {
|
|
1701
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1702
|
-
const credentials = yield this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password);
|
|
1703
|
-
const user = credentials.user;
|
|
1704
|
-
return {
|
|
1705
|
-
id: user.uid,
|
|
1706
|
-
displayName: user.displayName,
|
|
1707
|
-
email: user.email,
|
|
1708
|
-
phone: user.phoneNumber,
|
|
1709
|
-
isAnonymous: false,
|
|
1710
|
-
};
|
|
1711
|
-
});
|
|
1712
|
-
}
|
|
1713
|
-
signInWithGoogle() {
|
|
1714
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1715
|
-
const credentials = yield this.firebaseAuth.signInWithPopup(new firebase$1.auth.GoogleAuthProvider());
|
|
1716
|
-
const user = credentials.user;
|
|
1717
|
-
return {
|
|
1718
|
-
id: user.uid,
|
|
1719
|
-
displayName: user.displayName,
|
|
1720
|
-
email: user.email,
|
|
1721
|
-
phone: user.phoneNumber,
|
|
1722
|
-
isAnonymous: false,
|
|
1723
|
-
};
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
signOut() {
|
|
1727
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1728
|
-
this.firebaseAuth.signOut();
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1731
|
-
signInAnonymously() {
|
|
1732
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1733
|
-
const auth = yield this.firebaseAuth.signInAnonymously();
|
|
1734
|
-
const user = auth.user;
|
|
1735
|
-
user.id = auth.user.uid;
|
|
1736
|
-
return user;
|
|
1737
|
-
});
|
|
1738
|
-
}
|
|
1739
|
-
sendPasswordResetEmail(email) {
|
|
1740
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1741
|
-
return this.firebaseAuth.sendPasswordResetEmail(email);
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
class RegisterFirebaseAuthService {
|
|
1747
|
-
constructor(firebaseAuth) {
|
|
1748
|
-
this.firebaseAuth = firebaseAuth;
|
|
1749
|
-
}
|
|
1750
|
-
register(params) {
|
|
1751
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1752
|
-
try {
|
|
1753
|
-
const auth = yield this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password);
|
|
1754
|
-
const user = auth.user;
|
|
1755
|
-
user.sendEmailVerification();
|
|
1756
|
-
user.id = auth.user.uid;
|
|
1757
|
-
return user;
|
|
1758
|
-
}
|
|
1759
|
-
catch (error) {
|
|
1760
|
-
if (error.code === 'auth/email-already-in-use')
|
|
1761
|
-
throw new UserAlreadyRegisteredError('Email already registered');
|
|
1762
|
-
if (error.code === 'auth/weak-password')
|
|
1763
|
-
throw new WeakPasswordError();
|
|
1764
|
-
throw error;
|
|
1765
|
-
}
|
|
1766
|
-
});
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
/**
|
|
1771
|
-
* Generated bundle index. Do not edit.
|
|
1290
|
+
class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1291
|
+
constructor(firestore) {
|
|
1292
|
+
super();
|
|
1293
|
+
this.firestore = firestore;
|
|
1294
|
+
this.collectionName = 'subscription';
|
|
1295
|
+
this.model = Subscription;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
class UserSearch extends BaseModel {
|
|
1300
|
+
identifierFields() {
|
|
1301
|
+
return ['id'];
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
class UserSearchFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1306
|
+
constructor(firestore) {
|
|
1307
|
+
super();
|
|
1308
|
+
this.firestore = firestore;
|
|
1309
|
+
this.collectionName = 'userSearch';
|
|
1310
|
+
this.model = UserSearch;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1315
|
+
constructor(firestore, userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore)) {
|
|
1316
|
+
super();
|
|
1317
|
+
this.firestore = firestore;
|
|
1318
|
+
this.userSearchFirestoreRepository = userSearchFirestoreRepository;
|
|
1319
|
+
this.collectionName = 'users';
|
|
1320
|
+
this.model = User;
|
|
1321
|
+
}
|
|
1322
|
+
get(identifiers) {
|
|
1323
|
+
const _super = Object.create(null, {
|
|
1324
|
+
get: { get: () => super.get }
|
|
1325
|
+
});
|
|
1326
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1327
|
+
const user = yield _super.get.call(this, { id: identifiers.id });
|
|
1328
|
+
user.beautyProfile = yield this.getBeautyProfile(user.id);
|
|
1329
|
+
user.isSubscriber = yield this.checkIfIsSubscriber(user.id);
|
|
1330
|
+
return user;
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
checkIfExistsByField(field, value) {
|
|
1334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1335
|
+
const result = yield this.userSearchFirestoreRepository.find([{ [field]: { operator: Where.EQUALS, value } }]);
|
|
1336
|
+
return result.count > 0;
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
buildModelInstance() {
|
|
1340
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1341
|
+
return {
|
|
1342
|
+
toFirestore: (data) => {
|
|
1343
|
+
const plain = toFirestore(data);
|
|
1344
|
+
delete plain.isSubscriber;
|
|
1345
|
+
return plain;
|
|
1346
|
+
},
|
|
1347
|
+
fromFirestore,
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
getBeautyProfile(userId) {
|
|
1351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1352
|
+
const beautyProfile = yield this.collection()
|
|
1353
|
+
.doc(userId)
|
|
1354
|
+
.collection('CX')
|
|
1355
|
+
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1356
|
+
.doc('beautyProfile')
|
|
1357
|
+
.get();
|
|
1358
|
+
return beautyProfile.data();
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
checkIfIsSubscriber(userId) {
|
|
1362
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1363
|
+
const docs = yield this.firestore
|
|
1364
|
+
.collection('subscription')
|
|
1365
|
+
.where('user.id', '==', userId)
|
|
1366
|
+
.where('status', '==', 'active')
|
|
1367
|
+
.get();
|
|
1368
|
+
return !!docs && !!docs.size;
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
buildBeautyProfileModelInstance() {
|
|
1372
|
+
return {
|
|
1373
|
+
toFirestore: (data) => data.toPlain(),
|
|
1374
|
+
fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1380
|
+
constructor(firestore, parentRepository) {
|
|
1381
|
+
super();
|
|
1382
|
+
this.firestore = firestore;
|
|
1383
|
+
this.parentRepository = parentRepository;
|
|
1384
|
+
this.collectionName = 'editions';
|
|
1385
|
+
this.parentIdField = 'subscriptionId';
|
|
1386
|
+
this.model = Edition;
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1391
|
+
constructor(firestore, parentRepository) {
|
|
1392
|
+
super();
|
|
1393
|
+
this.firestore = firestore;
|
|
1394
|
+
this.parentRepository = parentRepository;
|
|
1395
|
+
this.collectionName = 'CX';
|
|
1396
|
+
this.parentIdField = 'userId';
|
|
1397
|
+
this.model = BeautyProfile;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1402
|
+
constructor(firestore, parentRepository) {
|
|
1403
|
+
super();
|
|
1404
|
+
this.firestore = firestore;
|
|
1405
|
+
this.parentRepository = parentRepository;
|
|
1406
|
+
this.collectionName = 'address';
|
|
1407
|
+
this.parentIdField = 'userId';
|
|
1408
|
+
this.model = UserAddress;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1413
|
+
constructor(firestore, parentRepository) {
|
|
1414
|
+
super();
|
|
1415
|
+
this.firestore = firestore;
|
|
1416
|
+
this.parentRepository = parentRepository;
|
|
1417
|
+
this.collectionName = 'payment_method';
|
|
1418
|
+
this.parentIdField = 'userId';
|
|
1419
|
+
this.model = UserPaymentMethod;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1424
|
+
constructor(firestore, parentRepository) {
|
|
1425
|
+
super();
|
|
1426
|
+
this.firestore = firestore;
|
|
1427
|
+
this.parentRepository = parentRepository;
|
|
1428
|
+
this.collectionName = 'payments';
|
|
1429
|
+
this.parentIdField = 'subscriptionId';
|
|
1430
|
+
this.model = SubscriptionPayment;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1435
|
+
constructor(firestore) {
|
|
1436
|
+
super();
|
|
1437
|
+
this.firestore = firestore;
|
|
1438
|
+
this.collectionName = 'leads';
|
|
1439
|
+
this.model = Lead;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1444
|
+
constructor(firestore) {
|
|
1445
|
+
super();
|
|
1446
|
+
this.firestore = firestore;
|
|
1447
|
+
this.collectionName = 'categories';
|
|
1448
|
+
this.model = Category;
|
|
1449
|
+
}
|
|
1450
|
+
getCategoryBySlug(slug, shop) {
|
|
1451
|
+
return this.collection(this.collectionName)
|
|
1452
|
+
.where('slug', '==', slug)
|
|
1453
|
+
.where('shop', '==', shop)
|
|
1454
|
+
.where('published', '==', true)
|
|
1455
|
+
.get()
|
|
1456
|
+
.then((snap) => {
|
|
1457
|
+
if (snap.size > 1)
|
|
1458
|
+
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
1459
|
+
if (snap.empty)
|
|
1460
|
+
throw new NotFoundError(`Document with slug ${slug} not found`);
|
|
1461
|
+
return snap.docs[0].data();
|
|
1462
|
+
})
|
|
1463
|
+
.catch((error) => error);
|
|
1464
|
+
}
|
|
1465
|
+
getCategoriesForHome(categoryIds, limit = 4) {
|
|
1466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1467
|
+
const categorySnap = yield this.collection(this.collectionName)
|
|
1468
|
+
.where('id', 'in', categoryIds.filter(Boolean))
|
|
1469
|
+
.where('published', '==', true)
|
|
1470
|
+
.get();
|
|
1471
|
+
if (categorySnap.empty)
|
|
1472
|
+
throw new NotFoundError('Categories not found');
|
|
1473
|
+
const categories = categorySnap.docs.map((doc) => doc.data());
|
|
1474
|
+
const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
|
|
1475
|
+
return ({
|
|
1476
|
+
category,
|
|
1477
|
+
products: yield this.mountCategory(category, { limit, hasStock: true }),
|
|
1478
|
+
});
|
|
1479
|
+
})));
|
|
1480
|
+
return homeSections;
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
mountCategory(category, options) {
|
|
1484
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1485
|
+
if (!category.products)
|
|
1486
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
1487
|
+
const chunks = chunk(category.products, 10);
|
|
1488
|
+
const products = [];
|
|
1489
|
+
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1490
|
+
for (const productIds of chunks) {
|
|
1491
|
+
if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
|
|
1492
|
+
break;
|
|
1493
|
+
let query = yield this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds);
|
|
1494
|
+
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
1495
|
+
query = query.where('stock.quantity', '>', 0);
|
|
1496
|
+
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
1497
|
+
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
1498
|
+
const productSnap = yield query.get();
|
|
1499
|
+
if (productSnap.empty)
|
|
1500
|
+
continue;
|
|
1501
|
+
products.push(...productSnap.docs.map((doc) => doc.data()));
|
|
1502
|
+
}
|
|
1503
|
+
return products;
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1509
|
+
constructor(firestore) {
|
|
1510
|
+
super();
|
|
1511
|
+
this.firestore = firestore;
|
|
1512
|
+
this.collectionName = 'products';
|
|
1513
|
+
this.model = Product;
|
|
1514
|
+
}
|
|
1515
|
+
getBySlug(slug, shop) {
|
|
1516
|
+
var _a;
|
|
1517
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1518
|
+
const result = yield this.find([
|
|
1519
|
+
{ slug: { operator: Where.EQUALS, value: slug } },
|
|
1520
|
+
{ shopAvailability: { operator: Where.IN, value: [shop] } },
|
|
1521
|
+
]);
|
|
1522
|
+
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
|
|
1528
|
+
constructor(firestore, parentRepository) {
|
|
1529
|
+
super();
|
|
1530
|
+
this.firestore = firestore;
|
|
1531
|
+
this.parentRepository = parentRepository;
|
|
1532
|
+
this.collectionName = 'variants';
|
|
1533
|
+
this.parentIdField = 'productId';
|
|
1534
|
+
this.model = Variant;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1539
|
+
constructor(firestore) {
|
|
1540
|
+
super();
|
|
1541
|
+
this.firestore = firestore;
|
|
1542
|
+
this.collectionName = 'subscriptionProducts';
|
|
1543
|
+
this.model = Product;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1548
|
+
constructor(firestore) {
|
|
1549
|
+
super();
|
|
1550
|
+
this.firestore = firestore;
|
|
1551
|
+
this.collectionName = 'checkouts';
|
|
1552
|
+
this.model = Checkout;
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1557
|
+
constructor(firestore) {
|
|
1558
|
+
super();
|
|
1559
|
+
this.firestore = firestore;
|
|
1560
|
+
this.collectionName = 'coupons';
|
|
1561
|
+
this.model = Coupon;
|
|
1562
|
+
}
|
|
1563
|
+
buildModelInstance() {
|
|
1564
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1565
|
+
return {
|
|
1566
|
+
toFirestore: (data) => {
|
|
1567
|
+
const plain = toFirestore(data);
|
|
1568
|
+
if (!!data.expiresIn)
|
|
1569
|
+
plain.expiresIn = data.expiresIn.getTime();
|
|
1570
|
+
return plain;
|
|
1571
|
+
},
|
|
1572
|
+
fromFirestore: (snap) => {
|
|
1573
|
+
const instance = fromFirestore(snap);
|
|
1574
|
+
if (!isNil(instance.expiresIn))
|
|
1575
|
+
instance.expiresIn = new Date(snap.data().expiresIn);
|
|
1576
|
+
return instance;
|
|
1577
|
+
},
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1583
|
+
constructor(firestore) {
|
|
1584
|
+
super();
|
|
1585
|
+
this.firestore = firestore;
|
|
1586
|
+
this.collectionName = 'orders';
|
|
1587
|
+
this.model = Order;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1592
|
+
constructor(firestore) {
|
|
1593
|
+
super();
|
|
1594
|
+
this.firestore = firestore;
|
|
1595
|
+
this.collectionName = 'payments';
|
|
1596
|
+
this.model = Payment;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1601
|
+
constructor(firestore) {
|
|
1602
|
+
super();
|
|
1603
|
+
this.firestore = firestore;
|
|
1604
|
+
this.collectionName = 'checkoutsSubscription';
|
|
1605
|
+
this.model = CheckoutSubscription;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1610
|
+
constructor(firestore) {
|
|
1611
|
+
super();
|
|
1612
|
+
this.firestore = firestore;
|
|
1613
|
+
this.collectionName = 'subscriptionPlans';
|
|
1614
|
+
this.model = SubscriptionPlan;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1619
|
+
constructor(firestore) {
|
|
1620
|
+
super();
|
|
1621
|
+
this.firestore = firestore;
|
|
1622
|
+
this.collectionName = 'buy2win';
|
|
1623
|
+
this.model = Buy2Win;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
1628
|
+
constructor(firestore) {
|
|
1629
|
+
super(firestore);
|
|
1630
|
+
this.firestore = firestore;
|
|
1631
|
+
this.collectionName = 'legacyOrders';
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1636
|
+
constructor(firestore) {
|
|
1637
|
+
super();
|
|
1638
|
+
this.firestore = firestore;
|
|
1639
|
+
this.homeToFirestore = (home) => {
|
|
1640
|
+
var _a;
|
|
1641
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1642
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.homeCategoryGroupToPlain);
|
|
1643
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.homeCategoryGroupToPlain);
|
|
1644
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.homeCategoryGroupToPlain);
|
|
1645
|
+
}
|
|
1646
|
+
return home;
|
|
1647
|
+
};
|
|
1648
|
+
this.homeCategoryGroupToPlain = (homeCategoryGroup) => ({
|
|
1649
|
+
category: homeCategoryGroup.category.toPlain(),
|
|
1650
|
+
products: homeCategoryGroup.products.map((product) => product.toPlain()),
|
|
1651
|
+
});
|
|
1652
|
+
this.homeFromFirestore = (home) => {
|
|
1653
|
+
var _a;
|
|
1654
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1655
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.plainToHomeCategoryGroup);
|
|
1656
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.plainToHomeCategoryGroup);
|
|
1657
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.plainToHomeCategoryGroup);
|
|
1658
|
+
home.data.createdAt =
|
|
1659
|
+
home.data.createdAt instanceof firebase.firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
|
|
1660
|
+
home.data.expiresAt =
|
|
1661
|
+
home.data.expiresAt instanceof firebase.firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
|
|
1662
|
+
}
|
|
1663
|
+
return home;
|
|
1664
|
+
};
|
|
1665
|
+
this.plainToHomeCategoryGroup = (homeCategoryGroup) => ({
|
|
1666
|
+
category: Category.toInstance(homeCategoryGroup.category),
|
|
1667
|
+
products: homeCategoryGroup.products.map((product) => Product.toInstance(product)),
|
|
1668
|
+
});
|
|
1669
|
+
this.collectionName = 'dms';
|
|
1670
|
+
this.model = Home;
|
|
1671
|
+
}
|
|
1672
|
+
buildModelInstance() {
|
|
1673
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1674
|
+
return {
|
|
1675
|
+
toFirestore: (data) => {
|
|
1676
|
+
const modifiedData = this.homeToFirestore(data);
|
|
1677
|
+
return toFirestore(modifiedData);
|
|
1678
|
+
},
|
|
1679
|
+
fromFirestore: (snap) => {
|
|
1680
|
+
const instance = fromFirestore(snap);
|
|
1681
|
+
return this.homeFromFirestore(instance);
|
|
1682
|
+
},
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1688
|
+
constructor(firestore) {
|
|
1689
|
+
super();
|
|
1690
|
+
this.firestore = firestore;
|
|
1691
|
+
this.collectionName = 'shopMenus';
|
|
1692
|
+
this.model = ShopMenu;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
class AuthenticationFirebaseAuthService {
|
|
1697
|
+
constructor(firebaseAuth) {
|
|
1698
|
+
this.firebaseAuth = firebaseAuth;
|
|
1699
|
+
}
|
|
1700
|
+
signInWithEmailAndPassword(data) {
|
|
1701
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1702
|
+
const credentials = yield this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password);
|
|
1703
|
+
const user = credentials.user;
|
|
1704
|
+
return {
|
|
1705
|
+
id: user.uid,
|
|
1706
|
+
displayName: user.displayName,
|
|
1707
|
+
email: user.email,
|
|
1708
|
+
phone: user.phoneNumber,
|
|
1709
|
+
isAnonymous: false,
|
|
1710
|
+
};
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
signInWithGoogle() {
|
|
1714
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1715
|
+
const credentials = yield this.firebaseAuth.signInWithPopup(new firebase$1.auth.GoogleAuthProvider());
|
|
1716
|
+
const user = credentials.user;
|
|
1717
|
+
return {
|
|
1718
|
+
id: user.uid,
|
|
1719
|
+
displayName: user.displayName,
|
|
1720
|
+
email: user.email,
|
|
1721
|
+
phone: user.phoneNumber,
|
|
1722
|
+
isAnonymous: false,
|
|
1723
|
+
};
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1726
|
+
signOut() {
|
|
1727
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1728
|
+
this.firebaseAuth.signOut();
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
signInAnonymously() {
|
|
1732
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1733
|
+
const auth = yield this.firebaseAuth.signInAnonymously();
|
|
1734
|
+
const user = auth.user;
|
|
1735
|
+
user.id = auth.user.uid;
|
|
1736
|
+
return user;
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
sendPasswordResetEmail(email) {
|
|
1740
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1741
|
+
return this.firebaseAuth.sendPasswordResetEmail(email);
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
class RegisterFirebaseAuthService {
|
|
1747
|
+
constructor(firebaseAuth) {
|
|
1748
|
+
this.firebaseAuth = firebaseAuth;
|
|
1749
|
+
}
|
|
1750
|
+
register(params) {
|
|
1751
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1752
|
+
try {
|
|
1753
|
+
const auth = yield this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password);
|
|
1754
|
+
const user = auth.user;
|
|
1755
|
+
user.sendEmailVerification();
|
|
1756
|
+
user.id = auth.user.uid;
|
|
1757
|
+
return user;
|
|
1758
|
+
}
|
|
1759
|
+
catch (error) {
|
|
1760
|
+
if (error.code === 'auth/email-already-in-use')
|
|
1761
|
+
throw new UserAlreadyRegisteredError('Email already registered');
|
|
1762
|
+
if (error.code === 'auth/weak-password')
|
|
1763
|
+
throw new WeakPasswordError();
|
|
1764
|
+
throw error;
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Generated bundle index. Do not edit.
|
|
1772
1772
|
*/
|
|
1773
1773
|
|
|
1774
1774
|
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, FilterType, FragranceImportances, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, Register, RegisterFirebaseAuthService, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserSearchFirestoreRepository, UserType, Variant, WeakPasswordError, Where, withCreateFirestore, withCrudFirestore, withDeleteFirestore, withFindFirestore, withFirestore, withGetFirestore, withHelpers, withSubCollection, withUpdateFirestore };
|