@infrab4a/connect 1.0.0-beta.1 → 1.0.0-beta.10
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/bundles/infrab4a-connect.umd.js +1576 -246
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/models/category.d.ts +23 -0
- package/domain/catalog/models/enums/shops.enum.d.ts +5 -0
- package/domain/catalog/models/product.d.ts +36 -0
- package/domain/catalog/models/types/product-review.type.d.ts +15 -0
- package/domain/catalog/models/variant.d.ts +18 -0
- package/domain/catalog/repositories/category.repository.d.ts +15 -0
- package/domain/catalog/repositories/product.repository.d.ts +5 -0
- package/domain/catalog/repositories/subscription-product.repository.d.ts +4 -0
- package/domain/catalog/repositories/variant.repository.d.ts +4 -0
- package/domain/generic/model/base.model.d.ts +10 -0
- package/domain/generic/model/index.d.ts +3 -0
- package/domain/generic/model/types/base-model-builder.type.d.ts +15 -0
- package/domain/generic/model/types/identifier-model.type.d.ts +7 -0
- package/domain/generic/model/types/index.d.ts +5 -0
- package/domain/generic/model/types/model-base-structure.type.d.ts +6 -0
- package/domain/generic/model/types/non-function-properties.type.d.ts +12 -0
- package/domain/generic/model/types/non-function-property-name.type.d.ts +4 -0
- package/domain/generic/repository/create.repository.d.ts +8 -0
- package/domain/generic/repository/crud.repository.d.ts +19 -0
- package/domain/generic/repository/delete.repository.d.ts +7 -0
- package/domain/generic/repository/enums/where.enum.d.ts +13 -0
- package/domain/generic/repository/find.repository.d.ts +10 -0
- package/domain/generic/repository/get.repository.d.ts +5 -0
- package/domain/generic/repository/read.repository.d.ts +14 -0
- package/domain/generic/repository/types/index.d.ts +6 -0
- package/domain/generic/repository/types/repository-find-filters.type.d.ts +13 -0
- package/domain/generic/repository/types/repository-update-params.type.d.ts +11 -0
- package/domain/generic/repository/types/where-options.type.d.ts +2 -0
- package/domain/generic/repository/update.repository.d.ts +6 -0
- package/domain/index.d.ts +6 -0
- package/domain/location/models/address.d.ts +22 -0
- package/domain/shop-settings/models/home.d.ts +17 -0
- package/domain/shop-settings/models/shop-menu.d.ts +7 -0
- package/domain/shop-settings/models/types/home-data.type.d.ts +15 -0
- package/domain/shop-settings/models/types/index.d.ts +5 -0
- package/domain/shop-settings/repositories/home.repository.d.ts +4 -0
- package/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -0
- package/domain/shopping/models/buy-2-win.d.ts +16 -0
- package/domain/shopping/models/checkout.d.ts +27 -0
- package/domain/shopping/models/coupons/coupon.d.ts +26 -0
- package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -0
- package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +6 -0
- package/domain/shopping/models/coupons/enums/index.d.ts +3 -0
- package/domain/shopping/models/coupons/financial-coupon.d.ts +9 -0
- package/domain/shopping/models/coupons/index.d.ts +3 -0
- package/domain/shopping/models/payment.d.ts +67 -0
- package/domain/shopping/models/shipping-method.d.ts +16 -0
- package/domain/shopping/models/subscription/checkout.d.ts +21 -0
- package/domain/shopping/models/subscription/plan.d.ts +10 -0
- package/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -0
- package/domain/shopping/repositories/checkout.repository.d.ts +4 -0
- package/domain/shopping/repositories/coupon.repository.d.ts +4 -0
- package/domain/shopping/repositories/order.repository.d.ts +4 -0
- package/domain/shopping/repositories/payment.repository.d.ts +4 -0
- package/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -0
- package/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -0
- package/domain/users/models/beauty-profile.d.ts +11 -0
- package/domain/users/models/lead.d.ts +7 -0
- package/domain/users/models/subscription/edition.d.ts +16 -0
- package/domain/users/models/subscription/payment.d.ts +13 -0
- package/domain/users/models/subscription/subscription.d.ts +28 -0
- package/domain/users/models/user-address.d.ts +7 -0
- package/domain/users/models/user-payment-method.d.ts +14 -0
- package/domain/users/models/user.d.ts +26 -0
- package/domain/users/repositories/beauty-profile.repository.d.ts +4 -0
- package/domain/users/repositories/edition.repository.d.ts +4 -0
- package/domain/users/repositories/lead.repository.d.ts +4 -0
- package/domain/users/repositories/subscription-payment.repository.d.ts +4 -0
- package/domain/users/repositories/subscription.repository.d.ts +4 -0
- package/domain/users/repositories/user-address.repository.d.ts +4 -0
- package/domain/users/repositories/user-payment-method.repository.d.ts +4 -0
- package/domain/users/repositories/user.repository.d.ts +6 -0
- package/domain/users/services/authentication.service.d.ts +12 -0
- package/domain/users/use-cases/index.d.ts +4 -0
- package/domain/users/use-cases/recovery-password.d.ts +6 -0
- package/esm2015/domain/catalog/index.js +3 -0
- package/esm2015/domain/catalog/models/category.js +10 -0
- package/esm2015/domain/catalog/models/enums/index.js +2 -0
- package/esm2015/domain/catalog/models/enums/shops.enum.js +7 -0
- package/esm2015/domain/catalog/models/index.js +6 -0
- package/esm2015/domain/catalog/models/product.js +14 -0
- package/esm2015/domain/catalog/models/types/category-condition.type.js +2 -0
- package/esm2015/domain/catalog/models/types/category-filter.type.js +2 -0
- package/esm2015/domain/catalog/models/types/index.js +8 -0
- package/esm2015/domain/catalog/models/types/product-review.type.js +2 -0
- package/esm2015/domain/catalog/models/types/shops-description.type.js +2 -0
- package/esm2015/domain/catalog/models/types/shops-price.type.js +2 -0
- package/esm2015/domain/catalog/models/types/stock.type.js +2 -0
- package/esm2015/domain/catalog/models/types/variant-grade.type.js +2 -0
- package/esm2015/domain/catalog/models/variant.js +10 -0
- package/esm2015/domain/catalog/repositories/category.repository.js +2 -0
- package/esm2015/domain/catalog/repositories/index.js +5 -0
- package/esm2015/domain/catalog/repositories/product.repository.js +2 -0
- package/esm2015/domain/catalog/repositories/subscription-product.repository.js +2 -0
- package/esm2015/domain/catalog/repositories/variant.repository.js +2 -0
- package/esm2015/domain/generic/index.js +3 -0
- package/esm2015/domain/generic/model/base.model.js +23 -0
- package/esm2015/domain/generic/model/identifier-fields.js +2 -0
- package/esm2015/domain/generic/model/index.js +4 -0
- package/esm2015/domain/generic/model/types/base-model-builder.type.js +2 -0
- package/esm2015/domain/generic/model/types/identifier-model.type.js +2 -0
- package/esm2015/domain/generic/model/types/index.js +6 -0
- package/esm2015/domain/generic/model/types/model-base-structure.type.js +2 -0
- package/esm2015/domain/generic/model/types/non-function-properties.type.js +2 -0
- package/esm2015/domain/generic/model/types/non-function-property-name.type.js +2 -0
- package/esm2015/domain/generic/repository/create.repository.js +2 -0
- package/esm2015/domain/generic/repository/crud.repository.js +2 -0
- package/esm2015/domain/generic/repository/delete.repository.js +2 -0
- package/esm2015/domain/generic/repository/enums/index.js +3 -0
- package/esm2015/domain/generic/repository/enums/update-option-actions.enum.js +9 -0
- package/esm2015/domain/generic/repository/enums/where.enum.js +15 -0
- package/esm2015/domain/generic/repository/find.repository.js +2 -0
- package/esm2015/domain/generic/repository/get.repository.js +2 -0
- package/esm2015/domain/generic/repository/index.js +10 -0
- package/esm2015/domain/generic/repository/read.repository.js +2 -0
- package/esm2015/domain/generic/repository/types/index.js +7 -0
- package/esm2015/domain/generic/repository/types/repository-find-filters.type.js +2 -0
- package/esm2015/domain/generic/repository/types/repository-find-result.type.js +2 -0
- package/esm2015/domain/generic/repository/types/repository-limit-options.type.js +2 -0
- package/esm2015/domain/generic/repository/types/repository-order-by-list.type.js +2 -0
- package/esm2015/domain/generic/repository/types/repository-update-params.type.js +2 -0
- package/esm2015/domain/generic/repository/types/where-options.type.js +2 -0
- package/esm2015/domain/generic/repository/update.repository.js +2 -0
- package/esm2015/domain/index.js +7 -0
- package/esm2015/domain/location/index.js +2 -0
- package/esm2015/domain/location/models/address.js +7 -0
- package/esm2015/domain/location/models/index.js +3 -0
- package/esm2015/domain/location/models/types/index.js +4 -0
- package/esm2015/domain/location/models/types/location-bound.type.js +2 -0
- package/esm2015/domain/location/models/types/location-geometry.type.js +2 -0
- package/esm2015/domain/location/models/types/location-lat-lng.type.js +2 -0
- package/esm2015/domain/shop-settings/enums/filter-type.enum.js +21 -0
- package/esm2015/domain/shop-settings/enums/index.js +3 -0
- package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +21 -0
- package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +46 -0
- package/esm2015/domain/shop-settings/helpers/index.js +2 -0
- package/esm2015/domain/shop-settings/index.js +5 -0
- package/esm2015/domain/shop-settings/models/home.js +7 -0
- package/esm2015/domain/shop-settings/models/index.js +4 -0
- package/esm2015/domain/shop-settings/models/shop-menu.js +7 -0
- package/esm2015/domain/shop-settings/models/types/banner.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/benefit.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/home-data.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/index.js +6 -0
- package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +2 -0
- package/esm2015/domain/shop-settings/repositories/home.repository.js +2 -0
- package/esm2015/domain/shop-settings/repositories/index.js +3 -0
- package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +2 -0
- package/esm2015/domain/shopping/index.js +3 -0
- package/esm2015/domain/shopping/models/buy-2-win.js +14 -0
- package/esm2015/domain/shopping/models/checkout.js +38 -0
- package/esm2015/domain/shopping/models/coupons/coupon.js +23 -0
- package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -0
- package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +8 -0
- package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -0
- package/esm2015/domain/shopping/models/coupons/enums/index.js +4 -0
- package/esm2015/domain/shopping/models/coupons/financial-coupon.js +28 -0
- package/esm2015/domain/shopping/models/coupons/index.js +4 -0
- package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +6 -0
- package/esm2015/domain/shopping/models/enums/index.js +3 -0
- package/esm2015/domain/shopping/models/enums/order-status.enum.js +12 -0
- package/esm2015/domain/shopping/models/index.js +12 -0
- package/esm2015/domain/shopping/models/line-item.js +4 -0
- package/esm2015/domain/shopping/models/order.js +11 -0
- package/esm2015/domain/shopping/models/payment.js +169 -0
- package/esm2015/domain/shopping/models/shipping-method.js +7 -0
- package/esm2015/domain/shopping/models/subscription/checkout.js +28 -0
- package/esm2015/domain/shopping/models/subscription/index.js +3 -0
- package/esm2015/domain/shopping/models/subscription/plan.js +7 -0
- package/esm2015/domain/shopping/models/types/index.js +8 -0
- package/esm2015/domain/shopping/models/types/payment-address.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-billing.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-card.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-customer.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-document.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-item.type.js +2 -0
- package/esm2015/domain/shopping/models/types/payment-shipping.type.js +2 -0
- package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/checkout.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/coupon.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/index.js +8 -0
- package/esm2015/domain/shopping/repositories/legacy-order.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/order.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/payment.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +2 -0
- package/esm2015/domain/shopping/repositories/subscription/index.js +3 -0
- package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +2 -0
- package/esm2015/domain/users/errors/index.js +4 -0
- package/esm2015/domain/users/errors/unauthorized.error.js +7 -0
- package/esm2015/domain/users/errors/user-already-registered.error.js +7 -0
- package/esm2015/domain/users/errors/weak-password.error.js +7 -0
- package/esm2015/domain/users/index.js +6 -0
- package/esm2015/domain/users/models/beauty-profile.js +12 -0
- package/esm2015/domain/users/models/enums/accessory-importances.enum.js +7 -0
- package/esm2015/domain/users/models/enums/area.enum.js +13 -0
- package/esm2015/domain/users/models/enums/beard-problems.enum.js +11 -0
- package/esm2015/domain/users/models/enums/beard-sizes.enum.js +9 -0
- package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +8 -0
- package/esm2015/domain/users/models/enums/body-problems.enum.js +13 -0
- package/esm2015/domain/users/models/enums/body-shapes.enum.js +9 -0
- package/esm2015/domain/users/models/enums/body-tattoos.enum.js +7 -0
- package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -0
- package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +12 -0
- package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +10 -0
- package/esm2015/domain/users/models/enums/family-incomes.enum.js +10 -0
- package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +7 -0
- package/esm2015/domain/users/models/enums/hair-colors.enum.js +12 -0
- package/esm2015/domain/users/models/enums/hair-problems.enum.js +12 -0
- package/esm2015/domain/users/models/enums/hair-strands.enum.js +10 -0
- package/esm2015/domain/users/models/enums/hair-types.enum.js +9 -0
- package/esm2015/domain/users/models/enums/index.js +21 -0
- package/esm2015/domain/users/models/enums/office-position.enum.js +8 -0
- package/esm2015/domain/users/models/enums/product-spents.enum.js +10 -0
- package/esm2015/domain/users/models/enums/user-type.enum.js +10 -0
- package/esm2015/domain/users/models/index.js +8 -0
- package/esm2015/domain/users/models/lead.js +7 -0
- package/esm2015/domain/users/models/subscription/edition.js +7 -0
- package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +5 -0
- package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +6 -0
- package/esm2015/domain/users/models/subscription/enums/index.js +5 -0
- package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +7 -0
- package/esm2015/domain/users/models/subscription/enums/status.enum.js +6 -0
- package/esm2015/domain/users/models/subscription/index.js +5 -0
- package/esm2015/domain/users/models/subscription/payment.js +14 -0
- package/esm2015/domain/users/models/subscription/subscription.js +43 -0
- package/esm2015/domain/users/models/user-address.js +7 -0
- package/esm2015/domain/users/models/user-payment-method.js +7 -0
- package/esm2015/domain/users/models/user.js +26 -0
- package/esm2015/domain/users/repositories/beauty-profile.repository.js +2 -0
- package/esm2015/domain/users/repositories/edition.repository.js +2 -0
- package/esm2015/domain/users/repositories/index.js +9 -0
- package/esm2015/domain/users/repositories/lead.repository.js +2 -0
- package/esm2015/domain/users/repositories/subscription-payment.repository.js +2 -0
- package/esm2015/domain/users/repositories/subscription.repository.js +2 -0
- package/esm2015/domain/users/repositories/user-address.repository.js +2 -0
- package/esm2015/domain/users/repositories/user-payment-method.repository.js +2 -0
- package/esm2015/domain/users/repositories/user.repository.js +2 -0
- package/esm2015/domain/users/services/authentication.service.js +2 -0
- package/esm2015/domain/users/services/index.js +4 -0
- package/esm2015/domain/users/services/register.service.js +2 -0
- package/esm2015/domain/users/services/types/basic-user-data.type.js +2 -0
- package/esm2015/domain/users/services/types/index.js +2 -0
- package/esm2015/domain/users/use-cases/authentication.js +40 -0
- package/esm2015/domain/users/use-cases/index.js +5 -0
- package/esm2015/domain/users/use-cases/recovery-password.js +12 -0
- package/esm2015/domain/users/use-cases/register.js +34 -0
- package/esm2015/domain/users/use-cases/signout.js +12 -0
- package/esm2015/errors/duplicated-results.error.js +7 -0
- package/esm2015/errors/index.js +5 -0
- package/esm2015/errors/invalid-argument.error.js +7 -0
- package/esm2015/errors/not-found.error.js +7 -0
- package/esm2015/errors/required-argument.error.js +8 -0
- package/esm2015/index.js +6 -0
- package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +22 -0
- package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +2 -0
- package/esm2015/infra/elasticsearch/adapters/index.js +3 -0
- package/esm2015/infra/elasticsearch/index.js +4 -0
- package/esm2015/infra/elasticsearch/indexes/index.js +2 -0
- package/esm2015/infra/elasticsearch/indexes/products-index.js +59 -0
- package/esm2015/infra/elasticsearch/types/elastic-search-result.js +2 -0
- package/esm2015/infra/elasticsearch/types/index.js +2 -0
- package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +52 -0
- package/esm2015/infra/firebase/auth/index.js +3 -0
- package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +26 -0
- package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -0
- package/esm2015/infra/firebase/firestore/index.js +4 -0
- package/esm2015/infra/firebase/firestore/mixins/index.js +10 -0
- package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -0
- package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -0
- package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -0
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +86 -0
- package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +23 -0
- package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -0
- package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -0
- package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -0
- package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -0
- package/esm2015/infra/firebase/firestore/models/user-search.js +7 -0
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +70 -0
- package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +5 -0
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +25 -0
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/index.js +5 -0
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +56 -0
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +3 -0
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +29 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +9 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/users/index.js +10 -0
- package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -0
- package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -0
- package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -0
- package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +2 -0
- package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +2 -0
- package/esm2015/infra/firebase/firestore/types/index.js +4 -0
- package/esm2015/infra/firebase/index.js +3 -0
- package/esm2015/infra/hasura-graphql/enums/hasura-graphql-column-type.enum.js +13 -0
- package/esm2015/infra/hasura-graphql/enums/hasura-graphql-where.enum.js +15 -0
- package/esm2015/infra/hasura-graphql/enums/index.js +3 -0
- package/esm2015/infra/hasura-graphql/index.js +4 -0
- package/esm2015/infra/hasura-graphql/mixins/helpers/attribute-option.helper.js +32 -0
- package/esm2015/infra/hasura-graphql/mixins/helpers/filter-option.helper.js +18 -0
- package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +74 -0
- package/esm2015/infra/hasura-graphql/mixins/helpers/index.js +4 -0
- package/esm2015/infra/hasura-graphql/mixins/index.js +8 -0
- package/esm2015/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.js +27 -0
- package/esm2015/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.js +10 -0
- package/esm2015/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.js +29 -0
- package/esm2015/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.js +86 -0
- package/esm2015/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.js +34 -0
- package/esm2015/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.js +94 -0
- package/esm2015/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.js +53 -0
- package/esm2015/infra/hasura-graphql/models/category-hasura-graphql.js +4 -0
- package/esm2015/infra/hasura-graphql/models/index.js +4 -0
- package/esm2015/infra/hasura-graphql/models/product-hasura-graphql.js +4 -0
- package/esm2015/infra/hasura-graphql/models/variant-hasura-graphql.js +9 -0
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +107 -0
- package/esm2015/infra/hasura-graphql/repositories/catalog/index.js +4 -0
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +108 -0
- package/esm2015/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.js +61 -0
- package/esm2015/infra/hasura-graphql/repositories/index.js +2 -0
- package/esm2015/infra/hasura-graphql/types/fields.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/graphql.repository.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-auth-options.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-headers.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/index.js +9 -0
- package/esm2015/infra/hasura-graphql/types/nested-field.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/query-builder-options.type.js +2 -0
- package/esm2015/infra/hasura-graphql/types/variable-options.type.js +2 -0
- package/esm2015/infra/index.js +4 -0
- package/esm2015/infrab4a-connect.js +2 -2
- package/esm2015/utils/index.js +8 -0
- package/esm2015/utils/is-uuid.js +3 -0
- package/esm2015/utils/mixins/base.mixin.js +6 -0
- package/esm2015/utils/mixins/index.js +4 -0
- package/esm2015/utils/mixins/merge-constructor-params.type.js +2 -0
- package/esm2015/utils/mixins/mixin-ctor.type.js +2 -0
- package/esm2015/utils/parse-datetime.js +14 -0
- package/esm2015/utils/types/array-element.type.js +2 -0
- package/esm2015/utils/types/index.js +3 -0
- package/esm2015/utils/types/prop.type.js +2 -0
- package/fesm2015/infrab4a-connect.js +1036 -149
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/index.d.ts +5 -0
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +11 -0
- package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +4 -0
- package/infra/elasticsearch/adapters/index.d.ts +2 -0
- package/infra/elasticsearch/index.d.ts +3 -0
- package/infra/elasticsearch/indexes/index.d.ts +1 -0
- package/infra/elasticsearch/indexes/products-index.d.ts +11 -0
- package/infra/elasticsearch/types/elastic-search-result.d.ts +7 -0
- package/infra/elasticsearch/types/index.d.ts +1 -0
- package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +12 -0
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +4 -0
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +11 -0
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +7 -0
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +7 -0
- package/infra/firebase/firestore/models/user-search.d.ts +9 -0
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +17 -0
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +9 -0
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +16 -0
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +12 -0
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +19 -0
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +13 -0
- package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +9 -0
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -0
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -0
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +12 -0
- package/infra/hasura-graphql/enums/hasura-graphql-column-type.enum.d.ts +11 -0
- package/infra/hasura-graphql/enums/hasura-graphql-where.enum.d.ts +13 -0
- package/infra/hasura-graphql/enums/index.d.ts +2 -0
- package/infra/hasura-graphql/index.d.ts +3 -0
- package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +17 -0
- package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +6 -0
- package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +8 -0
- package/infra/hasura-graphql/mixins/helpers/index.d.ts +3 -0
- package/infra/hasura-graphql/mixins/index.d.ts +7 -0
- package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +8 -0
- package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +11 -0
- package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +7 -0
- package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +30 -0
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +24 -0
- package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +11 -0
- package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +14 -0
- package/infra/hasura-graphql/models/category-hasura-graphql.d.ts +6 -0
- package/infra/hasura-graphql/models/index.d.ts +3 -0
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +7 -0
- package/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +9 -0
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +22 -0
- package/infra/hasura-graphql/repositories/catalog/index.d.ts +3 -0
- package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +11 -0
- package/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +10 -0
- package/infra/hasura-graphql/repositories/index.d.ts +1 -0
- package/infra/hasura-graphql/types/fields.type.d.ts +2 -0
- package/infra/hasura-graphql/types/graphql.repository.type.d.ts +21 -0
- package/infra/hasura-graphql/types/hasura-graphql-auth-options.type.d.ts +8 -0
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +42 -0
- package/infra/hasura-graphql/types/hasura-graphql-headers.type.d.ts +7 -0
- package/infra/hasura-graphql/types/index.d.ts +8 -0
- package/infra/hasura-graphql/types/nested-field.type.d.ts +7 -0
- package/infra/hasura-graphql/types/query-builder-options.type.d.ts +7 -0
- package/infra/hasura-graphql/types/variable-options.type.d.ts +9 -0
- package/infra/index.d.ts +3 -0
- package/infrab4a-connect.d.ts +1 -1
- package/package.json +4 -1
- package/utils/index.d.ts +7 -0
- package/utils/is-uuid.d.ts +1 -0
- package/utils/mixins/index.d.ts +3 -0
- package/utils/mixins/merge-constructor-params.type.d.ts +3 -0
- package/utils/mixins/mixin-ctor.type.d.ts +1 -0
- package/utils/parse-datetime.d.ts +1 -0
- package/utils/types/array-element.type.d.ts +1 -0
- package/utils/types/index.d.ts +2 -0
- package/esm2015/lib/domain/catalog/index.js +0 -3
- package/esm2015/lib/domain/catalog/models/category.js +0 -7
- package/esm2015/lib/domain/catalog/models/enums/index.js +0 -2
- package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +0 -6
- package/esm2015/lib/domain/catalog/models/index.js +0 -6
- package/esm2015/lib/domain/catalog/models/product.js +0 -11
- package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/index.js +0 -8
- package/esm2015/lib/domain/catalog/models/types/product-review.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/stock.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +0 -2
- package/esm2015/lib/domain/catalog/models/variant.js +0 -7
- package/esm2015/lib/domain/catalog/repositories/category.repository.js +0 -2
- package/esm2015/lib/domain/catalog/repositories/index.js +0 -5
- package/esm2015/lib/domain/catalog/repositories/product.repository.js +0 -2
- package/esm2015/lib/domain/catalog/repositories/subscription-product.repository.js +0 -2
- package/esm2015/lib/domain/catalog/repositories/variant.repository.js +0 -2
- package/esm2015/lib/domain/general/index.js +0 -3
- package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +0 -2
- package/esm2015/lib/domain/general/model/base.model.js +0 -13
- package/esm2015/lib/domain/general/model/identifier-fields.js +0 -2
- package/esm2015/lib/domain/general/model/index.js +0 -5
- package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +0 -2
- package/esm2015/lib/domain/general/model/types/index.js +0 -4
- package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +0 -2
- package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +0 -2
- package/esm2015/lib/domain/general/repository/create.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/crud.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/delete.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/enums/index.js +0 -3
- package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +0 -9
- package/esm2015/lib/domain/general/repository/enums/where.enum.js +0 -12
- package/esm2015/lib/domain/general/repository/find.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/get.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/index.js +0 -10
- package/esm2015/lib/domain/general/repository/read.repository.js +0 -2
- package/esm2015/lib/domain/general/repository/types/index.js +0 -6
- package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +0 -2
- package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +0 -2
- package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +0 -2
- package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +0 -2
- package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +0 -2
- package/esm2015/lib/domain/general/repository/update.repository.js +0 -2
- package/esm2015/lib/domain/index.js +0 -7
- package/esm2015/lib/domain/location/index.js +0 -2
- package/esm2015/lib/domain/location/models/address.js +0 -4
- package/esm2015/lib/domain/location/models/index.js +0 -3
- package/esm2015/lib/domain/location/models/types/index.js +0 -4
- package/esm2015/lib/domain/location/models/types/location-bound.type.js +0 -2
- package/esm2015/lib/domain/location/models/types/location-geometry.type.js +0 -2
- package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +0 -2
- package/esm2015/lib/domain/shop-settings/enums/filter-type.enum.js +0 -21
- package/esm2015/lib/domain/shop-settings/enums/index.js +0 -3
- package/esm2015/lib/domain/shop-settings/enums/questions-filters.enum.js +0 -21
- package/esm2015/lib/domain/shop-settings/helpers/beauty-questions.helper.js +0 -46
- package/esm2015/lib/domain/shop-settings/helpers/index.js +0 -2
- package/esm2015/lib/domain/shop-settings/index.js +0 -5
- package/esm2015/lib/domain/shop-settings/models/home.js +0 -7
- package/esm2015/lib/domain/shop-settings/models/index.js +0 -4
- package/esm2015/lib/domain/shop-settings/models/shop-menu.js +0 -7
- package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +0 -2
- package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +0 -2
- package/esm2015/lib/domain/shop-settings/models/types/index.js +0 -5
- package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +0 -2
- package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +0 -2
- package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +0 -2
- package/esm2015/lib/domain/shop-settings/repositories/index.js +0 -3
- package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +0 -2
- package/esm2015/lib/domain/shopping/index.js +0 -3
- package/esm2015/lib/domain/shopping/models/buy-2-win.js +0 -14
- package/esm2015/lib/domain/shopping/models/checkout.js +0 -38
- package/esm2015/lib/domain/shopping/models/coupons/club-coupon.js +0 -23
- package/esm2015/lib/domain/shopping/models/coupons/coupon.js +0 -31
- package/esm2015/lib/domain/shopping/models/coupons/enums/discount-type.enum.js +0 -7
- package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +0 -7
- package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +0 -3
- package/esm2015/lib/domain/shopping/models/coupons/index.js +0 -5
- package/esm2015/lib/domain/shopping/models/coupons/store-coupon.js +0 -23
- package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +0 -6
- package/esm2015/lib/domain/shopping/models/enums/index.js +0 -3
- package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +0 -12
- package/esm2015/lib/domain/shopping/models/index.js +0 -12
- package/esm2015/lib/domain/shopping/models/line-item.js +0 -4
- package/esm2015/lib/domain/shopping/models/order.js +0 -11
- package/esm2015/lib/domain/shopping/models/payment.js +0 -169
- package/esm2015/lib/domain/shopping/models/shipping-method.js +0 -7
- package/esm2015/lib/domain/shopping/models/subscription/checkout.js +0 -28
- package/esm2015/lib/domain/shopping/models/subscription/index.js +0 -3
- package/esm2015/lib/domain/shopping/models/subscription/plan.js +0 -7
- package/esm2015/lib/domain/shopping/models/types/index.js +0 -8
- package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +0 -2
- package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/index.js +0 -8
- package/esm2015/lib/domain/shopping/repositories/legacy-order.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/order.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/payment.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +0 -2
- package/esm2015/lib/domain/shopping/repositories/subscription/index.js +0 -3
- package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +0 -2
- package/esm2015/lib/domain/users/errors/index.js +0 -4
- package/esm2015/lib/domain/users/errors/unauthorized.error.js +0 -7
- package/esm2015/lib/domain/users/errors/user-already-registered.error.js +0 -7
- package/esm2015/lib/domain/users/errors/weak-password.error.js +0 -7
- package/esm2015/lib/domain/users/index.js +0 -6
- package/esm2015/lib/domain/users/models/beauty-profile.js +0 -12
- package/esm2015/lib/domain/users/models/enums/accessory-importances.enum.js +0 -7
- package/esm2015/lib/domain/users/models/enums/area.enum.js +0 -13
- package/esm2015/lib/domain/users/models/enums/beard-problems.enum.js +0 -11
- package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +0 -9
- package/esm2015/lib/domain/users/models/enums/beauty-product-importances.enum.js +0 -8
- package/esm2015/lib/domain/users/models/enums/body-problems.enum.js +0 -13
- package/esm2015/lib/domain/users/models/enums/body-shapes.enum.js +0 -9
- package/esm2015/lib/domain/users/models/enums/body-tattoos.enum.js +0 -7
- package/esm2015/lib/domain/users/models/enums/face-skin-oilinesses.enum.js +0 -9
- package/esm2015/lib/domain/users/models/enums/face-skin-problems.enum.js +0 -12
- package/esm2015/lib/domain/users/models/enums/face-skin-tones.enum.js +0 -10
- package/esm2015/lib/domain/users/models/enums/family-incomes.enum.js +0 -10
- package/esm2015/lib/domain/users/models/enums/fragrance-importances.enum.js +0 -7
- package/esm2015/lib/domain/users/models/enums/hair-colors.enum.js +0 -12
- package/esm2015/lib/domain/users/models/enums/hair-problems.enum.js +0 -12
- package/esm2015/lib/domain/users/models/enums/hair-strands.enum.js +0 -10
- package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +0 -9
- package/esm2015/lib/domain/users/models/enums/index.js +0 -21
- package/esm2015/lib/domain/users/models/enums/office-position.enum.js +0 -8
- package/esm2015/lib/domain/users/models/enums/product-spents.enum.js +0 -10
- package/esm2015/lib/domain/users/models/enums/user-type.enum.js +0 -10
- package/esm2015/lib/domain/users/models/index.js +0 -8
- package/esm2015/lib/domain/users/models/lead.js +0 -7
- package/esm2015/lib/domain/users/models/subscription/edition.js +0 -7
- package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +0 -5
- package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +0 -6
- package/esm2015/lib/domain/users/models/subscription/enums/index.js +0 -5
- package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +0 -7
- package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +0 -6
- package/esm2015/lib/domain/users/models/subscription/index.js +0 -5
- package/esm2015/lib/domain/users/models/subscription/payment.js +0 -14
- package/esm2015/lib/domain/users/models/subscription/subscription.js +0 -43
- package/esm2015/lib/domain/users/models/user-address.js +0 -7
- package/esm2015/lib/domain/users/models/user-payment-method.js +0 -7
- package/esm2015/lib/domain/users/models/user.js +0 -26
- package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/edition.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/index.js +0 -9
- package/esm2015/lib/domain/users/repositories/lead.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/subscription.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/user-address.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/user-payment-method.repository.js +0 -2
- package/esm2015/lib/domain/users/repositories/user.repository.js +0 -2
- package/esm2015/lib/domain/users/services/authentication.service.js +0 -2
- package/esm2015/lib/domain/users/services/index.js +0 -4
- package/esm2015/lib/domain/users/services/register.service.js +0 -2
- package/esm2015/lib/domain/users/services/types/basic-user-data.type.js +0 -2
- package/esm2015/lib/domain/users/services/types/index.js +0 -2
- package/esm2015/lib/domain/users/use-cases/authentication.js +0 -40
- package/esm2015/lib/domain/users/use-cases/index.js +0 -4
- package/esm2015/lib/domain/users/use-cases/register.js +0 -34
- package/esm2015/lib/domain/users/use-cases/signout.js +0 -12
- package/esm2015/lib/errors/duplicated-results.error.js +0 -7
- package/esm2015/lib/errors/index.js +0 -5
- package/esm2015/lib/errors/invalid-argument.error.js +0 -7
- package/esm2015/lib/errors/not-found.error.js +0 -7
- package/esm2015/lib/errors/required-argument.error.js +0 -8
- package/esm2015/lib/index.js +0 -5
- package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +0 -47
- package/esm2015/lib/infra/firebase/auth/index.js +0 -3
- package/esm2015/lib/infra/firebase/auth/register-firebase-auth.service.js +0 -26
- package/esm2015/lib/infra/firebase/auth/types/firebase-user-with-id.type.js +0 -2
- package/esm2015/lib/infra/firebase/firestore/index.js +0 -4
- package/esm2015/lib/infra/firebase/firestore/mixins/index.js +0 -10
- package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +0 -31
- package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +0 -10
- package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +0 -18
- package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +0 -76
- package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +0 -26
- package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +0 -24
- package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +0 -17
- package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +0 -11
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +0 -45
- package/esm2015/lib/infra/firebase/firestore/models/user-search.js +0 -7
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +0 -78
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +0 -5
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +0 -23
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/index.js +0 -5
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +0 -3
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +0 -39
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +0 -9
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +0 -9
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +0 -10
- package/esm2015/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +0 -70
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +0 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +0 -12
- package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +0 -2
- package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +0 -2
- package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +0 -2
- package/esm2015/lib/infra/firebase/firestore/types/index.js +0 -4
- package/esm2015/lib/infra/firebase/index.js +0 -3
- package/esm2015/lib/infra/index.js +0 -2
- package/esm2015/lib/utils/index.js +0 -5
- package/esm2015/lib/utils/mixins/base.mixin.js +0 -6
- package/esm2015/lib/utils/mixins/index.js +0 -3
- package/esm2015/lib/utils/mixins/mixin-ctor.type.js +0 -2
- package/esm2015/lib/utils/types/index.js +0 -2
- package/esm2015/lib/utils/types/prop.type.js +0 -2
- package/esm2015/public-api.js +0 -3
- package/lib/domain/catalog/models/category.d.ts +0 -22
- package/lib/domain/catalog/models/enums/shops.enum.d.ts +0 -4
- package/lib/domain/catalog/models/product.d.ts +0 -33
- package/lib/domain/catalog/models/types/product-review.type.d.ts +0 -14
- package/lib/domain/catalog/models/variant.d.ts +0 -14
- package/lib/domain/catalog/repositories/category.repository.d.ts +0 -12
- package/lib/domain/catalog/repositories/product.repository.d.ts +0 -5
- package/lib/domain/catalog/repositories/subscription-product.repository.d.ts +0 -4
- package/lib/domain/catalog/repositories/variant.repository.d.ts +0 -4
- package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +0 -3
- package/lib/domain/general/model/base.model.d.ts +0 -6
- package/lib/domain/general/model/index.d.ts +0 -4
- package/lib/domain/general/model/types/base-model-builder.type.d.ts +0 -5
- package/lib/domain/general/model/types/index.d.ts +0 -3
- package/lib/domain/general/model/types/non-function-properties.type.d.ts +0 -2
- package/lib/domain/general/model/types/non-function-property-name.type.d.ts +0 -3
- package/lib/domain/general/repository/create.repository.d.ts +0 -5
- package/lib/domain/general/repository/crud.repository.d.ts +0 -7
- package/lib/domain/general/repository/delete.repository.d.ts +0 -5
- package/lib/domain/general/repository/enums/where.enum.d.ts +0 -10
- package/lib/domain/general/repository/find.repository.d.ts +0 -5
- package/lib/domain/general/repository/get.repository.d.ts +0 -5
- package/lib/domain/general/repository/read.repository.d.ts +0 -5
- package/lib/domain/general/repository/types/index.d.ts +0 -5
- package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +0 -14
- package/lib/domain/general/repository/types/repository-update-params.type.d.ts +0 -11
- package/lib/domain/general/repository/update.repository.d.ts +0 -5
- package/lib/domain/index.d.ts +0 -6
- package/lib/domain/location/models/address.d.ts +0 -21
- package/lib/domain/shop-settings/models/home.d.ts +0 -17
- package/lib/domain/shop-settings/models/shop-menu.d.ts +0 -7
- package/lib/domain/shop-settings/models/types/index.d.ts +0 -4
- package/lib/domain/shop-settings/repositories/home.repository.d.ts +0 -4
- package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +0 -4
- package/lib/domain/shopping/models/buy-2-win.d.ts +0 -18
- package/lib/domain/shopping/models/checkout.d.ts +0 -28
- package/lib/domain/shopping/models/coupons/club-coupon.d.ts +0 -9
- package/lib/domain/shopping/models/coupons/coupon.d.ts +0 -28
- package/lib/domain/shopping/models/coupons/enums/discount-type.enum.d.ts +0 -5
- package/lib/domain/shopping/models/coupons/enums/index.d.ts +0 -2
- package/lib/domain/shopping/models/coupons/index.d.ts +0 -4
- package/lib/domain/shopping/models/coupons/store-coupon.d.ts +0 -8
- package/lib/domain/shopping/models/payment.d.ts +0 -69
- package/lib/domain/shopping/models/shipping-method.d.ts +0 -18
- package/lib/domain/shopping/models/subscription/checkout.d.ts +0 -23
- package/lib/domain/shopping/models/subscription/plan.d.ts +0 -12
- package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/checkout.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/coupon.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/order.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/payment.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +0 -4
- package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +0 -4
- package/lib/domain/users/models/beauty-profile.d.ts +0 -12
- package/lib/domain/users/models/lead.d.ts +0 -9
- package/lib/domain/users/models/subscription/edition.d.ts +0 -15
- package/lib/domain/users/models/subscription/payment.d.ts +0 -14
- package/lib/domain/users/models/subscription/subscription.d.ts +0 -30
- package/lib/domain/users/models/user-address.d.ts +0 -7
- package/lib/domain/users/models/user-payment-method.d.ts +0 -13
- package/lib/domain/users/models/user.d.ts +0 -24
- package/lib/domain/users/repositories/beauty-profile.repository.d.ts +0 -4
- package/lib/domain/users/repositories/edition.repository.d.ts +0 -4
- package/lib/domain/users/repositories/lead.repository.d.ts +0 -4
- package/lib/domain/users/repositories/subscription-payment.repository.d.ts +0 -4
- package/lib/domain/users/repositories/subscription.repository.d.ts +0 -4
- package/lib/domain/users/repositories/user-address.repository.d.ts +0 -4
- package/lib/domain/users/repositories/user-payment-method.repository.d.ts +0 -4
- package/lib/domain/users/repositories/user.repository.d.ts +0 -6
- package/lib/domain/users/services/authentication.service.d.ts +0 -11
- package/lib/domain/users/use-cases/index.d.ts +0 -3
- package/lib/index.d.ts +0 -4
- package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +0 -11
- package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +0 -17
- package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +0 -29
- package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +0 -15
- package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +0 -20
- package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +0 -15
- package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +0 -15
- package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +0 -10
- package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +0 -14
- package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +0 -16
- package/lib/infra/firebase/firestore/models/user-search.d.ts +0 -9
- package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +0 -55
- package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +0 -50
- package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +0 -53
- package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +0 -49
- package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +0 -60
- package/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +0 -50
- package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +0 -6
- package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +0 -8
- package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +0 -8
- package/lib/infra/index.d.ts +0 -1
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/mixins/index.d.ts +0 -2
- package/lib/utils/mixins/mixin-ctor.type.d.ts +0 -1
- package/lib/utils/types/index.d.ts +0 -1
- package/public-api.d.ts +0 -2
- /package/{lib/domain → domain}/catalog/index.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/enums/index.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/index.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/category-condition.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/category-filter.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/index.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/shops-description.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/shops-price.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/stock.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/models/types/variant-grade.type.d.ts +0 -0
- /package/{lib/domain → domain}/catalog/repositories/index.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/index.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/model/identifier-fields.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/enums/index.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/enums/update-option-actions.enum.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/index.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/types/repository-find-result.type.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/types/repository-limit-options.type.d.ts +0 -0
- /package/{lib/domain/general → domain/generic}/repository/types/repository-order-by-list.type.d.ts +0 -0
- /package/{lib/domain → domain}/location/index.d.ts +0 -0
- /package/{lib/domain → domain}/location/models/index.d.ts +0 -0
- /package/{lib/domain → domain}/location/models/types/index.d.ts +0 -0
- /package/{lib/domain → domain}/location/models/types/location-bound.type.d.ts +0 -0
- /package/{lib/domain → domain}/location/models/types/location-geometry.type.d.ts +0 -0
- /package/{lib/domain → domain}/location/models/types/location-lat-lng.type.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/enums/filter-type.enum.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/enums/index.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/enums/questions-filters.enum.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/helpers/beauty-questions.helper.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/helpers/index.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/index.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/models/index.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/models/types/banner.type.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/models/types/benefit.type.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/models/types/menu-nav.type.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/models/types/sub-menu.type.d.ts +0 -0
- /package/{lib/domain → domain}/shop-settings/repositories/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/coupons/enums/exclusivities.enum.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/enums/checkout-types.enum.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/enums/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/enums/order-status.enum.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/line-item.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/order.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/subscription/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-address.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-billing.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-card.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-customer.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-document.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-item.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/models/types/payment-shipping.type.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/repositories/index.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/repositories/legacy-order.repository.d.ts +0 -0
- /package/{lib/domain → domain}/shopping/repositories/subscription/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/errors/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/errors/unauthorized.error.d.ts +0 -0
- /package/{lib/domain → domain}/users/errors/user-already-registered.error.d.ts +0 -0
- /package/{lib/domain → domain}/users/errors/weak-password.error.d.ts +0 -0
- /package/{lib/domain → domain}/users/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/accessory-importances.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/area.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/beard-problems.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/beard-sizes.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/beauty-product-importances.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/body-problems.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/body-shapes.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/body-tattoos.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/face-skin-oilinesses.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/face-skin-problems.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/face-skin-tones.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/family-incomes.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/fragrance-importances.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/hair-colors.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/hair-problems.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/hair-strands.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/hair-types.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/office-position.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/product-spents.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/enums/user-type.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/enums/billing-status.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/enums/edition-status.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/enums/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/enums/payment-type.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/enums/status.enum.d.ts +0 -0
- /package/{lib/domain → domain}/users/models/subscription/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/repositories/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/services/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/services/register.service.d.ts +0 -0
- /package/{lib/domain → domain}/users/services/types/basic-user-data.type.d.ts +0 -0
- /package/{lib/domain → domain}/users/services/types/index.d.ts +0 -0
- /package/{lib/domain → domain}/users/use-cases/authentication.d.ts +0 -0
- /package/{lib/domain → domain}/users/use-cases/register.d.ts +0 -0
- /package/{lib/domain → domain}/users/use-cases/signout.d.ts +0 -0
- /package/{lib/errors → errors}/duplicated-results.error.d.ts +0 -0
- /package/{lib/errors → errors}/index.d.ts +0 -0
- /package/{lib/errors → errors}/invalid-argument.error.d.ts +0 -0
- /package/{lib/errors → errors}/not-found.error.d.ts +0 -0
- /package/{lib/errors → errors}/required-argument.error.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/auth/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/auth/register-firebase-auth.service.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/auth/types/firebase-user-with-id.type.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/mixins/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/catalog/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/shop-settings/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/shopping/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/repositories/users/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/firestore/types/index.d.ts +0 -0
- /package/{lib/infra → infra}/firebase/index.d.ts +0 -0
- /package/{lib/utils → utils}/mixins/base.mixin.d.ts +0 -0
- /package/{lib/utils → utils}/types/prop.type.d.ts +0 -0
|
@@ -1,33 +1,52 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { plainToClass, classToPlain, Expose, Type } from 'class-transformer';
|
|
3
3
|
import { __decorate, __metadata, __awaiter } from 'tslib';
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
4
|
+
import { parseISO } from 'date-fns';
|
|
5
|
+
export { add, addBusinessDays, addDays, addMonths, addYears, endOfDay, format, formatISO9075, parseISO, startOfDay, sub } from 'date-fns';
|
|
6
|
+
import { isString, isNil, isNumber, isDate, set, isObject, isEmpty, chunk, isBoolean, isInteger, isNaN as isNaN$1 } from 'lodash';
|
|
7
|
+
export { chunk, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set } from 'lodash';
|
|
8
|
+
import { Md5 } from 'ts-md5';
|
|
9
|
+
import axios from 'axios';
|
|
6
10
|
import firebase from 'firebase';
|
|
7
11
|
import firebase$1 from 'firebase/app';
|
|
12
|
+
import { mutation, query } from 'gql-query-builder';
|
|
13
|
+
import fetch from 'node-fetch';
|
|
8
14
|
|
|
9
15
|
class BaseModel {
|
|
16
|
+
get identifier() {
|
|
17
|
+
const fields = this.constructor.identifiersFields.filter((field) => field !== 'identifier');
|
|
18
|
+
return fields.reduce((object, field) => (Object.assign(Object.assign({}, object), { [field]: this[field] })), {});
|
|
19
|
+
}
|
|
20
|
+
get identifiersFields() {
|
|
21
|
+
return this.constructor.identifiersFields;
|
|
22
|
+
}
|
|
10
23
|
constructor(args) {
|
|
11
24
|
Object.assign(this, args);
|
|
12
25
|
}
|
|
13
26
|
static toInstance(data) {
|
|
14
|
-
return plainToClass(this, data);
|
|
27
|
+
return plainToClass(this, data || {});
|
|
28
|
+
}
|
|
29
|
+
static isModel(value) {
|
|
30
|
+
return value instanceof this;
|
|
15
31
|
}
|
|
16
32
|
toPlain() {
|
|
17
|
-
return classToPlain(this
|
|
33
|
+
return classToPlain(this);
|
|
18
34
|
}
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
var Where;
|
|
22
38
|
(function (Where) {
|
|
23
39
|
Where["EQUALS"] = "==";
|
|
24
|
-
Where["NOTEQUALS"] = "!=";
|
|
25
40
|
Where["GT"] = ">";
|
|
26
41
|
Where["GTE"] = ">=";
|
|
27
42
|
Where["IN"] = "in";
|
|
43
|
+
Where["NOTIN"] = "not in";
|
|
28
44
|
Where["LT"] = "<";
|
|
29
45
|
Where["LTE"] = "<=";
|
|
30
46
|
Where["LIKE"] = "like";
|
|
47
|
+
Where["NOTLIKE"] = "not like";
|
|
48
|
+
Where["ISNULL"] = "is null";
|
|
49
|
+
Where["ISNOTNULL"] = "is not null";
|
|
31
50
|
})(Where || (Where = {}));
|
|
32
51
|
|
|
33
52
|
var UpdateOptionActions;
|
|
@@ -260,13 +279,13 @@ var Status;
|
|
|
260
279
|
})(Status || (Status = {}));
|
|
261
280
|
|
|
262
281
|
class Edition extends BaseModel {
|
|
263
|
-
|
|
264
|
-
return ['id'];
|
|
282
|
+
static get identifiersFields() {
|
|
283
|
+
return ['id', 'subscriptionId'];
|
|
265
284
|
}
|
|
266
285
|
}
|
|
267
286
|
|
|
268
287
|
class Payment extends BaseModel {
|
|
269
|
-
|
|
288
|
+
static get identifiersFields() {
|
|
270
289
|
return ['id'];
|
|
271
290
|
}
|
|
272
291
|
}
|
|
@@ -432,8 +451,8 @@ __decorate([
|
|
|
432
451
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
433
452
|
|
|
434
453
|
class SubscriptionPayment extends BaseModel {
|
|
435
|
-
|
|
436
|
-
return ['id'];
|
|
454
|
+
static get identifiersFields() {
|
|
455
|
+
return ['id', 'subscriptionId'];
|
|
437
456
|
}
|
|
438
457
|
}
|
|
439
458
|
__decorate([
|
|
@@ -442,6 +461,9 @@ __decorate([
|
|
|
442
461
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
443
462
|
|
|
444
463
|
class Address extends BaseModel {
|
|
464
|
+
static get identifiersFields() {
|
|
465
|
+
return ['id'];
|
|
466
|
+
}
|
|
445
467
|
}
|
|
446
468
|
|
|
447
469
|
var CheckoutTypes;
|
|
@@ -456,12 +478,33 @@ class Base {
|
|
|
456
478
|
}
|
|
457
479
|
}
|
|
458
480
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
481
|
+
const isUUID = (value) => isString(value) && /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/.test(value);
|
|
482
|
+
|
|
483
|
+
const parseDateTime = (value) => {
|
|
484
|
+
if (!isString(value))
|
|
485
|
+
return value;
|
|
486
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value) &&
|
|
487
|
+
!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}/.test(value))
|
|
488
|
+
return value;
|
|
489
|
+
const date = parseISO(value);
|
|
490
|
+
if (isNaN(date.getTime()))
|
|
491
|
+
return value;
|
|
492
|
+
return date;
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
var CouponTypes;
|
|
496
|
+
(function (CouponTypes) {
|
|
497
|
+
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
498
|
+
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
499
|
+
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
500
|
+
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
501
|
+
})(CouponTypes || (CouponTypes = {}));
|
|
502
|
+
|
|
503
|
+
var CouponSubtypes;
|
|
504
|
+
(function (CouponSubtypes) {
|
|
505
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
506
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
507
|
+
})(CouponSubtypes || (CouponSubtypes = {}));
|
|
465
508
|
|
|
466
509
|
var Exclusivities;
|
|
467
510
|
(function (Exclusivities) {
|
|
@@ -474,17 +517,9 @@ class Coupon extends BaseModel {
|
|
|
474
517
|
get isInfluencer() {
|
|
475
518
|
return !isNil(this.influencerEmail);
|
|
476
519
|
}
|
|
477
|
-
|
|
520
|
+
static get identifiersFields() {
|
|
478
521
|
return ['id'];
|
|
479
522
|
}
|
|
480
|
-
calculeDiscount(amount) {
|
|
481
|
-
switch (this.discountType) {
|
|
482
|
-
case DiscountType.ABSOLUTE:
|
|
483
|
-
return this.discount < amount ? this.discount : amount;
|
|
484
|
-
case DiscountType.PERCENTAGE:
|
|
485
|
-
return this.discount * 0.01 * amount;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
523
|
}
|
|
489
524
|
__decorate([
|
|
490
525
|
Expose({ name: 'checkout_type' }),
|
|
@@ -496,7 +531,7 @@ __decorate([
|
|
|
496
531
|
], Coupon.prototype, "exclusivityType", void 0);
|
|
497
532
|
|
|
498
533
|
class SubscriptionPlan extends BaseModel {
|
|
499
|
-
|
|
534
|
+
static get identifiersFields() {
|
|
500
535
|
return ['id'];
|
|
501
536
|
}
|
|
502
537
|
}
|
|
@@ -507,8 +542,8 @@ class BeautyProfile extends BaseModel {
|
|
|
507
542
|
delete plain.id;
|
|
508
543
|
return plain;
|
|
509
544
|
}
|
|
510
|
-
|
|
511
|
-
return ['id'];
|
|
545
|
+
static get identifiersFields() {
|
|
546
|
+
return ['id', 'userId'];
|
|
512
547
|
}
|
|
513
548
|
}
|
|
514
549
|
|
|
@@ -519,14 +554,14 @@ class User extends BaseModel {
|
|
|
519
554
|
instance.displayName = `${data.firstName}${!isNil(data.lastName) ? ` ${data.lastName}` : ''}`;
|
|
520
555
|
return instance;
|
|
521
556
|
}
|
|
522
|
-
identifierFields() {
|
|
523
|
-
return ['id'];
|
|
524
|
-
}
|
|
525
557
|
toPlain() {
|
|
526
558
|
const plain = super.toPlain();
|
|
527
559
|
delete plain.beautyProfile;
|
|
528
560
|
return plain;
|
|
529
561
|
}
|
|
562
|
+
static get identifiersFields() {
|
|
563
|
+
return ['id'];
|
|
564
|
+
}
|
|
530
565
|
}
|
|
531
566
|
__decorate([
|
|
532
567
|
Type(() => BeautyProfile),
|
|
@@ -534,7 +569,7 @@ __decorate([
|
|
|
534
569
|
], User.prototype, "beautyProfile", void 0);
|
|
535
570
|
|
|
536
571
|
class Subscription extends BaseModel {
|
|
537
|
-
|
|
572
|
+
static get identifiersFields() {
|
|
538
573
|
return ['id'];
|
|
539
574
|
}
|
|
540
575
|
}
|
|
@@ -568,19 +603,19 @@ __decorate([
|
|
|
568
603
|
], Subscription.prototype, "payment", void 0);
|
|
569
604
|
|
|
570
605
|
class UserAddress extends Address {
|
|
571
|
-
|
|
572
|
-
return ['id'];
|
|
606
|
+
static get identifiersFields() {
|
|
607
|
+
return ['id', 'userId'];
|
|
573
608
|
}
|
|
574
609
|
}
|
|
575
610
|
|
|
576
611
|
class UserPaymentMethod extends BaseModel {
|
|
577
|
-
|
|
578
|
-
return ['id'];
|
|
612
|
+
static get identifiersFields() {
|
|
613
|
+
return ['id', 'userId'];
|
|
579
614
|
}
|
|
580
615
|
}
|
|
581
616
|
|
|
582
617
|
class Lead extends BaseModel {
|
|
583
|
-
|
|
618
|
+
static get identifiersFields() {
|
|
584
619
|
return ['id'];
|
|
585
620
|
}
|
|
586
621
|
}
|
|
@@ -652,9 +687,9 @@ class Register {
|
|
|
652
687
|
const email = params.email.toLocaleLowerCase();
|
|
653
688
|
const displayName = `${params.firstName} ${params.lastName}`;
|
|
654
689
|
if (yield this.userRepository.checkIfExistsByField('cpf', params.cpf))
|
|
655
|
-
throw new UserAlreadyRegisteredError(`
|
|
690
|
+
throw new UserAlreadyRegisteredError(`Usuário com CPF ${params.cpf} já registrado.`);
|
|
656
691
|
if (yield this.userRepository.checkIfExistsByField('email', params.email))
|
|
657
|
-
throw new UserAlreadyRegisteredError(`
|
|
692
|
+
throw new UserAlreadyRegisteredError(`Usuário com e-mail ${params.email} já registrado.`);
|
|
658
693
|
const auth = yield this.registerService.register({
|
|
659
694
|
birthday: params.birthday,
|
|
660
695
|
email,
|
|
@@ -684,16 +719,31 @@ class SignOut {
|
|
|
684
719
|
}
|
|
685
720
|
}
|
|
686
721
|
|
|
722
|
+
class RecoveryPassword {
|
|
723
|
+
constructor(authService) {
|
|
724
|
+
this.authService = authService;
|
|
725
|
+
}
|
|
726
|
+
sendEmail(email) {
|
|
727
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
728
|
+
yield this.authService.sendPasswordResetEmail(email);
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
687
733
|
var Shops;
|
|
688
734
|
(function (Shops) {
|
|
689
735
|
Shops["MENSMARKET"] = "mensmarket";
|
|
690
736
|
Shops["GLAMSHOP"] = "Glamshop";
|
|
737
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
691
738
|
})(Shops || (Shops = {}));
|
|
692
739
|
|
|
693
740
|
class Category extends BaseModel {
|
|
694
741
|
identifierFields() {
|
|
695
742
|
return ['id'];
|
|
696
743
|
}
|
|
744
|
+
static get identifiersFields() {
|
|
745
|
+
return ['id'];
|
|
746
|
+
}
|
|
697
747
|
}
|
|
698
748
|
|
|
699
749
|
class Product extends BaseModel {
|
|
@@ -704,49 +754,43 @@ class Product extends BaseModel {
|
|
|
704
754
|
var _a, _b, _c, _d, _e, _f;
|
|
705
755
|
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]) || {}));
|
|
706
756
|
}
|
|
757
|
+
static get identifiersFields() {
|
|
758
|
+
return ['id'];
|
|
759
|
+
}
|
|
707
760
|
}
|
|
708
761
|
|
|
709
762
|
class Variant extends BaseModel {
|
|
710
763
|
identifierFields() {
|
|
711
764
|
return ['id'];
|
|
712
765
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
class ClubCoupon extends Coupon {
|
|
716
|
-
constructor() {
|
|
717
|
-
super(...arguments);
|
|
718
|
-
this.checkoutType = CheckoutTypes.SUBSCRIPTION;
|
|
719
|
-
}
|
|
720
|
-
static isClubCoupon(coupon) {
|
|
721
|
-
return coupon instanceof ClubCoupon;
|
|
766
|
+
static get identifiersFields() {
|
|
767
|
+
return ['id', 'productId'];
|
|
722
768
|
}
|
|
723
769
|
}
|
|
724
|
-
__decorate([
|
|
725
|
-
Expose({ name: 'checkout_type' }),
|
|
726
|
-
__metadata("design:type", Object)
|
|
727
|
-
], ClubCoupon.prototype, "checkoutType", void 0);
|
|
728
|
-
__decorate([
|
|
729
|
-
Type(() => Category),
|
|
730
|
-
__metadata("design:type", Array)
|
|
731
|
-
], ClubCoupon.prototype, "categories", void 0);
|
|
732
770
|
|
|
733
|
-
|
|
771
|
+
const COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
772
|
+
class FinancialCoupon extends Coupon {
|
|
734
773
|
constructor() {
|
|
735
774
|
super(...arguments);
|
|
736
|
-
this.
|
|
737
|
-
}
|
|
738
|
-
static
|
|
739
|
-
return coupon
|
|
775
|
+
this.type = CouponTypes.FINANCIAL;
|
|
776
|
+
}
|
|
777
|
+
static isFinancialCoupon(coupon) {
|
|
778
|
+
return coupon.type === CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
779
|
+
}
|
|
780
|
+
static createCoupon(userId) {
|
|
781
|
+
return this.toInstance({
|
|
782
|
+
name: Md5.hashStr(`${userId}_${Date.now}`).toString(),
|
|
783
|
+
nickname: `${Date.now()}`,
|
|
784
|
+
type: CouponTypes.FINANCIAL,
|
|
785
|
+
subtype: CouponSubtypes.PERCENTAGE,
|
|
786
|
+
checkoutType: CheckoutTypes.ECOMMERCE,
|
|
787
|
+
discount: 30,
|
|
788
|
+
user: userId,
|
|
789
|
+
createdAt: new Date(Date.now()),
|
|
790
|
+
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
791
|
+
});
|
|
740
792
|
}
|
|
741
793
|
}
|
|
742
|
-
__decorate([
|
|
743
|
-
Expose({ name: 'checkout_type' }),
|
|
744
|
-
__metadata("design:type", Object)
|
|
745
|
-
], StoreCoupon.prototype, "checkoutType", void 0);
|
|
746
|
-
__decorate([
|
|
747
|
-
Type(() => Category),
|
|
748
|
-
__metadata("design:type", Array)
|
|
749
|
-
], StoreCoupon.prototype, "categories", void 0);
|
|
750
794
|
|
|
751
795
|
var OrderStatus;
|
|
752
796
|
(function (OrderStatus) {
|
|
@@ -764,13 +808,13 @@ class LineItem extends Product {
|
|
|
764
808
|
}
|
|
765
809
|
|
|
766
810
|
class ShippingMethod extends BaseModel {
|
|
767
|
-
|
|
811
|
+
static get identifiersFields() {
|
|
768
812
|
return ['id'];
|
|
769
813
|
}
|
|
770
814
|
}
|
|
771
815
|
|
|
772
816
|
class Checkout extends BaseModel {
|
|
773
|
-
|
|
817
|
+
static get identifiersFields() {
|
|
774
818
|
return ['id'];
|
|
775
819
|
}
|
|
776
820
|
}
|
|
@@ -807,7 +851,7 @@ __decorate([
|
|
|
807
851
|
], Order.prototype, "payment", void 0);
|
|
808
852
|
|
|
809
853
|
class CheckoutSubscription extends BaseModel {
|
|
810
|
-
|
|
854
|
+
static get identifiersFields() {
|
|
811
855
|
return ['id'];
|
|
812
856
|
}
|
|
813
857
|
}
|
|
@@ -829,7 +873,7 @@ __decorate([
|
|
|
829
873
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
830
874
|
|
|
831
875
|
class Buy2Win extends BaseModel {
|
|
832
|
-
|
|
876
|
+
static get identifiersFields() {
|
|
833
877
|
return ['id'];
|
|
834
878
|
}
|
|
835
879
|
}
|
|
@@ -925,13 +969,13 @@ class BeautyQuestionsHelper {
|
|
|
925
969
|
}
|
|
926
970
|
|
|
927
971
|
class Home extends BaseModel {
|
|
928
|
-
|
|
972
|
+
static get identifiersFields() {
|
|
929
973
|
return ['id'];
|
|
930
974
|
}
|
|
931
975
|
}
|
|
932
976
|
|
|
933
977
|
class ShopMenu extends BaseModel {
|
|
934
|
-
|
|
978
|
+
static get identifiersFields() {
|
|
935
979
|
return ['id'];
|
|
936
980
|
}
|
|
937
981
|
}
|
|
@@ -965,11 +1009,85 @@ class DuplicatedResultsError extends Error {
|
|
|
965
1009
|
}
|
|
966
1010
|
}
|
|
967
1011
|
|
|
1012
|
+
class AxiosAdapter {
|
|
1013
|
+
constructor(config) {
|
|
1014
|
+
this.config = config;
|
|
1015
|
+
}
|
|
1016
|
+
query(index, query) {
|
|
1017
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1018
|
+
const { data } = yield axios({
|
|
1019
|
+
url: `${this.config.url}/${index}`,
|
|
1020
|
+
method: 'POST',
|
|
1021
|
+
headers: { Authorization: `Basic ${this.config.credential}` },
|
|
1022
|
+
data: query,
|
|
1023
|
+
});
|
|
1024
|
+
return {
|
|
1025
|
+
total: data.hits.total.value,
|
|
1026
|
+
hits: data.hits.hits,
|
|
1027
|
+
};
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
class ProductsIndex {
|
|
1033
|
+
constructor(adapter) {
|
|
1034
|
+
this.adapter = adapter;
|
|
1035
|
+
}
|
|
1036
|
+
findById(ids, options) {
|
|
1037
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1038
|
+
const publishedField = options.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1039
|
+
const fields = [
|
|
1040
|
+
'brand',
|
|
1041
|
+
'id',
|
|
1042
|
+
'images',
|
|
1043
|
+
'miniatures',
|
|
1044
|
+
'name',
|
|
1045
|
+
'price',
|
|
1046
|
+
'sku',
|
|
1047
|
+
'stock',
|
|
1048
|
+
'slug',
|
|
1049
|
+
'reviews',
|
|
1050
|
+
'pricePaid',
|
|
1051
|
+
'isGift',
|
|
1052
|
+
'stock',
|
|
1053
|
+
'weight',
|
|
1054
|
+
'tags',
|
|
1055
|
+
'hasVariants',
|
|
1056
|
+
];
|
|
1057
|
+
const { hits } = yield this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
|
|
1058
|
+
bool: {
|
|
1059
|
+
filter: [
|
|
1060
|
+
{
|
|
1061
|
+
terms: {
|
|
1062
|
+
_id: ids,
|
|
1063
|
+
},
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
term: {
|
|
1067
|
+
[publishedField]: true,
|
|
1068
|
+
},
|
|
1069
|
+
},
|
|
1070
|
+
...(options.hasStock
|
|
1071
|
+
? [
|
|
1072
|
+
{
|
|
1073
|
+
range: {
|
|
1074
|
+
'stock.quantity': {
|
|
1075
|
+
gt: 0,
|
|
1076
|
+
},
|
|
1077
|
+
},
|
|
1078
|
+
},
|
|
1079
|
+
]
|
|
1080
|
+
: []),
|
|
1081
|
+
],
|
|
1082
|
+
},
|
|
1083
|
+
} }, (options.size ? { size: options.size } : {})));
|
|
1084
|
+
return hits.map((hit) => Product.toInstance(hit._source));
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
|
|
968
1089
|
const withFirestore = (MixinBase) => {
|
|
969
1090
|
return class extends MixinBase {
|
|
970
|
-
constructor(...args) {
|
|
971
|
-
super(args);
|
|
972
|
-
}
|
|
973
1091
|
collection(path) {
|
|
974
1092
|
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
975
1093
|
}
|
|
@@ -983,7 +1101,7 @@ const withFirestore = (MixinBase) => {
|
|
|
983
1101
|
data[key] = data[key].toDate();
|
|
984
1102
|
}
|
|
985
1103
|
});
|
|
986
|
-
return this.model.toInstance(Object.assign({ id: snap.id }
|
|
1104
|
+
return this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
|
|
987
1105
|
},
|
|
988
1106
|
};
|
|
989
1107
|
}
|
|
@@ -1032,6 +1150,9 @@ const withFindFirestore = (MixinBase) => {
|
|
|
1032
1150
|
const getValueFromFilter = (filter) => {
|
|
1033
1151
|
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1034
1152
|
};
|
|
1153
|
+
const getFinalValueFrom = (value) => isNumber(value) || isString(value) || isDate(value) || Array.isArray(value)
|
|
1154
|
+
? value
|
|
1155
|
+
: Object.values(getFinalValueFrom);
|
|
1035
1156
|
return class FindFirestore extends MixinBase {
|
|
1036
1157
|
constructor() {
|
|
1037
1158
|
super(...arguments);
|
|
@@ -1039,25 +1160,33 @@ const withFindFirestore = (MixinBase) => {
|
|
|
1039
1160
|
this.buildWhereSentence = (queryReference, fieldName, options) => {
|
|
1040
1161
|
if (this.isSubCollection(this) && fieldName === this.parentIdField)
|
|
1041
1162
|
return queryReference;
|
|
1163
|
+
const value = (options === null || options === void 0 ? void 0 : options.value) || options;
|
|
1164
|
+
const object = {};
|
|
1165
|
+
set(object, fieldName, value);
|
|
1166
|
+
const plainInstance = new this.model(object).toPlain();
|
|
1167
|
+
const firestoreFieldName = fieldName.toString().indexOf('.') > -1
|
|
1168
|
+
? fieldName.toString()
|
|
1169
|
+
: Object.keys(plainInstance).find((key) => plainInstance[key]);
|
|
1042
1170
|
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
|
|
1043
1171
|
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1044
|
-
return queryReference.where(
|
|
1045
|
-
queryReference = queryReference.where(
|
|
1046
|
-
queryReference = queryReference.where(
|
|
1172
|
+
return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
|
|
1173
|
+
queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
|
|
1174
|
+
queryReference = queryReference.where(firestoreFieldName, '<=', `${options.value}~`);
|
|
1047
1175
|
return queryReference;
|
|
1048
1176
|
}
|
|
1049
1177
|
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1050
|
-
return queryReference.where(
|
|
1051
|
-
if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1052
|
-
return Object.keys(options).reduce((queryReferenceWithWhere, key) => this.buildWhereSentence(queryReferenceWithWhere, `${fieldName}.${key}`, options[key]), queryReference);
|
|
1053
|
-
|
|
1178
|
+
return queryReference.where(firestoreFieldName, 'array-contains', options.value);
|
|
1179
|
+
if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value)) {
|
|
1180
|
+
return Object.keys(options).reduce((queryReferenceWithWhere, key) => this.buildWhereSentence(queryReferenceWithWhere, `${fieldName.toString()}.${key}`, options[key]), queryReference);
|
|
1181
|
+
}
|
|
1182
|
+
return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1054
1183
|
};
|
|
1055
1184
|
}
|
|
1056
|
-
find(filters, limits, orderBy) {
|
|
1185
|
+
find({ filters, limits, orderBy, }) {
|
|
1057
1186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1058
1187
|
let query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1059
|
-
|
|
1060
|
-
|
|
1188
|
+
query = this.makeFirestoreWhere(query, filters);
|
|
1189
|
+
Object.keys(orderBy).forEach((fieldName) => (query = query.orderBy(fieldName, orderBy[fieldName])));
|
|
1061
1190
|
query = yield this.defineLimits(query, filters, limits);
|
|
1062
1191
|
const docs = yield query.get();
|
|
1063
1192
|
const data = docs.docs.map((doc) => doc.data());
|
|
@@ -1068,19 +1197,18 @@ const withFindFirestore = (MixinBase) => {
|
|
|
1068
1197
|
});
|
|
1069
1198
|
}
|
|
1070
1199
|
buildCollectionPathForFind(filters) {
|
|
1071
|
-
var _a;
|
|
1072
1200
|
if (!this.isSubCollection(this))
|
|
1073
1201
|
return this.collectionName;
|
|
1074
1202
|
const parentIdField = this.parentIdField;
|
|
1075
|
-
const parentId = getValueFromFilter(
|
|
1203
|
+
const parentId = getValueFromFilter(filters === null || filters === void 0 ? void 0 : filters[parentIdField]);
|
|
1076
1204
|
return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
|
|
1077
1205
|
}
|
|
1078
1206
|
defineLimits(query, filters, limits) {
|
|
1079
1207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1080
1208
|
if (limits === null || limits === void 0 ? void 0 : limits.offset) {
|
|
1081
|
-
if (limits.offset
|
|
1209
|
+
if (this.model.isModel(limits.offset))
|
|
1082
1210
|
query = query.startAfter(yield this.collection(this.buildCollectionPathForFind(filters))
|
|
1083
|
-
.doc(limits.offset[limits.offset.
|
|
1211
|
+
.doc(limits.offset[limits.offset.identifiersFields.shift()])
|
|
1084
1212
|
.get());
|
|
1085
1213
|
else if (isNumber(limits.offset) || isString(limits.offset))
|
|
1086
1214
|
query = query.startAt(limits.offset);
|
|
@@ -1112,7 +1240,7 @@ const withCreateFirestore = (MixinBase) => {
|
|
|
1112
1240
|
save(data) {
|
|
1113
1241
|
var _a;
|
|
1114
1242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1115
|
-
const id = (_a = data[data.
|
|
1243
|
+
const id = (_a = data[data.identifiersFields.shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1116
1244
|
const collectionPath = this.buildCollectionPathForAdd(data);
|
|
1117
1245
|
if (isEmpty(id))
|
|
1118
1246
|
return this.collection(collectionPath).add(data);
|
|
@@ -1149,7 +1277,7 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
1149
1277
|
update(data) {
|
|
1150
1278
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1151
1279
|
const model = new this.model();
|
|
1152
|
-
const keyField = model.
|
|
1280
|
+
const keyField = model.identifiersFields.shift();
|
|
1153
1281
|
const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1154
1282
|
yield docRef.set(this.paramsToPlain(data), { merge: true });
|
|
1155
1283
|
const doc = yield docRef.get();
|
|
@@ -1163,8 +1291,8 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
1163
1291
|
}
|
|
1164
1292
|
paramsToPlain(params) {
|
|
1165
1293
|
const model = this.model;
|
|
1166
|
-
if (params
|
|
1167
|
-
return params;
|
|
1294
|
+
if (model.isModel(params))
|
|
1295
|
+
return params.toPlain();
|
|
1168
1296
|
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
1169
1297
|
}
|
|
1170
1298
|
};
|
|
@@ -1213,7 +1341,7 @@ class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
1213
1341
|
}
|
|
1214
1342
|
|
|
1215
1343
|
class UserSearch extends BaseModel {
|
|
1216
|
-
|
|
1344
|
+
static get identifiersFields() {
|
|
1217
1345
|
return ['id'];
|
|
1218
1346
|
}
|
|
1219
1347
|
}
|
|
@@ -1248,7 +1376,7 @@ class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
|
|
|
1248
1376
|
}
|
|
1249
1377
|
checkIfExistsByField(field, value) {
|
|
1250
1378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1251
|
-
const result = yield this.userSearchFirestoreRepository.find(
|
|
1379
|
+
const result = yield this.userSearchFirestoreRepository.find({ [field]: { operator: Where.EQUALS, value } });
|
|
1252
1380
|
return result.count > 0;
|
|
1253
1381
|
});
|
|
1254
1382
|
}
|
|
@@ -1381,49 +1509,41 @@ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFire
|
|
|
1381
1509
|
getCategoriesForHome(categoryIds, limit = 4) {
|
|
1382
1510
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1383
1511
|
const categorySnap = yield this.collection(this.collectionName)
|
|
1384
|
-
.where('id', 'in', categoryIds)
|
|
1512
|
+
.where('id', 'in', categoryIds.filter(Boolean))
|
|
1385
1513
|
.where('published', '==', true)
|
|
1386
1514
|
.get();
|
|
1387
1515
|
if (categorySnap.empty)
|
|
1388
1516
|
throw new NotFoundError('Categories not found');
|
|
1389
1517
|
const categories = categorySnap.docs.map((doc) => doc.data());
|
|
1390
|
-
const homeSections =
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
.where('stock.quantity', '>', 1)
|
|
1397
|
-
.limit(limit)
|
|
1398
|
-
.get();
|
|
1399
|
-
const products = productSnap.docs.map((doc) => doc.data());
|
|
1400
|
-
homeSections.push({ category, products });
|
|
1401
|
-
}
|
|
1518
|
+
const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
|
|
1519
|
+
return ({
|
|
1520
|
+
category,
|
|
1521
|
+
products: yield this.mountCategory(category, { limit, hasStock: true }),
|
|
1522
|
+
});
|
|
1523
|
+
})));
|
|
1402
1524
|
return homeSections;
|
|
1403
1525
|
});
|
|
1404
1526
|
}
|
|
1405
|
-
mountCategory(category) {
|
|
1527
|
+
mountCategory(category, options) {
|
|
1406
1528
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1407
1529
|
if (!category.products)
|
|
1408
1530
|
throw new RequiredArgumentError(['Category products is empty']);
|
|
1409
|
-
const chunks = category.products
|
|
1410
|
-
const chunkIndex = Math.floor(index / 10);
|
|
1411
|
-
if (!resultArray[chunkIndex])
|
|
1412
|
-
resultArray[chunkIndex] = [];
|
|
1413
|
-
resultArray[chunkIndex].push(item);
|
|
1414
|
-
return resultArray;
|
|
1415
|
-
}, []);
|
|
1531
|
+
const chunks = chunk(category.products, 10);
|
|
1416
1532
|
const products = [];
|
|
1417
1533
|
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1534
|
+
for (const productIds of chunks) {
|
|
1535
|
+
if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
|
|
1536
|
+
break;
|
|
1537
|
+
let query = yield this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds);
|
|
1538
|
+
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
1539
|
+
query = query.where('stock.quantity', '>', 0);
|
|
1540
|
+
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
1541
|
+
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
1542
|
+
const productSnap = yield query.get();
|
|
1423
1543
|
if (productSnap.empty)
|
|
1424
|
-
|
|
1544
|
+
continue;
|
|
1425
1545
|
products.push(...productSnap.docs.map((doc) => doc.data()));
|
|
1426
|
-
}
|
|
1546
|
+
}
|
|
1427
1547
|
return products;
|
|
1428
1548
|
});
|
|
1429
1549
|
}
|
|
@@ -1439,10 +1559,12 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
1439
1559
|
getBySlug(slug, shop) {
|
|
1440
1560
|
var _a;
|
|
1441
1561
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1442
|
-
const result = yield this.find(
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1562
|
+
const result = yield this.find({
|
|
1563
|
+
filters: {
|
|
1564
|
+
slug: { operator: Where.EQUALS, value: slug },
|
|
1565
|
+
shopAvailability: { operator: Where.IN, value: [shop] },
|
|
1566
|
+
},
|
|
1567
|
+
});
|
|
1446
1568
|
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
1447
1569
|
});
|
|
1448
1570
|
}
|
|
@@ -1485,28 +1607,19 @@ class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirest
|
|
|
1485
1607
|
this.model = Coupon;
|
|
1486
1608
|
}
|
|
1487
1609
|
buildModelInstance() {
|
|
1610
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1488
1611
|
return {
|
|
1489
1612
|
toFirestore: (data) => {
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
plain.categories = (_a = plain === null || plain === void 0 ? void 0 : plain.categories) === null || _a === void 0 ? void 0 : _a.map((category) => category.id);
|
|
1613
|
+
const plain = toFirestore(data);
|
|
1614
|
+
if (!!data.expiresIn)
|
|
1615
|
+
plain.expiresIn = data.expiresIn.getTime();
|
|
1494
1616
|
return plain;
|
|
1495
1617
|
},
|
|
1496
1618
|
fromFirestore: (snap) => {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
data[key] = data[key].toDate();
|
|
1502
|
-
}
|
|
1503
|
-
});
|
|
1504
|
-
data.categories = (_a = data === null || data === void 0 ? void 0 : data.categories) === null || _a === void 0 ? void 0 : _a.map((category) => ({ id: category }));
|
|
1505
|
-
if (data.checkout_type === CheckoutTypes.SUBSCRIPTION)
|
|
1506
|
-
return ClubCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
1507
|
-
if (data.checkout_type === CheckoutTypes.ECOMMERCE)
|
|
1508
|
-
return StoreCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
1509
|
-
return this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1619
|
+
const instance = fromFirestore(snap);
|
|
1620
|
+
if (!isNil(instance.expiresIn))
|
|
1621
|
+
instance.expiresIn = new Date(snap.data().expiresIn);
|
|
1622
|
+
return instance;
|
|
1510
1623
|
},
|
|
1511
1624
|
};
|
|
1512
1625
|
}
|
|
@@ -1569,9 +1682,52 @@ class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
|
|
|
1569
1682
|
constructor(firestore) {
|
|
1570
1683
|
super();
|
|
1571
1684
|
this.firestore = firestore;
|
|
1685
|
+
this.homeToFirestore = (home) => {
|
|
1686
|
+
var _a;
|
|
1687
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1688
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.homeCategoryGroupToPlain);
|
|
1689
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.homeCategoryGroupToPlain);
|
|
1690
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.homeCategoryGroupToPlain);
|
|
1691
|
+
}
|
|
1692
|
+
return home;
|
|
1693
|
+
};
|
|
1694
|
+
this.homeCategoryGroupToPlain = (homeCategoryGroup) => ({
|
|
1695
|
+
category: homeCategoryGroup.category.toPlain(),
|
|
1696
|
+
products: homeCategoryGroup.products.map((product) => product.toPlain()),
|
|
1697
|
+
});
|
|
1698
|
+
this.homeFromFirestore = (home) => {
|
|
1699
|
+
var _a;
|
|
1700
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
1701
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.plainToHomeCategoryGroup);
|
|
1702
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.plainToHomeCategoryGroup);
|
|
1703
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.plainToHomeCategoryGroup);
|
|
1704
|
+
home.data.createdAt =
|
|
1705
|
+
home.data.createdAt instanceof firebase.firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
|
|
1706
|
+
home.data.expiresAt =
|
|
1707
|
+
home.data.expiresAt instanceof firebase.firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
|
|
1708
|
+
}
|
|
1709
|
+
return home;
|
|
1710
|
+
};
|
|
1711
|
+
this.plainToHomeCategoryGroup = (homeCategoryGroup) => ({
|
|
1712
|
+
category: Category.toInstance(homeCategoryGroup.category),
|
|
1713
|
+
products: homeCategoryGroup.products.map((product) => Product.toInstance(product)),
|
|
1714
|
+
});
|
|
1572
1715
|
this.collectionName = 'dms';
|
|
1573
1716
|
this.model = Home;
|
|
1574
1717
|
}
|
|
1718
|
+
buildModelInstance() {
|
|
1719
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1720
|
+
return {
|
|
1721
|
+
toFirestore: (data) => {
|
|
1722
|
+
const modifiedData = this.homeToFirestore(data);
|
|
1723
|
+
return toFirestore(modifiedData);
|
|
1724
|
+
},
|
|
1725
|
+
fromFirestore: (snap) => {
|
|
1726
|
+
const instance = fromFirestore(snap);
|
|
1727
|
+
return this.homeFromFirestore(instance);
|
|
1728
|
+
},
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1575
1731
|
}
|
|
1576
1732
|
|
|
1577
1733
|
class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
@@ -1626,6 +1782,11 @@ class AuthenticationFirebaseAuthService {
|
|
|
1626
1782
|
return user;
|
|
1627
1783
|
});
|
|
1628
1784
|
}
|
|
1785
|
+
sendPasswordResetEmail(email) {
|
|
1786
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1787
|
+
return this.firebaseAuth.sendPasswordResetEmail(email);
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1629
1790
|
}
|
|
1630
1791
|
|
|
1631
1792
|
class RegisterFirebaseAuthService {
|
|
@@ -1652,9 +1813,735 @@ class RegisterFirebaseAuthService {
|
|
|
1652
1813
|
}
|
|
1653
1814
|
}
|
|
1654
1815
|
|
|
1816
|
+
class AttributeOptionHelper {
|
|
1817
|
+
}
|
|
1818
|
+
AttributeOptionHelper.FindByAttribute = (attributeName, fields) => {
|
|
1819
|
+
if (fields.includes(attributeName))
|
|
1820
|
+
return { columnName: attributeName.toString(), attributeName };
|
|
1821
|
+
const field = fields.find((columnOption) => isObject(columnOption) && Object.keys(columnOption).includes(attributeName.toString()));
|
|
1822
|
+
const fieldOption = field === null || field === void 0 ? void 0 : field[attributeName.toString()];
|
|
1823
|
+
if (isNil(fieldOption))
|
|
1824
|
+
return { columnName: attributeName.toString(), attributeName };
|
|
1825
|
+
if (Array.isArray(fieldOption))
|
|
1826
|
+
return { columnName: attributeName.toString(), attributeName, fields: fieldOption };
|
|
1827
|
+
return Object.assign({ attributeName, columnName: attributeName.toString() }, fieldOption);
|
|
1828
|
+
};
|
|
1829
|
+
AttributeOptionHelper.CheckIsColumnModelOption = (fieldValue) => !!fieldValue.columnName && !!fieldValue.fields;
|
|
1830
|
+
AttributeOptionHelper.CheckIsColumnOption = (fieldValue) => AttributeOptionHelper.CheckIsColumnModelOption(fieldValue) || !!fieldValue.columnName;
|
|
1831
|
+
AttributeOptionHelper.FindColumnOptionFromList = (columnName, fields) => {
|
|
1832
|
+
if (fields.includes(columnName))
|
|
1833
|
+
return { columnName, attributeName: columnName };
|
|
1834
|
+
const field = fields.find((columnOption) => {
|
|
1835
|
+
var _a;
|
|
1836
|
+
return isObject(columnOption) &&
|
|
1837
|
+
((_a = Object.values(columnOption).find((option) => AttributeOptionHelper.CheckIsColumnOption(option) && option.columnName === columnName)) === null || _a === void 0 ? void 0 : _a.columnName) === columnName;
|
|
1838
|
+
}) || {};
|
|
1839
|
+
const attributeName = Object.keys(field).find((fieldOptionFromList) => AttributeOptionHelper.CheckIsColumnOption(field[fieldOptionFromList]) ||
|
|
1840
|
+
Array.isArray(field[fieldOptionFromList]));
|
|
1841
|
+
const fieldOption = field === null || field === void 0 ? void 0 : field[attributeName];
|
|
1842
|
+
if (Array.isArray(fieldOption))
|
|
1843
|
+
return { attributeName: attributeName, fields: fieldOption };
|
|
1844
|
+
return Object.assign({ attributeName: attributeName || columnName, columnName }, fieldOption);
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
class GraphQLFieldHelper {
|
|
1848
|
+
}
|
|
1849
|
+
GraphQLFieldHelper.CheckIsGraphQLParams = (params) => !isString(params) && Array.isArray(params) && params.length >= 0 && !!params[0].operation;
|
|
1850
|
+
GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields = (fields) => {
|
|
1851
|
+
return fields
|
|
1852
|
+
.map((field) => {
|
|
1853
|
+
if (isString(field))
|
|
1854
|
+
return field.toString();
|
|
1855
|
+
const fieldName = Object.keys(field).shift();
|
|
1856
|
+
const fieldValue = field[fieldName];
|
|
1857
|
+
if (Array.isArray(fieldValue))
|
|
1858
|
+
return { [fieldName]: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue) };
|
|
1859
|
+
if (AttributeOptionHelper.CheckIsColumnModelOption(fieldValue))
|
|
1860
|
+
return {
|
|
1861
|
+
[fieldValue.columnName || fieldName]: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
1862
|
+
};
|
|
1863
|
+
if (AttributeOptionHelper.CheckIsColumnOption(fieldValue))
|
|
1864
|
+
return fieldValue.columnName;
|
|
1865
|
+
return;
|
|
1866
|
+
})
|
|
1867
|
+
.filter((field) => !!field);
|
|
1868
|
+
};
|
|
1869
|
+
GraphQLFieldHelper.ConvertFieldValueFrom = (data, fields) => Object.keys(data).reduce((result, columnName) => {
|
|
1870
|
+
const { attributeName, fields: attributeFields, from, } = AttributeOptionHelper.FindColumnOptionFromList(columnName, fields);
|
|
1871
|
+
if (!!attributeFields && Array.isArray(attributeFields)) {
|
|
1872
|
+
if (Array.isArray(data[columnName]))
|
|
1873
|
+
return Object.assign(Object.assign({}, result), { [attributeName]: from
|
|
1874
|
+
? from(data[columnName], data)
|
|
1875
|
+
: data[columnName].map((value) => GraphQLFieldHelper.ConvertFieldValueFrom(value, attributeFields)) });
|
|
1876
|
+
if (isObject(data[columnName]))
|
|
1877
|
+
return Object.assign(Object.assign({}, result), { [attributeName]: GraphQLFieldHelper.ConvertFieldValueFrom(data[columnName], attributeFields) });
|
|
1878
|
+
}
|
|
1879
|
+
if (!!from)
|
|
1880
|
+
return Object.assign(Object.assign({}, result), { [attributeName]: from(data[columnName], data) });
|
|
1881
|
+
return Object.assign(Object.assign({}, result), { [attributeName]: parseDateTime(data[columnName]) });
|
|
1882
|
+
}, {});
|
|
1883
|
+
GraphQLFieldHelper.ConvertFieldValueTo = (instance, fields, update = false) => {
|
|
1884
|
+
var _a;
|
|
1885
|
+
const data = ((_a = instance.toPlain) === null || _a === void 0 ? void 0 : _a.call(instance)) || instance;
|
|
1886
|
+
return Object.keys(data)
|
|
1887
|
+
.filter((key) => !isNil(data[key]))
|
|
1888
|
+
.reduce((result, attributeName) => {
|
|
1889
|
+
const { columnName, fields: attributeFields, foreignKeyColumn, to, bindPersistData, } = AttributeOptionHelper.FindByAttribute(attributeName, fields);
|
|
1890
|
+
if (bindPersistData)
|
|
1891
|
+
return Object.assign(Object.assign({}, result), bindPersistData(data[attributeName], instance));
|
|
1892
|
+
if (isNil(columnName))
|
|
1893
|
+
return result;
|
|
1894
|
+
if (!!foreignKeyColumn &&
|
|
1895
|
+
!isEmpty(foreignKeyColumn) &&
|
|
1896
|
+
!Object.keys(foreignKeyColumn).filter((key) => !data[attributeName][key]).length)
|
|
1897
|
+
return Object.keys(foreignKeyColumn).reduce((object, current) => (Object.assign(Object.assign({}, object), { [foreignKeyColumn[current]]: data[attributeName][current] })), Object.assign({}, result));
|
|
1898
|
+
if (update && isObject(data[attributeName]) && !isNil(attributeFields) && !isDate(data[attributeName]))
|
|
1899
|
+
return result;
|
|
1900
|
+
if (!!columnName && Array.isArray(attributeFields) && isObject(data[attributeName])) {
|
|
1901
|
+
const converted = !isNil(columnName) && to ? to(instance[attributeName], instance) : data[attributeName];
|
|
1902
|
+
return Object.assign(Object.assign({}, result), (converted !== undefined
|
|
1903
|
+
? {
|
|
1904
|
+
[columnName]: {
|
|
1905
|
+
data: data[attributeName] instanceof BaseModel
|
|
1906
|
+
? GraphQLFieldHelper.ConvertFieldValueTo(data[attributeName], attributeFields)
|
|
1907
|
+
: converted,
|
|
1908
|
+
},
|
|
1909
|
+
}
|
|
1910
|
+
: {}));
|
|
1911
|
+
}
|
|
1912
|
+
if (!!to)
|
|
1913
|
+
return Object.assign(Object.assign({}, result), { [columnName]: to(instance[attributeName], instance) });
|
|
1914
|
+
return Object.assign(Object.assign({}, result), { [columnName]: data[attributeName] });
|
|
1915
|
+
}, {});
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
class FilterOptionHelper {
|
|
1919
|
+
}
|
|
1920
|
+
FilterOptionHelper.CheckIfIsFilterOption = (filter) => !isNil(filter === null || filter === void 0 ? void 0 : filter.operator);
|
|
1921
|
+
FilterOptionHelper.GetValueFromFilter = (filter, fieldOption) => {
|
|
1922
|
+
if (!FilterOptionHelper.CheckIfIsFilterOption(filter))
|
|
1923
|
+
return filter;
|
|
1924
|
+
if (filter.operator === Where.ISNULL)
|
|
1925
|
+
return true;
|
|
1926
|
+
if (filter.operator === Where.ISNOTNULL)
|
|
1927
|
+
return false;
|
|
1928
|
+
const converter = fieldOption.to ? fieldOption.to : (value) => value;
|
|
1929
|
+
return Array.isArray(filter.value) && [Where.IN, Where.NOTIN].includes(filter.operator)
|
|
1930
|
+
? filter.value.map((fieldValue) => converter(fieldValue))
|
|
1931
|
+
: converter(filter.value);
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
const withCreateHasuraGraphQL = (MixinBase) => {
|
|
1935
|
+
return class CreateHasuraGraphQLMixin extends MixinBase {
|
|
1936
|
+
constructor(...params) {
|
|
1937
|
+
const options = params === null || params === void 0 ? void 0 : params[0];
|
|
1938
|
+
super(...params);
|
|
1939
|
+
this.insertGraphQLOperation = (options === null || options === void 0 ? void 0 : options.insertGraphQLOperation) || `insert_${this.tableName}_one`;
|
|
1940
|
+
this.insertGraphQLObjectType = (options === null || options === void 0 ? void 0 : options.insertGraphQLObjectType) || `${this.tableName}_insert_input`;
|
|
1941
|
+
}
|
|
1942
|
+
create(data) {
|
|
1943
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1944
|
+
const newData = yield this.save(this.model.toInstance(data));
|
|
1945
|
+
return this.model.toInstance(newData);
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
save(data) {
|
|
1949
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1950
|
+
const result = yield this.mutation(this.insertGraphQLOperation, this.model.identifiersFields.map((field) => AttributeOptionHelper.FindByAttribute(field, this.fields).columnName), {
|
|
1951
|
+
object: { type: this.insertGraphQLObjectType, required: true, value: this.convertDataToHasura(data) },
|
|
1952
|
+
});
|
|
1953
|
+
return Object.assign(Object.assign({}, data.toPlain()), this.convertDataFromHasura(result[this.insertGraphQLOperation]).toPlain());
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
const withDeleteHasuraGraphQL = (MixinBase) => {
|
|
1960
|
+
return class DeleteHasuraGraphQLMixin extends MixinBase {
|
|
1961
|
+
constructor(...params) {
|
|
1962
|
+
const options = params === null || params === void 0 ? void 0 : params[0];
|
|
1963
|
+
super(...params);
|
|
1964
|
+
this.deleteGraphQLOperation = (options === null || options === void 0 ? void 0 : options.deleteGraphQLOperation) || `delete_${this.tableName}_by_pk`;
|
|
1965
|
+
}
|
|
1966
|
+
delete(identifiers) {
|
|
1967
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1968
|
+
const instance = this.model.toInstance(identifiers);
|
|
1969
|
+
yield this.mutation(this.deleteGraphQLOperation, this.model.identifiersFields.map((field) => AttributeOptionHelper.FindByAttribute(field, this.fields).columnName), this.model.identifiersFields.reduce((ids, identifier) => {
|
|
1970
|
+
if (isNil(instance[identifier]))
|
|
1971
|
+
return ids;
|
|
1972
|
+
const columnOption = AttributeOptionHelper.FindByAttribute(identifier, this.fields);
|
|
1973
|
+
const value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
1974
|
+
return Object.assign(Object.assign({}, ids), { [columnOption.columnName]: {
|
|
1975
|
+
type: this.getAttributeGraphQLTypeOf(columnOption.type || value),
|
|
1976
|
+
value,
|
|
1977
|
+
required: true,
|
|
1978
|
+
} });
|
|
1979
|
+
}, {}));
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
};
|
|
1984
|
+
|
|
1985
|
+
const withHasuraGraphQL = (MixinBase) => {
|
|
1986
|
+
return class HasuraGraphQLMixin extends MixinBase {
|
|
1987
|
+
constructor(...params) {
|
|
1988
|
+
const options = params[0];
|
|
1989
|
+
super(...params);
|
|
1990
|
+
this.tableName = options.tableName;
|
|
1991
|
+
this.endpoint = options.endpoint;
|
|
1992
|
+
this.authOptions = options.authOptions;
|
|
1993
|
+
this.model = options.model;
|
|
1994
|
+
this.fields = options.fields || this.model.identifiersFields;
|
|
1995
|
+
}
|
|
1996
|
+
get headers() {
|
|
1997
|
+
return Object.assign(Object.assign(Object.assign({ 'Content-Type': 'application/json' }, (isNil(this.authOptions.authToken) ? {} : { Authorization: this.authOptions.authToken })), (isNil(this.authOptions.adminSecret) ? {} : { 'X-Hasura-Admin-Secret': this.authOptions.adminSecret })), (isNil(this.authOptions.authRole)
|
|
1998
|
+
? {}
|
|
1999
|
+
: { 'X-Hasura-Role': this.authOptions.authRole.role, 'X-Hasura-User-Id': this.authOptions.authRole.userId }));
|
|
2000
|
+
}
|
|
2001
|
+
mutation(operation, fields, variables) {
|
|
2002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2003
|
+
const resultQuery = mutation({
|
|
2004
|
+
operation,
|
|
2005
|
+
variables,
|
|
2006
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fields),
|
|
2007
|
+
});
|
|
2008
|
+
return this.fetch(resultQuery);
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
query(operation, fields, variables) {
|
|
2012
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2013
|
+
const resultQuery = GraphQLFieldHelper.CheckIsGraphQLParams(operation)
|
|
2014
|
+
? query(operation.map((option) => ({
|
|
2015
|
+
operation: option.operation,
|
|
2016
|
+
variables: option.variables,
|
|
2017
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(option.fields),
|
|
2018
|
+
})))
|
|
2019
|
+
: query({
|
|
2020
|
+
operation,
|
|
2021
|
+
variables,
|
|
2022
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fields),
|
|
2023
|
+
});
|
|
2024
|
+
return this.fetch(resultQuery);
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
fetch(params) {
|
|
2028
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2029
|
+
const headers = this.headers;
|
|
2030
|
+
const response = yield fetch(`${this.endpoint}`, {
|
|
2031
|
+
method: 'POST',
|
|
2032
|
+
body: JSON.stringify(params),
|
|
2033
|
+
headers,
|
|
2034
|
+
});
|
|
2035
|
+
const result = yield response.json();
|
|
2036
|
+
if (!isNil(result.errors))
|
|
2037
|
+
throw new Error(JSON.stringify(result.errors));
|
|
2038
|
+
return result.data;
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
getAttributeGraphQLTypeOf(value) {
|
|
2042
|
+
if (isUUID(value))
|
|
2043
|
+
return 'uuid';
|
|
2044
|
+
if (isString(value))
|
|
2045
|
+
return 'String';
|
|
2046
|
+
if (isBoolean(value))
|
|
2047
|
+
return 'Boolean';
|
|
2048
|
+
if (value instanceof Date)
|
|
2049
|
+
return 'timestamptz';
|
|
2050
|
+
if (isInteger(value))
|
|
2051
|
+
return 'Int';
|
|
2052
|
+
if (isNumber(value))
|
|
2053
|
+
return 'numeric';
|
|
2054
|
+
throw new Error('Type not implemented yet');
|
|
2055
|
+
}
|
|
2056
|
+
checkIfIsDateTimeAndParse(value) {
|
|
2057
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value))
|
|
2058
|
+
return value;
|
|
2059
|
+
const date = parseISO(value);
|
|
2060
|
+
if (isNaN$1(date.getTime()))
|
|
2061
|
+
return value;
|
|
2062
|
+
return date;
|
|
2063
|
+
}
|
|
2064
|
+
convertDataFromHasura(data) {
|
|
2065
|
+
const plain = GraphQLFieldHelper.ConvertFieldValueFrom(data, this.fields);
|
|
2066
|
+
return this.model.toInstance(plain);
|
|
2067
|
+
}
|
|
2068
|
+
convertDataToHasura(instance, update = false) {
|
|
2069
|
+
return GraphQLFieldHelper.ConvertFieldValueTo(instance, this.fields, update);
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
const withUpdateHasuraGraphQL = (MixinBase) => {
|
|
2075
|
+
const getValueByAction = (options) => {
|
|
2076
|
+
if (isNil(options.action))
|
|
2077
|
+
return options;
|
|
2078
|
+
if (options.action === UpdateOptionActions.REMOVE_FIELD)
|
|
2079
|
+
return null;
|
|
2080
|
+
return options.value;
|
|
2081
|
+
};
|
|
2082
|
+
return class UpdateHasuraGraphQLMixin extends MixinBase {
|
|
2083
|
+
constructor(...params) {
|
|
2084
|
+
const options = params === null || params === void 0 ? void 0 : params[0];
|
|
2085
|
+
super(...params);
|
|
2086
|
+
this.updateGraphQLOperation = (options === null || options === void 0 ? void 0 : options.updateGraphQLOperation) || `update_${this.tableName}_by_pk`;
|
|
2087
|
+
this.updateGraphQLObjectType = (options === null || options === void 0 ? void 0 : options.updateGraphQLObjectType) || `${this.tableName}_set_input`;
|
|
2088
|
+
this.updateGraphQLPKType = (options === null || options === void 0 ? void 0 : options.updateGraphQLPKType) || `${this.tableName}_pk_columns_input`;
|
|
2089
|
+
}
|
|
2090
|
+
update(data) {
|
|
2091
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2092
|
+
const plainData = this.paramsToPlain(data);
|
|
2093
|
+
yield this.mutation(this.updateGraphQLOperation, this.model.identifiersFields.map((field) => AttributeOptionHelper.FindByAttribute(field, this.fields).columnName), {
|
|
2094
|
+
_set: {
|
|
2095
|
+
type: this.updateGraphQLObjectType,
|
|
2096
|
+
value: this.convertDataToHasura(this.model.toInstance(plainData), true),
|
|
2097
|
+
required: true,
|
|
2098
|
+
},
|
|
2099
|
+
pk_columns: { type: this.updateGraphQLPKType, value: this.getUpdateModelKeys(plainData), required: true },
|
|
2100
|
+
});
|
|
2101
|
+
return this.model.toInstance(plainData);
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
paramsToPlain(params) {
|
|
2105
|
+
const model = this.model;
|
|
2106
|
+
if (model.isModel(params))
|
|
2107
|
+
return params.toPlain();
|
|
2108
|
+
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
2109
|
+
}
|
|
2110
|
+
getUpdateModelKeys(data) {
|
|
2111
|
+
const instance = this.model.toInstance(data);
|
|
2112
|
+
return this.model.identifiersFields.reduce((ids, identifier) => {
|
|
2113
|
+
if (isNil(instance[identifier]))
|
|
2114
|
+
return ids;
|
|
2115
|
+
const columnOption = AttributeOptionHelper.FindByAttribute(identifier, this.fields);
|
|
2116
|
+
const value = columnOption.to(data[identifier.toString()], instance);
|
|
2117
|
+
return Object.assign(Object.assign({}, ids), { [columnOption.columnName]: value });
|
|
2118
|
+
}, {});
|
|
2119
|
+
}
|
|
2120
|
+
};
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
const withGetHasuraGraphQL = (MixinBase) => {
|
|
2124
|
+
return class GetHasuraGraphQLMixin extends MixinBase {
|
|
2125
|
+
constructor(...params) {
|
|
2126
|
+
const options = params === null || params === void 0 ? void 0 : params[0];
|
|
2127
|
+
super(...params);
|
|
2128
|
+
this.getGraphQLOperation = (options === null || options === void 0 ? void 0 : options.getGraphQLOperation) || `${this.tableName}_by_pk`;
|
|
2129
|
+
}
|
|
2130
|
+
get(identifiers) {
|
|
2131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2132
|
+
const instance = this.model.toInstance(identifiers);
|
|
2133
|
+
const result = yield this.query(this.getGraphQLOperation, this.fields, this.model.identifiersFields.reduce((ids, identifier) => {
|
|
2134
|
+
if (isNil(instance[identifier]))
|
|
2135
|
+
return ids;
|
|
2136
|
+
const columnOption = AttributeOptionHelper.FindByAttribute(identifier, this.fields);
|
|
2137
|
+
const value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
2138
|
+
return Object.assign(Object.assign({}, ids), { [columnOption.columnName]: {
|
|
2139
|
+
type: this.getAttributeGraphQLTypeOf(columnOption.type || value),
|
|
2140
|
+
value,
|
|
2141
|
+
required: true,
|
|
2142
|
+
} });
|
|
2143
|
+
}, {}));
|
|
2144
|
+
const data = result[this.getGraphQLOperation];
|
|
2145
|
+
if (isNil(data))
|
|
2146
|
+
throw new NotFoundError(`${instance.constructor.name} not found`);
|
|
2147
|
+
return this.convertDataFromHasura(result[this.getGraphQLOperation]);
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
|
|
2153
|
+
var HasuraGraphQLWhere;
|
|
2154
|
+
(function (HasuraGraphQLWhere) {
|
|
2155
|
+
HasuraGraphQLWhere["EQUALS"] = "_eq";
|
|
2156
|
+
HasuraGraphQLWhere["GT"] = "_gt";
|
|
2157
|
+
HasuraGraphQLWhere["GTE"] = "_gte";
|
|
2158
|
+
HasuraGraphQLWhere["IN"] = "_in";
|
|
2159
|
+
HasuraGraphQLWhere["NOTIN"] = "_nin";
|
|
2160
|
+
HasuraGraphQLWhere["LT"] = "_lt";
|
|
2161
|
+
HasuraGraphQLWhere["LTE"] = "_lte";
|
|
2162
|
+
HasuraGraphQLWhere["LIKE"] = "_like";
|
|
2163
|
+
HasuraGraphQLWhere["NOTLIKE"] = "_nlike";
|
|
2164
|
+
HasuraGraphQLWhere["ISNULL"] = "_is_null";
|
|
2165
|
+
HasuraGraphQLWhere["ISNOTNULL"] = "_is_null";
|
|
2166
|
+
})(HasuraGraphQLWhere || (HasuraGraphQLWhere = {}));
|
|
2167
|
+
|
|
2168
|
+
var HasuraGraphQLColumnType;
|
|
2169
|
+
(function (HasuraGraphQLColumnType) {
|
|
2170
|
+
HasuraGraphQLColumnType["Int"] = "Int";
|
|
2171
|
+
HasuraGraphQLColumnType["Float"] = "Float";
|
|
2172
|
+
HasuraGraphQLColumnType["Boolean"] = "Boolean";
|
|
2173
|
+
HasuraGraphQLColumnType["String"] = "String";
|
|
2174
|
+
HasuraGraphQLColumnType["DateTime"] = "timestampz";
|
|
2175
|
+
HasuraGraphQLColumnType["Json"] = "json";
|
|
2176
|
+
HasuraGraphQLColumnType["Jsonb"] = "jsonb";
|
|
2177
|
+
HasuraGraphQLColumnType["Enum"] = "enum";
|
|
2178
|
+
HasuraGraphQLColumnType["Uuid"] = "uuid";
|
|
2179
|
+
})(HasuraGraphQLColumnType || (HasuraGraphQLColumnType = {}));
|
|
2180
|
+
|
|
2181
|
+
const withFindHasuraGraphQL = (MixinBase) => {
|
|
2182
|
+
return class FindHasuraGraphQLMixin extends MixinBase {
|
|
2183
|
+
constructor() {
|
|
2184
|
+
super(...arguments);
|
|
2185
|
+
this.makeGraphQLWhere = (filter, fields) => Object.keys(filter).reduce((variables, fieldName) => {
|
|
2186
|
+
const columnOption = AttributeOptionHelper.FindByAttribute(fieldName, fields);
|
|
2187
|
+
if (!columnOption.bindFindFilter)
|
|
2188
|
+
return Object.assign(Object.assign({}, variables), { [columnOption.columnName]: this.buildWhereSentence(fieldName, filter[fieldName], fields) });
|
|
2189
|
+
const builtFilter = columnOption.bindFindFilter(filter[fieldName]);
|
|
2190
|
+
return Object.assign(Object.assign({}, variables), Object.keys(builtFilter).reduce((variablesList, columnName) => (Object.assign(Object.assign({}, variablesList), { [columnName]: this.buildWhereSentence(fieldName, builtFilter[columnName], fields) })), {}));
|
|
2191
|
+
}, {});
|
|
2192
|
+
this.buildWhereSentence = (field, options, fields) => {
|
|
2193
|
+
const fieldSentenceOptions = AttributeOptionHelper.FindByAttribute(field, fields);
|
|
2194
|
+
if (!Array.isArray(options) &&
|
|
2195
|
+
isObject(options) &&
|
|
2196
|
+
isNil(options === null || options === void 0 ? void 0 : options.operator) &&
|
|
2197
|
+
isNil(options === null || options === void 0 ? void 0 : options.value) &&
|
|
2198
|
+
isNil(fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.to))
|
|
2199
|
+
return Object.keys(options).reduce((variables, key) => {
|
|
2200
|
+
const fieldOptions = AttributeOptionHelper.FindByAttribute(key, fields);
|
|
2201
|
+
const columnName = fieldOptions.columnName;
|
|
2202
|
+
const columnFields = fieldOptions.fields;
|
|
2203
|
+
return Object.assign(Object.assign({}, variables), { [columnName]: this.buildWhereSentence(key, options[key], columnFields || []) });
|
|
2204
|
+
}, {});
|
|
2205
|
+
if (!Array.isArray(options) && !isNil(fieldSentenceOptions.fields))
|
|
2206
|
+
return {
|
|
2207
|
+
[fieldSentenceOptions.fields[0]]: this.buildOperatorSentence(options, fieldSentenceOptions),
|
|
2208
|
+
};
|
|
2209
|
+
if (isObject(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
|
|
2210
|
+
options = Object.values(options)[0];
|
|
2211
|
+
return Array.isArray(options)
|
|
2212
|
+
? options.reduce((whereSentence, option) => (Object.assign(Object.assign({}, whereSentence), this.buildOperatorSentence(option, fieldSentenceOptions))), {})
|
|
2213
|
+
: this.buildOperatorSentence(options, fieldSentenceOptions);
|
|
2214
|
+
};
|
|
2215
|
+
this.buildOperatorSentence = (options, fieldOption) => ({
|
|
2216
|
+
[this.getHasuraOperator(options, fieldOption)]: FilterOptionHelper.GetValueFromFilter(options, fieldOption),
|
|
2217
|
+
});
|
|
2218
|
+
this.getHasuraOperator = (options, fieldOption) => FilterOptionHelper.CheckIfIsFilterOption(options)
|
|
2219
|
+
? fieldOption.type === HasuraGraphQLColumnType.Jsonb
|
|
2220
|
+
? this.getHasuraJsonbOperator(options)
|
|
2221
|
+
: HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find((graphQLOperator) => graphQLOperator === Object.keys(Where).find((operator) => Where[operator] === (options === null || options === void 0 ? void 0 : options.operator)))]
|
|
2222
|
+
: HasuraGraphQLWhere.EQUALS;
|
|
2223
|
+
this.getHasuraJsonbOperator = (options) => options.operator === Where.IN
|
|
2224
|
+
? '_contains'
|
|
2225
|
+
: options.operator === Where.LIKE
|
|
2226
|
+
? '_has_keys_any'
|
|
2227
|
+
: HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find((graphQLOperator) => graphQLOperator === Object.keys(Where).find((operator) => Where[operator] === (options === null || options === void 0 ? void 0 : options.operator)))];
|
|
2228
|
+
}
|
|
2229
|
+
find(options) {
|
|
2230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2231
|
+
const { filters, limits, orderBy } = options || {};
|
|
2232
|
+
const variablesCount = Object.assign(Object.assign({}, (isNil(orderBy) ? {} : { order_by: { type: `${this.tableName}_order_by!`, list: true, value: orderBy } })), (isNil(filters)
|
|
2233
|
+
? {}
|
|
2234
|
+
: {
|
|
2235
|
+
where: {
|
|
2236
|
+
value: this.makeGraphQLWhere(filters, this.fields),
|
|
2237
|
+
type: `${this.tableName}_bool_exp`,
|
|
2238
|
+
required: true,
|
|
2239
|
+
},
|
|
2240
|
+
}));
|
|
2241
|
+
const variables = Object.assign(Object.assign({}, (isNil(limits) ? {} : limits)), variablesCount);
|
|
2242
|
+
const result = yield this.query([
|
|
2243
|
+
{
|
|
2244
|
+
operation: this.tableName,
|
|
2245
|
+
fields: this.fields,
|
|
2246
|
+
variables,
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
operation: `${this.tableName}_aggregate`,
|
|
2250
|
+
fields: [{ aggregate: ['count'] }],
|
|
2251
|
+
variables: variablesCount,
|
|
2252
|
+
},
|
|
2253
|
+
]);
|
|
2254
|
+
const data = result[this.tableName].map((row) => this.convertDataFromHasura(row));
|
|
2255
|
+
const count = result[`${this.tableName}_aggregate`].aggregate.count;
|
|
2256
|
+
return { count, data };
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
};
|
|
2261
|
+
|
|
2262
|
+
const withCrudHasuraGraphQL = (MixinBase) => {
|
|
2263
|
+
return class CrudHasuraGraphQLMixin extends withUpdateHasuraGraphQL(withGetHasuraGraphQL(withFindHasuraGraphQL(withDeleteHasuraGraphQL(withCreateHasuraGraphQL(MixinBase))))) {
|
|
2264
|
+
};
|
|
2265
|
+
};
|
|
2266
|
+
|
|
2267
|
+
class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2268
|
+
constructor(endpoint, authOptions, productRepository) {
|
|
2269
|
+
super({
|
|
2270
|
+
tableName: 'category',
|
|
2271
|
+
model: Category,
|
|
2272
|
+
endpoint,
|
|
2273
|
+
authOptions,
|
|
2274
|
+
fields: [
|
|
2275
|
+
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
2276
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
2277
|
+
'name',
|
|
2278
|
+
'description',
|
|
2279
|
+
'image',
|
|
2280
|
+
'published',
|
|
2281
|
+
'shop',
|
|
2282
|
+
'slug',
|
|
2283
|
+
{ brandCategory: { columnName: 'brand_category' } },
|
|
2284
|
+
{ brandCategoryBanner: { columnName: 'brand_banner' } },
|
|
2285
|
+
{ brandCategoryBannerMobile: { columnName: 'brand_banner_mobile' } },
|
|
2286
|
+
{ brandLogo: { columnName: 'brand_logo' } },
|
|
2287
|
+
{ brandCondition: { columnName: 'brand_condition' } },
|
|
2288
|
+
{
|
|
2289
|
+
conditions: {
|
|
2290
|
+
columnName: 'tag_condition',
|
|
2291
|
+
from: (tags, row) => ({ brand: row.brand_condition, tags }),
|
|
2292
|
+
bindPersistData: (value) => {
|
|
2293
|
+
return {
|
|
2294
|
+
brand_condition: value.brand,
|
|
2295
|
+
tag_condition: `{"${value.tags.join('","')}"}`,
|
|
2296
|
+
};
|
|
2297
|
+
},
|
|
2298
|
+
},
|
|
2299
|
+
},
|
|
2300
|
+
'filters',
|
|
2301
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
2302
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
2303
|
+
{
|
|
2304
|
+
products: {
|
|
2305
|
+
columnName: 'products',
|
|
2306
|
+
fields: ['product_id'],
|
|
2307
|
+
from: (value) => value.map((product) => product.product_id.toString()),
|
|
2308
|
+
to: (productIds) => productIds.map((productId) => ({
|
|
2309
|
+
product_id: +productId,
|
|
2310
|
+
})),
|
|
2311
|
+
},
|
|
2312
|
+
},
|
|
2313
|
+
],
|
|
2314
|
+
});
|
|
2315
|
+
this.productRepository = productRepository;
|
|
2316
|
+
}
|
|
2317
|
+
get(identifiers) {
|
|
2318
|
+
const _super = Object.create(null, {
|
|
2319
|
+
get: { get: () => super.get }
|
|
2320
|
+
});
|
|
2321
|
+
var _a;
|
|
2322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2323
|
+
return Number.isNaN(+identifiers.id)
|
|
2324
|
+
? (_a = (yield this.find({ filters: { firestoreId: identifiers.id } })).data) === null || _a === void 0 ? void 0 : _a[0]
|
|
2325
|
+
: _super.get.call(this, identifiers);
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
getCategoryBySlug(slug, shop) {
|
|
2329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2330
|
+
if (!slug)
|
|
2331
|
+
return;
|
|
2332
|
+
const { data, count } = yield this.find({ filters: { slug, shop, published: true } });
|
|
2333
|
+
if (count > 1)
|
|
2334
|
+
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
2335
|
+
if (!count)
|
|
2336
|
+
throw new NotFoundError(`Category with slug ${slug} not found`);
|
|
2337
|
+
return data.shift();
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
getCategoriesForHome(categoryIds, limit = 4) {
|
|
2341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2342
|
+
const { data: categories, count } = yield this.find({
|
|
2343
|
+
filters: { firestoreId: { operator: Where.IN, value: categoryIds.filter(Boolean) }, published: true },
|
|
2344
|
+
});
|
|
2345
|
+
if (!count)
|
|
2346
|
+
throw new NotFoundError('Categories not found');
|
|
2347
|
+
const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
|
|
2348
|
+
return ({
|
|
2349
|
+
category,
|
|
2350
|
+
products: yield this.mountCategory(category, { limit, hasStock: true }),
|
|
2351
|
+
});
|
|
2352
|
+
})));
|
|
2353
|
+
return homeSections;
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
mountCategory(category, options) {
|
|
2357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2358
|
+
if (!category.products)
|
|
2359
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
2360
|
+
const products = [];
|
|
2361
|
+
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
2362
|
+
const { data: productsData } = yield this.productRepository.find(Object.assign({ filters: Object.assign({ id: { operator: Where.IN, value: category.products }, [publishedField]: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: Where.GT, value: 0 } } } : {})) }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})));
|
|
2363
|
+
products.push(...productsData);
|
|
2364
|
+
return products;
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
class CategoryHasuraGraphQL extends Category {
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
class ProductHasuraGraphQL extends Product {
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
class VariantHasuraGraphQL extends Variant {
|
|
2376
|
+
constructor() {
|
|
2377
|
+
super(...arguments);
|
|
2378
|
+
this.name = '';
|
|
2379
|
+
this.hasVariants = false;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2384
|
+
constructor(endpoint, authOptions) {
|
|
2385
|
+
super({
|
|
2386
|
+
tableName: 'product',
|
|
2387
|
+
model: ProductHasuraGraphQL,
|
|
2388
|
+
endpoint,
|
|
2389
|
+
authOptions,
|
|
2390
|
+
fields: [
|
|
2391
|
+
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
2392
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
2393
|
+
{ CEST: { columnName: 'cest' } },
|
|
2394
|
+
{ EAN: { columnName: 'ean' } },
|
|
2395
|
+
{ NCM: { columnName: 'ncm' } },
|
|
2396
|
+
'brand',
|
|
2397
|
+
{ costPrice: { columnName: 'cost_price' } },
|
|
2398
|
+
{
|
|
2399
|
+
description: {
|
|
2400
|
+
columnName: 'description',
|
|
2401
|
+
from: (description) => Object.values(Shops).reduce((shops, shop) => (Object.assign(Object.assign({}, shops), { [shop]: { description } })), {}),
|
|
2402
|
+
to: (value) => Object.values(value).shift().description,
|
|
2403
|
+
},
|
|
2404
|
+
},
|
|
2405
|
+
{ hasVariants: { columnName: 'has_variants' } },
|
|
2406
|
+
{ images: { columnName: 'images', to: (value) => `{"${value.join(`","`)}"}` } },
|
|
2407
|
+
{ miniatures: { columnName: 'miniatures', to: (value) => `{"${value.join(`","`)}"}` } },
|
|
2408
|
+
'name',
|
|
2409
|
+
{
|
|
2410
|
+
price: {
|
|
2411
|
+
columnName: 'price',
|
|
2412
|
+
from: (price, data) => Object.values(Shops).reduce((prices, shop) => (Object.assign(Object.assign({}, prices), { [shop]: {
|
|
2413
|
+
price,
|
|
2414
|
+
fullPrice: data.full_price,
|
|
2415
|
+
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
2416
|
+
subscriberPrice: data.subscriber_price,
|
|
2417
|
+
} })), {}),
|
|
2418
|
+
bindFindFilter: (sentence) => {
|
|
2419
|
+
const filters = Object.values(sentence).shift();
|
|
2420
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.price) && { price: filters.price })), (filters.fullPrice && { full_price: filters.fullPrice })), (filters.subscriberDiscountPercentage && {
|
|
2421
|
+
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
2422
|
+
})), (filters.subscriberPrice && { subscriber_price: filters.subscriberPrice }));
|
|
2423
|
+
},
|
|
2424
|
+
bindPersistData: (value) => {
|
|
2425
|
+
const priceData = Object.values(value).shift();
|
|
2426
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) && { price: priceData.price })), (priceData.fullPrice && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage && {
|
|
2427
|
+
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
2428
|
+
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
2429
|
+
},
|
|
2430
|
+
},
|
|
2431
|
+
},
|
|
2432
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
2433
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
2434
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
2435
|
+
'published',
|
|
2436
|
+
{ publishedGlam: { columnName: 'published_glam' } },
|
|
2437
|
+
'sku',
|
|
2438
|
+
{
|
|
2439
|
+
stock: {
|
|
2440
|
+
columnName: 'stock',
|
|
2441
|
+
from: (quantity) => ({ quantity }),
|
|
2442
|
+
to: (value) => (value === null || value === void 0 ? void 0 : value.quantity) || value,
|
|
2443
|
+
},
|
|
2444
|
+
},
|
|
2445
|
+
'slug',
|
|
2446
|
+
'type',
|
|
2447
|
+
'video',
|
|
2448
|
+
'weight',
|
|
2449
|
+
{
|
|
2450
|
+
categories: {
|
|
2451
|
+
columnName: 'categories',
|
|
2452
|
+
fields: ['category_id'],
|
|
2453
|
+
to: (categories) => categories.map((categoryId) => ({ category_id: +categoryId })),
|
|
2454
|
+
from: (categories) => (categories === null || categories === void 0 ? void 0 : categories.map((category) => { var _a; return (_a = category === null || category === void 0 ? void 0 : category.category_id) === null || _a === void 0 ? void 0 : _a.toString(); })) || [],
|
|
2455
|
+
},
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
shopAvailability: {
|
|
2459
|
+
columnName: 'shop_availabilities',
|
|
2460
|
+
fields: ['shop'],
|
|
2461
|
+
from: (shop) => (Array.isArray(shop) ? shop.map((row) => row.shop) : []),
|
|
2462
|
+
to: (shops) => shops.map((shop) => ({ shop })),
|
|
2463
|
+
},
|
|
2464
|
+
},
|
|
2465
|
+
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
2466
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
2467
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
2468
|
+
],
|
|
2469
|
+
});
|
|
2470
|
+
}
|
|
2471
|
+
getBySlug(slug, shop) {
|
|
2472
|
+
var _a;
|
|
2473
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2474
|
+
const result = yield this.find({
|
|
2475
|
+
filters: {
|
|
2476
|
+
slug: { operator: Where.EQUALS, value: slug },
|
|
2477
|
+
shopAvailability: { operator: Where.IN, value: [shop] },
|
|
2478
|
+
},
|
|
2479
|
+
});
|
|
2480
|
+
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
2481
|
+
});
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2486
|
+
constructor(endpoint, authOptions) {
|
|
2487
|
+
super({
|
|
2488
|
+
tableName: 'product',
|
|
2489
|
+
model: VariantHasuraGraphQL,
|
|
2490
|
+
endpoint,
|
|
2491
|
+
authOptions,
|
|
2492
|
+
fields: [
|
|
2493
|
+
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
2494
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
2495
|
+
{ productId: { columnName: 'main_product_id', to: (value) => +value, from: (value) => value.toString() } },
|
|
2496
|
+
{ EAN: { columnName: 'ean' } },
|
|
2497
|
+
{ costPrice: { columnName: 'cost_price' } },
|
|
2498
|
+
{
|
|
2499
|
+
price: {
|
|
2500
|
+
columnName: 'price',
|
|
2501
|
+
from: (price, data) => Object.values(Shops).reduce((prices, shop) => (Object.assign(Object.assign({}, prices), { [shop]: {
|
|
2502
|
+
price,
|
|
2503
|
+
fullPrice: data.full_price,
|
|
2504
|
+
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
2505
|
+
subscriberPrice: data.subscriber_price,
|
|
2506
|
+
} })), {}),
|
|
2507
|
+
bindFindFilter: (sentence) => {
|
|
2508
|
+
const filters = Object.values(sentence).shift();
|
|
2509
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.price) && { price: filters.price })), (filters.fullPrice && { full_price: filters.fullPrice })), (filters.subscriberDiscountPercentage && {
|
|
2510
|
+
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
2511
|
+
})), (filters.subscriberPrice && { subscriber_price: filters.subscriberPrice }));
|
|
2512
|
+
},
|
|
2513
|
+
bindPersistData: (value, instance) => {
|
|
2514
|
+
const priceData = Object.values(value).shift();
|
|
2515
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) && { price: priceData.price })), (priceData.fullPrice && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage && {
|
|
2516
|
+
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
2517
|
+
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
2518
|
+
},
|
|
2519
|
+
},
|
|
2520
|
+
},
|
|
2521
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
2522
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
2523
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
2524
|
+
'sku',
|
|
2525
|
+
{
|
|
2526
|
+
stock: {
|
|
2527
|
+
columnName: 'stock',
|
|
2528
|
+
from: (quantity) => ({ quantity }),
|
|
2529
|
+
to: (value) => (value === null || value === void 0 ? void 0 : value.quantity) || value,
|
|
2530
|
+
},
|
|
2531
|
+
},
|
|
2532
|
+
'weight',
|
|
2533
|
+
{ name: { to: () => '', from: () => undefined } },
|
|
2534
|
+
{ hasVariants: { columnName: 'has_variants', to: () => false, from: () => undefined } },
|
|
2535
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
2536
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
2537
|
+
],
|
|
2538
|
+
});
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
|
|
1655
2542
|
/**
|
|
1656
2543
|
* Generated bundle index. Do not edit.
|
|
1657
2544
|
*/
|
|
1658
2545
|
|
|
1659
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes,
|
|
2546
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, FilterType, FinancialCoupon, FragranceImportances, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQLRepository, 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, VariantHasuraGraphQLRepository, WeakPasswordError, Where, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
1660
2547
|
//# sourceMappingURL=infrab4a-connect.js.map
|