@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,23 +1,47 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('lodash'), require('firebase'), require('firebase/app')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'lodash', 'firebase', 'firebase/app'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global.lodash, global.firebase, global.firebase$1));
|
|
5
|
-
})(this, (function (exports, reflectMetadata, classTransformer, lodash, firebase, firebase$1) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('ts-md5'), require('axios'), require('firebase'), require('firebase/app'), require('gql-query-builder'), require('node-fetch')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'ts-md5', 'axios', 'firebase', 'firebase/app', 'gql-query-builder', 'node-fetch'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global.tsMd5, global.axios, global.firebase, global.firebase$1, global["gql-query-builder"], global.fetch));
|
|
5
|
+
})(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, tsMd5, axios, firebase, firebase$1, gqlQueryBuilder, fetch) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
9
10
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
10
11
|
var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
|
|
12
|
+
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
11
13
|
|
|
12
14
|
var BaseModel = /** @class */ (function () {
|
|
13
15
|
function BaseModel(args) {
|
|
14
16
|
Object.assign(this, args);
|
|
15
17
|
}
|
|
18
|
+
Object.defineProperty(BaseModel.prototype, "identifier", {
|
|
19
|
+
get: function () {
|
|
20
|
+
var _this = this;
|
|
21
|
+
var fields = this.constructor.identifiersFields.filter(function (field) { return field !== 'identifier'; });
|
|
22
|
+
return fields.reduce(function (object, field) {
|
|
23
|
+
var _a;
|
|
24
|
+
return (Object.assign(Object.assign({}, object), (_a = {}, _a[field] = _this[field], _a)));
|
|
25
|
+
}, {});
|
|
26
|
+
},
|
|
27
|
+
enumerable: false,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(BaseModel.prototype, "identifiersFields", {
|
|
31
|
+
get: function () {
|
|
32
|
+
return this.constructor.identifiersFields;
|
|
33
|
+
},
|
|
34
|
+
enumerable: false,
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
16
37
|
BaseModel.toInstance = function (data) {
|
|
17
|
-
return classTransformer.plainToClass(this, data);
|
|
38
|
+
return classTransformer.plainToClass(this, data || {});
|
|
39
|
+
};
|
|
40
|
+
BaseModel.isModel = function (value) {
|
|
41
|
+
return value instanceof this;
|
|
18
42
|
};
|
|
19
43
|
BaseModel.prototype.toPlain = function () {
|
|
20
|
-
return classTransformer.classToPlain(this
|
|
44
|
+
return classTransformer.classToPlain(this);
|
|
21
45
|
};
|
|
22
46
|
return BaseModel;
|
|
23
47
|
}());
|
|
@@ -25,13 +49,16 @@
|
|
|
25
49
|
exports.Where = void 0;
|
|
26
50
|
(function (Where) {
|
|
27
51
|
Where["EQUALS"] = "==";
|
|
28
|
-
Where["NOTEQUALS"] = "!=";
|
|
29
52
|
Where["GT"] = ">";
|
|
30
53
|
Where["GTE"] = ">=";
|
|
31
54
|
Where["IN"] = "in";
|
|
55
|
+
Where["NOTIN"] = "not in";
|
|
32
56
|
Where["LT"] = "<";
|
|
33
57
|
Where["LTE"] = "<=";
|
|
34
58
|
Where["LIKE"] = "like";
|
|
59
|
+
Where["NOTLIKE"] = "not like";
|
|
60
|
+
Where["ISNULL"] = "is null";
|
|
61
|
+
Where["ISNOTNULL"] = "is not null";
|
|
35
62
|
})(exports.Where || (exports.Where = {}));
|
|
36
63
|
|
|
37
64
|
exports.UpdateOptionActions = void 0;
|
|
@@ -586,9 +613,13 @@
|
|
|
586
613
|
function Edition() {
|
|
587
614
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
588
615
|
}
|
|
589
|
-
Edition
|
|
590
|
-
|
|
591
|
-
|
|
616
|
+
Object.defineProperty(Edition, "identifiersFields", {
|
|
617
|
+
get: function () {
|
|
618
|
+
return ['id', 'subscriptionId'];
|
|
619
|
+
},
|
|
620
|
+
enumerable: false,
|
|
621
|
+
configurable: true
|
|
622
|
+
});
|
|
592
623
|
return Edition;
|
|
593
624
|
}(BaseModel));
|
|
594
625
|
|
|
@@ -597,9 +628,13 @@
|
|
|
597
628
|
function Payment() {
|
|
598
629
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
599
630
|
}
|
|
600
|
-
Payment
|
|
601
|
-
|
|
602
|
-
|
|
631
|
+
Object.defineProperty(Payment, "identifiersFields", {
|
|
632
|
+
get: function () {
|
|
633
|
+
return ['id'];
|
|
634
|
+
},
|
|
635
|
+
enumerable: false,
|
|
636
|
+
configurable: true
|
|
637
|
+
});
|
|
603
638
|
return Payment;
|
|
604
639
|
}(BaseModel));
|
|
605
640
|
__decorate([
|
|
@@ -768,9 +803,13 @@
|
|
|
768
803
|
function SubscriptionPayment() {
|
|
769
804
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
770
805
|
}
|
|
771
|
-
SubscriptionPayment
|
|
772
|
-
|
|
773
|
-
|
|
806
|
+
Object.defineProperty(SubscriptionPayment, "identifiersFields", {
|
|
807
|
+
get: function () {
|
|
808
|
+
return ['id', 'subscriptionId'];
|
|
809
|
+
},
|
|
810
|
+
enumerable: false,
|
|
811
|
+
configurable: true
|
|
812
|
+
});
|
|
774
813
|
return SubscriptionPayment;
|
|
775
814
|
}(BaseModel));
|
|
776
815
|
__decorate([
|
|
@@ -783,6 +822,13 @@
|
|
|
783
822
|
function Address() {
|
|
784
823
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
785
824
|
}
|
|
825
|
+
Object.defineProperty(Address, "identifiersFields", {
|
|
826
|
+
get: function () {
|
|
827
|
+
return ['id'];
|
|
828
|
+
},
|
|
829
|
+
enumerable: false,
|
|
830
|
+
configurable: true
|
|
831
|
+
});
|
|
786
832
|
return Address;
|
|
787
833
|
}(BaseModel));
|
|
788
834
|
|
|
@@ -797,19 +843,19 @@
|
|
|
797
843
|
return Base;
|
|
798
844
|
}());
|
|
799
845
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}
|
|
846
|
+
var isUUID = function (value) { return lodash.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); };
|
|
847
|
+
|
|
848
|
+
var parseDateTime = function (value) {
|
|
849
|
+
if (!lodash.isString(value))
|
|
850
|
+
return value;
|
|
851
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value) &&
|
|
852
|
+
!/^\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))
|
|
853
|
+
return value;
|
|
854
|
+
var date = dateFns.parseISO(value);
|
|
855
|
+
if (isNaN(date.getTime()))
|
|
856
|
+
return value;
|
|
857
|
+
return date;
|
|
858
|
+
};
|
|
813
859
|
|
|
814
860
|
var Coupon = /** @class */ (function (_super) {
|
|
815
861
|
__extends(Coupon, _super);
|
|
@@ -823,17 +869,13 @@
|
|
|
823
869
|
enumerable: false,
|
|
824
870
|
configurable: true
|
|
825
871
|
});
|
|
826
|
-
Coupon
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
case exports.DiscountType.PERCENTAGE:
|
|
834
|
-
return this.discount * 0.01 * amount;
|
|
835
|
-
}
|
|
836
|
-
};
|
|
872
|
+
Object.defineProperty(Coupon, "identifiersFields", {
|
|
873
|
+
get: function () {
|
|
874
|
+
return ['id'];
|
|
875
|
+
},
|
|
876
|
+
enumerable: false,
|
|
877
|
+
configurable: true
|
|
878
|
+
});
|
|
837
879
|
return Coupon;
|
|
838
880
|
}(BaseModel));
|
|
839
881
|
__decorate([
|
|
@@ -850,9 +892,13 @@
|
|
|
850
892
|
function SubscriptionPlan() {
|
|
851
893
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
852
894
|
}
|
|
853
|
-
SubscriptionPlan
|
|
854
|
-
|
|
855
|
-
|
|
895
|
+
Object.defineProperty(SubscriptionPlan, "identifiersFields", {
|
|
896
|
+
get: function () {
|
|
897
|
+
return ['id'];
|
|
898
|
+
},
|
|
899
|
+
enumerable: false,
|
|
900
|
+
configurable: true
|
|
901
|
+
});
|
|
856
902
|
return SubscriptionPlan;
|
|
857
903
|
}(BaseModel));
|
|
858
904
|
|
|
@@ -866,9 +912,13 @@
|
|
|
866
912
|
delete plain.id;
|
|
867
913
|
return plain;
|
|
868
914
|
};
|
|
869
|
-
BeautyProfile
|
|
870
|
-
|
|
871
|
-
|
|
915
|
+
Object.defineProperty(BeautyProfile, "identifiersFields", {
|
|
916
|
+
get: function () {
|
|
917
|
+
return ['id', 'userId'];
|
|
918
|
+
},
|
|
919
|
+
enumerable: false,
|
|
920
|
+
configurable: true
|
|
921
|
+
});
|
|
872
922
|
return BeautyProfile;
|
|
873
923
|
}(BaseModel));
|
|
874
924
|
|
|
@@ -883,14 +933,18 @@
|
|
|
883
933
|
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
884
934
|
return instance;
|
|
885
935
|
};
|
|
886
|
-
User.prototype.identifierFields = function () {
|
|
887
|
-
return ['id'];
|
|
888
|
-
};
|
|
889
936
|
User.prototype.toPlain = function () {
|
|
890
937
|
var plain = _super.prototype.toPlain.call(this);
|
|
891
938
|
delete plain.beautyProfile;
|
|
892
939
|
return plain;
|
|
893
940
|
};
|
|
941
|
+
Object.defineProperty(User, "identifiersFields", {
|
|
942
|
+
get: function () {
|
|
943
|
+
return ['id'];
|
|
944
|
+
},
|
|
945
|
+
enumerable: false,
|
|
946
|
+
configurable: true
|
|
947
|
+
});
|
|
894
948
|
return User;
|
|
895
949
|
}(BaseModel));
|
|
896
950
|
__decorate([
|
|
@@ -903,9 +957,13 @@
|
|
|
903
957
|
function Subscription() {
|
|
904
958
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
905
959
|
}
|
|
906
|
-
Subscription
|
|
907
|
-
|
|
908
|
-
|
|
960
|
+
Object.defineProperty(Subscription, "identifiersFields", {
|
|
961
|
+
get: function () {
|
|
962
|
+
return ['id'];
|
|
963
|
+
},
|
|
964
|
+
enumerable: false,
|
|
965
|
+
configurable: true
|
|
966
|
+
});
|
|
909
967
|
return Subscription;
|
|
910
968
|
}(BaseModel));
|
|
911
969
|
__decorate([
|
|
@@ -942,9 +1000,13 @@
|
|
|
942
1000
|
function UserAddress() {
|
|
943
1001
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
944
1002
|
}
|
|
945
|
-
UserAddress
|
|
946
|
-
|
|
947
|
-
|
|
1003
|
+
Object.defineProperty(UserAddress, "identifiersFields", {
|
|
1004
|
+
get: function () {
|
|
1005
|
+
return ['id', 'userId'];
|
|
1006
|
+
},
|
|
1007
|
+
enumerable: false,
|
|
1008
|
+
configurable: true
|
|
1009
|
+
});
|
|
948
1010
|
return UserAddress;
|
|
949
1011
|
}(Address));
|
|
950
1012
|
|
|
@@ -953,9 +1015,13 @@
|
|
|
953
1015
|
function UserPaymentMethod() {
|
|
954
1016
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
955
1017
|
}
|
|
956
|
-
UserPaymentMethod
|
|
957
|
-
|
|
958
|
-
|
|
1018
|
+
Object.defineProperty(UserPaymentMethod, "identifiersFields", {
|
|
1019
|
+
get: function () {
|
|
1020
|
+
return ['id', 'userId'];
|
|
1021
|
+
},
|
|
1022
|
+
enumerable: false,
|
|
1023
|
+
configurable: true
|
|
1024
|
+
});
|
|
959
1025
|
return UserPaymentMethod;
|
|
960
1026
|
}(BaseModel));
|
|
961
1027
|
|
|
@@ -964,9 +1030,13 @@
|
|
|
964
1030
|
function Lead() {
|
|
965
1031
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
966
1032
|
}
|
|
967
|
-
Lead
|
|
968
|
-
|
|
969
|
-
|
|
1033
|
+
Object.defineProperty(Lead, "identifiersFields", {
|
|
1034
|
+
get: function () {
|
|
1035
|
+
return ['id'];
|
|
1036
|
+
},
|
|
1037
|
+
enumerable: false,
|
|
1038
|
+
configurable: true
|
|
1039
|
+
});
|
|
970
1040
|
return Lead;
|
|
971
1041
|
}(BaseModel));
|
|
972
1042
|
|
|
@@ -1066,11 +1136,11 @@
|
|
|
1066
1136
|
return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
|
|
1067
1137
|
case 1:
|
|
1068
1138
|
if (_a.sent())
|
|
1069
|
-
throw new UserAlreadyRegisteredError("
|
|
1139
|
+
throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
|
|
1070
1140
|
return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
|
|
1071
1141
|
case 2:
|
|
1072
1142
|
if (_a.sent())
|
|
1073
|
-
throw new UserAlreadyRegisteredError("
|
|
1143
|
+
throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
|
|
1074
1144
|
return [4 /*yield*/, this.registerService.register({
|
|
1075
1145
|
birthday: params.birthday,
|
|
1076
1146
|
email: email,
|
|
@@ -1115,10 +1185,30 @@
|
|
|
1115
1185
|
return SignOut;
|
|
1116
1186
|
}());
|
|
1117
1187
|
|
|
1188
|
+
var RecoveryPassword = /** @class */ (function () {
|
|
1189
|
+
function RecoveryPassword(authService) {
|
|
1190
|
+
this.authService = authService;
|
|
1191
|
+
}
|
|
1192
|
+
RecoveryPassword.prototype.sendEmail = function (email) {
|
|
1193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1194
|
+
return __generator(this, function (_a) {
|
|
1195
|
+
switch (_a.label) {
|
|
1196
|
+
case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
|
|
1197
|
+
case 1:
|
|
1198
|
+
_a.sent();
|
|
1199
|
+
return [2 /*return*/];
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
});
|
|
1203
|
+
};
|
|
1204
|
+
return RecoveryPassword;
|
|
1205
|
+
}());
|
|
1206
|
+
|
|
1118
1207
|
exports.Shops = void 0;
|
|
1119
1208
|
(function (Shops) {
|
|
1120
1209
|
Shops["MENSMARKET"] = "mensmarket";
|
|
1121
1210
|
Shops["GLAMSHOP"] = "Glamshop";
|
|
1211
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
1122
1212
|
})(exports.Shops || (exports.Shops = {}));
|
|
1123
1213
|
|
|
1124
1214
|
var Category = /** @class */ (function (_super) {
|
|
@@ -1129,6 +1219,13 @@
|
|
|
1129
1219
|
Category.prototype.identifierFields = function () {
|
|
1130
1220
|
return ['id'];
|
|
1131
1221
|
};
|
|
1222
|
+
Object.defineProperty(Category, "identifiersFields", {
|
|
1223
|
+
get: function () {
|
|
1224
|
+
return ['id'];
|
|
1225
|
+
},
|
|
1226
|
+
enumerable: false,
|
|
1227
|
+
configurable: true
|
|
1228
|
+
});
|
|
1132
1229
|
return Category;
|
|
1133
1230
|
}(BaseModel));
|
|
1134
1231
|
|
|
@@ -1144,6 +1241,13 @@
|
|
|
1144
1241
|
var _a, _b, _c, _d, _e, _f;
|
|
1145
1242
|
return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
|
|
1146
1243
|
};
|
|
1244
|
+
Object.defineProperty(Product, "identifiersFields", {
|
|
1245
|
+
get: function () {
|
|
1246
|
+
return ['id'];
|
|
1247
|
+
},
|
|
1248
|
+
enumerable: false,
|
|
1249
|
+
configurable: true
|
|
1250
|
+
});
|
|
1147
1251
|
return Product;
|
|
1148
1252
|
}(BaseModel));
|
|
1149
1253
|
|
|
@@ -1155,56 +1259,69 @@
|
|
|
1155
1259
|
Variant.prototype.identifierFields = function () {
|
|
1156
1260
|
return ['id'];
|
|
1157
1261
|
};
|
|
1262
|
+
Object.defineProperty(Variant, "identifiersFields", {
|
|
1263
|
+
get: function () {
|
|
1264
|
+
return ['id', 'productId'];
|
|
1265
|
+
},
|
|
1266
|
+
enumerable: false,
|
|
1267
|
+
configurable: true
|
|
1268
|
+
});
|
|
1158
1269
|
return Variant;
|
|
1159
1270
|
}(BaseModel));
|
|
1160
1271
|
|
|
1272
|
+
exports.CouponTypes = void 0;
|
|
1273
|
+
(function (CouponTypes) {
|
|
1274
|
+
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
1275
|
+
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
1276
|
+
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
1277
|
+
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
1278
|
+
})(exports.CouponTypes || (exports.CouponTypes = {}));
|
|
1279
|
+
|
|
1280
|
+
exports.CouponSubtypes = void 0;
|
|
1281
|
+
(function (CouponSubtypes) {
|
|
1282
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
1283
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
1284
|
+
})(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
|
|
1285
|
+
|
|
1286
|
+
exports.Exclusivities = void 0;
|
|
1287
|
+
(function (Exclusivities) {
|
|
1288
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
1289
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
1290
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
1291
|
+
})(exports.Exclusivities || (exports.Exclusivities = {}));
|
|
1292
|
+
|
|
1161
1293
|
exports.CheckoutTypes = void 0;
|
|
1162
1294
|
(function (CheckoutTypes) {
|
|
1163
1295
|
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
1164
1296
|
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
1165
1297
|
})(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
|
|
1166
1298
|
|
|
1167
|
-
var
|
|
1168
|
-
|
|
1169
|
-
|
|
1299
|
+
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
1300
|
+
var FinancialCoupon = /** @class */ (function (_super) {
|
|
1301
|
+
__extends(FinancialCoupon, _super);
|
|
1302
|
+
function FinancialCoupon() {
|
|
1170
1303
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1171
|
-
_this.
|
|
1304
|
+
_this.type = exports.CouponTypes.FINANCIAL;
|
|
1172
1305
|
return _this;
|
|
1173
1306
|
}
|
|
1174
|
-
|
|
1175
|
-
return coupon
|
|
1307
|
+
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
1308
|
+
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
1176
1309
|
};
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
__extends(StoreCoupon, _super);
|
|
1190
|
-
function StoreCoupon() {
|
|
1191
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1192
|
-
_this.checkoutType = exports.CheckoutTypes.ECOMMERCE;
|
|
1193
|
-
return _this;
|
|
1194
|
-
}
|
|
1195
|
-
StoreCoupon.isStoreCoupon = function (coupon) {
|
|
1196
|
-
return coupon instanceof StoreCoupon;
|
|
1310
|
+
FinancialCoupon.createCoupon = function (userId) {
|
|
1311
|
+
return this.toInstance({
|
|
1312
|
+
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
1313
|
+
nickname: "" + Date.now(),
|
|
1314
|
+
type: exports.CouponTypes.FINANCIAL,
|
|
1315
|
+
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
1316
|
+
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
1317
|
+
discount: 30,
|
|
1318
|
+
user: userId,
|
|
1319
|
+
createdAt: new Date(Date.now()),
|
|
1320
|
+
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
1321
|
+
});
|
|
1197
1322
|
};
|
|
1198
|
-
return
|
|
1323
|
+
return FinancialCoupon;
|
|
1199
1324
|
}(Coupon));
|
|
1200
|
-
__decorate([
|
|
1201
|
-
classTransformer.Expose({ name: 'checkout_type' }),
|
|
1202
|
-
__metadata("design:type", Object)
|
|
1203
|
-
], StoreCoupon.prototype, "checkoutType", void 0);
|
|
1204
|
-
__decorate([
|
|
1205
|
-
classTransformer.Type(function () { return Category; }),
|
|
1206
|
-
__metadata("design:type", Array)
|
|
1207
|
-
], StoreCoupon.prototype, "categories", void 0);
|
|
1208
1325
|
|
|
1209
1326
|
exports.OrderStatus = void 0;
|
|
1210
1327
|
(function (OrderStatus) {
|
|
@@ -1231,9 +1348,13 @@
|
|
|
1231
1348
|
function ShippingMethod() {
|
|
1232
1349
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1233
1350
|
}
|
|
1234
|
-
ShippingMethod
|
|
1235
|
-
|
|
1236
|
-
|
|
1351
|
+
Object.defineProperty(ShippingMethod, "identifiersFields", {
|
|
1352
|
+
get: function () {
|
|
1353
|
+
return ['id'];
|
|
1354
|
+
},
|
|
1355
|
+
enumerable: false,
|
|
1356
|
+
configurable: true
|
|
1357
|
+
});
|
|
1237
1358
|
return ShippingMethod;
|
|
1238
1359
|
}(BaseModel));
|
|
1239
1360
|
|
|
@@ -1242,9 +1363,13 @@
|
|
|
1242
1363
|
function Checkout() {
|
|
1243
1364
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1244
1365
|
}
|
|
1245
|
-
Checkout
|
|
1246
|
-
|
|
1247
|
-
|
|
1366
|
+
Object.defineProperty(Checkout, "identifiersFields", {
|
|
1367
|
+
get: function () {
|
|
1368
|
+
return ['id'];
|
|
1369
|
+
},
|
|
1370
|
+
enumerable: false,
|
|
1371
|
+
configurable: true
|
|
1372
|
+
});
|
|
1248
1373
|
return Checkout;
|
|
1249
1374
|
}(BaseModel));
|
|
1250
1375
|
__decorate([
|
|
@@ -1289,9 +1414,13 @@
|
|
|
1289
1414
|
function CheckoutSubscription() {
|
|
1290
1415
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1291
1416
|
}
|
|
1292
|
-
CheckoutSubscription
|
|
1293
|
-
|
|
1294
|
-
|
|
1417
|
+
Object.defineProperty(CheckoutSubscription, "identifiersFields", {
|
|
1418
|
+
get: function () {
|
|
1419
|
+
return ['id'];
|
|
1420
|
+
},
|
|
1421
|
+
enumerable: false,
|
|
1422
|
+
configurable: true
|
|
1423
|
+
});
|
|
1295
1424
|
return CheckoutSubscription;
|
|
1296
1425
|
}(BaseModel));
|
|
1297
1426
|
__decorate([
|
|
@@ -1316,9 +1445,13 @@
|
|
|
1316
1445
|
function Buy2Win() {
|
|
1317
1446
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1318
1447
|
}
|
|
1319
|
-
Buy2Win
|
|
1320
|
-
|
|
1321
|
-
|
|
1448
|
+
Object.defineProperty(Buy2Win, "identifiersFields", {
|
|
1449
|
+
get: function () {
|
|
1450
|
+
return ['id'];
|
|
1451
|
+
},
|
|
1452
|
+
enumerable: false,
|
|
1453
|
+
configurable: true
|
|
1454
|
+
});
|
|
1322
1455
|
return Buy2Win;
|
|
1323
1456
|
}(BaseModel));
|
|
1324
1457
|
__decorate([
|
|
@@ -1420,9 +1553,13 @@
|
|
|
1420
1553
|
function Home() {
|
|
1421
1554
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1422
1555
|
}
|
|
1423
|
-
Home
|
|
1424
|
-
|
|
1425
|
-
|
|
1556
|
+
Object.defineProperty(Home, "identifiersFields", {
|
|
1557
|
+
get: function () {
|
|
1558
|
+
return ['id'];
|
|
1559
|
+
},
|
|
1560
|
+
enumerable: false,
|
|
1561
|
+
configurable: true
|
|
1562
|
+
});
|
|
1426
1563
|
return Home;
|
|
1427
1564
|
}(BaseModel));
|
|
1428
1565
|
|
|
@@ -1431,9 +1568,13 @@
|
|
|
1431
1568
|
function ShopMenu() {
|
|
1432
1569
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1433
1570
|
}
|
|
1434
|
-
ShopMenu
|
|
1435
|
-
|
|
1436
|
-
|
|
1571
|
+
Object.defineProperty(ShopMenu, "identifiersFields", {
|
|
1572
|
+
get: function () {
|
|
1573
|
+
return ['id'];
|
|
1574
|
+
},
|
|
1575
|
+
enumerable: false,
|
|
1576
|
+
configurable: true
|
|
1577
|
+
});
|
|
1437
1578
|
return ShopMenu;
|
|
1438
1579
|
}(BaseModel));
|
|
1439
1580
|
|
|
@@ -1478,15 +1619,105 @@
|
|
|
1478
1619
|
return DuplicatedResultsError;
|
|
1479
1620
|
}(Error));
|
|
1480
1621
|
|
|
1622
|
+
var AxiosAdapter = /** @class */ (function () {
|
|
1623
|
+
function AxiosAdapter(config) {
|
|
1624
|
+
this.config = config;
|
|
1625
|
+
}
|
|
1626
|
+
AxiosAdapter.prototype.query = function (index, query) {
|
|
1627
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1628
|
+
var data;
|
|
1629
|
+
return __generator(this, function (_a) {
|
|
1630
|
+
switch (_a.label) {
|
|
1631
|
+
case 0: return [4 /*yield*/, axios__default["default"]({
|
|
1632
|
+
url: this.config.url + "/" + index,
|
|
1633
|
+
method: 'POST',
|
|
1634
|
+
headers: { Authorization: "Basic " + this.config.credential },
|
|
1635
|
+
data: query,
|
|
1636
|
+
})];
|
|
1637
|
+
case 1:
|
|
1638
|
+
data = (_a.sent()).data;
|
|
1639
|
+
return [2 /*return*/, {
|
|
1640
|
+
total: data.hits.total.value,
|
|
1641
|
+
hits: data.hits.hits,
|
|
1642
|
+
}];
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
});
|
|
1646
|
+
};
|
|
1647
|
+
return AxiosAdapter;
|
|
1648
|
+
}());
|
|
1649
|
+
|
|
1650
|
+
var ProductsIndex = /** @class */ (function () {
|
|
1651
|
+
function ProductsIndex(adapter) {
|
|
1652
|
+
this.adapter = adapter;
|
|
1653
|
+
}
|
|
1654
|
+
ProductsIndex.prototype.findById = function (ids, options) {
|
|
1655
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1656
|
+
var publishedField, fields, hits;
|
|
1657
|
+
var _a;
|
|
1658
|
+
return __generator(this, function (_b) {
|
|
1659
|
+
switch (_b.label) {
|
|
1660
|
+
case 0:
|
|
1661
|
+
publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1662
|
+
fields = [
|
|
1663
|
+
'brand',
|
|
1664
|
+
'id',
|
|
1665
|
+
'images',
|
|
1666
|
+
'miniatures',
|
|
1667
|
+
'name',
|
|
1668
|
+
'price',
|
|
1669
|
+
'sku',
|
|
1670
|
+
'stock',
|
|
1671
|
+
'slug',
|
|
1672
|
+
'reviews',
|
|
1673
|
+
'pricePaid',
|
|
1674
|
+
'isGift',
|
|
1675
|
+
'stock',
|
|
1676
|
+
'weight',
|
|
1677
|
+
'tags',
|
|
1678
|
+
'hasVariants',
|
|
1679
|
+
];
|
|
1680
|
+
return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
|
|
1681
|
+
bool: {
|
|
1682
|
+
filter: __spreadArray([
|
|
1683
|
+
{
|
|
1684
|
+
terms: {
|
|
1685
|
+
_id: ids,
|
|
1686
|
+
},
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
term: (_a = {},
|
|
1690
|
+
_a[publishedField] = true,
|
|
1691
|
+
_a),
|
|
1692
|
+
}
|
|
1693
|
+
], __read((options.hasStock
|
|
1694
|
+
? [
|
|
1695
|
+
{
|
|
1696
|
+
range: {
|
|
1697
|
+
'stock.quantity': {
|
|
1698
|
+
gt: 0,
|
|
1699
|
+
},
|
|
1700
|
+
},
|
|
1701
|
+
},
|
|
1702
|
+
]
|
|
1703
|
+
: []))),
|
|
1704
|
+
},
|
|
1705
|
+
} }, (options.size ? { size: options.size } : {})))];
|
|
1706
|
+
case 1:
|
|
1707
|
+
hits = (_b.sent()).hits;
|
|
1708
|
+
return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
};
|
|
1713
|
+
return ProductsIndex;
|
|
1714
|
+
}());
|
|
1715
|
+
|
|
1481
1716
|
var withFirestore = function (MixinBase) {
|
|
1482
1717
|
return /** @class */ (function (_super) {
|
|
1483
1718
|
__extends(class_1, _super);
|
|
1484
1719
|
function class_1() {
|
|
1485
|
-
|
|
1486
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1487
|
-
args[_i] = arguments[_i];
|
|
1488
|
-
}
|
|
1489
|
-
return _super.call(this, args) || this;
|
|
1720
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1490
1721
|
}
|
|
1491
1722
|
class_1.prototype.collection = function (path) {
|
|
1492
1723
|
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
@@ -1502,7 +1733,7 @@
|
|
|
1502
1733
|
data[key] = data[key].toDate();
|
|
1503
1734
|
}
|
|
1504
1735
|
});
|
|
1505
|
-
return _this.model.toInstance(Object.assign({ id: snap.id }
|
|
1736
|
+
return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
|
|
1506
1737
|
},
|
|
1507
1738
|
};
|
|
1508
1739
|
};
|
|
@@ -1569,6 +1800,9 @@
|
|
|
1569
1800
|
var getValueFromFilter = function (filter) {
|
|
1570
1801
|
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1571
1802
|
};
|
|
1803
|
+
var getFinalValueFrom = function (value) { return lodash.isNumber(value) || lodash.isString(value) || lodash.isDate(value) || Array.isArray(value)
|
|
1804
|
+
? value
|
|
1805
|
+
: Object.values(getFinalValueFrom); };
|
|
1572
1806
|
return /** @class */ (function (_super) {
|
|
1573
1807
|
__extends(FindFirestore, _super);
|
|
1574
1808
|
function FindFirestore() {
|
|
@@ -1577,37 +1811,45 @@
|
|
|
1577
1811
|
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1578
1812
|
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1579
1813
|
return queryReference;
|
|
1814
|
+
var value = (options === null || options === void 0 ? void 0 : options.value) || options;
|
|
1815
|
+
var object = {};
|
|
1816
|
+
lodash.set(object, fieldName, value);
|
|
1817
|
+
var plainInstance = new _this.model(object).toPlain();
|
|
1818
|
+
var firestoreFieldName = fieldName.toString().indexOf('.') > -1
|
|
1819
|
+
? fieldName.toString()
|
|
1820
|
+
: Object.keys(plainInstance).find(function (key) { return plainInstance[key]; });
|
|
1580
1821
|
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
|
|
1581
1822
|
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1582
|
-
return queryReference.where(
|
|
1583
|
-
queryReference = queryReference.where(
|
|
1584
|
-
queryReference = queryReference.where(
|
|
1823
|
+
return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
|
|
1824
|
+
queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
|
|
1825
|
+
queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
|
|
1585
1826
|
return queryReference;
|
|
1586
1827
|
}
|
|
1587
1828
|
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1588
|
-
return queryReference.where(
|
|
1589
|
-
if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1590
|
-
return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
|
|
1591
|
-
|
|
1829
|
+
return queryReference.where(firestoreFieldName, 'array-contains', options.value);
|
|
1830
|
+
if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value)) {
|
|
1831
|
+
return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName.toString() + "." + key, options[key]); }, queryReference);
|
|
1832
|
+
}
|
|
1833
|
+
return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1592
1834
|
};
|
|
1593
1835
|
return _this;
|
|
1594
1836
|
}
|
|
1595
|
-
FindFirestore.prototype.find = function (
|
|
1837
|
+
FindFirestore.prototype.find = function (_a) {
|
|
1838
|
+
var filters = _a.filters, limits = _a.limits, orderBy = _a.orderBy;
|
|
1596
1839
|
return __awaiter(this, void 0, void 0, function () {
|
|
1597
1840
|
var query, docs, data;
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
switch (_b.label) {
|
|
1841
|
+
return __generator(this, function (_a) {
|
|
1842
|
+
switch (_a.label) {
|
|
1601
1843
|
case 0:
|
|
1602
1844
|
query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1603
|
-
|
|
1604
|
-
|
|
1845
|
+
query = this.makeFirestoreWhere(query, filters);
|
|
1846
|
+
Object.keys(orderBy).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderBy[fieldName])); });
|
|
1605
1847
|
return [4 /*yield*/, this.defineLimits(query, filters, limits)];
|
|
1606
1848
|
case 1:
|
|
1607
|
-
query =
|
|
1849
|
+
query = _a.sent();
|
|
1608
1850
|
return [4 /*yield*/, query.get()];
|
|
1609
1851
|
case 2:
|
|
1610
|
-
docs =
|
|
1852
|
+
docs = _a.sent();
|
|
1611
1853
|
data = docs.docs.map(function (doc) { return doc.data(); });
|
|
1612
1854
|
return [2 /*return*/, {
|
|
1613
1855
|
data: data,
|
|
@@ -1618,32 +1860,31 @@
|
|
|
1618
1860
|
});
|
|
1619
1861
|
};
|
|
1620
1862
|
FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
|
|
1621
|
-
var _a;
|
|
1622
1863
|
if (!this.isSubCollection(this))
|
|
1623
1864
|
return this.collectionName;
|
|
1624
1865
|
var parentIdField = this.parentIdField;
|
|
1625
|
-
var parentId = getValueFromFilter(
|
|
1866
|
+
var parentId = getValueFromFilter(filters === null || filters === void 0 ? void 0 : filters[parentIdField]);
|
|
1626
1867
|
return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
|
|
1627
1868
|
};
|
|
1628
1869
|
FindFirestore.prototype.defineLimits = function (query, filters, limits) {
|
|
1629
1870
|
return __awaiter(this, void 0, void 0, function () {
|
|
1630
|
-
var
|
|
1631
|
-
return __generator(this, function (
|
|
1632
|
-
switch (
|
|
1871
|
+
var _a, _b;
|
|
1872
|
+
return __generator(this, function (_c) {
|
|
1873
|
+
switch (_c.label) {
|
|
1633
1874
|
case 0:
|
|
1634
1875
|
if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
|
|
1635
|
-
if (!(limits.offset
|
|
1636
|
-
|
|
1876
|
+
if (!this.model.isModel(limits.offset)) return [3 /*break*/, 2];
|
|
1877
|
+
_b = (_a = query).startAfter;
|
|
1637
1878
|
return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
|
|
1638
|
-
.doc(limits.offset[limits.offset.
|
|
1879
|
+
.doc(limits.offset[limits.offset.identifiersFields.shift()])
|
|
1639
1880
|
.get()];
|
|
1640
1881
|
case 1:
|
|
1641
|
-
query =
|
|
1882
|
+
query = _b.apply(_a, [_c.sent()]);
|
|
1642
1883
|
return [3 /*break*/, 3];
|
|
1643
1884
|
case 2:
|
|
1644
1885
|
if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
|
|
1645
1886
|
query = query.startAt(limits.offset);
|
|
1646
|
-
|
|
1887
|
+
_c.label = 3;
|
|
1647
1888
|
case 3:
|
|
1648
1889
|
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1649
1890
|
query = query.limit(limits.limit);
|
|
@@ -1692,7 +1933,7 @@
|
|
|
1692
1933
|
return __generator(this, function (_b) {
|
|
1693
1934
|
switch (_b.label) {
|
|
1694
1935
|
case 0:
|
|
1695
|
-
id = (_a = data[data.
|
|
1936
|
+
id = (_a = data[data.identifiersFields.shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1696
1937
|
collectionPath = this.buildCollectionPathForAdd(data);
|
|
1697
1938
|
if (lodash.isEmpty(id))
|
|
1698
1939
|
return [2 /*return*/, this.collection(collectionPath).add(data)];
|
|
@@ -1742,7 +1983,7 @@
|
|
|
1742
1983
|
switch (_b.label) {
|
|
1743
1984
|
case 0:
|
|
1744
1985
|
model = new this.model();
|
|
1745
|
-
keyField = model.
|
|
1986
|
+
keyField = model.identifiersFields.shift();
|
|
1746
1987
|
docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1747
1988
|
return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
|
|
1748
1989
|
case 1:
|
|
@@ -1762,8 +2003,8 @@
|
|
|
1762
2003
|
};
|
|
1763
2004
|
UpdateFirestore.prototype.paramsToPlain = function (params) {
|
|
1764
2005
|
var model = this.model;
|
|
1765
|
-
if (params
|
|
1766
|
-
return params;
|
|
2006
|
+
if (model.isModel(params))
|
|
2007
|
+
return params.toPlain();
|
|
1767
2008
|
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1768
2009
|
var _b;
|
|
1769
2010
|
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
@@ -1846,9 +2087,13 @@
|
|
|
1846
2087
|
function UserSearch() {
|
|
1847
2088
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1848
2089
|
}
|
|
1849
|
-
UserSearch
|
|
1850
|
-
|
|
1851
|
-
|
|
2090
|
+
Object.defineProperty(UserSearch, "identifiersFields", {
|
|
2091
|
+
get: function () {
|
|
2092
|
+
return ['id'];
|
|
2093
|
+
},
|
|
2094
|
+
enumerable: false,
|
|
2095
|
+
configurable: true
|
|
2096
|
+
});
|
|
1852
2097
|
return UserSearch;
|
|
1853
2098
|
}(BaseModel));
|
|
1854
2099
|
|
|
@@ -1905,7 +2150,7 @@
|
|
|
1905
2150
|
var _a;
|
|
1906
2151
|
return __generator(this, function (_b) {
|
|
1907
2152
|
switch (_b.label) {
|
|
1908
|
-
case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find(
|
|
2153
|
+
case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find((_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a))];
|
|
1909
2154
|
case 1:
|
|
1910
2155
|
result = _b.sent();
|
|
1911
2156
|
return [2 /*return*/, result.count > 0];
|
|
@@ -2077,43 +2322,79 @@
|
|
|
2077
2322
|
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
2078
2323
|
if (limit === void 0) { limit = 4; }
|
|
2079
2324
|
return __awaiter(this, void 0, void 0, function () {
|
|
2080
|
-
var categorySnap, categories, homeSections
|
|
2081
|
-
var
|
|
2082
|
-
return __generator(this, function (
|
|
2083
|
-
switch (
|
|
2325
|
+
var categorySnap, categories, homeSections;
|
|
2326
|
+
var _this = this;
|
|
2327
|
+
return __generator(this, function (_a) {
|
|
2328
|
+
switch (_a.label) {
|
|
2084
2329
|
case 0: return [4 /*yield*/, this.collection(this.collectionName)
|
|
2085
|
-
.where('id', 'in', categoryIds)
|
|
2330
|
+
.where('id', 'in', categoryIds.filter(Boolean))
|
|
2086
2331
|
.where('published', '==', true)
|
|
2087
2332
|
.get()];
|
|
2088
2333
|
case 1:
|
|
2089
|
-
categorySnap =
|
|
2334
|
+
categorySnap = _a.sent();
|
|
2090
2335
|
if (categorySnap.empty)
|
|
2091
2336
|
throw new NotFoundError('Categories not found');
|
|
2092
2337
|
categories = categorySnap.docs.map(function (doc) { return doc.data(); });
|
|
2093
|
-
|
|
2338
|
+
return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
|
|
2339
|
+
var _a;
|
|
2340
|
+
return __generator(this, function (_b) {
|
|
2341
|
+
switch (_b.label) {
|
|
2342
|
+
case 0:
|
|
2343
|
+
_a = {
|
|
2344
|
+
category: category
|
|
2345
|
+
};
|
|
2346
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
2347
|
+
case 1: return [2 /*return*/, (_a.products = _b.sent(),
|
|
2348
|
+
_a)];
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
}); }))];
|
|
2352
|
+
case 2:
|
|
2353
|
+
homeSections = _a.sent();
|
|
2354
|
+
return [2 /*return*/, homeSections];
|
|
2355
|
+
}
|
|
2356
|
+
});
|
|
2357
|
+
});
|
|
2358
|
+
};
|
|
2359
|
+
CategoryFirestoreRepository.prototype.mountCategory = function (category, options) {
|
|
2360
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2361
|
+
var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, query, productSnap, e_1_1;
|
|
2362
|
+
var e_1, _a;
|
|
2363
|
+
return __generator(this, function (_b) {
|
|
2364
|
+
switch (_b.label) {
|
|
2365
|
+
case 0:
|
|
2366
|
+
if (!category.products)
|
|
2367
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
2368
|
+
chunks = lodash.chunk(category.products, 10);
|
|
2369
|
+
products = [];
|
|
2370
|
+
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
2371
|
+
_b.label = 1;
|
|
2372
|
+
case 1:
|
|
2373
|
+
_b.trys.push([1, 7, 8, 9]);
|
|
2374
|
+
chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
|
|
2094
2375
|
_b.label = 2;
|
|
2095
2376
|
case 2:
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2377
|
+
if (!!chunks_1_1.done) return [3 /*break*/, 6];
|
|
2378
|
+
productIds = chunks_1_1.value;
|
|
2379
|
+
if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
|
|
2380
|
+
return [3 /*break*/, 6];
|
|
2381
|
+
return [4 /*yield*/, this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds)];
|
|
2099
2382
|
case 3:
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
.where('stock.quantity', '>', 1)
|
|
2107
|
-
.limit(limit)
|
|
2108
|
-
.get()];
|
|
2383
|
+
query = _b.sent();
|
|
2384
|
+
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
2385
|
+
query = query.where('stock.quantity', '>', 0);
|
|
2386
|
+
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
2387
|
+
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
2388
|
+
return [4 /*yield*/, query.get()];
|
|
2109
2389
|
case 4:
|
|
2110
2390
|
productSnap = _b.sent();
|
|
2111
|
-
|
|
2112
|
-
|
|
2391
|
+
if (productSnap.empty)
|
|
2392
|
+
return [3 /*break*/, 5];
|
|
2393
|
+
products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
|
|
2113
2394
|
_b.label = 5;
|
|
2114
2395
|
case 5:
|
|
2115
|
-
|
|
2116
|
-
return [3 /*break*/,
|
|
2396
|
+
chunks_1_1 = chunks_1.next();
|
|
2397
|
+
return [3 /*break*/, 2];
|
|
2117
2398
|
case 6: return [3 /*break*/, 9];
|
|
2118
2399
|
case 7:
|
|
2119
2400
|
e_1_1 = _b.sent();
|
|
@@ -2121,53 +2402,11 @@
|
|
|
2121
2402
|
return [3 /*break*/, 9];
|
|
2122
2403
|
case 8:
|
|
2123
2404
|
try {
|
|
2124
|
-
if (
|
|
2405
|
+
if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
|
|
2125
2406
|
}
|
|
2126
2407
|
finally { if (e_1) throw e_1.error; }
|
|
2127
2408
|
return [7 /*endfinally*/];
|
|
2128
|
-
case 9: return [2 /*return*/,
|
|
2129
|
-
}
|
|
2130
|
-
});
|
|
2131
|
-
});
|
|
2132
|
-
};
|
|
2133
|
-
CategoryFirestoreRepository.prototype.mountCategory = function (category) {
|
|
2134
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2135
|
-
var chunks, products, publishedField;
|
|
2136
|
-
var _this = this;
|
|
2137
|
-
return __generator(this, function (_a) {
|
|
2138
|
-
switch (_a.label) {
|
|
2139
|
-
case 0:
|
|
2140
|
-
if (!category.products)
|
|
2141
|
-
throw new RequiredArgumentError(['Category products is empty']);
|
|
2142
|
-
chunks = category.products.reduce(function (resultArray, item, index) {
|
|
2143
|
-
var chunkIndex = Math.floor(index / 10);
|
|
2144
|
-
if (!resultArray[chunkIndex])
|
|
2145
|
-
resultArray[chunkIndex] = [];
|
|
2146
|
-
resultArray[chunkIndex].push(item);
|
|
2147
|
-
return resultArray;
|
|
2148
|
-
}, []);
|
|
2149
|
-
products = [];
|
|
2150
|
-
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
2151
|
-
return [4 /*yield*/, Promise.all(chunks.map(function (productIds) { return __awaiter(_this, void 0, void 0, function () {
|
|
2152
|
-
var productSnap;
|
|
2153
|
-
return __generator(this, function (_a) {
|
|
2154
|
-
switch (_a.label) {
|
|
2155
|
-
case 0: return [4 /*yield*/, this.collection('products')
|
|
2156
|
-
.where(publishedField, '==', true)
|
|
2157
|
-
.where('id', 'in', productIds)
|
|
2158
|
-
.get()];
|
|
2159
|
-
case 1:
|
|
2160
|
-
productSnap = _a.sent();
|
|
2161
|
-
if (productSnap.empty)
|
|
2162
|
-
return [2 /*return*/];
|
|
2163
|
-
products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
|
|
2164
|
-
return [2 /*return*/];
|
|
2165
|
-
}
|
|
2166
|
-
});
|
|
2167
|
-
}); }))];
|
|
2168
|
-
case 1:
|
|
2169
|
-
_a.sent();
|
|
2170
|
-
return [2 /*return*/, products];
|
|
2409
|
+
case 9: return [2 /*return*/, products];
|
|
2171
2410
|
}
|
|
2172
2411
|
});
|
|
2173
2412
|
});
|
|
@@ -2190,10 +2429,12 @@
|
|
|
2190
2429
|
var result;
|
|
2191
2430
|
return __generator(this, function (_b) {
|
|
2192
2431
|
switch (_b.label) {
|
|
2193
|
-
case 0: return [4 /*yield*/, this.find(
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2432
|
+
case 0: return [4 /*yield*/, this.find({
|
|
2433
|
+
filters: {
|
|
2434
|
+
slug: { operator: exports.Where.EQUALS, value: slug },
|
|
2435
|
+
shopAvailability: { operator: exports.Where.IN, value: [shop] },
|
|
2436
|
+
},
|
|
2437
|
+
})];
|
|
2197
2438
|
case 1:
|
|
2198
2439
|
result = _b.sent();
|
|
2199
2440
|
return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
|
|
@@ -2252,29 +2493,19 @@
|
|
|
2252
2493
|
return _this;
|
|
2253
2494
|
}
|
|
2254
2495
|
CouponFirestoreRepository.prototype.buildModelInstance = function () {
|
|
2255
|
-
var
|
|
2496
|
+
var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
|
|
2256
2497
|
return {
|
|
2257
2498
|
toFirestore: function (data) {
|
|
2258
|
-
var
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
plain.categories = (_a = plain === null || plain === void 0 ? void 0 : plain.categories) === null || _a === void 0 ? void 0 : _a.map(function (category) { return category.id; });
|
|
2499
|
+
var plain = toFirestore(data);
|
|
2500
|
+
if (!!data.expiresIn)
|
|
2501
|
+
plain.expiresIn = data.expiresIn.getTime();
|
|
2262
2502
|
return plain;
|
|
2263
2503
|
},
|
|
2264
2504
|
fromFirestore: function (snap) {
|
|
2265
|
-
var
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
data[key] = data[key].toDate();
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
data.categories = (_a = data === null || data === void 0 ? void 0 : data.categories) === null || _a === void 0 ? void 0 : _a.map(function (category) { return ({ id: category }); });
|
|
2273
|
-
if (data.checkout_type === exports.CheckoutTypes.SUBSCRIPTION)
|
|
2274
|
-
return ClubCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
2275
|
-
if (data.checkout_type === exports.CheckoutTypes.ECOMMERCE)
|
|
2276
|
-
return StoreCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
2277
|
-
return _this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
2505
|
+
var instance = fromFirestore(snap);
|
|
2506
|
+
if (!lodash.isNil(instance.expiresIn))
|
|
2507
|
+
instance.expiresIn = new Date(snap.data().expiresIn);
|
|
2508
|
+
return instance;
|
|
2278
2509
|
},
|
|
2279
2510
|
};
|
|
2280
2511
|
};
|
|
@@ -2357,10 +2588,54 @@
|
|
|
2357
2588
|
function HomeFirestoreRepository(firestore) {
|
|
2358
2589
|
var _this = _super.call(this) || this;
|
|
2359
2590
|
_this.firestore = firestore;
|
|
2591
|
+
_this.homeToFirestore = function (home) {
|
|
2592
|
+
var _a;
|
|
2593
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
2594
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.homeCategoryGroupToPlain);
|
|
2595
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.homeCategoryGroupToPlain);
|
|
2596
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.homeCategoryGroupToPlain);
|
|
2597
|
+
}
|
|
2598
|
+
return home;
|
|
2599
|
+
};
|
|
2600
|
+
_this.homeCategoryGroupToPlain = function (homeCategoryGroup) { return ({
|
|
2601
|
+
category: homeCategoryGroup.category.toPlain(),
|
|
2602
|
+
products: homeCategoryGroup.products.map(function (product) { return product.toPlain(); }),
|
|
2603
|
+
}); };
|
|
2604
|
+
_this.homeFromFirestore = function (home) {
|
|
2605
|
+
var _a;
|
|
2606
|
+
if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
|
|
2607
|
+
home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.plainToHomeCategoryGroup);
|
|
2608
|
+
home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.plainToHomeCategoryGroup);
|
|
2609
|
+
home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.plainToHomeCategoryGroup);
|
|
2610
|
+
home.data.createdAt =
|
|
2611
|
+
home.data.createdAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
|
|
2612
|
+
home.data.expiresAt =
|
|
2613
|
+
home.data.expiresAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
|
|
2614
|
+
}
|
|
2615
|
+
return home;
|
|
2616
|
+
};
|
|
2617
|
+
_this.plainToHomeCategoryGroup = function (homeCategoryGroup) { return ({
|
|
2618
|
+
category: Category.toInstance(homeCategoryGroup.category),
|
|
2619
|
+
products: homeCategoryGroup.products.map(function (product) { return Product.toInstance(product); }),
|
|
2620
|
+
}); };
|
|
2360
2621
|
_this.collectionName = 'dms';
|
|
2361
2622
|
_this.model = Home;
|
|
2362
2623
|
return _this;
|
|
2363
2624
|
}
|
|
2625
|
+
HomeFirestoreRepository.prototype.buildModelInstance = function () {
|
|
2626
|
+
var _this = this;
|
|
2627
|
+
var _b = _super.prototype.buildModelInstance.call(this), fromFirestore = _b.fromFirestore, toFirestore = _b.toFirestore;
|
|
2628
|
+
return {
|
|
2629
|
+
toFirestore: function (data) {
|
|
2630
|
+
var modifiedData = _this.homeToFirestore(data);
|
|
2631
|
+
return toFirestore(modifiedData);
|
|
2632
|
+
},
|
|
2633
|
+
fromFirestore: function (snap) {
|
|
2634
|
+
var instance = fromFirestore(snap);
|
|
2635
|
+
return _this.homeFromFirestore(instance);
|
|
2636
|
+
},
|
|
2637
|
+
};
|
|
2638
|
+
};
|
|
2364
2639
|
return HomeFirestoreRepository;
|
|
2365
2640
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
2366
2641
|
|
|
@@ -2443,6 +2718,13 @@
|
|
|
2443
2718
|
});
|
|
2444
2719
|
});
|
|
2445
2720
|
};
|
|
2721
|
+
AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
|
|
2722
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2723
|
+
return __generator(this, function (_a) {
|
|
2724
|
+
return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
|
|
2725
|
+
});
|
|
2726
|
+
});
|
|
2727
|
+
};
|
|
2446
2728
|
return AuthenticationFirebaseAuthService;
|
|
2447
2729
|
}());
|
|
2448
2730
|
|
|
@@ -2479,18 +2761,1040 @@
|
|
|
2479
2761
|
return RegisterFirebaseAuthService;
|
|
2480
2762
|
}());
|
|
2481
2763
|
|
|
2764
|
+
var AttributeOptionHelper = /** @class */ (function () {
|
|
2765
|
+
function AttributeOptionHelper() {
|
|
2766
|
+
}
|
|
2767
|
+
return AttributeOptionHelper;
|
|
2768
|
+
}());
|
|
2769
|
+
AttributeOptionHelper.FindByAttribute = function (attributeName, fields) {
|
|
2770
|
+
if (fields.includes(attributeName))
|
|
2771
|
+
return { columnName: attributeName.toString(), attributeName: attributeName };
|
|
2772
|
+
var field = fields.find(function (columnOption) { return lodash.isObject(columnOption) && Object.keys(columnOption).includes(attributeName.toString()); });
|
|
2773
|
+
var fieldOption = field === null || field === void 0 ? void 0 : field[attributeName.toString()];
|
|
2774
|
+
if (lodash.isNil(fieldOption))
|
|
2775
|
+
return { columnName: attributeName.toString(), attributeName: attributeName };
|
|
2776
|
+
if (Array.isArray(fieldOption))
|
|
2777
|
+
return { columnName: attributeName.toString(), attributeName: attributeName, fields: fieldOption };
|
|
2778
|
+
return Object.assign({ attributeName: attributeName, columnName: attributeName.toString() }, fieldOption);
|
|
2779
|
+
};
|
|
2780
|
+
AttributeOptionHelper.CheckIsColumnModelOption = function (fieldValue) { return !!fieldValue.columnName && !!fieldValue.fields; };
|
|
2781
|
+
AttributeOptionHelper.CheckIsColumnOption = function (fieldValue) { return AttributeOptionHelper.CheckIsColumnModelOption(fieldValue) || !!fieldValue.columnName; };
|
|
2782
|
+
AttributeOptionHelper.FindColumnOptionFromList = function (columnName, fields) {
|
|
2783
|
+
if (fields.includes(columnName))
|
|
2784
|
+
return { columnName: columnName, attributeName: columnName };
|
|
2785
|
+
var field = fields.find(function (columnOption) {
|
|
2786
|
+
var _a;
|
|
2787
|
+
return lodash.isObject(columnOption) &&
|
|
2788
|
+
((_a = Object.values(columnOption).find(function (option) { return AttributeOptionHelper.CheckIsColumnOption(option) && option.columnName === columnName; })) === null || _a === void 0 ? void 0 : _a.columnName) === columnName;
|
|
2789
|
+
}) || {};
|
|
2790
|
+
var attributeName = Object.keys(field).find(function (fieldOptionFromList) { return AttributeOptionHelper.CheckIsColumnOption(field[fieldOptionFromList]) ||
|
|
2791
|
+
Array.isArray(field[fieldOptionFromList]); });
|
|
2792
|
+
var fieldOption = field === null || field === void 0 ? void 0 : field[attributeName];
|
|
2793
|
+
if (Array.isArray(fieldOption))
|
|
2794
|
+
return { attributeName: attributeName, fields: fieldOption };
|
|
2795
|
+
return Object.assign({ attributeName: attributeName || columnName, columnName: columnName }, fieldOption);
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2798
|
+
var GraphQLFieldHelper = /** @class */ (function () {
|
|
2799
|
+
function GraphQLFieldHelper() {
|
|
2800
|
+
}
|
|
2801
|
+
return GraphQLFieldHelper;
|
|
2802
|
+
}());
|
|
2803
|
+
GraphQLFieldHelper.CheckIsGraphQLParams = function (params) { return !lodash.isString(params) && Array.isArray(params) && params.length >= 0 && !!params[0].operation; };
|
|
2804
|
+
GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields = function (fields) {
|
|
2805
|
+
return fields
|
|
2806
|
+
.map(function (field) {
|
|
2807
|
+
var _b, _c;
|
|
2808
|
+
if (lodash.isString(field))
|
|
2809
|
+
return field.toString();
|
|
2810
|
+
var fieldName = Object.keys(field).shift();
|
|
2811
|
+
var fieldValue = field[fieldName];
|
|
2812
|
+
if (Array.isArray(fieldValue))
|
|
2813
|
+
return _b = {}, _b[fieldName] = GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue), _b;
|
|
2814
|
+
if (AttributeOptionHelper.CheckIsColumnModelOption(fieldValue))
|
|
2815
|
+
return _c = {},
|
|
2816
|
+
_c[fieldValue.columnName || fieldName] = GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
2817
|
+
_c;
|
|
2818
|
+
if (AttributeOptionHelper.CheckIsColumnOption(fieldValue))
|
|
2819
|
+
return fieldValue.columnName;
|
|
2820
|
+
return;
|
|
2821
|
+
})
|
|
2822
|
+
.filter(function (field) { return !!field; });
|
|
2823
|
+
};
|
|
2824
|
+
GraphQLFieldHelper.ConvertFieldValueFrom = function (data, fields) { return Object.keys(data).reduce(function (result, columnName) {
|
|
2825
|
+
var _b, _c, _d, _e;
|
|
2826
|
+
var _f = AttributeOptionHelper.FindColumnOptionFromList(columnName, fields), attributeName = _f.attributeName, attributeFields = _f.fields, from = _f.from;
|
|
2827
|
+
if (!!attributeFields && Array.isArray(attributeFields)) {
|
|
2828
|
+
if (Array.isArray(data[columnName]))
|
|
2829
|
+
return Object.assign(Object.assign({}, result), (_b = {}, _b[attributeName] = from
|
|
2830
|
+
? from(data[columnName], data)
|
|
2831
|
+
: data[columnName].map(function (value) { return GraphQLFieldHelper.ConvertFieldValueFrom(value, attributeFields); }), _b));
|
|
2832
|
+
if (lodash.isObject(data[columnName]))
|
|
2833
|
+
return Object.assign(Object.assign({}, result), (_c = {}, _c[attributeName] = GraphQLFieldHelper.ConvertFieldValueFrom(data[columnName], attributeFields), _c));
|
|
2834
|
+
}
|
|
2835
|
+
if (!!from)
|
|
2836
|
+
return Object.assign(Object.assign({}, result), (_d = {}, _d[attributeName] = from(data[columnName], data), _d));
|
|
2837
|
+
return Object.assign(Object.assign({}, result), (_e = {}, _e[attributeName] = parseDateTime(data[columnName]), _e));
|
|
2838
|
+
}, {}); };
|
|
2839
|
+
GraphQLFieldHelper.ConvertFieldValueTo = function (instance, fields, update) {
|
|
2840
|
+
if (update === void 0) { update = false; }
|
|
2841
|
+
var _a;
|
|
2842
|
+
var data = ((_a = instance.toPlain) === null || _a === void 0 ? void 0 : _a.call(instance)) || instance;
|
|
2843
|
+
return Object.keys(data)
|
|
2844
|
+
.filter(function (key) { return !lodash.isNil(data[key]); })
|
|
2845
|
+
.reduce(function (result, attributeName) {
|
|
2846
|
+
var _b, _c, _d;
|
|
2847
|
+
var _e = AttributeOptionHelper.FindByAttribute(attributeName, fields), columnName = _e.columnName, attributeFields = _e.fields, foreignKeyColumn = _e.foreignKeyColumn, to = _e.to, bindPersistData = _e.bindPersistData;
|
|
2848
|
+
if (bindPersistData)
|
|
2849
|
+
return Object.assign(Object.assign({}, result), bindPersistData(data[attributeName], instance));
|
|
2850
|
+
if (lodash.isNil(columnName))
|
|
2851
|
+
return result;
|
|
2852
|
+
if (!!foreignKeyColumn &&
|
|
2853
|
+
!lodash.isEmpty(foreignKeyColumn) &&
|
|
2854
|
+
!Object.keys(foreignKeyColumn).filter(function (key) { return !data[attributeName][key]; }).length)
|
|
2855
|
+
return Object.keys(foreignKeyColumn).reduce(function (object, current) {
|
|
2856
|
+
var _b;
|
|
2857
|
+
return (Object.assign(Object.assign({}, object), (_b = {}, _b[foreignKeyColumn[current]] = data[attributeName][current], _b)));
|
|
2858
|
+
}, Object.assign({}, result));
|
|
2859
|
+
if (update && lodash.isObject(data[attributeName]) && !lodash.isNil(attributeFields) && !lodash.isDate(data[attributeName]))
|
|
2860
|
+
return result;
|
|
2861
|
+
if (!!columnName && Array.isArray(attributeFields) && lodash.isObject(data[attributeName])) {
|
|
2862
|
+
var converted = !lodash.isNil(columnName) && to ? to(instance[attributeName], instance) : data[attributeName];
|
|
2863
|
+
return Object.assign(Object.assign({}, result), (converted !== undefined
|
|
2864
|
+
? (_b = {},
|
|
2865
|
+
_b[columnName] = {
|
|
2866
|
+
data: data[attributeName] instanceof BaseModel
|
|
2867
|
+
? GraphQLFieldHelper.ConvertFieldValueTo(data[attributeName], attributeFields)
|
|
2868
|
+
: converted,
|
|
2869
|
+
},
|
|
2870
|
+
_b) : {}));
|
|
2871
|
+
}
|
|
2872
|
+
if (!!to)
|
|
2873
|
+
return Object.assign(Object.assign({}, result), (_c = {}, _c[columnName] = to(instance[attributeName], instance), _c));
|
|
2874
|
+
return Object.assign(Object.assign({}, result), (_d = {}, _d[columnName] = data[attributeName], _d));
|
|
2875
|
+
}, {});
|
|
2876
|
+
};
|
|
2877
|
+
|
|
2878
|
+
var FilterOptionHelper = /** @class */ (function () {
|
|
2879
|
+
function FilterOptionHelper() {
|
|
2880
|
+
}
|
|
2881
|
+
return FilterOptionHelper;
|
|
2882
|
+
}());
|
|
2883
|
+
FilterOptionHelper.CheckIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
|
|
2884
|
+
FilterOptionHelper.GetValueFromFilter = function (filter, fieldOption) {
|
|
2885
|
+
if (!FilterOptionHelper.CheckIfIsFilterOption(filter))
|
|
2886
|
+
return filter;
|
|
2887
|
+
if (filter.operator === exports.Where.ISNULL)
|
|
2888
|
+
return true;
|
|
2889
|
+
if (filter.operator === exports.Where.ISNOTNULL)
|
|
2890
|
+
return false;
|
|
2891
|
+
var converter = fieldOption.to ? fieldOption.to : function (value) { return value; };
|
|
2892
|
+
return Array.isArray(filter.value) && [exports.Where.IN, exports.Where.NOTIN].includes(filter.operator)
|
|
2893
|
+
? filter.value.map(function (fieldValue) { return converter(fieldValue); })
|
|
2894
|
+
: converter(filter.value);
|
|
2895
|
+
};
|
|
2896
|
+
|
|
2897
|
+
var withCreateHasuraGraphQL = function (MixinBase) {
|
|
2898
|
+
return /** @class */ (function (_super) {
|
|
2899
|
+
__extends(CreateHasuraGraphQLMixin, _super);
|
|
2900
|
+
function CreateHasuraGraphQLMixin() {
|
|
2901
|
+
var params = [];
|
|
2902
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2903
|
+
params[_i] = arguments[_i];
|
|
2904
|
+
}
|
|
2905
|
+
var _this = this;
|
|
2906
|
+
var options = params === null || params === void 0 ? void 0 : params[0];
|
|
2907
|
+
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
2908
|
+
_this.insertGraphQLOperation = (options === null || options === void 0 ? void 0 : options.insertGraphQLOperation) || "insert_" + _this.tableName + "_one";
|
|
2909
|
+
_this.insertGraphQLObjectType = (options === null || options === void 0 ? void 0 : options.insertGraphQLObjectType) || _this.tableName + "_insert_input";
|
|
2910
|
+
return _this;
|
|
2911
|
+
}
|
|
2912
|
+
CreateHasuraGraphQLMixin.prototype.create = function (data) {
|
|
2913
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2914
|
+
var newData;
|
|
2915
|
+
return __generator(this, function (_a) {
|
|
2916
|
+
switch (_a.label) {
|
|
2917
|
+
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
2918
|
+
case 1:
|
|
2919
|
+
newData = _a.sent();
|
|
2920
|
+
return [2 /*return*/, this.model.toInstance(newData)];
|
|
2921
|
+
}
|
|
2922
|
+
});
|
|
2923
|
+
});
|
|
2924
|
+
};
|
|
2925
|
+
CreateHasuraGraphQLMixin.prototype.save = function (data) {
|
|
2926
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2927
|
+
var result;
|
|
2928
|
+
var _this = this;
|
|
2929
|
+
return __generator(this, function (_a) {
|
|
2930
|
+
switch (_a.label) {
|
|
2931
|
+
case 0: return [4 /*yield*/, this.mutation(this.insertGraphQLOperation, this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; }), {
|
|
2932
|
+
object: { type: this.insertGraphQLObjectType, required: true, value: this.convertDataToHasura(data) },
|
|
2933
|
+
})];
|
|
2934
|
+
case 1:
|
|
2935
|
+
result = _a.sent();
|
|
2936
|
+
return [2 /*return*/, Object.assign(Object.assign({}, data.toPlain()), this.convertDataFromHasura(result[this.insertGraphQLOperation]).toPlain())];
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
});
|
|
2940
|
+
};
|
|
2941
|
+
return CreateHasuraGraphQLMixin;
|
|
2942
|
+
}(MixinBase));
|
|
2943
|
+
};
|
|
2944
|
+
|
|
2945
|
+
var withDeleteHasuraGraphQL = function (MixinBase) {
|
|
2946
|
+
return /** @class */ (function (_super) {
|
|
2947
|
+
__extends(DeleteHasuraGraphQLMixin, _super);
|
|
2948
|
+
function DeleteHasuraGraphQLMixin() {
|
|
2949
|
+
var params = [];
|
|
2950
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2951
|
+
params[_i] = arguments[_i];
|
|
2952
|
+
}
|
|
2953
|
+
var _this = this;
|
|
2954
|
+
var options = params === null || params === void 0 ? void 0 : params[0];
|
|
2955
|
+
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
2956
|
+
_this.deleteGraphQLOperation = (options === null || options === void 0 ? void 0 : options.deleteGraphQLOperation) || "delete_" + _this.tableName + "_by_pk";
|
|
2957
|
+
return _this;
|
|
2958
|
+
}
|
|
2959
|
+
DeleteHasuraGraphQLMixin.prototype.delete = function (identifiers) {
|
|
2960
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2961
|
+
var instance;
|
|
2962
|
+
var _this = this;
|
|
2963
|
+
return __generator(this, function (_a) {
|
|
2964
|
+
switch (_a.label) {
|
|
2965
|
+
case 0:
|
|
2966
|
+
instance = this.model.toInstance(identifiers);
|
|
2967
|
+
return [4 /*yield*/, this.mutation(this.deleteGraphQLOperation, this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; }), this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
2968
|
+
var _a;
|
|
2969
|
+
if (lodash.isNil(instance[identifier]))
|
|
2970
|
+
return ids;
|
|
2971
|
+
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
2972
|
+
var value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
2973
|
+
return Object.assign(Object.assign({}, ids), (_a = {}, _a[columnOption.columnName] = {
|
|
2974
|
+
type: _this.getAttributeGraphQLTypeOf(columnOption.type || value),
|
|
2975
|
+
value: value,
|
|
2976
|
+
required: true,
|
|
2977
|
+
}, _a));
|
|
2978
|
+
}, {}))];
|
|
2979
|
+
case 1:
|
|
2980
|
+
_a.sent();
|
|
2981
|
+
return [2 /*return*/];
|
|
2982
|
+
}
|
|
2983
|
+
});
|
|
2984
|
+
});
|
|
2985
|
+
};
|
|
2986
|
+
return DeleteHasuraGraphQLMixin;
|
|
2987
|
+
}(MixinBase));
|
|
2988
|
+
};
|
|
2989
|
+
|
|
2990
|
+
var withHasuraGraphQL = function (MixinBase) {
|
|
2991
|
+
return /** @class */ (function (_super) {
|
|
2992
|
+
__extends(HasuraGraphQLMixin, _super);
|
|
2993
|
+
function HasuraGraphQLMixin() {
|
|
2994
|
+
var params = [];
|
|
2995
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2996
|
+
params[_i] = arguments[_i];
|
|
2997
|
+
}
|
|
2998
|
+
var _this = this;
|
|
2999
|
+
var options = params[0];
|
|
3000
|
+
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
3001
|
+
_this.tableName = options.tableName;
|
|
3002
|
+
_this.endpoint = options.endpoint;
|
|
3003
|
+
_this.authOptions = options.authOptions;
|
|
3004
|
+
_this.model = options.model;
|
|
3005
|
+
_this.fields = options.fields || _this.model.identifiersFields;
|
|
3006
|
+
return _this;
|
|
3007
|
+
}
|
|
3008
|
+
Object.defineProperty(HasuraGraphQLMixin.prototype, "headers", {
|
|
3009
|
+
get: function () {
|
|
3010
|
+
return Object.assign(Object.assign(Object.assign({ 'Content-Type': 'application/json' }, (lodash.isNil(this.authOptions.authToken) ? {} : { Authorization: this.authOptions.authToken })), (lodash.isNil(this.authOptions.adminSecret) ? {} : { 'X-Hasura-Admin-Secret': this.authOptions.adminSecret })), (lodash.isNil(this.authOptions.authRole)
|
|
3011
|
+
? {}
|
|
3012
|
+
: { 'X-Hasura-Role': this.authOptions.authRole.role, 'X-Hasura-User-Id': this.authOptions.authRole.userId }));
|
|
3013
|
+
},
|
|
3014
|
+
enumerable: false,
|
|
3015
|
+
configurable: true
|
|
3016
|
+
});
|
|
3017
|
+
HasuraGraphQLMixin.prototype.mutation = function (operation, fields, variables) {
|
|
3018
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3019
|
+
var resultQuery;
|
|
3020
|
+
return __generator(this, function (_a) {
|
|
3021
|
+
resultQuery = gqlQueryBuilder.mutation({
|
|
3022
|
+
operation: operation,
|
|
3023
|
+
variables: variables,
|
|
3024
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fields),
|
|
3025
|
+
});
|
|
3026
|
+
return [2 /*return*/, this.fetch(resultQuery)];
|
|
3027
|
+
});
|
|
3028
|
+
});
|
|
3029
|
+
};
|
|
3030
|
+
HasuraGraphQLMixin.prototype.query = function (operation, fields, variables) {
|
|
3031
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3032
|
+
var resultQuery;
|
|
3033
|
+
return __generator(this, function (_a) {
|
|
3034
|
+
resultQuery = GraphQLFieldHelper.CheckIsGraphQLParams(operation)
|
|
3035
|
+
? gqlQueryBuilder.query(operation.map(function (option) { return ({
|
|
3036
|
+
operation: option.operation,
|
|
3037
|
+
variables: option.variables,
|
|
3038
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(option.fields),
|
|
3039
|
+
}); }))
|
|
3040
|
+
: gqlQueryBuilder.query({
|
|
3041
|
+
operation: operation,
|
|
3042
|
+
variables: variables,
|
|
3043
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fields),
|
|
3044
|
+
});
|
|
3045
|
+
return [2 /*return*/, this.fetch(resultQuery)];
|
|
3046
|
+
});
|
|
3047
|
+
});
|
|
3048
|
+
};
|
|
3049
|
+
HasuraGraphQLMixin.prototype.fetch = function (params) {
|
|
3050
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3051
|
+
var headers, response, result;
|
|
3052
|
+
return __generator(this, function (_a) {
|
|
3053
|
+
switch (_a.label) {
|
|
3054
|
+
case 0:
|
|
3055
|
+
headers = this.headers;
|
|
3056
|
+
return [4 /*yield*/, fetch__default["default"]("" + this.endpoint, {
|
|
3057
|
+
method: 'POST',
|
|
3058
|
+
body: JSON.stringify(params),
|
|
3059
|
+
headers: headers,
|
|
3060
|
+
})];
|
|
3061
|
+
case 1:
|
|
3062
|
+
response = _a.sent();
|
|
3063
|
+
return [4 /*yield*/, response.json()];
|
|
3064
|
+
case 2:
|
|
3065
|
+
result = _a.sent();
|
|
3066
|
+
if (!lodash.isNil(result.errors))
|
|
3067
|
+
throw new Error(JSON.stringify(result.errors));
|
|
3068
|
+
return [2 /*return*/, result.data];
|
|
3069
|
+
}
|
|
3070
|
+
});
|
|
3071
|
+
});
|
|
3072
|
+
};
|
|
3073
|
+
HasuraGraphQLMixin.prototype.getAttributeGraphQLTypeOf = function (value) {
|
|
3074
|
+
if (isUUID(value))
|
|
3075
|
+
return 'uuid';
|
|
3076
|
+
if (lodash.isString(value))
|
|
3077
|
+
return 'String';
|
|
3078
|
+
if (lodash.isBoolean(value))
|
|
3079
|
+
return 'Boolean';
|
|
3080
|
+
if (value instanceof Date)
|
|
3081
|
+
return 'timestamptz';
|
|
3082
|
+
if (lodash.isInteger(value))
|
|
3083
|
+
return 'Int';
|
|
3084
|
+
if (lodash.isNumber(value))
|
|
3085
|
+
return 'numeric';
|
|
3086
|
+
throw new Error('Type not implemented yet');
|
|
3087
|
+
};
|
|
3088
|
+
HasuraGraphQLMixin.prototype.checkIfIsDateTimeAndParse = function (value) {
|
|
3089
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value))
|
|
3090
|
+
return value;
|
|
3091
|
+
var date = dateFns.parseISO(value);
|
|
3092
|
+
if (lodash.isNaN(date.getTime()))
|
|
3093
|
+
return value;
|
|
3094
|
+
return date;
|
|
3095
|
+
};
|
|
3096
|
+
HasuraGraphQLMixin.prototype.convertDataFromHasura = function (data) {
|
|
3097
|
+
var plain = GraphQLFieldHelper.ConvertFieldValueFrom(data, this.fields);
|
|
3098
|
+
return this.model.toInstance(plain);
|
|
3099
|
+
};
|
|
3100
|
+
HasuraGraphQLMixin.prototype.convertDataToHasura = function (instance, update) {
|
|
3101
|
+
if (update === void 0) { update = false; }
|
|
3102
|
+
return GraphQLFieldHelper.ConvertFieldValueTo(instance, this.fields, update);
|
|
3103
|
+
};
|
|
3104
|
+
return HasuraGraphQLMixin;
|
|
3105
|
+
}(MixinBase));
|
|
3106
|
+
};
|
|
3107
|
+
|
|
3108
|
+
var withUpdateHasuraGraphQL = function (MixinBase) {
|
|
3109
|
+
var getValueByAction = function (options) {
|
|
3110
|
+
if (lodash.isNil(options.action))
|
|
3111
|
+
return options;
|
|
3112
|
+
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
3113
|
+
return null;
|
|
3114
|
+
return options.value;
|
|
3115
|
+
};
|
|
3116
|
+
return /** @class */ (function (_super) {
|
|
3117
|
+
__extends(UpdateHasuraGraphQLMixin, _super);
|
|
3118
|
+
function UpdateHasuraGraphQLMixin() {
|
|
3119
|
+
var params = [];
|
|
3120
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3121
|
+
params[_i] = arguments[_i];
|
|
3122
|
+
}
|
|
3123
|
+
var _this = this;
|
|
3124
|
+
var options = params === null || params === void 0 ? void 0 : params[0];
|
|
3125
|
+
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
3126
|
+
_this.updateGraphQLOperation = (options === null || options === void 0 ? void 0 : options.updateGraphQLOperation) || "update_" + _this.tableName + "_by_pk";
|
|
3127
|
+
_this.updateGraphQLObjectType = (options === null || options === void 0 ? void 0 : options.updateGraphQLObjectType) || _this.tableName + "_set_input";
|
|
3128
|
+
_this.updateGraphQLPKType = (options === null || options === void 0 ? void 0 : options.updateGraphQLPKType) || _this.tableName + "_pk_columns_input";
|
|
3129
|
+
return _this;
|
|
3130
|
+
}
|
|
3131
|
+
UpdateHasuraGraphQLMixin.prototype.update = function (data) {
|
|
3132
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3133
|
+
var plainData;
|
|
3134
|
+
var _this = this;
|
|
3135
|
+
return __generator(this, function (_a) {
|
|
3136
|
+
switch (_a.label) {
|
|
3137
|
+
case 0:
|
|
3138
|
+
plainData = this.paramsToPlain(data);
|
|
3139
|
+
return [4 /*yield*/, this.mutation(this.updateGraphQLOperation, this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; }), {
|
|
3140
|
+
_set: {
|
|
3141
|
+
type: this.updateGraphQLObjectType,
|
|
3142
|
+
value: this.convertDataToHasura(this.model.toInstance(plainData), true),
|
|
3143
|
+
required: true,
|
|
3144
|
+
},
|
|
3145
|
+
pk_columns: { type: this.updateGraphQLPKType, value: this.getUpdateModelKeys(plainData), required: true },
|
|
3146
|
+
})];
|
|
3147
|
+
case 1:
|
|
3148
|
+
_a.sent();
|
|
3149
|
+
return [2 /*return*/, this.model.toInstance(plainData)];
|
|
3150
|
+
}
|
|
3151
|
+
});
|
|
3152
|
+
});
|
|
3153
|
+
};
|
|
3154
|
+
UpdateHasuraGraphQLMixin.prototype.paramsToPlain = function (params) {
|
|
3155
|
+
var model = this.model;
|
|
3156
|
+
if (model.isModel(params))
|
|
3157
|
+
return params.toPlain();
|
|
3158
|
+
return Object.keys(params).reduce(function (data, currentKey) {
|
|
3159
|
+
var _a;
|
|
3160
|
+
return (Object.assign(Object.assign({}, data), (_a = {}, _a[currentKey] = getValueByAction(params[currentKey]), _a)));
|
|
3161
|
+
}, {});
|
|
3162
|
+
};
|
|
3163
|
+
UpdateHasuraGraphQLMixin.prototype.getUpdateModelKeys = function (data) {
|
|
3164
|
+
var _this = this;
|
|
3165
|
+
var instance = this.model.toInstance(data);
|
|
3166
|
+
return this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3167
|
+
var _a;
|
|
3168
|
+
if (lodash.isNil(instance[identifier]))
|
|
3169
|
+
return ids;
|
|
3170
|
+
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
3171
|
+
var value = columnOption.to(data[identifier.toString()], instance);
|
|
3172
|
+
return Object.assign(Object.assign({}, ids), (_a = {}, _a[columnOption.columnName] = value, _a));
|
|
3173
|
+
}, {});
|
|
3174
|
+
};
|
|
3175
|
+
return UpdateHasuraGraphQLMixin;
|
|
3176
|
+
}(MixinBase));
|
|
3177
|
+
};
|
|
3178
|
+
|
|
3179
|
+
var withGetHasuraGraphQL = function (MixinBase) {
|
|
3180
|
+
return /** @class */ (function (_super) {
|
|
3181
|
+
__extends(GetHasuraGraphQLMixin, _super);
|
|
3182
|
+
function GetHasuraGraphQLMixin() {
|
|
3183
|
+
var params = [];
|
|
3184
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3185
|
+
params[_i] = arguments[_i];
|
|
3186
|
+
}
|
|
3187
|
+
var _this = this;
|
|
3188
|
+
var options = params === null || params === void 0 ? void 0 : params[0];
|
|
3189
|
+
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
3190
|
+
_this.getGraphQLOperation = (options === null || options === void 0 ? void 0 : options.getGraphQLOperation) || _this.tableName + "_by_pk";
|
|
3191
|
+
return _this;
|
|
3192
|
+
}
|
|
3193
|
+
GetHasuraGraphQLMixin.prototype.get = function (identifiers) {
|
|
3194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3195
|
+
var instance, result, data;
|
|
3196
|
+
var _this = this;
|
|
3197
|
+
return __generator(this, function (_a) {
|
|
3198
|
+
switch (_a.label) {
|
|
3199
|
+
case 0:
|
|
3200
|
+
instance = this.model.toInstance(identifiers);
|
|
3201
|
+
return [4 /*yield*/, this.query(this.getGraphQLOperation, this.fields, this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3202
|
+
var _a;
|
|
3203
|
+
if (lodash.isNil(instance[identifier]))
|
|
3204
|
+
return ids;
|
|
3205
|
+
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
3206
|
+
var value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
3207
|
+
return Object.assign(Object.assign({}, ids), (_a = {}, _a[columnOption.columnName] = {
|
|
3208
|
+
type: _this.getAttributeGraphQLTypeOf(columnOption.type || value),
|
|
3209
|
+
value: value,
|
|
3210
|
+
required: true,
|
|
3211
|
+
}, _a));
|
|
3212
|
+
}, {}))];
|
|
3213
|
+
case 1:
|
|
3214
|
+
result = _a.sent();
|
|
3215
|
+
data = result[this.getGraphQLOperation];
|
|
3216
|
+
if (lodash.isNil(data))
|
|
3217
|
+
throw new NotFoundError(instance.constructor.name + " not found");
|
|
3218
|
+
return [2 /*return*/, this.convertDataFromHasura(result[this.getGraphQLOperation])];
|
|
3219
|
+
}
|
|
3220
|
+
});
|
|
3221
|
+
});
|
|
3222
|
+
};
|
|
3223
|
+
return GetHasuraGraphQLMixin;
|
|
3224
|
+
}(MixinBase));
|
|
3225
|
+
};
|
|
3226
|
+
|
|
3227
|
+
var HasuraGraphQLWhere;
|
|
3228
|
+
(function (HasuraGraphQLWhere) {
|
|
3229
|
+
HasuraGraphQLWhere["EQUALS"] = "_eq";
|
|
3230
|
+
HasuraGraphQLWhere["GT"] = "_gt";
|
|
3231
|
+
HasuraGraphQLWhere["GTE"] = "_gte";
|
|
3232
|
+
HasuraGraphQLWhere["IN"] = "_in";
|
|
3233
|
+
HasuraGraphQLWhere["NOTIN"] = "_nin";
|
|
3234
|
+
HasuraGraphQLWhere["LT"] = "_lt";
|
|
3235
|
+
HasuraGraphQLWhere["LTE"] = "_lte";
|
|
3236
|
+
HasuraGraphQLWhere["LIKE"] = "_like";
|
|
3237
|
+
HasuraGraphQLWhere["NOTLIKE"] = "_nlike";
|
|
3238
|
+
HasuraGraphQLWhere["ISNULL"] = "_is_null";
|
|
3239
|
+
HasuraGraphQLWhere["ISNOTNULL"] = "_is_null";
|
|
3240
|
+
})(HasuraGraphQLWhere || (HasuraGraphQLWhere = {}));
|
|
3241
|
+
|
|
3242
|
+
var HasuraGraphQLColumnType;
|
|
3243
|
+
(function (HasuraGraphQLColumnType) {
|
|
3244
|
+
HasuraGraphQLColumnType["Int"] = "Int";
|
|
3245
|
+
HasuraGraphQLColumnType["Float"] = "Float";
|
|
3246
|
+
HasuraGraphQLColumnType["Boolean"] = "Boolean";
|
|
3247
|
+
HasuraGraphQLColumnType["String"] = "String";
|
|
3248
|
+
HasuraGraphQLColumnType["DateTime"] = "timestampz";
|
|
3249
|
+
HasuraGraphQLColumnType["Json"] = "json";
|
|
3250
|
+
HasuraGraphQLColumnType["Jsonb"] = "jsonb";
|
|
3251
|
+
HasuraGraphQLColumnType["Enum"] = "enum";
|
|
3252
|
+
HasuraGraphQLColumnType["Uuid"] = "uuid";
|
|
3253
|
+
})(HasuraGraphQLColumnType || (HasuraGraphQLColumnType = {}));
|
|
3254
|
+
|
|
3255
|
+
var withFindHasuraGraphQL = function (MixinBase) {
|
|
3256
|
+
return /** @class */ (function (_super) {
|
|
3257
|
+
__extends(FindHasuraGraphQLMixin, _super);
|
|
3258
|
+
function FindHasuraGraphQLMixin() {
|
|
3259
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
3260
|
+
_this.makeGraphQLWhere = function (filter, fields) { return Object.keys(filter).reduce(function (variables, fieldName) {
|
|
3261
|
+
var _a;
|
|
3262
|
+
var columnOption = AttributeOptionHelper.FindByAttribute(fieldName, fields);
|
|
3263
|
+
if (!columnOption.bindFindFilter)
|
|
3264
|
+
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnOption.columnName] = _this.buildWhereSentence(fieldName, filter[fieldName], fields), _a));
|
|
3265
|
+
var builtFilter = columnOption.bindFindFilter(filter[fieldName]);
|
|
3266
|
+
return Object.assign(Object.assign({}, variables), Object.keys(builtFilter).reduce(function (variablesList, columnName) {
|
|
3267
|
+
var _a;
|
|
3268
|
+
return (Object.assign(Object.assign({}, variablesList), (_a = {}, _a[columnName] = _this.buildWhereSentence(fieldName, builtFilter[columnName], fields), _a)));
|
|
3269
|
+
}, {}));
|
|
3270
|
+
}, {}); };
|
|
3271
|
+
_this.buildWhereSentence = function (field, options, fields) {
|
|
3272
|
+
var _a;
|
|
3273
|
+
var fieldSentenceOptions = AttributeOptionHelper.FindByAttribute(field, fields);
|
|
3274
|
+
if (!Array.isArray(options) &&
|
|
3275
|
+
lodash.isObject(options) &&
|
|
3276
|
+
lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) &&
|
|
3277
|
+
lodash.isNil(options === null || options === void 0 ? void 0 : options.value) &&
|
|
3278
|
+
lodash.isNil(fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.to))
|
|
3279
|
+
return Object.keys(options).reduce(function (variables, key) {
|
|
3280
|
+
var _a;
|
|
3281
|
+
var fieldOptions = AttributeOptionHelper.FindByAttribute(key, fields);
|
|
3282
|
+
var columnName = fieldOptions.columnName;
|
|
3283
|
+
var columnFields = fieldOptions.fields;
|
|
3284
|
+
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnName] = _this.buildWhereSentence(key, options[key], columnFields || []), _a));
|
|
3285
|
+
}, {});
|
|
3286
|
+
if (!Array.isArray(options) && !lodash.isNil(fieldSentenceOptions.fields))
|
|
3287
|
+
return _a = {},
|
|
3288
|
+
_a[fieldSentenceOptions.fields[0]] = _this.buildOperatorSentence(options, fieldSentenceOptions),
|
|
3289
|
+
_a;
|
|
3290
|
+
if (lodash.isObject(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
|
|
3291
|
+
options = Object.values(options)[0];
|
|
3292
|
+
return Array.isArray(options)
|
|
3293
|
+
? options.reduce(function (whereSentence, option) { return (Object.assign(Object.assign({}, whereSentence), _this.buildOperatorSentence(option, fieldSentenceOptions))); }, {})
|
|
3294
|
+
: _this.buildOperatorSentence(options, fieldSentenceOptions);
|
|
3295
|
+
};
|
|
3296
|
+
_this.buildOperatorSentence = function (options, fieldOption) {
|
|
3297
|
+
var _a;
|
|
3298
|
+
return (_a = {},
|
|
3299
|
+
_a[_this.getHasuraOperator(options, fieldOption)] = FilterOptionHelper.GetValueFromFilter(options, fieldOption),
|
|
3300
|
+
_a);
|
|
3301
|
+
};
|
|
3302
|
+
_this.getHasuraOperator = function (options, fieldOption) { return FilterOptionHelper.CheckIfIsFilterOption(options)
|
|
3303
|
+
? fieldOption.type === HasuraGraphQLColumnType.Jsonb
|
|
3304
|
+
? _this.getHasuraJsonbOperator(options)
|
|
3305
|
+
: HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find(function (graphQLOperator) { return graphQLOperator === Object.keys(exports.Where).find(function (operator) { return exports.Where[operator] === (options === null || options === void 0 ? void 0 : options.operator); }); })]
|
|
3306
|
+
: HasuraGraphQLWhere.EQUALS; };
|
|
3307
|
+
_this.getHasuraJsonbOperator = function (options) { return options.operator === exports.Where.IN
|
|
3308
|
+
? '_contains'
|
|
3309
|
+
: options.operator === exports.Where.LIKE
|
|
3310
|
+
? '_has_keys_any'
|
|
3311
|
+
: HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find(function (graphQLOperator) { return graphQLOperator === Object.keys(exports.Where).find(function (operator) { return exports.Where[operator] === (options === null || options === void 0 ? void 0 : options.operator); }); })]; };
|
|
3312
|
+
return _this;
|
|
3313
|
+
}
|
|
3314
|
+
FindHasuraGraphQLMixin.prototype.find = function (options) {
|
|
3315
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3316
|
+
var _a, filters, limits, orderBy, variablesCount, variables, result, data, count;
|
|
3317
|
+
var _this = this;
|
|
3318
|
+
return __generator(this, function (_b) {
|
|
3319
|
+
switch (_b.label) {
|
|
3320
|
+
case 0:
|
|
3321
|
+
_a = options || {}, filters = _a.filters, limits = _a.limits, orderBy = _a.orderBy;
|
|
3322
|
+
variablesCount = Object.assign(Object.assign({}, (lodash.isNil(orderBy) ? {} : { order_by: { type: this.tableName + "_order_by!", list: true, value: orderBy } })), (lodash.isNil(filters)
|
|
3323
|
+
? {}
|
|
3324
|
+
: {
|
|
3325
|
+
where: {
|
|
3326
|
+
value: this.makeGraphQLWhere(filters, this.fields),
|
|
3327
|
+
type: this.tableName + "_bool_exp",
|
|
3328
|
+
required: true,
|
|
3329
|
+
},
|
|
3330
|
+
}));
|
|
3331
|
+
variables = Object.assign(Object.assign({}, (lodash.isNil(limits) ? {} : limits)), variablesCount);
|
|
3332
|
+
return [4 /*yield*/, this.query([
|
|
3333
|
+
{
|
|
3334
|
+
operation: this.tableName,
|
|
3335
|
+
fields: this.fields,
|
|
3336
|
+
variables: variables,
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
operation: this.tableName + "_aggregate",
|
|
3340
|
+
fields: [{ aggregate: ['count'] }],
|
|
3341
|
+
variables: variablesCount,
|
|
3342
|
+
},
|
|
3343
|
+
])];
|
|
3344
|
+
case 1:
|
|
3345
|
+
result = _b.sent();
|
|
3346
|
+
data = result[this.tableName].map(function (row) { return _this.convertDataFromHasura(row); });
|
|
3347
|
+
count = result[this.tableName + "_aggregate"].aggregate.count;
|
|
3348
|
+
return [2 /*return*/, { count: count, data: data }];
|
|
3349
|
+
}
|
|
3350
|
+
});
|
|
3351
|
+
});
|
|
3352
|
+
};
|
|
3353
|
+
return FindHasuraGraphQLMixin;
|
|
3354
|
+
}(MixinBase));
|
|
3355
|
+
};
|
|
3356
|
+
|
|
3357
|
+
var withCrudHasuraGraphQL = function (MixinBase) {
|
|
3358
|
+
return /** @class */ (function (_super) {
|
|
3359
|
+
__extends(CrudHasuraGraphQLMixin, _super);
|
|
3360
|
+
function CrudHasuraGraphQLMixin() {
|
|
3361
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3362
|
+
}
|
|
3363
|
+
return CrudHasuraGraphQLMixin;
|
|
3364
|
+
}(withUpdateHasuraGraphQL(withGetHasuraGraphQL(withFindHasuraGraphQL(withDeleteHasuraGraphQL(withCreateHasuraGraphQL(MixinBase)))))));
|
|
3365
|
+
};
|
|
3366
|
+
|
|
3367
|
+
var CategoryHasuraGraphQLRepository = /** @class */ (function (_super_1) {
|
|
3368
|
+
__extends(CategoryHasuraGraphQLRepository, _super_1);
|
|
3369
|
+
function CategoryHasuraGraphQLRepository(endpoint, authOptions, productRepository) {
|
|
3370
|
+
var _this = _super_1.call(this, {
|
|
3371
|
+
tableName: 'category',
|
|
3372
|
+
model: Category,
|
|
3373
|
+
endpoint: endpoint,
|
|
3374
|
+
authOptions: authOptions,
|
|
3375
|
+
fields: [
|
|
3376
|
+
{ id: { columnName: 'id', to: function (value) { return +value; }, from: function (value) { return value.toString(); } } },
|
|
3377
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
3378
|
+
'name',
|
|
3379
|
+
'description',
|
|
3380
|
+
'image',
|
|
3381
|
+
'published',
|
|
3382
|
+
'shop',
|
|
3383
|
+
'slug',
|
|
3384
|
+
{ brandCategory: { columnName: 'brand_category' } },
|
|
3385
|
+
{ brandCategoryBanner: { columnName: 'brand_banner' } },
|
|
3386
|
+
{ brandCategoryBannerMobile: { columnName: 'brand_banner_mobile' } },
|
|
3387
|
+
{ brandLogo: { columnName: 'brand_logo' } },
|
|
3388
|
+
{ brandCondition: { columnName: 'brand_condition' } },
|
|
3389
|
+
{
|
|
3390
|
+
conditions: {
|
|
3391
|
+
columnName: 'tag_condition',
|
|
3392
|
+
from: function (tags, row) { return ({ brand: row.brand_condition, tags: tags }); },
|
|
3393
|
+
bindPersistData: function (value) {
|
|
3394
|
+
return {
|
|
3395
|
+
brand_condition: value.brand,
|
|
3396
|
+
tag_condition: "{\"" + value.tags.join('","') + "\"}",
|
|
3397
|
+
};
|
|
3398
|
+
},
|
|
3399
|
+
},
|
|
3400
|
+
},
|
|
3401
|
+
'filters',
|
|
3402
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
3403
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
3404
|
+
{
|
|
3405
|
+
products: {
|
|
3406
|
+
columnName: 'products',
|
|
3407
|
+
fields: ['product_id'],
|
|
3408
|
+
from: function (value) { return value.map(function (product) { return product.product_id.toString(); }); },
|
|
3409
|
+
to: function (productIds) { return productIds.map(function (productId) { return ({
|
|
3410
|
+
product_id: +productId,
|
|
3411
|
+
}); }); },
|
|
3412
|
+
},
|
|
3413
|
+
},
|
|
3414
|
+
],
|
|
3415
|
+
}) || this;
|
|
3416
|
+
_this.productRepository = productRepository;
|
|
3417
|
+
return _this;
|
|
3418
|
+
}
|
|
3419
|
+
CategoryHasuraGraphQLRepository.prototype.get = function (identifiers) {
|
|
3420
|
+
var _super = Object.create(null, {
|
|
3421
|
+
get: { get: function () { return _super_1.prototype.get; } }
|
|
3422
|
+
});
|
|
3423
|
+
var _a;
|
|
3424
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3425
|
+
var _b;
|
|
3426
|
+
return __generator(this, function (_c) {
|
|
3427
|
+
switch (_c.label) {
|
|
3428
|
+
case 0:
|
|
3429
|
+
if (!Number.isNaN(+identifiers.id)) return [3 /*break*/, 2];
|
|
3430
|
+
return [4 /*yield*/, this.find({ filters: { firestoreId: identifiers.id } })];
|
|
3431
|
+
case 1:
|
|
3432
|
+
_b = (_a = (_c.sent()).data) === null || _a === void 0 ? void 0 : _a[0];
|
|
3433
|
+
return [3 /*break*/, 3];
|
|
3434
|
+
case 2:
|
|
3435
|
+
_b = _super.get.call(this, identifiers);
|
|
3436
|
+
_c.label = 3;
|
|
3437
|
+
case 3: return [2 /*return*/, _b];
|
|
3438
|
+
}
|
|
3439
|
+
});
|
|
3440
|
+
});
|
|
3441
|
+
};
|
|
3442
|
+
CategoryHasuraGraphQLRepository.prototype.getCategoryBySlug = function (slug, shop) {
|
|
3443
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3444
|
+
var _b, data, count;
|
|
3445
|
+
return __generator(this, function (_c) {
|
|
3446
|
+
switch (_c.label) {
|
|
3447
|
+
case 0:
|
|
3448
|
+
if (!slug)
|
|
3449
|
+
return [2 /*return*/];
|
|
3450
|
+
return [4 /*yield*/, this.find({ filters: { slug: slug, shop: shop, published: true } })];
|
|
3451
|
+
case 1:
|
|
3452
|
+
_b = _c.sent(), data = _b.data, count = _b.count;
|
|
3453
|
+
if (count > 1)
|
|
3454
|
+
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
3455
|
+
if (!count)
|
|
3456
|
+
throw new NotFoundError("Category with slug " + slug + " not found");
|
|
3457
|
+
return [2 /*return*/, data.shift()];
|
|
3458
|
+
}
|
|
3459
|
+
});
|
|
3460
|
+
});
|
|
3461
|
+
};
|
|
3462
|
+
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
3463
|
+
if (limit === void 0) { limit = 4; }
|
|
3464
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3465
|
+
var _b, categories, count, homeSections;
|
|
3466
|
+
var _this = this;
|
|
3467
|
+
return __generator(this, function (_c) {
|
|
3468
|
+
switch (_c.label) {
|
|
3469
|
+
case 0: return [4 /*yield*/, this.find({
|
|
3470
|
+
filters: { firestoreId: { operator: exports.Where.IN, value: categoryIds.filter(Boolean) }, published: true },
|
|
3471
|
+
})];
|
|
3472
|
+
case 1:
|
|
3473
|
+
_b = _c.sent(), categories = _b.data, count = _b.count;
|
|
3474
|
+
if (!count)
|
|
3475
|
+
throw new NotFoundError('Categories not found');
|
|
3476
|
+
return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
|
|
3477
|
+
var _b;
|
|
3478
|
+
return __generator(this, function (_c) {
|
|
3479
|
+
switch (_c.label) {
|
|
3480
|
+
case 0:
|
|
3481
|
+
_b = {
|
|
3482
|
+
category: category
|
|
3483
|
+
};
|
|
3484
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
3485
|
+
case 1: return [2 /*return*/, (_b.products = _c.sent(),
|
|
3486
|
+
_b)];
|
|
3487
|
+
}
|
|
3488
|
+
});
|
|
3489
|
+
}); }))];
|
|
3490
|
+
case 2:
|
|
3491
|
+
homeSections = _c.sent();
|
|
3492
|
+
return [2 /*return*/, homeSections];
|
|
3493
|
+
}
|
|
3494
|
+
});
|
|
3495
|
+
});
|
|
3496
|
+
};
|
|
3497
|
+
CategoryHasuraGraphQLRepository.prototype.mountCategory = function (category, options) {
|
|
3498
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3499
|
+
var products, publishedField, productsData;
|
|
3500
|
+
var _b;
|
|
3501
|
+
return __generator(this, function (_c) {
|
|
3502
|
+
switch (_c.label) {
|
|
3503
|
+
case 0:
|
|
3504
|
+
if (!category.products)
|
|
3505
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
3506
|
+
products = [];
|
|
3507
|
+
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
3508
|
+
return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign((_b = { id: { operator: exports.Where.IN, value: category.products } }, _b[publishedField] = true, _b), ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})) }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})))];
|
|
3509
|
+
case 1:
|
|
3510
|
+
productsData = (_c.sent()).data;
|
|
3511
|
+
products.push.apply(products, __spreadArray([], __read(productsData)));
|
|
3512
|
+
return [2 /*return*/, products];
|
|
3513
|
+
}
|
|
3514
|
+
});
|
|
3515
|
+
});
|
|
3516
|
+
};
|
|
3517
|
+
return CategoryHasuraGraphQLRepository;
|
|
3518
|
+
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
3519
|
+
|
|
3520
|
+
var CategoryHasuraGraphQL = /** @class */ (function (_super) {
|
|
3521
|
+
__extends(CategoryHasuraGraphQL, _super);
|
|
3522
|
+
function CategoryHasuraGraphQL() {
|
|
3523
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3524
|
+
}
|
|
3525
|
+
return CategoryHasuraGraphQL;
|
|
3526
|
+
}(Category));
|
|
3527
|
+
|
|
3528
|
+
var ProductHasuraGraphQL = /** @class */ (function (_super) {
|
|
3529
|
+
__extends(ProductHasuraGraphQL, _super);
|
|
3530
|
+
function ProductHasuraGraphQL() {
|
|
3531
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3532
|
+
}
|
|
3533
|
+
return ProductHasuraGraphQL;
|
|
3534
|
+
}(Product));
|
|
3535
|
+
|
|
3536
|
+
var VariantHasuraGraphQL = /** @class */ (function (_super) {
|
|
3537
|
+
__extends(VariantHasuraGraphQL, _super);
|
|
3538
|
+
function VariantHasuraGraphQL() {
|
|
3539
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
3540
|
+
_this.name = '';
|
|
3541
|
+
_this.hasVariants = false;
|
|
3542
|
+
return _this;
|
|
3543
|
+
}
|
|
3544
|
+
return VariantHasuraGraphQL;
|
|
3545
|
+
}(Variant));
|
|
3546
|
+
|
|
3547
|
+
var ProductHasuraGraphQLRepository = /** @class */ (function (_super) {
|
|
3548
|
+
__extends(ProductHasuraGraphQLRepository, _super);
|
|
3549
|
+
function ProductHasuraGraphQLRepository(endpoint, authOptions) {
|
|
3550
|
+
return _super.call(this, {
|
|
3551
|
+
tableName: 'product',
|
|
3552
|
+
model: ProductHasuraGraphQL,
|
|
3553
|
+
endpoint: endpoint,
|
|
3554
|
+
authOptions: authOptions,
|
|
3555
|
+
fields: [
|
|
3556
|
+
{ id: { columnName: 'id', to: function (value) { return +value; }, from: function (value) { return value.toString(); } } },
|
|
3557
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
3558
|
+
{ CEST: { columnName: 'cest' } },
|
|
3559
|
+
{ EAN: { columnName: 'ean' } },
|
|
3560
|
+
{ NCM: { columnName: 'ncm' } },
|
|
3561
|
+
'brand',
|
|
3562
|
+
{ costPrice: { columnName: 'cost_price' } },
|
|
3563
|
+
{
|
|
3564
|
+
description: {
|
|
3565
|
+
columnName: 'description',
|
|
3566
|
+
from: function (description) { return Object.values(exports.Shops).reduce(function (shops, shop) {
|
|
3567
|
+
var _b;
|
|
3568
|
+
return (Object.assign(Object.assign({}, shops), (_b = {}, _b[shop] = { description: description }, _b)));
|
|
3569
|
+
}, {}); },
|
|
3570
|
+
to: function (value) { return Object.values(value).shift().description; },
|
|
3571
|
+
},
|
|
3572
|
+
},
|
|
3573
|
+
{ hasVariants: { columnName: 'has_variants' } },
|
|
3574
|
+
{ images: { columnName: 'images', to: function (value) { return "{\"" + value.join("\",\"") + "\"}"; } } },
|
|
3575
|
+
{ miniatures: { columnName: 'miniatures', to: function (value) { return "{\"" + value.join("\",\"") + "\"}"; } } },
|
|
3576
|
+
'name',
|
|
3577
|
+
{
|
|
3578
|
+
price: {
|
|
3579
|
+
columnName: 'price',
|
|
3580
|
+
from: function (price, data) { return Object.values(exports.Shops).reduce(function (prices, shop) {
|
|
3581
|
+
var _b;
|
|
3582
|
+
return (Object.assign(Object.assign({}, prices), (_b = {}, _b[shop] = {
|
|
3583
|
+
price: price,
|
|
3584
|
+
fullPrice: data.full_price,
|
|
3585
|
+
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
3586
|
+
subscriberPrice: data.subscriber_price,
|
|
3587
|
+
}, _b)));
|
|
3588
|
+
}, {}); },
|
|
3589
|
+
bindFindFilter: function (sentence) {
|
|
3590
|
+
var filters = Object.values(sentence).shift();
|
|
3591
|
+
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 && {
|
|
3592
|
+
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
3593
|
+
})), (filters.subscriberPrice && { subscriber_price: filters.subscriberPrice }));
|
|
3594
|
+
},
|
|
3595
|
+
bindPersistData: function (value) {
|
|
3596
|
+
var priceData = Object.values(value).shift();
|
|
3597
|
+
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 && {
|
|
3598
|
+
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
3599
|
+
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
3600
|
+
},
|
|
3601
|
+
},
|
|
3602
|
+
},
|
|
3603
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
3604
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
3605
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
3606
|
+
'published',
|
|
3607
|
+
{ publishedGlam: { columnName: 'published_glam' } },
|
|
3608
|
+
'sku',
|
|
3609
|
+
{
|
|
3610
|
+
stock: {
|
|
3611
|
+
columnName: 'stock',
|
|
3612
|
+
from: function (quantity) { return ({ quantity: quantity }); },
|
|
3613
|
+
to: function (value) { return (value === null || value === void 0 ? void 0 : value.quantity) || value; },
|
|
3614
|
+
},
|
|
3615
|
+
},
|
|
3616
|
+
'slug',
|
|
3617
|
+
'type',
|
|
3618
|
+
'video',
|
|
3619
|
+
'weight',
|
|
3620
|
+
{
|
|
3621
|
+
categories: {
|
|
3622
|
+
columnName: 'categories',
|
|
3623
|
+
fields: ['category_id'],
|
|
3624
|
+
to: function (categories) { return categories.map(function (categoryId) { return ({ category_id: +categoryId }); }); },
|
|
3625
|
+
from: function (categories) { return (categories === null || categories === void 0 ? void 0 : categories.map(function (category) { var _a; return (_a = category === null || category === void 0 ? void 0 : category.category_id) === null || _a === void 0 ? void 0 : _a.toString(); })) || []; },
|
|
3626
|
+
},
|
|
3627
|
+
},
|
|
3628
|
+
{
|
|
3629
|
+
shopAvailability: {
|
|
3630
|
+
columnName: 'shop_availabilities',
|
|
3631
|
+
fields: ['shop'],
|
|
3632
|
+
from: function (shop) { return (Array.isArray(shop) ? shop.map(function (row) { return row.shop; }) : []); },
|
|
3633
|
+
to: function (shops) { return shops.map(function (shop) { return ({ shop: shop }); }); },
|
|
3634
|
+
},
|
|
3635
|
+
},
|
|
3636
|
+
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
3637
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
3638
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
3639
|
+
],
|
|
3640
|
+
}) || this;
|
|
3641
|
+
}
|
|
3642
|
+
ProductHasuraGraphQLRepository.prototype.getBySlug = function (slug, shop) {
|
|
3643
|
+
var _a;
|
|
3644
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3645
|
+
var result;
|
|
3646
|
+
return __generator(this, function (_b) {
|
|
3647
|
+
switch (_b.label) {
|
|
3648
|
+
case 0: return [4 /*yield*/, this.find({
|
|
3649
|
+
filters: {
|
|
3650
|
+
slug: { operator: exports.Where.EQUALS, value: slug },
|
|
3651
|
+
shopAvailability: { operator: exports.Where.IN, value: [shop] },
|
|
3652
|
+
},
|
|
3653
|
+
})];
|
|
3654
|
+
case 1:
|
|
3655
|
+
result = _b.sent();
|
|
3656
|
+
return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
|
|
3657
|
+
}
|
|
3658
|
+
});
|
|
3659
|
+
});
|
|
3660
|
+
};
|
|
3661
|
+
return ProductHasuraGraphQLRepository;
|
|
3662
|
+
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
3663
|
+
|
|
3664
|
+
var VariantHasuraGraphQLRepository = /** @class */ (function (_super) {
|
|
3665
|
+
__extends(VariantHasuraGraphQLRepository, _super);
|
|
3666
|
+
function VariantHasuraGraphQLRepository(endpoint, authOptions) {
|
|
3667
|
+
return _super.call(this, {
|
|
3668
|
+
tableName: 'product',
|
|
3669
|
+
model: VariantHasuraGraphQL,
|
|
3670
|
+
endpoint: endpoint,
|
|
3671
|
+
authOptions: authOptions,
|
|
3672
|
+
fields: [
|
|
3673
|
+
{ id: { columnName: 'id', to: function (value) { return +value; }, from: function (value) { return value.toString(); } } },
|
|
3674
|
+
{ firestoreId: { columnName: 'firestore_id' } },
|
|
3675
|
+
{ productId: { columnName: 'main_product_id', to: function (value) { return +value; }, from: function (value) { return value.toString(); } } },
|
|
3676
|
+
{ EAN: { columnName: 'ean' } },
|
|
3677
|
+
{ costPrice: { columnName: 'cost_price' } },
|
|
3678
|
+
{
|
|
3679
|
+
price: {
|
|
3680
|
+
columnName: 'price',
|
|
3681
|
+
from: function (price, data) { return Object.values(exports.Shops).reduce(function (prices, shop) {
|
|
3682
|
+
var _a;
|
|
3683
|
+
return (Object.assign(Object.assign({}, prices), (_a = {}, _a[shop] = {
|
|
3684
|
+
price: price,
|
|
3685
|
+
fullPrice: data.full_price,
|
|
3686
|
+
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
3687
|
+
subscriberPrice: data.subscriber_price,
|
|
3688
|
+
}, _a)));
|
|
3689
|
+
}, {}); },
|
|
3690
|
+
bindFindFilter: function (sentence) {
|
|
3691
|
+
var filters = Object.values(sentence).shift();
|
|
3692
|
+
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 && {
|
|
3693
|
+
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
3694
|
+
})), (filters.subscriberPrice && { subscriber_price: filters.subscriberPrice }));
|
|
3695
|
+
},
|
|
3696
|
+
bindPersistData: function (value, instance) {
|
|
3697
|
+
var priceData = Object.values(value).shift();
|
|
3698
|
+
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 && {
|
|
3699
|
+
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
3700
|
+
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
3701
|
+
},
|
|
3702
|
+
},
|
|
3703
|
+
},
|
|
3704
|
+
{ fullPrice: { columnName: 'full_price' } },
|
|
3705
|
+
{ subscriberDiscountPercentage: { columnName: 'subscriber_discount_percentage' } },
|
|
3706
|
+
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
3707
|
+
'sku',
|
|
3708
|
+
{
|
|
3709
|
+
stock: {
|
|
3710
|
+
columnName: 'stock',
|
|
3711
|
+
from: function (quantity) { return ({ quantity: quantity }); },
|
|
3712
|
+
to: function (value) { return (value === null || value === void 0 ? void 0 : value.quantity) || value; },
|
|
3713
|
+
},
|
|
3714
|
+
},
|
|
3715
|
+
'weight',
|
|
3716
|
+
{ name: { to: function () { return ''; }, from: function () { return undefined; } } },
|
|
3717
|
+
{ hasVariants: { columnName: 'has_variants', to: function () { return false; }, from: function () { return undefined; } } },
|
|
3718
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
3719
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
3720
|
+
],
|
|
3721
|
+
}) || this;
|
|
3722
|
+
}
|
|
3723
|
+
return VariantHasuraGraphQLRepository;
|
|
3724
|
+
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
3725
|
+
|
|
2482
3726
|
/**
|
|
2483
3727
|
* Generated bundle index. Do not edit.
|
|
2484
3728
|
*/
|
|
2485
3729
|
|
|
3730
|
+
Object.defineProperty(exports, 'add', {
|
|
3731
|
+
enumerable: true,
|
|
3732
|
+
get: function () { return dateFns.add; }
|
|
3733
|
+
});
|
|
3734
|
+
Object.defineProperty(exports, 'addBusinessDays', {
|
|
3735
|
+
enumerable: true,
|
|
3736
|
+
get: function () { return dateFns.addBusinessDays; }
|
|
3737
|
+
});
|
|
3738
|
+
Object.defineProperty(exports, 'addDays', {
|
|
3739
|
+
enumerable: true,
|
|
3740
|
+
get: function () { return dateFns.addDays; }
|
|
3741
|
+
});
|
|
3742
|
+
Object.defineProperty(exports, 'addMonths', {
|
|
3743
|
+
enumerable: true,
|
|
3744
|
+
get: function () { return dateFns.addMonths; }
|
|
3745
|
+
});
|
|
3746
|
+
Object.defineProperty(exports, 'addYears', {
|
|
3747
|
+
enumerable: true,
|
|
3748
|
+
get: function () { return dateFns.addYears; }
|
|
3749
|
+
});
|
|
3750
|
+
Object.defineProperty(exports, 'endOfDay', {
|
|
3751
|
+
enumerable: true,
|
|
3752
|
+
get: function () { return dateFns.endOfDay; }
|
|
3753
|
+
});
|
|
3754
|
+
Object.defineProperty(exports, 'format', {
|
|
3755
|
+
enumerable: true,
|
|
3756
|
+
get: function () { return dateFns.format; }
|
|
3757
|
+
});
|
|
3758
|
+
Object.defineProperty(exports, 'formatISO9075', {
|
|
3759
|
+
enumerable: true,
|
|
3760
|
+
get: function () { return dateFns.formatISO9075; }
|
|
3761
|
+
});
|
|
3762
|
+
Object.defineProperty(exports, 'parseISO', {
|
|
3763
|
+
enumerable: true,
|
|
3764
|
+
get: function () { return dateFns.parseISO; }
|
|
3765
|
+
});
|
|
3766
|
+
Object.defineProperty(exports, 'startOfDay', {
|
|
3767
|
+
enumerable: true,
|
|
3768
|
+
get: function () { return dateFns.startOfDay; }
|
|
3769
|
+
});
|
|
3770
|
+
Object.defineProperty(exports, 'sub', {
|
|
3771
|
+
enumerable: true,
|
|
3772
|
+
get: function () { return dateFns.sub; }
|
|
3773
|
+
});
|
|
2486
3774
|
Object.defineProperty(exports, 'chunk', {
|
|
2487
3775
|
enumerable: true,
|
|
2488
3776
|
get: function () { return lodash.chunk; }
|
|
2489
3777
|
});
|
|
3778
|
+
Object.defineProperty(exports, 'isBoolean', {
|
|
3779
|
+
enumerable: true,
|
|
3780
|
+
get: function () { return lodash.isBoolean; }
|
|
3781
|
+
});
|
|
3782
|
+
Object.defineProperty(exports, 'isDate', {
|
|
3783
|
+
enumerable: true,
|
|
3784
|
+
get: function () { return lodash.isDate; }
|
|
3785
|
+
});
|
|
2490
3786
|
Object.defineProperty(exports, 'isEmpty', {
|
|
2491
3787
|
enumerable: true,
|
|
2492
3788
|
get: function () { return lodash.isEmpty; }
|
|
2493
3789
|
});
|
|
3790
|
+
Object.defineProperty(exports, 'isInteger', {
|
|
3791
|
+
enumerable: true,
|
|
3792
|
+
get: function () { return lodash.isInteger; }
|
|
3793
|
+
});
|
|
3794
|
+
Object.defineProperty(exports, 'isNaN', {
|
|
3795
|
+
enumerable: true,
|
|
3796
|
+
get: function () { return lodash.isNaN; }
|
|
3797
|
+
});
|
|
2494
3798
|
Object.defineProperty(exports, 'isNil', {
|
|
2495
3799
|
enumerable: true,
|
|
2496
3800
|
get: function () { return lodash.isNil; }
|
|
@@ -2507,13 +3811,26 @@
|
|
|
2507
3811
|
enumerable: true,
|
|
2508
3812
|
get: function () { return lodash.isString; }
|
|
2509
3813
|
});
|
|
3814
|
+
Object.defineProperty(exports, 'now', {
|
|
3815
|
+
enumerable: true,
|
|
3816
|
+
get: function () { return lodash.now; }
|
|
3817
|
+
});
|
|
3818
|
+
Object.defineProperty(exports, 'omit', {
|
|
3819
|
+
enumerable: true,
|
|
3820
|
+
get: function () { return lodash.omit; }
|
|
3821
|
+
});
|
|
2510
3822
|
Object.defineProperty(exports, 'pick', {
|
|
2511
3823
|
enumerable: true,
|
|
2512
3824
|
get: function () { return lodash.pick; }
|
|
2513
3825
|
});
|
|
3826
|
+
Object.defineProperty(exports, 'set', {
|
|
3827
|
+
enumerable: true,
|
|
3828
|
+
get: function () { return lodash.set; }
|
|
3829
|
+
});
|
|
2514
3830
|
exports.Address = Address;
|
|
2515
3831
|
exports.Authentication = Authentication;
|
|
2516
3832
|
exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
|
|
3833
|
+
exports.AxiosAdapter = AxiosAdapter;
|
|
2517
3834
|
exports.Base = Base;
|
|
2518
3835
|
exports.BaseModel = BaseModel;
|
|
2519
3836
|
exports.BeautyProfile = BeautyProfile;
|
|
@@ -2522,15 +3839,16 @@
|
|
|
2522
3839
|
exports.Buy2WinFirestoreRepository = Buy2WinFirestoreRepository;
|
|
2523
3840
|
exports.Category = Category;
|
|
2524
3841
|
exports.CategoryFirestoreRepository = CategoryFirestoreRepository;
|
|
3842
|
+
exports.CategoryHasuraGraphQLRepository = CategoryHasuraGraphQLRepository;
|
|
2525
3843
|
exports.Checkout = Checkout;
|
|
2526
3844
|
exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
2527
3845
|
exports.CheckoutSubscription = CheckoutSubscription;
|
|
2528
3846
|
exports.CheckoutSubscriptionFirestoreRepository = CheckoutSubscriptionFirestoreRepository;
|
|
2529
|
-
exports.ClubCoupon = ClubCoupon;
|
|
2530
3847
|
exports.Coupon = Coupon;
|
|
2531
3848
|
exports.CouponFirestoreRepository = CouponFirestoreRepository;
|
|
2532
3849
|
exports.DuplicatedResultsError = DuplicatedResultsError;
|
|
2533
3850
|
exports.Edition = Edition;
|
|
3851
|
+
exports.FinancialCoupon = FinancialCoupon;
|
|
2534
3852
|
exports.Home = Home;
|
|
2535
3853
|
exports.HomeFirestoreRepository = HomeFirestoreRepository;
|
|
2536
3854
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
@@ -2545,7 +3863,10 @@
|
|
|
2545
3863
|
exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
|
2546
3864
|
exports.Product = Product;
|
|
2547
3865
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
3866
|
+
exports.ProductHasuraGraphQLRepository = ProductHasuraGraphQLRepository;
|
|
2548
3867
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
3868
|
+
exports.ProductsIndex = ProductsIndex;
|
|
3869
|
+
exports.RecoveryPassword = RecoveryPassword;
|
|
2549
3870
|
exports.Register = Register;
|
|
2550
3871
|
exports.RegisterFirebaseAuthService = RegisterFirebaseAuthService;
|
|
2551
3872
|
exports.RequiredArgumentError = RequiredArgumentError;
|
|
@@ -2553,7 +3874,6 @@
|
|
|
2553
3874
|
exports.ShopMenu = ShopMenu;
|
|
2554
3875
|
exports.ShopMenuFirestoreRepository = ShopMenuFirestoreRepository;
|
|
2555
3876
|
exports.SignOut = SignOut;
|
|
2556
|
-
exports.StoreCoupon = StoreCoupon;
|
|
2557
3877
|
exports.Subscription = Subscription;
|
|
2558
3878
|
exports.SubscriptionEditionFirestoreRepository = SubscriptionEditionFirestoreRepository;
|
|
2559
3879
|
exports.SubscriptionFirestoreRepository = SubscriptionFirestoreRepository;
|
|
@@ -2573,16 +3893,26 @@
|
|
|
2573
3893
|
exports.UserPaymentMethodFirestoreRepository = UserPaymentMethodFirestoreRepository;
|
|
2574
3894
|
exports.UserSearchFirestoreRepository = UserSearchFirestoreRepository;
|
|
2575
3895
|
exports.Variant = Variant;
|
|
3896
|
+
exports.VariantHasuraGraphQLRepository = VariantHasuraGraphQLRepository;
|
|
2576
3897
|
exports.WeakPasswordError = WeakPasswordError;
|
|
3898
|
+
exports.isUUID = isUUID;
|
|
3899
|
+
exports.parseDateTime = parseDateTime;
|
|
2577
3900
|
exports.withCreateFirestore = withCreateFirestore;
|
|
3901
|
+
exports.withCreateHasuraGraphQL = withCreateHasuraGraphQL;
|
|
2578
3902
|
exports.withCrudFirestore = withCrudFirestore;
|
|
3903
|
+
exports.withCrudHasuraGraphQL = withCrudHasuraGraphQL;
|
|
2579
3904
|
exports.withDeleteFirestore = withDeleteFirestore;
|
|
3905
|
+
exports.withDeleteHasuraGraphQL = withDeleteHasuraGraphQL;
|
|
2580
3906
|
exports.withFindFirestore = withFindFirestore;
|
|
3907
|
+
exports.withFindHasuraGraphQL = withFindHasuraGraphQL;
|
|
2581
3908
|
exports.withFirestore = withFirestore;
|
|
2582
3909
|
exports.withGetFirestore = withGetFirestore;
|
|
3910
|
+
exports.withGetHasuraGraphQL = withGetHasuraGraphQL;
|
|
3911
|
+
exports.withHasuraGraphQL = withHasuraGraphQL;
|
|
2583
3912
|
exports.withHelpers = withHelpers;
|
|
2584
3913
|
exports.withSubCollection = withSubCollection;
|
|
2585
3914
|
exports.withUpdateFirestore = withUpdateFirestore;
|
|
3915
|
+
exports.withUpdateHasuraGraphQL = withUpdateHasuraGraphQL;
|
|
2586
3916
|
|
|
2587
3917
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2588
3918
|
|