@infrab4a/connect-angular 5.5.0-beta.9 → 5.6.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-firestore.module.mjs +16 -2
- package/esm2020/services/catalog/helpers/brand-manager.helper.mjs +7 -8
- package/esm2020/services/catalog/helpers/product-fields.helper.mjs +2 -1
- package/esm2020/services/catalog/strategies/term-search.strategy.mjs +5 -2
- package/esm2020/services/catalog/strategies/types/strategy-params.type.mjs +1 -1
- package/esm2020/services/checkout.service.mjs +2 -2
- package/fesm2015/infrab4a-connect-angular.mjs +28 -20
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +27 -10
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/services/catalog/strategies/types/strategy-params.type.d.ts +1 -0
|
@@ -7,7 +7,7 @@ import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
|
|
|
7
7
|
import * as i3 from '@angular/fire/storage';
|
|
8
8
|
import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
|
|
9
9
|
import * as i1$3 from '@infrab4a/connect';
|
|
10
|
-
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
10
|
+
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, BrandCategoryFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
11
11
|
import * as i1 from '@angular/fire/auth';
|
|
12
12
|
import { Auth, provideAuth, initializeAuth, indexedDBLocalPersistence, browserLocalPersistence, browserSessionPersistence, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
13
13
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
@@ -463,6 +463,13 @@ AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
463
463
|
},
|
|
464
464
|
deps: ['FirestoreOptions'],
|
|
465
465
|
},
|
|
466
|
+
{
|
|
467
|
+
provide: 'BrandCategoryRepository',
|
|
468
|
+
useFactory: (options) => {
|
|
469
|
+
return new BrandCategoryFirestoreRepository(options);
|
|
470
|
+
},
|
|
471
|
+
deps: ['FirestoreOptions'],
|
|
472
|
+
},
|
|
466
473
|
], imports: [AngularElasticSeachModule,
|
|
467
474
|
provideFirestore((injector) => {
|
|
468
475
|
const platformId = injector.get(PLATFORM_ID);
|
|
@@ -736,6 +743,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
736
743
|
},
|
|
737
744
|
deps: ['FirestoreOptions'],
|
|
738
745
|
},
|
|
746
|
+
{
|
|
747
|
+
provide: 'BrandCategoryRepository',
|
|
748
|
+
useFactory: (options) => {
|
|
749
|
+
return new BrandCategoryFirestoreRepository(options);
|
|
750
|
+
},
|
|
751
|
+
deps: ['FirestoreOptions'],
|
|
752
|
+
},
|
|
739
753
|
],
|
|
740
754
|
}]
|
|
741
755
|
}] });
|
|
@@ -1300,7 +1314,7 @@ class CheckoutService {
|
|
|
1300
1314
|
})), concatMap(() => this.getCheckout()));
|
|
1301
1315
|
}
|
|
1302
1316
|
createOrder(checkoutPayload, paymentProvider, applicationVersion) {
|
|
1303
|
-
return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/
|
|
1317
|
+
return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkout`, {
|
|
1304
1318
|
data: {
|
|
1305
1319
|
...checkoutPayload,
|
|
1306
1320
|
applicationVersion,
|
|
@@ -1693,6 +1707,7 @@ class TermSearchStrategy {
|
|
|
1693
1707
|
limits,
|
|
1694
1708
|
shop,
|
|
1695
1709
|
mainGender,
|
|
1710
|
+
sort,
|
|
1696
1711
|
fields: this.helpersService.getFieldsHelper().getStandardFields(),
|
|
1697
1712
|
});
|
|
1698
1713
|
}
|
|
@@ -1722,9 +1737,10 @@ class TermSearchStrategy {
|
|
|
1722
1737
|
});
|
|
1723
1738
|
}
|
|
1724
1739
|
async searchDefault(params) {
|
|
1725
|
-
const { productIds, filters, limits, shop, mainGender, fields } = params;
|
|
1740
|
+
const { productIds, filters, limits, sort, shop, mainGender, fields } = params;
|
|
1726
1741
|
const productCatalog = this.repositoryService.getProductCatalog();
|
|
1727
1742
|
const filterHelper = this.helpersService.getFilterHelper();
|
|
1743
|
+
const sortHelper = this.helpersService.getSortHelper();
|
|
1728
1744
|
return productCatalog.productCatalogRepository.findCatalog({
|
|
1729
1745
|
fields,
|
|
1730
1746
|
filters: {
|
|
@@ -1733,6 +1749,7 @@ class TermSearchStrategy {
|
|
|
1733
1749
|
...filterHelper.buildFilterQuery(filters || {}),
|
|
1734
1750
|
},
|
|
1735
1751
|
limits,
|
|
1752
|
+
...(sort ? { orderBy: sortHelper.buildSortQuery(sort) } : {}),
|
|
1736
1753
|
options: {
|
|
1737
1754
|
minimal: ['price'],
|
|
1738
1755
|
maximum: ['price'],
|
|
@@ -1920,13 +1937,7 @@ class BrandManagerHelper {
|
|
|
1920
1937
|
if (isEmpty(brands) && options.filters) {
|
|
1921
1938
|
delete options.filters.brands;
|
|
1922
1939
|
}
|
|
1923
|
-
|
|
1924
|
-
this.brandsList[indexKey] = await this.fetchBrandsOnly(options);
|
|
1925
|
-
}
|
|
1926
|
-
else {
|
|
1927
|
-
this.brandsList[indexKey] = this.brandsList[indexKey] || brands;
|
|
1928
|
-
}
|
|
1929
|
-
// this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options))
|
|
1940
|
+
this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options));
|
|
1930
1941
|
this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
|
|
1931
1942
|
if (options.filters) {
|
|
1932
1943
|
options.filters = {
|
|
@@ -1948,10 +1959,15 @@ class BrandManagerHelper {
|
|
|
1948
1959
|
return '';
|
|
1949
1960
|
}
|
|
1950
1961
|
async fetchBrandsOnly(options) {
|
|
1962
|
+
let filters = {};
|
|
1963
|
+
if (options.category) {
|
|
1964
|
+
filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
|
|
1965
|
+
}
|
|
1951
1966
|
return this.productCatalog.productCatalogRepository
|
|
1952
1967
|
.findCatalog({
|
|
1953
1968
|
fields: ['id'],
|
|
1954
1969
|
filters: {
|
|
1970
|
+
...filters,
|
|
1955
1971
|
published: { operator: Where.EQUALS, value: true },
|
|
1956
1972
|
},
|
|
1957
1973
|
options: {
|
|
@@ -2089,6 +2105,7 @@ class ProductFieldsHelper {
|
|
|
2089
2105
|
'outlet',
|
|
2090
2106
|
'group',
|
|
2091
2107
|
'variantSlug',
|
|
2108
|
+
'filters',
|
|
2092
2109
|
];
|
|
2093
2110
|
}
|
|
2094
2111
|
}
|