@infrab4a/connect-angular 4.4.3-beta.0 → 4.5.0-beta.0
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/esm2020/angular-hasura-graphql.module.mjs +24 -2
- package/esm2020/services/catalog/catalog.service.mjs +10 -3
- package/esm2020/services/catalog/wishlist.service.mjs +11 -8
- package/fesm2015/infrab4a-connect-angular.mjs +44 -10
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +42 -10
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/services/catalog/catalog.service.d.ts +4 -2
- package/services/catalog/wishlist.service.d.ts +5 -6
|
@@ -3,7 +3,7 @@ import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angu
|
|
|
3
3
|
import * as i1$4 from '@angular/fire/app';
|
|
4
4
|
import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
|
|
5
5
|
import * as i1$2 from '@infrab4a/connect';
|
|
6
|
-
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, FirebaseFileUploaderService, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, Wishlist, CheckoutSubscription, Product, RequiredArgumentError, add, Order, UpdateUserImage } from '@infrab4a/connect';
|
|
6
|
+
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, FirebaseFileUploaderService, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, Wishlist, CheckoutSubscription, Product, RequiredArgumentError, add, Order, UpdateUserImage } from '@infrab4a/connect';
|
|
7
7
|
import * as i1 from '@angular/fire/auth';
|
|
8
8
|
import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
9
9
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
@@ -749,6 +749,17 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
749
749
|
},
|
|
750
750
|
deps: ['HasuraConfig'],
|
|
751
751
|
},
|
|
752
|
+
{
|
|
753
|
+
provide: 'ProductStockNotification',
|
|
754
|
+
useExisting: ProductStockNotificationHasuraGraphQLRepository,
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
provide: ProductStockNotificationHasuraGraphQLRepository,
|
|
758
|
+
useFactory: (hasuraConfig) => {
|
|
759
|
+
return new ProductStockNotificationHasuraGraphQLRepository(hasuraConfig);
|
|
760
|
+
},
|
|
761
|
+
deps: ['HasuraConfig'],
|
|
762
|
+
},
|
|
752
763
|
{
|
|
753
764
|
provide: 'CategoryFilterRepository',
|
|
754
765
|
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
@@ -874,6 +885,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
874
885
|
},
|
|
875
886
|
deps: ['HasuraConfig'],
|
|
876
887
|
},
|
|
888
|
+
{
|
|
889
|
+
provide: 'ProductStockNotification',
|
|
890
|
+
useExisting: ProductStockNotificationHasuraGraphQLRepository,
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
provide: ProductStockNotificationHasuraGraphQLRepository,
|
|
894
|
+
useFactory: (hasuraConfig) => {
|
|
895
|
+
return new ProductStockNotificationHasuraGraphQLRepository(hasuraConfig);
|
|
896
|
+
},
|
|
897
|
+
deps: ['HasuraConfig'],
|
|
898
|
+
},
|
|
877
899
|
{
|
|
878
900
|
provide: 'CategoryFilterRepository',
|
|
879
901
|
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
@@ -1597,8 +1619,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1597
1619
|
}] }]; } });
|
|
1598
1620
|
|
|
1599
1621
|
class CatalogService {
|
|
1600
|
-
constructor(productRepository, categoryRepository, categoryStructureAdapter, shop, productIndex) {
|
|
1622
|
+
constructor(productRepository, productStockNotificationRepository, categoryRepository, categoryStructureAdapter, shop, productIndex) {
|
|
1601
1623
|
this.productRepository = productRepository;
|
|
1624
|
+
this.productStockNotificationRepository = productStockNotificationRepository;
|
|
1602
1625
|
this.categoryRepository = categoryRepository;
|
|
1603
1626
|
this.categoryStructureAdapter = categoryStructureAdapter;
|
|
1604
1627
|
this.shop = shop;
|
|
@@ -1678,6 +1701,9 @@ class CatalogService {
|
|
|
1678
1701
|
brands: distinct?.brand,
|
|
1679
1702
|
}));
|
|
1680
1703
|
}
|
|
1704
|
+
async addCustomerToStockNotification(productId, email) {
|
|
1705
|
+
return this.productStockNotificationRepository.addCustomerEmail(productId, email);
|
|
1706
|
+
}
|
|
1681
1707
|
async findCatalog(options, limits) {
|
|
1682
1708
|
if (this.hasTerm(options) && options.sort === 'most-relevant') {
|
|
1683
1709
|
const productsIds = await this.findCatalogIdsByElasticSearch(options.term);
|
|
@@ -1767,13 +1793,16 @@ class CatalogService {
|
|
|
1767
1793
|
}));
|
|
1768
1794
|
}
|
|
1769
1795
|
}
|
|
1770
|
-
CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1796
|
+
CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: 'ProductStockNotification' }, { token: 'CategoryRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1771
1797
|
CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
|
|
1772
1798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
|
|
1773
1799
|
type: Injectable
|
|
1774
1800
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1775
1801
|
type: Inject,
|
|
1776
1802
|
args: ['ProductRepository']
|
|
1803
|
+
}] }, { type: undefined, decorators: [{
|
|
1804
|
+
type: Inject,
|
|
1805
|
+
args: ['ProductStockNotification']
|
|
1777
1806
|
}] }, { type: undefined, decorators: [{
|
|
1778
1807
|
type: Inject,
|
|
1779
1808
|
args: ['CategoryRepository']
|
|
@@ -1850,11 +1879,12 @@ __decorate([
|
|
|
1850
1879
|
], CategoryWithTree.prototype, "children", void 0);
|
|
1851
1880
|
|
|
1852
1881
|
class WishlistService {
|
|
1853
|
-
constructor(wishlistRepository, shop, productRepository, categoryFilterRepository, categoryRepository, productIndex) {
|
|
1882
|
+
constructor(wishlistRepository, shop, productRepository, categoryFilterRepository, categoryRepository, productStockNotificationRepository, productIndex) {
|
|
1854
1883
|
this.wishlistRepository = wishlistRepository;
|
|
1855
1884
|
this.shop = shop;
|
|
1885
|
+
this.productStockNotificationRepository = productStockNotificationRepository;
|
|
1856
1886
|
const categoryStructureAdapter = new NewCategoryStructureAdapter(wishlistRepository);
|
|
1857
|
-
this.catalogService = new CatalogService(productRepository, categoryRepository, categoryStructureAdapter, shop, productIndex);
|
|
1887
|
+
this.catalogService = new CatalogService(productRepository, productStockNotificationRepository, categoryRepository, categoryStructureAdapter, shop, productIndex);
|
|
1858
1888
|
this.categoryService = new CategoryService(productRepository, categoryRepository, categoryFilterRepository, categoryStructureAdapter, shop);
|
|
1859
1889
|
}
|
|
1860
1890
|
getCatalogService() {
|
|
@@ -1863,7 +1893,7 @@ class WishlistService {
|
|
|
1863
1893
|
getCategoryService() {
|
|
1864
1894
|
return this.categoryService;
|
|
1865
1895
|
}
|
|
1866
|
-
async create({ personId, title, description,
|
|
1896
|
+
async create({ personId, title, description, userFullName, userPhoto, theme, bannerUrl, }) {
|
|
1867
1897
|
const data = {
|
|
1868
1898
|
slug: '',
|
|
1869
1899
|
name: title,
|
|
@@ -1878,7 +1908,7 @@ class WishlistService {
|
|
|
1878
1908
|
personName: userFullName,
|
|
1879
1909
|
personPhoto: userPhoto,
|
|
1880
1910
|
brandCategory: false,
|
|
1881
|
-
published,
|
|
1911
|
+
published: true,
|
|
1882
1912
|
theme,
|
|
1883
1913
|
bannerUrl,
|
|
1884
1914
|
};
|
|
@@ -1886,12 +1916,11 @@ class WishlistService {
|
|
|
1886
1916
|
await this.wishlistRepository.update({ id: newWishlist.id, slug: newWishlist.id });
|
|
1887
1917
|
return Wishlist.toInstance({ ...newWishlist.toPlain(), slug: newWishlist.id });
|
|
1888
1918
|
}
|
|
1889
|
-
update({ id, title, description,
|
|
1919
|
+
update({ id, title, description, userFullName, userPhoto, theme, bannerUrl, }) {
|
|
1890
1920
|
const data = {
|
|
1891
1921
|
id,
|
|
1892
1922
|
name: title,
|
|
1893
1923
|
description,
|
|
1894
|
-
published,
|
|
1895
1924
|
metadata: {
|
|
1896
1925
|
title: `${userFullName} - ${title}`,
|
|
1897
1926
|
description: `${userFullName} - ${description}`,
|
|
@@ -1936,7 +1965,7 @@ class WishlistService {
|
|
|
1936
1965
|
return wishlist;
|
|
1937
1966
|
}
|
|
1938
1967
|
}
|
|
1939
|
-
WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: 'CategoryRepository' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1968
|
+
WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: 'CategoryRepository' }, { token: 'ProductStockNotification' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1940
1969
|
WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
|
|
1941
1970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
|
|
1942
1971
|
type: Injectable
|
|
@@ -1955,6 +1984,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1955
1984
|
}] }, { type: undefined, decorators: [{
|
|
1956
1985
|
type: Inject,
|
|
1957
1986
|
args: ['CategoryRepository']
|
|
1987
|
+
}] }, { type: undefined, decorators: [{
|
|
1988
|
+
type: Inject,
|
|
1989
|
+
args: ['ProductStockNotification']
|
|
1958
1990
|
}] }, { type: i1$2.ProductsIndex }]; } });
|
|
1959
1991
|
|
|
1960
1992
|
class CheckoutSubscriptionService {
|